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>
17 #include <wx/cshelp.h>
18 #include <wx/helphtml.h>
20 #include <wx/msw/helpchm.h>
22 #include <wx/html/helpctrl.h>
25 #include <wx/ogl/ogl.h>
26 #include <wx/ogl/canvas.h>
29 class csEditorToolPalette
;
30 class csProjectTreeCtrl
;
32 class csSymbolDatabase
;
33 class wxSashLayoutWindow
;
37 #define csGRID_STYLE_NONE 0
38 #define csGRID_STYLE_INVISIBLE 1
39 #define csGRID_STYLE_DOTTED 2
41 // Define a new application
42 class csApp
: public wxApp
53 // Read/write configuration information
57 // Create the diagram tool palette
58 bool CreatePalette(wxFrame
*parent
);
60 // Create the project window
61 bool CreateProjectWindow(wxFrame
*parent
);
63 // Initialise the general toolbar
64 void InitToolBar(wxToolBar
* toolBar
);
66 // Create and initialise the diagram toolbar
67 void CreateDiagramToolBar(wxFrame
* parent
);
69 wxMDIChildFrame
*CreateChildFrame(wxDocument
*doc
, wxView
*view
, wxMenu
** editMenu
);
70 csCanvas
*CreateCanvas(wxView
*view
, wxMDIChildFrame
*parent
);
72 // Fill out the project tree control
73 void FillProjectTreeCtrl();
75 // Add symbols to database
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
; }
93 int GetGridStyle() const { return m_gridStyle
; }
94 void SetGridStyle(int style
) { m_gridStyle
= style
; }
96 int GetGridSpacing() const { return m_gridSpacing
; }
97 void SetGridSpacing(int spacing
) { m_gridSpacing
= spacing
; }
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
;
113 wxPoint m_mainFramePos
;
114 wxSize m_mainFrameSize
;
119 csDiagramClipboard m_diagramClipboard
;
122 wxHelpControllerBase
* m_helpController
;
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
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
150 #define ID_CS_ABOUT 100
151 #define ID_CS_SELECT_ALL 102
152 #define ID_CS_SETTINGS 103
154 #define ID_LAYOUT_WINDOW_PALETTE 200
155 #define ID_LAYOUT_WINDOW_DIAGRAM_TOOLBAR 201
156 #define ID_LAYOUT_WINDOW_PROJECT 202
158 #define ID_DIAGRAM_PALETTE 250
160 #define ID_WINDOW_PROJECT_TREE 300
161 #define ID_WINDOW_POINT_SIZE_COMBOBOX 301
162 #define ID_WINDOW_ZOOM_COMBOBOX 302
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