]>
git.saurik.com Git - wxWidgets.git/blob - contrib/samples/ogl/studio/project.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Studio project classes
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
10 /////////////////////////////////////////////////////////////////////////////
12 // For compilers that support precompilation, includes "wx/wx.h".
13 #include "wx/wxprec.h"
24 #include "wx/laywin.h"
28 IMPLEMENT_CLASS(csProjectTreeCtrl
, wxTreeCtrl
)
30 BEGIN_EVENT_TABLE(csProjectTreeCtrl
, wxTreeCtrl
)
33 // Define my frame constructor
34 csProjectTreeCtrl::csProjectTreeCtrl(wxWindow
*parent
, const wxWindowID id
, const wxPoint
& pos
, const wxSize
& size
, long style
):
36 wxTreeCtrl(parent
, id
, pos
, size
, style
),
39 m_imageList
.Add(wxIcon(_T("folder1")));
40 m_imageList
.Add(wxIcon(_T("file1")));
42 SetImageList(& m_imageList
);
45 csProjectTreeCtrl::~csProjectTreeCtrl()
50 // Create the project window
51 bool csApp::CreateProjectWindow(wxFrame
*WXUNUSED(parent
))
54 // Create a layout window
55 wxSashLayoutWindow
* win
= new wxSashLayoutWindow(parent
, ID_LAYOUT_WINDOW_PROJECT
, wxDefaultPosition
, wxSize(200, 30), wxNO_BORDER
|wxSW_3D
|wxCLIP_CHILDREN
);
56 win
->SetDefaultSize(wxSize(150, 10000));
57 win
->SetOrientation(wxLAYOUT_VERTICAL
);
58 win
->SetAlignment(wxLAYOUT_LEFT
);
59 win
->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE
));
60 win
->SetSashVisible(wxSASH_RIGHT
, true);
61 win
->SetExtraBorderSize(5);
63 m_projectSashWindow
= win
;
65 m_projectTreeCtrl
= new csProjectTreeCtrl(win
, ID_WINDOW_PROJECT_TREE
, wxDefaultPosition
,
66 wxDefaultSize
, wxTR_HAS_BUTTONS
|wxTR_LINES_AT_ROOT
|wxDOUBLE_BORDER
);
68 // For now, hide the window
69 m_projectSashWindow
->Show(false);
75 // Fill out the project tree control
76 void csApp::FillProjectTreeCtrl()
79 csProjectTreeCtrl
& tree
= *GetProjectTreeCtrl();
82 long level0
= tree
.InsertItem(0, "Applications", 0, 0);
83 long level1
= tree
.InsertItem(level0
, "Projects", 0, 0);
84 tree
.InsertItem(level1
, "project1", 1, 1);
85 tree
.InsertItem(level1
, "project2", 1, 1);