]>
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
, wxWindowID id
, const wxPoint
& pos
, const wxSize
& size
,
37 wxTreeCtrl(parent
, id
, pos
, size
, style
),
40 m_imageList
.Add(wxIcon(_T("folder1")));
41 m_imageList
.Add(wxIcon(_T("file1")));
43 SetImageList(& m_imageList
);
46 csProjectTreeCtrl::~csProjectTreeCtrl()
51 // Create the project window
52 bool csApp::CreateProjectWindow(wxFrame
*WXUNUSED(parent
))
55 // Create a layout window
56 wxSashLayoutWindow
* win
= new wxSashLayoutWindow(parent
, ID_LAYOUT_WINDOW_PROJECT
, wxDefaultPosition
, wxSize(200, 30), wxNO_BORDER
|wxSW_3D
|wxCLIP_CHILDREN
);
57 win
->SetDefaultSize(wxSize(150, 10000));
58 win
->SetOrientation(wxLAYOUT_VERTICAL
);
59 win
->SetAlignment(wxLAYOUT_LEFT
);
60 win
->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE
));
61 win
->SetSashVisible(wxSASH_RIGHT
, TRUE
);
62 win
->SetExtraBorderSize(5);
64 m_projectSashWindow
= win
;
66 m_projectTreeCtrl
= new csProjectTreeCtrl(win
, ID_WINDOW_PROJECT_TREE
, wxDefaultPosition
,
67 wxDefaultSize
, wxTR_HAS_BUTTONS
|wxTR_LINES_AT_ROOT
|wxDOUBLE_BORDER
);
69 // For now, hide the window
70 m_projectSashWindow
->Show(FALSE
);
76 // Fill out the project tree control
77 void csApp::FillProjectTreeCtrl()
80 csProjectTreeCtrl
& tree
= *GetProjectTreeCtrl();
83 long level0
= tree
.InsertItem(0, "Applications", 0, 0);
84 long level1
= tree
.InsertItem(level0
, "Projects", 0, 0);
85 tree
.InsertItem(level1
, "project1", 1, 1);
86 tree
.InsertItem(level1
, "project2", 1, 1);