1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Studio application class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
10 /////////////////////////////////////////////////////////////////////////////
12 // For compilers that support precompilation, includes "wx/wx.h".
13 #include "wx/wxprec.h"
24 #include <wx/deprecated/setup.h>
25 #include <wx/deprecated/resource.h>
26 #include "wx/config.h"
27 #include "wx/laywin.h"
33 #include "cspalette.h"
37 #if defined(__WXGTK__) || defined(__WXX11__) || defined(__WXMOTIF__) || defined(__WXMAC__)
38 #include "bitmaps/new.xpm"
39 #include "bitmaps/open.xpm"
40 #include "bitmaps/save.xpm"
41 #include "bitmaps/copy.xpm"
42 #include "bitmaps/cut.xpm"
43 #include "bitmaps/paste.xpm"
44 #include "bitmaps/print.xpm"
45 #include "bitmaps/help.xpm"
46 #include "bitmaps/undo.xpm"
47 #include "bitmaps/redo.xpm"
49 #include "bitmaps/alignl.xpm"
50 #include "bitmaps/alignr.xpm"
51 #include "bitmaps/alignt.xpm"
52 #include "bitmaps/alignb.xpm"
53 #include "bitmaps/horiz.xpm"
54 #include "bitmaps/vert.xpm"
55 #include "bitmaps/copysize.xpm"
56 #include "bitmaps/linearrow.xpm"
57 #include "bitmaps/newpoint.xpm"
58 #include "bitmaps/cutpoint.xpm"
59 #include "bitmaps/straight.xpm"
69 m_diagramPalette
= NULL
;
70 m_diagramToolBar
= NULL
;
71 m_projectTreeCtrl
= NULL
;
72 m_diagramPaletteSashWindow
= NULL
;
73 m_projectSashWindow
= NULL
;
74 m_symbolDatabase
= NULL
;
75 m_pointSizeComboBox
= NULL
;
76 m_zoomComboBox
= NULL
;
77 m_shapeEditMenu
= NULL
;
80 m_mainFramePos
.x
= 20;
81 m_mainFramePos
.y
= 20;
82 m_mainFrameSize
.x
= 500;
83 m_mainFrameSize
.y
= 400;
84 m_gridStyle
= csGRID_STYLE_INVISIBLE
;
92 // Initialise this in OnInit, not statically
93 bool csApp::OnInit(void)
95 if (!wxResourceParseFile(_T("studio_resources.wxr")))
97 wxMessageBox(_T("Could not find or parse resource file: studio_resources.wxr"), _T("Studio"));
101 #if wxUSE_MS_HTML_HELP && !defined(__WXUNIVERSAL__)
102 m_helpController
= new wxWinHelpController
;
104 m_helpController
= new wxHtmlHelpController
;
107 m_helpController
->Initialize(_T("studio.hlp"));
115 //// Create a document manager
116 m_docManager
= new wxDocManager
;
118 //// Create a template relating drawing documents to their views
119 (void) new wxDocTemplate(m_docManager
, _T("Diagram"), _T("*.dia"), wxEmptyString
, _T("dia"), _T("Diagram Doc"), _T("Diagram View"),
120 CLASSINFO(csDiagramDocument
), CLASSINFO(csDiagramView
));
122 // Create the main frame window.
123 // Note that we use a frame style that doesn't have wxCLIP_CHILDREN in it
124 // (the default frame style contains wxCLIP_CHILDREN), otherwise the client
125 // area doesn't refresh properly when we change its position, under Windows.
127 #define wxDEFAULT_FRAME_STYLE_NO_CLIP \
128 (wxDEFAULT_FRAME_STYLE & ~wxCLIP_CHILDREN)
130 csFrame
* frame
= new csFrame(m_docManager
, NULL
, wxID_ANY
, _T("OGL Studio"), m_mainFramePos
, m_mainFrameSize
,
131 wxDEFAULT_FRAME_STYLE_NO_CLIP
| wxHSCROLL
| wxVSCROLL
);
134 frame
->SetIcon(wxICON(studio
));
137 wxMenu
*fileMenu
= new wxMenu
;
139 fileMenu
->Append(wxID_NEW
, _T("&New...\tCtrl+N"));
140 fileMenu
->Append(wxID_OPEN
, _T("&Open...\tCtrl+O"));
142 fileMenu
->AppendSeparator();
144 fileMenu
->Append(wxID_PRINT
, _T("&Print...\tCtrl+P"));
145 fileMenu
->Append(wxID_PRINT_SETUP
, _T("Print &Setup..."));
146 fileMenu
->Append(wxID_PREVIEW
, _T("Print Pre&view"));
147 fileMenu
->AppendSeparator();
148 fileMenu
->Append(wxID_EXIT
, _T("E&xit"));
150 // A history of files visited. Use this menu.
151 m_docManager
->FileHistoryUseMenu(fileMenu
);
153 wxMenu
*viewMenu
= new wxMenu
;
154 viewMenu
->Append(ID_CS_SETTINGS
, _T("&Settings..."));
156 wxMenu
*helpMenu
= new wxMenu
;
157 helpMenu
->Append(wxID_HELP
, _T("&Help Contents\tF1"));
158 helpMenu
->Append(ID_CS_ABOUT
, _T("&About"));
160 wxMenuBar
*menuBar
= new wxMenuBar
;
162 menuBar
->Append(fileMenu
, _T("&File"));
163 menuBar
->Append(viewMenu
, _T("&View"));
164 menuBar
->Append(helpMenu
, _T("&Help"));
166 // Associate the menu bar with the frame
167 frame
->SetMenuBar(menuBar
);
169 // Load the file history
170 wxConfig
config(_T("OGL Studio"), _T("wxWidgets"));
171 m_docManager
->FileHistoryLoad(config
);
174 frame
->CreateStatusBar();
175 #endif // wxUSE_STATUSBAR
177 // The ordering of these is important for layout purposes
178 CreateDiagramToolBar(frame
);
179 CreatePalette(frame
);
182 CreateProjectWindow(frame);
183 FillProjectTreeCtrl();
186 // Create the shape editing menu
187 m_shapeEditMenu
= new ShapeEditMenu
;
188 m_shapeEditMenu
->Append(ID_CS_EDIT_PROPERTIES
, _T("Edit properties"));
189 m_shapeEditMenu
->AppendSeparator();
190 m_shapeEditMenu
->Append(ID_CS_ROTATE_CLOCKWISE
, _T("Rotate clockwise"));
191 m_shapeEditMenu
->Append(ID_CS_ROTATE_ANTICLOCKWISE
, _T("Rotate anticlockwise"));
192 m_shapeEditMenu
->AppendSeparator();
193 m_shapeEditMenu
->Append(ID_CS_CUT
, _T("Cut"));
202 int csApp::OnExit(void)
206 delete m_symbolDatabase
;
207 m_symbolDatabase
= NULL
;
212 delete m_shapeEditMenu
;
213 m_shapeEditMenu
= NULL
;
215 delete m_helpController
;
216 m_helpController
= NULL
;
224 * Centralised code for creating a document frame.
225 * Called from view.cpp, when a view is created.
228 wxMDIChildFrame
*csApp::CreateChildFrame(wxDocument
*doc
, wxView
*view
, wxMenu
** editMenuRet
)
230 //// Make a child frame
231 csMDIChildFrame
*subframe
= new csMDIChildFrame(doc
, view
, ((wxDocMDIParentFrame
*)GetTopWindow()), wxID_ANY
, _T("Child Frame"),
232 wxPoint(10, 10), wxSize(300, 300), wxDEFAULT_FRAME_STYLE
);
235 subframe
->SetIcon(wxString(_T("chart")));
238 subframe
->SetIcon(wxIcon(_T("doc.xbm")));
242 wxMenu
*fileMenu
= new wxMenu
;
244 fileMenu
->Append(wxID_NEW
, _T("&New...\tCtrl+N"));
245 fileMenu
->Append(wxID_OPEN
, _T("&Open...\tCtrl+O"));
246 fileMenu
->Append(wxID_CLOSE
, _T("&Close\tCtrl+W"));
247 fileMenu
->Append(wxID_SAVE
, _T("&Save\tCtrl+S"));
248 fileMenu
->Append(wxID_SAVEAS
, _T("Save &As...\tF12"));
250 fileMenu
->AppendSeparator();
251 fileMenu
->Append(wxID_PRINT
, _T("&Print...\tCtrl+P"));
252 fileMenu
->Append(wxID_PRINT_SETUP
, _T("Print &Setup..."));
253 fileMenu
->Append(wxID_PREVIEW
, _T("Print Pre&view"));
255 fileMenu
->AppendSeparator();
256 fileMenu
->Append(wxID_EXIT
, _T("E&xit"));
258 wxMenu
* editMenu
= new wxMenu
;
259 editMenu
->Append(wxID_UNDO
, _T("&Undo\tCtrl+Z"));
260 editMenu
->Append(wxID_REDO
, _T("&Redo\tCtrl+Y"));
261 editMenu
->AppendSeparator();
262 editMenu
->Append(wxID_CUT
, _T("Cu&t\tCtrl+X"));
263 editMenu
->Append(wxID_COPY
, _T("&Copy\tCtrl+C"));
264 editMenu
->Append(wxID_PASTE
, _T("&Paste\tCtrl+V"));
265 editMenu
->Append(wxID_DUPLICATE
, _T("&Duplicate\tCtrl+D"));
266 editMenu
->AppendSeparator();
267 editMenu
->Append(wxID_CLEAR
, _T("Cle&ar\tDelete"));
268 editMenu
->Append(ID_CS_SELECT_ALL
, _T("Select A&ll\tCtrl+A"));
269 editMenu
->AppendSeparator();
270 editMenu
->Append(ID_CS_EDIT_PROPERTIES
, _T("Edit P&roperties..."));
272 *editMenuRet
= editMenu
;
274 m_docManager
->FileHistoryUseMenu(fileMenu
);
275 m_docManager
->FileHistoryAddFilesToMenu(fileMenu
);
277 doc
->GetCommandProcessor()->SetEditMenu(editMenu
);
279 wxMenu
*viewMenu
= new wxMenu
;
280 viewMenu
->Append(ID_CS_SETTINGS
, _T("&Settings..."));
282 wxMenu
*helpMenu
= new wxMenu
;
283 helpMenu
->Append(wxID_HELP
, _T("&Help Contents\tF1"));
284 helpMenu
->Append(ID_CS_ABOUT
, _T("&About"));
286 wxMenuBar
*menuBar
= new wxMenuBar
;
288 menuBar
->Append(fileMenu
, _T("&File"));
289 menuBar
->Append(editMenu
, _T("&Edit"));
290 menuBar
->Append(viewMenu
, _T("&View"));
291 menuBar
->Append(helpMenu
, _T("&Help"));
293 //// Associate the menu bar with the frame
294 subframe
->SetMenuBar(menuBar
);
299 // Creates a canvas. Called by OnInit as a child of the main window
300 csCanvas
*csApp::CreateCanvas(wxView
*view
, wxMDIChildFrame
*parent
)
303 parent
->GetClientSize(&width
, &height
);
305 // Non-retained canvas
306 csCanvas
*canvas
= new csCanvas((csDiagramView
*) view
, parent
, 1000, wxPoint(0, 0), wxSize(width
, height
), wxSUNKEN_BORDER
);
308 wxColour
bgColour(_T("WHITE"));
309 canvas
->SetBackgroundColour(bgColour
);
311 wxCursor
cursor(wxCURSOR_HAND
);
312 canvas
->SetCursor(cursor
);
314 // Give it scrollbars
315 canvas
->SetScrollbars(20, 20, 100, 100);
320 void csApp::InitToolBar(wxToolBar
* toolBar
)
322 wxBitmap
* bitmaps
[10];
325 bitmaps
[0] = new wxBitmap(_T("new"), wxBITMAP_TYPE_RESOURCE
);
326 bitmaps
[1] = new wxBitmap(_T("open"), wxBITMAP_TYPE_RESOURCE
);
327 bitmaps
[2] = new wxBitmap(_T("save"), wxBITMAP_TYPE_RESOURCE
);
328 bitmaps
[3] = new wxBitmap(_T("copy"), wxBITMAP_TYPE_RESOURCE
);
329 bitmaps
[4] = new wxBitmap(_T("cut"), wxBITMAP_TYPE_RESOURCE
);
330 bitmaps
[5] = new wxBitmap(_T("paste"), wxBITMAP_TYPE_RESOURCE
);
331 bitmaps
[6] = new wxBitmap(_T("print"), wxBITMAP_TYPE_RESOURCE
);
332 bitmaps
[7] = new wxBitmap(_T("help"), wxBITMAP_TYPE_RESOURCE
);
333 bitmaps
[8] = new wxBitmap(_T("undo"), wxBITMAP_TYPE_RESOURCE
);
334 bitmaps
[9] = new wxBitmap(_T("redo"), wxBITMAP_TYPE_RESOURCE
);
335 #elif defined(__WXGTK__) || defined(__WXX11__) || defined(__WXMOTIF__) || defined(__WXMAC__)
336 bitmaps
[0] = new wxBitmap( new_xpm
);
337 bitmaps
[1] = new wxBitmap( open_xpm
);
338 bitmaps
[2] = new wxBitmap( save_xpm
);
339 bitmaps
[3] = new wxBitmap( copy_xpm
);
340 bitmaps
[4] = new wxBitmap( cut_xpm
);
341 bitmaps
[5] = new wxBitmap( paste_xpm
);
342 bitmaps
[6] = new wxBitmap( print_xpm
);
343 bitmaps
[7] = new wxBitmap( help_xpm
);
344 bitmaps
[8] = new wxBitmap( undo_xpm
);
345 bitmaps
[9] = new wxBitmap( redo_xpm
);
347 #error "Not implemented for this platform."
350 toolBar
->AddTool(wxID_NEW
, *bitmaps
[0], wxNullBitmap
, false, wxDefaultPosition
.x
, wxDefaultPosition
.y
, NULL
, _T("New file"));
351 toolBar
->AddTool(wxID_OPEN
, *bitmaps
[1], wxNullBitmap
, false, wxDefaultPosition
.x
, wxDefaultPosition
.y
, NULL
, _T("Open file"));
352 toolBar
->AddTool(wxID_SAVE
, *bitmaps
[2], wxNullBitmap
, false, wxDefaultPosition
.x
, wxDefaultPosition
.y
, NULL
, _T("Save file"));
353 toolBar
->AddSeparator();
354 toolBar
->AddTool(wxID_PRINT
, *bitmaps
[6], wxNullBitmap
, false, wxDefaultPosition
.x
, wxDefaultPosition
.y
, NULL
, _T("Print"));
355 toolBar
->AddSeparator();
356 toolBar
->AddTool(wxID_COPY
, *bitmaps
[3], wxNullBitmap
, false, wxDefaultPosition
.x
, wxDefaultPosition
.y
, NULL
, _T("Copy"));
357 toolBar
->AddTool(wxID_CUT
, *bitmaps
[4], wxNullBitmap
, false, wxDefaultPosition
.x
, wxDefaultPosition
.y
, NULL
, _T("Cut"));
358 toolBar
->AddTool(wxID_PASTE
, *bitmaps
[5], wxNullBitmap
, false, wxDefaultPosition
.x
, wxDefaultPosition
.y
, NULL
, _T("Paste"));
359 toolBar
->AddSeparator();
360 toolBar
->AddTool(wxID_UNDO
, *bitmaps
[8], wxNullBitmap
, false, wxDefaultPosition
.x
, wxDefaultPosition
.y
, NULL
, _T("Undo"));
361 toolBar
->AddTool(wxID_REDO
, *bitmaps
[9], wxNullBitmap
, false, wxDefaultPosition
.x
, wxDefaultPosition
.y
, NULL
, _T("Redo"));
362 toolBar
->AddSeparator();
363 toolBar
->AddTool(wxID_HELP
, *bitmaps
[7], wxNullBitmap
, false, wxDefaultPosition
.x
, wxDefaultPosition
.y
, NULL
, _T("Help"));
367 toolBar
->EnableTool(wxID_COPY
, false);
368 toolBar
->EnableTool(wxID_PASTE
, false);
369 toolBar
->EnableTool(wxID_PRINT
, false);
370 toolBar
->EnableTool(wxID_UNDO
, false);
371 toolBar
->EnableTool(wxID_REDO
, false);
374 for (i
= 0; i
< 10; i
++)
378 // Create and initialise the diagram toolbar
379 void csApp::CreateDiagramToolBar(wxFrame
* parent
)
381 // First create a layout window
382 wxSashLayoutWindow
* win
= new wxSashLayoutWindow(parent
, ID_LAYOUT_WINDOW_DIAGRAM_TOOLBAR
, wxDefaultPosition
, wxSize(200, 30), wxNO_BORDER
|wxSW_3D
|wxCLIP_CHILDREN
);
383 win
->SetDefaultSize(wxSize(10000, 30));
384 win
->SetOrientation(wxLAYOUT_HORIZONTAL
);
385 win
->SetAlignment(wxLAYOUT_TOP
);
386 win
->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE
));
388 m_diagramToolBarSashWindow
= win
;
389 m_diagramToolBarSashWindow
->Show(false);
391 // Create the actual toolbar
392 m_diagramToolBar
= new wxToolBar(win
, wxID_ANY
, wxDefaultPosition
, wxDefaultSize
, wxTB_HORIZONTAL
|wxNO_BORDER
|wxTB_FLAT
);
394 wxBitmap
* bitmaps
[11];
397 bitmaps
[0] = new wxBitmap(_T("alignl"), wxBITMAP_TYPE_RESOURCE
);
398 bitmaps
[1] = new wxBitmap(_T("alignr"), wxBITMAP_TYPE_RESOURCE
);
399 bitmaps
[2] = new wxBitmap(_T("alignt"), wxBITMAP_TYPE_RESOURCE
);
400 bitmaps
[3] = new wxBitmap(_T("alignb"), wxBITMAP_TYPE_RESOURCE
);
401 bitmaps
[4] = new wxBitmap(_T("horiz"), wxBITMAP_TYPE_RESOURCE
);
402 bitmaps
[5] = new wxBitmap(_T("vert"), wxBITMAP_TYPE_RESOURCE
);
403 bitmaps
[6] = new wxBitmap(_T("copysize"), wxBITMAP_TYPE_RESOURCE
);
404 bitmaps
[7] = new wxBitmap(_T("linearrow"), wxBITMAP_TYPE_RESOURCE
);
405 bitmaps
[8] = new wxBitmap(_T("newpoint"), wxBITMAP_TYPE_RESOURCE
);
406 bitmaps
[9] = new wxBitmap(_T("cutpoint"), wxBITMAP_TYPE_RESOURCE
);
407 bitmaps
[10] = new wxBitmap(_T("straighten"), wxBITMAP_TYPE_RESOURCE
);
408 #elif defined(__WXGTK__) || defined(__WXX11__) || defined(__WXMOTIF__) || defined(__WXMAC__)
409 bitmaps
[0] = new wxBitmap( alignl_xpm
);
410 bitmaps
[1] = new wxBitmap( alignr_xpm
);
411 bitmaps
[2] = new wxBitmap( alignt_xpm
);
412 bitmaps
[3] = new wxBitmap( alignb_xpm
);
413 bitmaps
[4] = new wxBitmap( horiz_xpm
);
414 bitmaps
[5] = new wxBitmap( vert_xpm
);
415 bitmaps
[6] = new wxBitmap( copysize_xpm
);
416 bitmaps
[7] = new wxBitmap( linearrow_xpm
);
417 bitmaps
[8] = new wxBitmap( newpoint_xpm
);
418 bitmaps
[9] = new wxBitmap( cutpoint_xpm
);
419 bitmaps
[10] = new wxBitmap( straight_xpm
);
421 #error "Not implemented for this platform."
424 m_diagramToolBar
->AddTool(DIAGRAM_TOOLBAR_ALIGNL
, *bitmaps
[0], wxNullBitmap
, false, wxDefaultPosition
.x
, wxDefaultPosition
.y
, NULL
, _T("Align left"));
425 m_diagramToolBar
->AddTool(DIAGRAM_TOOLBAR_ALIGNR
, *bitmaps
[1], wxNullBitmap
, false, wxDefaultPosition
.x
, wxDefaultPosition
.y
, NULL
, _T("Align right"));
426 m_diagramToolBar
->AddTool(DIAGRAM_TOOLBAR_ALIGNT
, *bitmaps
[2], wxNullBitmap
, false, wxDefaultPosition
.x
, wxDefaultPosition
.y
, NULL
, _T("Align top"));
427 m_diagramToolBar
->AddTool(DIAGRAM_TOOLBAR_ALIGNB
, *bitmaps
[3], wxNullBitmap
, false, wxDefaultPosition
.x
, wxDefaultPosition
.y
, NULL
, _T("Align bottom"));
428 m_diagramToolBar
->AddTool(DIAGRAM_TOOLBAR_ALIGN_HORIZ
, *bitmaps
[4], wxNullBitmap
, false, wxDefaultPosition
.x
, wxDefaultPosition
.y
, NULL
, _T("Align horizontally"));
429 m_diagramToolBar
->AddTool(DIAGRAM_TOOLBAR_ALIGN_VERT
, *bitmaps
[5], wxNullBitmap
, false, wxDefaultPosition
.x
, wxDefaultPosition
.y
, NULL
, _T("Align vertically"));
430 m_diagramToolBar
->AddTool(DIAGRAM_TOOLBAR_COPY_SIZE
, *bitmaps
[6], wxNullBitmap
, false, wxDefaultPosition
.x
, wxDefaultPosition
.y
, NULL
, _T("Copy size"));
431 m_diagramToolBar
->AddSeparator();
432 m_diagramToolBar
->AddTool(DIAGRAM_TOOLBAR_LINE_ARROW
, *bitmaps
[7], wxNullBitmap
, true, wxDefaultPosition
.x
, wxDefaultPosition
.y
, NULL
, _T("Toggle arrow"));
433 m_diagramToolBar
->AddTool(DIAGRAM_TOOLBAR_NEW_POINT
, *bitmaps
[8], wxNullBitmap
, false, wxDefaultPosition
.x
, wxDefaultPosition
.y
, NULL
, _T("New line point"));
434 m_diagramToolBar
->AddTool(DIAGRAM_TOOLBAR_CUT_POINT
, *bitmaps
[9], wxNullBitmap
, false, wxDefaultPosition
.x
, wxDefaultPosition
.y
, NULL
, _T("Cut line point"));
435 m_diagramToolBar
->AddTool(DIAGRAM_TOOLBAR_STRAIGHTEN
, *bitmaps
[10], wxNullBitmap
, false, wxDefaultPosition
.x
, wxDefaultPosition
.y
, NULL
, _T("Straighten lines"));
437 m_diagramToolBar
->Realize();
440 for (i
= 0; i
< 11; i
++)
443 // Create a combobox for point size
444 int maxPointSize
= 40;
445 wxString
*pointSizes
= new wxString
[maxPointSize
];
446 for (i
= 1; i
<= maxPointSize
; i
++)
448 pointSizes
[i
-1].Printf(_T("%d"), i
);
464 m_pointSizeComboBox
= new wxComboBox(m_diagramToolBar
, ID_WINDOW_POINT_SIZE_COMBOBOX
,
465 wxEmptyString
, wxPoint(controlX
, 1), wxSize(pointSizeW
, pointSizeH
), maxPointSize
, pointSizes
);
469 m_diagramToolBar
->AddControl(m_pointSizeComboBox
);
472 m_pointSizeComboBox
->SetSelection(10 - 1);
474 // Create a combobox for zooming
478 int noStrings
= (maxZoom
- minZoom
)/5 ;
479 wxString
*zoomStrings
= new wxString
[noStrings
];
480 for (i
= 0; i
< noStrings
; i
++)
482 zoomStrings
[noStrings
- i
- 1].Printf(_T("%d%%"), (i
*increment
+ minZoom
));
485 controlX
+= pointSizeW
+ 10;
487 m_zoomComboBox
= new wxComboBox(m_diagramToolBar
, ID_WINDOW_ZOOM_COMBOBOX
,
488 wxEmptyString
, wxPoint(controlX
, 1), wxSize(zoomW
, zoomH
), noStrings
, zoomStrings
);
489 delete[] zoomStrings
;
492 m_diagramToolBar
->AddControl(m_zoomComboBox
);
495 // i = (zoom - minZoom)/increment
496 // index = noStrings - i - 1
498 i
= (100 - minZoom
)/increment
;
499 m_zoomComboBox
->SetSelection(noStrings
- i
- 1);
502 // Read/write configuration information
503 bool csApp::ReadOptions()
505 wxConfig
config(_T("OGL Studio"), _T("wxWidgets"));
507 config
.Read(_T("mainX"), & m_mainFramePos
.x
);
508 config
.Read(_T("mainY"), & m_mainFramePos
.y
);
509 config
.Read(_T("mainWidth"), & m_mainFrameSize
.x
);
510 config
.Read(_T("mainHeight"), & m_mainFrameSize
.y
);
511 config
.Read(_T("gridStyle"), & m_gridStyle
);
512 config
.Read(_T("gridSpacing"), & m_gridSpacing
);
517 bool csApp::WriteOptions()
519 wxConfig
config(_T("OGL Studio"), _T("wxWidgets"));
521 config
.Write(_T("mainX"), (long) m_mainFramePos
.x
);
522 config
.Write(_T("mainY"), (long) m_mainFramePos
.y
);
523 config
.Write(_T("mainWidth"), (long) m_mainFrameSize
.x
);
524 config
.Write(_T("mainHeight"), (long) m_mainFrameSize
.y
);
525 config
.Write(_T("gridStyle"), (long) m_gridStyle
);
526 config
.Write(_T("gridSpacing"), (long) m_gridSpacing
);
528 m_docManager
->FileHistorySave(config
);