]> git.saurik.com Git - wxWidgets.git/blame - samples/ogl/studio/studio.h
removed OGL files from wxGTK build, fixed configure for wxBase
[wxWidgets.git] / samples / ogl / studio / studio.h
CommitLineData
2d08140f
JS
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
18#include <wx/ogl/ogl.h>
19#include <wx/ogl/canvas.h>
20#include "shapes.h"
21
22class csEditorToolPalette;
23class csProjectTreeCtrl;
24class csCanvas;
25class csSymbolDatabase;
26class wxSashLayoutWindow;
27class csFrame;
28
29// Grid style
30#define csGRID_STYLE_NONE 0
31#define csGRID_STYLE_INVISIBLE 1
32#define csGRID_STYLE_DOTTED 2
33
34// Define a new application
35class csApp: public wxApp
36{
37 friend csFrame;
38public:
39 csApp();
40 ~csApp();
41
42// Operations
43 bool OnInit(void);
44 int OnExit(void);
45
46 // Read/write configuration information
47 bool ReadOptions();
48 bool WriteOptions();
49
50 // Create the diagram tool palette
51 bool CreatePalette(wxFrame *parent);
52
53 // Create the project window
54 bool CreateProjectWindow(wxFrame *parent);
55
56 // Initialise the general toolbar
57 void InitToolBar(wxToolBar* toolBar);
58
59 // Create and initialise the diagram toolbar
60 void CreateDiagramToolBar(wxFrame* parent);
61
62 wxMDIChildFrame *CreateChildFrame(wxDocument *doc, wxView *view, wxMenu** editMenu);
63 csCanvas *CreateCanvas(wxView *view, wxFrame *parent);
64
65 // Fill out the project tree control
66 void FillProjectTreeCtrl();
67
68 // Add symbols to database
69 void InitSymbols();
70
71// Accessors
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; }
85
86 int GetGridStyle() const { return m_gridStyle; }
87 void SetGridStyle(int style) { m_gridStyle = style; }
88
89 int GetGridSpacing() const { return m_gridSpacing; }
90 void SetGridSpacing(int spacing) { m_gridSpacing = spacing; }
91
92protected:
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;
104
105 // Configuration
106 wxPoint m_mainFramePos;
107 wxSize m_mainFrameSize;
108 int m_gridStyle;
109 int m_gridSpacing;
110
111 // Diagram clipboard
112 csDiagramClipboard m_diagramClipboard;
113
114 // Help instance
115 wxHelpController m_helpController;
116};
117
118DECLARE_APP(csApp)
119
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
126#define ID_CS_MOVE 6
127#define ID_CS_SIZE 7
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
142
143#define ID_CS_ABOUT 100
144#define ID_CS_SELECT_ALL 102
145#define ID_CS_SETTINGS 103
146
147#define ID_LAYOUT_WINDOW_PALETTE 200
148#define ID_LAYOUT_WINDOW_DIAGRAM_TOOLBAR 201
149#define ID_LAYOUT_WINDOW_PROJECT 202
150
151#define ID_DIAGRAM_PALETTE 250
152
153#define ID_WINDOW_PROJECT_TREE 300
154#define ID_WINDOW_POINT_SIZE_COMBOBOX 301
155#define ID_WINDOW_ZOOM_COMBOBOX 302
156
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
168
169#endif
170 // _STUDIO_STUDIO_H_
171