-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwxsEditorApp.cpp
More file actions
84 lines (68 loc) · 1.81 KB
/
wxsEditorApp.cpp
File metadata and controls
84 lines (68 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/***************************************************************
* Name: wxsEditorApp.cpp
* Purpose: Code for Application Class
* Author: ImprobabilityCast
* Created: 2016-11-20
* Copyright: ImprobabilityCast
* License:
**************************************************************/
#include "wx_pch.h"
#include "wxsEditorApp.h"
//(*AppHeaders
#include "wxsEditorMain.h"
#include <wx/image.h>
//*)
IMPLEMENT_APP(wxsEditorApp);
bool wxsEditorApp::OnInit()
{
// call default behaviour (mandatory)
if (!wxApp::OnInit())
return false;
// some application-dependent treatments...
// Add this down there if it goes away:
// Frame->CheckCmdParamaters(cmdParam);
// Frame->Maximize();
//(*AppInitialize
bool wxsOK = true;
if (!silent_mode) {
wxInitAllImageHandlers();
if ( wxsOK )
{
wxsEditorFrame* Frame = new wxsEditorFrame(0);
Frame->Maximize();
Frame->Show();
Frame->CheckCmdParamaters(cmdParam);
SetTopWindow(Frame);
}
}
//*)
return wxsOK;
}
//For command line args
int wxsEditorApp::OnExit()
{
//clean up
return 0;
}
int wxsEditorApp::OnRun()
{
return wxApp::OnRun();
}
void wxsEditorApp::OnInitCmdLine(wxCmdLineParser& parser)
{
parser.SetDesc (g_cmdLineDesc);
// must refuse '/' as parameter starter or cannot use "/path" style paths
parser.SetSwitchChars (wxT("-"));
}
bool wxsEditorApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
silent_mode = parser.Found(wxT("s"));
// to get at your unnamed parameters use
for (unsigned int i = 0; i < parser.GetParamCount(); i++)
{
cmdParam = parser.GetParam(i);
}
// and other command line parameters
// then do what you need with them.
return true;
}