1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Studio application class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _STUDIO_STUDIO_H_
13 #define _STUDIO_STUDIO_H_
15 #include <wx/docmdi.h>
18 #include <wx/ogl/ogl.h>
19 #include <wx/ogl/canvas.h>
22 class csEditorToolPalette
;
23 class csProjectTreeCtrl
;
25 class csSymbolDatabase
;
26 class wxSashLayoutWindow
;
30 #define csGRID_STYLE_NONE 0
31 #define csGRID_STYLE_INVISIBLE 1
32 #define csGRID_STYLE_DOTTED 2
34 // Define a new application
35 class csApp
: public wxApp
46 // Read/write configuration information
50 // Create the diagram tool palette
51 bool CreatePalette(wxFrame
*parent
);
53 // Create the project window
54 bool CreateProjectWindow(wxFrame
*parent
);
56 // Initialise the general toolbar
57 void InitToolBar(wxToolBar
* toolBar
);
59 // Create and initialise the diagram toolbar
60 void CreateDiagramToolBar(wxFrame
* parent
);
62 wxMDIChildFrame
*CreateChildFrame(wxDocument
*doc
, wxView
*view
, wxMenu
** editMenu
);
63 csCanvas
*CreateCanvas(wxView
*view
, wxFrame
*parent
);
65 // Fill out the project tree control
66 void FillProjectTreeCtrl();
68 // Add symbols to database
72 csEditorToolPalette
* GetDiagramPalette() const { return m_diagramPalette
; }
73 wxToolBar
* GetDiagramToolBar() const { return m_diagramToolBar
; }
74 csProjectTreeCtrl
* GetProjectTreeCtrl() const { return m_projectTreeCtrl
; }
75 wxSashLayoutWindow
* GetDiagramPaletteSashWindow() const { return m_diagramPaletteSashWindow
; }
76 wxSashLayoutWindow
* GetProjectSashWindow() const { return m_projectSashWindow
; }
77 wxSashLayoutWindow
* GetDiagramToolBarSashWindow() const { return m_diagramToolBarSashWindow
; }
78 csSymbolDatabase
* GetSymbolDatabase() const { return m_symbolDatabase
; }
79 wxComboBox
* GetPointSizeComboBox() const { return m_pointSizeComboBox
; }
80 wxComboBox
* GetZoomComboBox() const { return m_zoomComboBox
; }
81 wxMenu
* GetShapeEditMenu() const { return m_shapeEditMenu
; }
82 wxDiagramClipboard
& GetDiagramClipboard() const { return (wxDiagramClipboard
&) m_diagramClipboard
; }
83 wxDocManager
* GetDocManager() const { return m_docManager
; }
84 wxHelpController
& GetHelpController() const { return (wxHelpController
&) m_helpController
; }
86 int GetGridStyle() const { return m_gridStyle
; }
87 void SetGridStyle(int style
) { m_gridStyle
= style
; }
89 int GetGridSpacing() const { return m_gridSpacing
; }
90 void SetGridSpacing(int spacing
) { m_gridSpacing
= spacing
; }
93 wxDocManager
* m_docManager
;
94 wxSashLayoutWindow
* m_diagramPaletteSashWindow
;
95 wxSashLayoutWindow
* m_diagramToolBarSashWindow
;
96 wxSashLayoutWindow
* m_projectSashWindow
;
97 csEditorToolPalette
* m_diagramPalette
;
98 csProjectTreeCtrl
* m_projectTreeCtrl
;
99 csSymbolDatabase
* m_symbolDatabase
;
100 wxToolBar
* m_diagramToolBar
;
101 wxComboBox
* m_pointSizeComboBox
;
102 wxComboBox
* m_zoomComboBox
;
103 wxMenu
* m_shapeEditMenu
;
106 wxPoint m_mainFramePos
;
107 wxSize m_mainFrameSize
;
112 csDiagramClipboard m_diagramClipboard
;
115 wxHelpController m_helpController
;
120 #define ID_CS_CUT wxID_CUT
121 #define ID_CS_ADD_SHAPE 2
122 #define ID_CS_ADD_LINE 3
123 // #define ID_CS_EDIT_LABEL 4
124 #define ID_CS_EDIT_PROPERTIES 4
125 #define ID_CS_CHANGE_BACKGROUND_COLOUR 5
128 #define ID_CS_FONT_CHANGE 8
129 #define ID_CS_ARROW_CHANGE 9
130 #define ID_CS_ROTATE_CLOCKWISE 11
131 #define ID_CS_ROTATE_ANTICLOCKWISE 12
132 #define ID_CS_CHANGE_LINE_ORDERING 13 // Change the list of lines for a wxShape
133 #define ID_CS_CHANGE_LINE_ATTACHMENT 14 // Change the attachment point for one end of a line
134 #define ID_CS_ALIGN 15
135 #define ID_CS_NEW_POINT 16
136 #define ID_CS_CUT_POINT 17
137 #define ID_CS_STRAIGHTEN 18
138 #define ID_CS_MOVE_LINE_POINT 19
139 #define ID_CS_MOVE_LABEL 20
140 #define ID_CS_ADD_SHAPE_SELECT 21
141 #define ID_CS_ADD_LINE_SELECT 22
143 #define ID_CS_ABOUT 100
144 #define ID_CS_SELECT_ALL 102
145 #define ID_CS_SETTINGS 103
147 #define ID_LAYOUT_WINDOW_PALETTE 200
148 #define ID_LAYOUT_WINDOW_DIAGRAM_TOOLBAR 201
149 #define ID_LAYOUT_WINDOW_PROJECT 202
151 #define ID_DIAGRAM_PALETTE 250
153 #define ID_WINDOW_PROJECT_TREE 300
154 #define ID_WINDOW_POINT_SIZE_COMBOBOX 301
155 #define ID_WINDOW_ZOOM_COMBOBOX 302
157 #define DIAGRAM_TOOLBAR_ALIGNL 500
158 #define DIAGRAM_TOOLBAR_ALIGNR 501
159 #define DIAGRAM_TOOLBAR_ALIGNB 502
160 #define DIAGRAM_TOOLBAR_ALIGNT 503
161 #define DIAGRAM_TOOLBAR_ALIGN_HORIZ 504
162 #define DIAGRAM_TOOLBAR_ALIGN_VERT 505
163 #define DIAGRAM_TOOLBAR_COPY_SIZE 506
164 #define DIAGRAM_TOOLBAR_LINE_ARROW 507
165 #define DIAGRAM_TOOLBAR_NEW_POINT 508
166 #define DIAGRAM_TOOLBAR_CUT_POINT 509
167 #define DIAGRAM_TOOLBAR_STRAIGHTEN 510