]> git.saurik.com Git - wxWidgets.git/blob - contrib/samples/ogl/studio/project.cpp
wx-config2.6
[wxWidgets.git] / contrib / samples / ogl / studio / project.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: project.cpp
3 // Purpose: Studio project classes
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 27/7/98
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence:
10 /////////////////////////////////////////////////////////////////////////////
11
12 // For compilers that support precompilation, includes "wx/wx.h".
13 #include "wx/wxprec.h"
14
15 #ifdef __BORLANDC__
16 #pragma hdrstop
17 #endif
18
19 #ifndef WX_PRECOMP
20 #include "wx/wx.h"
21 #include "wx/mdi.h"
22 #endif
23
24 #include "wx/laywin.h"
25 #include "studio.h"
26 #include "project.h"
27
28 IMPLEMENT_CLASS(csProjectTreeCtrl, wxTreeCtrl)
29
30 BEGIN_EVENT_TABLE(csProjectTreeCtrl, wxTreeCtrl)
31 END_EVENT_TABLE()
32
33 // Define my frame constructor
34 csProjectTreeCtrl::csProjectTreeCtrl(wxWindow *parent, const wxWindowID id, const wxPoint& pos, const wxSize& size, long style):
35
36 wxTreeCtrl(parent, id, pos, size, style),
37 m_imageList(16, 16)
38 {
39 m_imageList.Add(wxIcon(_T("folder1")));
40 m_imageList.Add(wxIcon(_T("file1")));
41
42 SetImageList(& m_imageList);
43 }
44
45 csProjectTreeCtrl::~csProjectTreeCtrl()
46 {
47 SetImageList(NULL);
48 }
49
50 // Create the project window
51 bool csApp::CreateProjectWindow(wxFrame *WXUNUSED(parent))
52 {
53 #if 0
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);
62
63 m_projectSashWindow = win;
64
65 m_projectTreeCtrl = new csProjectTreeCtrl(win, ID_WINDOW_PROJECT_TREE, wxDefaultPosition,
66 wxDefaultSize, wxTR_HAS_BUTTONS|wxTR_LINES_AT_ROOT|wxDOUBLE_BORDER);
67
68 // For now, hide the window
69 m_projectSashWindow->Show(false);
70 #endif
71
72 return true;
73 }
74
75 // Fill out the project tree control
76 void csApp::FillProjectTreeCtrl()
77 {
78 #if 0
79 csProjectTreeCtrl& tree = *GetProjectTreeCtrl();
80
81 // Dummy data for now
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);
86 #endif
87 }
88