]> git.saurik.com Git - wxWidgets.git/blob - contrib/samples/ogl/studio/studio.h
Make radiobutton tab behaviour the same on MSW
[wxWidgets.git] / contrib / samples / ogl / studio / studio.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: Studio.h
3 // Purpose: Studio application class
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 #ifndef _STUDIO_STUDIO_H_
13 #define _STUDIO_STUDIO_H_
14
15 #include <wx/docmdi.h>
16 #include <wx/help.h>
17 #include <wx/cshelp.h>
18 #include <wx/helphtml.h>
19 #ifdef __WXMSW__
20 #include <wx/msw/helpchm.h>
21 #else
22 #include <wx/html/helpctrl.h>
23 #endif
24
25 #include <wx/ogl/ogl.h>
26 #include <wx/ogl/canvas.h>
27 #include "shapes.h"
28
29 class csEditorToolPalette;
30 class csProjectTreeCtrl;
31 class csCanvas;
32 class csSymbolDatabase;
33 class wxSashLayoutWindow;
34 class csFrame;
35
36 // Grid style
37 #define csGRID_STYLE_NONE 0
38 #define csGRID_STYLE_INVISIBLE 1
39 #define csGRID_STYLE_DOTTED 2
40
41 // Define a new application
42 class csApp: public wxApp
43 {
44 friend class csFrame;
45 public:
46 csApp();
47 ~csApp();
48
49 // Operations
50 bool OnInit(void);
51 int OnExit(void);
52
53 // Read/write configuration information
54 bool ReadOptions();
55 bool WriteOptions();
56
57 // Create the diagram tool palette
58 bool CreatePalette(wxFrame *parent);
59
60 // Create the project window
61 bool CreateProjectWindow(wxFrame *parent);
62
63 // Initialise the general toolbar
64 void InitToolBar(wxToolBar* toolBar);
65
66 // Create and initialise the diagram toolbar
67 void CreateDiagramToolBar(wxFrame* parent);
68
69 wxMDIChildFrame *CreateChildFrame(wxDocument *doc, wxView *view, wxMenu** editMenu);
70 csCanvas *CreateCanvas(wxView *view, wxMDIChildFrame *parent);
71
72 // Fill out the project tree control
73 void FillProjectTreeCtrl();
74
75 // Add symbols to database
76 void InitSymbols();
77
78 // Accessors
79 csEditorToolPalette* GetDiagramPalette() const { return m_diagramPalette; }
80 wxToolBar* GetDiagramToolBar() const { return m_diagramToolBar; }
81 csProjectTreeCtrl* GetProjectTreeCtrl() const { return m_projectTreeCtrl; }
82 wxSashLayoutWindow* GetDiagramPaletteSashWindow() const { return m_diagramPaletteSashWindow; }
83 wxSashLayoutWindow* GetProjectSashWindow() const { return m_projectSashWindow; }
84 wxSashLayoutWindow* GetDiagramToolBarSashWindow() const { return m_diagramToolBarSashWindow; }
85 csSymbolDatabase* GetSymbolDatabase() const { return m_symbolDatabase; }
86 wxComboBox* GetPointSizeComboBox() const { return m_pointSizeComboBox; }
87 wxComboBox* GetZoomComboBox() const { return m_zoomComboBox; }
88 wxMenu* GetShapeEditMenu() const { return m_shapeEditMenu; }
89 wxDiagramClipboard& GetDiagramClipboard() const { return (wxDiagramClipboard&) m_diagramClipboard; }
90 wxDocManager* GetDocManager() const { return m_docManager; }
91 wxHelpControllerBase* GetHelpController() const { return m_helpController; }
92
93 int GetGridStyle() const { return m_gridStyle; }
94 void SetGridStyle(int style) { m_gridStyle = style; }
95
96 int GetGridSpacing() const { return m_gridSpacing; }
97 void SetGridSpacing(int spacing) { m_gridSpacing = spacing; }
98
99 protected:
100 wxDocManager* m_docManager;
101 wxSashLayoutWindow* m_diagramPaletteSashWindow;
102 wxSashLayoutWindow* m_diagramToolBarSashWindow;
103 wxSashLayoutWindow* m_projectSashWindow;
104 csEditorToolPalette* m_diagramPalette;
105 csProjectTreeCtrl* m_projectTreeCtrl;
106 csSymbolDatabase* m_symbolDatabase;
107 wxToolBar* m_diagramToolBar;
108 wxComboBox* m_pointSizeComboBox;
109 wxComboBox* m_zoomComboBox;
110 wxMenu* m_shapeEditMenu;
111
112 // Configuration
113 wxPoint m_mainFramePos;
114 wxSize m_mainFrameSize;
115 int m_gridStyle;
116 int m_gridSpacing;
117
118 // Diagram clipboard
119 csDiagramClipboard m_diagramClipboard;
120
121 // Help instance
122 wxHelpControllerBase* m_helpController;
123 };
124
125 DECLARE_APP(csApp)
126
127 #define ID_CS_CUT wxID_CUT
128 #define ID_CS_ADD_SHAPE 2
129 #define ID_CS_ADD_LINE 3
130 // #define ID_CS_EDIT_LABEL 4
131 #define ID_CS_EDIT_PROPERTIES 4
132 #define ID_CS_CHANGE_BACKGROUND_COLOUR 5
133 #define ID_CS_MOVE 6
134 #define ID_CS_SIZE 7
135 #define ID_CS_FONT_CHANGE 8
136 #define ID_CS_ARROW_CHANGE 9
137 #define ID_CS_ROTATE_CLOCKWISE 11
138 #define ID_CS_ROTATE_ANTICLOCKWISE 12
139 #define ID_CS_CHANGE_LINE_ORDERING 13 // Change the list of lines for a wxShape
140 #define ID_CS_CHANGE_LINE_ATTACHMENT 14 // Change the attachment point for one end of a line
141 #define ID_CS_ALIGN 15
142 #define ID_CS_NEW_POINT 16
143 #define ID_CS_CUT_POINT 17
144 #define ID_CS_STRAIGHTEN 18
145 #define ID_CS_MOVE_LINE_POINT 19
146 #define ID_CS_MOVE_LABEL 20
147 #define ID_CS_ADD_SHAPE_SELECT 21
148 #define ID_CS_ADD_LINE_SELECT 22
149
150 #define ID_CS_ABOUT 100
151 #define ID_CS_SELECT_ALL 102
152 #define ID_CS_SETTINGS 103
153
154 #define ID_LAYOUT_WINDOW_PALETTE 200
155 #define ID_LAYOUT_WINDOW_DIAGRAM_TOOLBAR 201
156 #define ID_LAYOUT_WINDOW_PROJECT 202
157
158 #define ID_DIAGRAM_PALETTE 250
159
160 #define ID_WINDOW_PROJECT_TREE 300
161 #define ID_WINDOW_POINT_SIZE_COMBOBOX 301
162 #define ID_WINDOW_ZOOM_COMBOBOX 302
163
164 #define DIAGRAM_TOOLBAR_ALIGNL 500
165 #define DIAGRAM_TOOLBAR_ALIGNR 501
166 #define DIAGRAM_TOOLBAR_ALIGNB 502
167 #define DIAGRAM_TOOLBAR_ALIGNT 503
168 #define DIAGRAM_TOOLBAR_ALIGN_HORIZ 504
169 #define DIAGRAM_TOOLBAR_ALIGN_VERT 505
170 #define DIAGRAM_TOOLBAR_COPY_SIZE 506
171 #define DIAGRAM_TOOLBAR_LINE_ARROW 507
172 #define DIAGRAM_TOOLBAR_NEW_POINT 508
173 #define DIAGRAM_TOOLBAR_CUT_POINT 509
174 #define DIAGRAM_TOOLBAR_STRAIGHTEN 510
175
176 #endif
177 // _STUDIO_STUDIO_H_
178