-
Notifications
You must be signed in to change notification settings - Fork 0
/
WxFrameFrm.cpp
292 lines (248 loc) · 9.38 KB
/
WxFrameFrm.cpp
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
///-----------------------------------------------------------------
///
/// @file WxFrameFrm.cpp
/// @author Administrator
/// Created: 2020/9/20 17:02:35
/// @section DESCRIPTION
/// WxFrameFrm class implementation
///
///------------------------------------------------------------------
#include "WxFrameFrm.h"
//Do not add custom headers between
//Header Include Start and Header Include End
//wxDev-C++ designer will remove them
////Header Include Start
#include "Images/WxFrameFrm_frmNewForm_XPM.xpm"
////Header Include End
#include <stdio.h>
//----------------------------------------------------------------------------
// WxFrameFrm
//----------------------------------------------------------------------------
//Add Custom Events only in the appropriate block.
//Code added in other places will be removed by wxDev-C++
////Event Table Start
BEGIN_EVENT_TABLE(WxFrameFrm,wxFrame)
////Manual Code Start
////Manual Code End
EVT_CLOSE(WxFrameFrm::OnClose)
EVT_KEY_DOWN(WxFrameFrm::WxFrameFrmKeyDown)
EVT_MOUSE_EVENTS(WxFrameFrm::WxFrameFrmMouseEvents)
EVT_TEXT(ID_WXEDIT1,WxFrameFrm::WxEdit1Updated)
EVT_MENU(ID_MNU______1015, WxFrameFrm::openFile)
EVT_MENU(ID_MNU______1016, WxFrameFrm::CreateNewFile)
EVT_MENU(ID_MNU______1031, WxFrameFrm::SaveFIle)
EVT_MENU(ID_MNU______1014, WxFrameFrm::Showabout)
EVT_MENU(ID_MNU__________1039, WxFrameFrm::HowToUse)
EVT_MENU(ID_MNU______1037, WxFrameFrm::SetUpLanguage)
END_EVENT_TABLE()
////Event Table End
WxFrameFrm::WxFrameFrm(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &position, const wxSize& size, long style)
: wxFrame(parent, id, title, position, size, style)
{
CreateGUIControls();
}
WxFrameFrm::~WxFrameFrm()
{
}
void WxFrameFrm::CreateGUIControls()
{
//Do not add custom code between
//GUI Items Creation Start and GUI Items Creation End
//wxDev-C++ designer will remove them.
//Add the custom code before or after the blocks
////GUI Items Creation Start
WxStaticText1 = new wxStaticText(this, ID_WXSTATICTEXT1, _("欢迎使用"), wxPoint(694, 33), wxDefaultSize, 0, _("WxStaticText1"));
WxStaticText1->SetBackgroundColour(wxColour(_("WHITE")));
WxStaticText2 = new wxStaticText(this, ID_WXSTATICTEXT2, _("添加组件+(游标blender)"), wxPoint(12, 93), wxDefaultSize, 0, _("WxStaticText2"));
WxStaticText2->SetBackgroundColour(wxColour(_("WHITE")));
WxTreeCtrl1 = new wxTreeCtrl(this, ID_WXTREECTRL1, wxPoint(723, 65), wxSize(121, 97), wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT | wxTR_HIDE_ROOT, wxDefaultValidator, _("WxTreeCtrl1"));
wxTreeItemId WxTreeCtrl1NodeID = WxTreeCtrl1->AddRoot(_(""));
WxTreeCtrl1NodeID = WxTreeCtrl1->AppendItem(WxTreeCtrl1NodeID, _("root"));
WxTreeCtrl1NodeID = WxTreeCtrl1->AppendItem(WxTreeCtrl1NodeID, _("child"));
WxTreeCtrl1NodeID = WxTreeCtrl1->AppendItem(WxTreeCtrl1->GetItemParent(WxTreeCtrl1NodeID), _("child1"));
WxTreeCtrl1NodeID = WxTreeCtrl1->AppendItem(WxTreeCtrl1->GetItemParent(WxTreeCtrl1NodeID), _("节点编辑器"));
WxListCtrl1 = new wxListCtrl(this, ID_WXLISTCTRL1, wxPoint(724, 176), wxSize(194, 119), wxLC_REPORT, wxDefaultValidator, _("WxListCtrl1"));
WxListCtrl1->InsertColumn(0, _("属性"), wxLIST_FORMAT_LEFT, 50);
WxListCtrl1->InsertColumn(1, _("文字"), wxLIST_FORMAT_LEFT, 50);
WxListCtrl1->InsertColumn(2, _("高度"), wxLIST_FORMAT_LEFT, 50);
WxListCtrl1->InsertColumn(3, _("高度"), wxLIST_FORMAT_LEFT, 50);
WxPanel1 = new wxPanel(this, ID_WXPANEL1, wxPoint(268, 92), wxSize(231, 362));
WxStaticText3 = new wxStaticText(WxPanel1, ID_WXSTATICTEXT3, _("这里是预览界面panel"), wxPoint(60, 68), wxDefaultSize, 0, _("WxStaticText3"));
WxMenuBar1 = new wxMenuBar();
wxMenu *ID_MNU______1012_Mnu_Obj = new wxMenu();
ID_MNU______1012_Mnu_Obj->Append(ID_MNU______1015, _("打开"), _(""), wxITEM_NORMAL);
ID_MNU______1012_Mnu_Obj->Append(ID_MNU______1016, _("新建"), _(""), wxITEM_NORMAL);
ID_MNU______1012_Mnu_Obj->Append(ID_MNU______________1017, _("关闭当前文件"), _(""), wxITEM_NORMAL);
ID_MNU______1012_Mnu_Obj->Append(ID_MNU______1031, _("保存"), _(""), wxITEM_NORMAL);
WxMenuBar1->Append(ID_MNU______1012_Mnu_Obj, _("文件"));
wxMenu *ID_MNU_____________BUILD_1019_Mnu_Obj = new wxMenu();
WxMenuBar1->Append(ID_MNU_____________BUILD_1019_Mnu_Obj, _("生成界面文件build"));
wxMenu *ID_MNU__________1018_Mnu_Obj = new wxMenu();
ID_MNU__________1018_Mnu_Obj->Append(ID_MNU______1020, _("按钮"), _(""), wxITEM_NORMAL);
ID_MNU__________1018_Mnu_Obj->Append(ID_MNU________1021, _("编辑框"), _(""), wxITEM_NORMAL);
ID_MNU__________1018_Mnu_Obj->Append(ID_MNU______1022, _("文本"), _(""), wxITEM_NORMAL);
ID_MNU__________1018_Mnu_Obj->Append(ID_MNU______1023, _("图片"), _(""), wxITEM_NORMAL);
WxMenuBar1->Append(ID_MNU__________1018_Mnu_Obj, _("添加组件"));
wxMenu *ID_MNU______1013_Mnu_Obj = new wxMenu();
ID_MNU______1013_Mnu_Obj->Append(ID_MNU______1014, _("关于"), _(""), wxITEM_NORMAL);
ID_MNU______1013_Mnu_Obj->Append(ID_MNU__________1039, _("使用说明"), _(""), wxITEM_NORMAL);
WxMenuBar1->Append(ID_MNU______1013_Mnu_Obj, _("帮助"));
wxMenu *ID_MNU______1036_Mnu_Obj = new wxMenu();
ID_MNU______1036_Mnu_Obj->Append(ID_MNU______1037, _("语言"), _(""), wxITEM_NORMAL);
WxMenuBar1->Append(ID_MNU______1036_Mnu_Obj, _("设置"));
SetMenuBar(WxMenuBar1);
WxSaveFileDialog1 = new wxFileDialog(this, _("保存文件"), _(""), _(""), _("*.*"), wxFD_SAVE);
WxToolBar1 = new wxToolBar(this, ID_WXTOOLBAR1, wxPoint(0, 0), wxSize(984, 29));
WxStaticText4 = new wxStaticText(WxToolBar1, ID_WXSTATICTEXT4, _("新建文件.xml"), wxPoint(0, 0), wxDefaultSize, 0, _("WxStaticText4"));
WxToolBar1->AddControl(WxStaticText4);
WxOpenFileDialog1 = new wxFileDialog(this, _("打开文件"), _(""), _(""), _("*.*"), wxFD_OPEN);
wxArrayString arrayStringFor_WxComboBox1;
arrayStringFor_WxComboBox1.Add(_("预览模式(展示解析后的结果)"));
arrayStringFor_WxComboBox1.Add(_("源代码(纯文本如.xml)格式"));
WxComboBox1 = new wxComboBox(this, ID_WXCOMBOBOX1, _("切换显示模式"), wxPoint(728, 311), wxSize(145, 25), arrayStringFor_WxComboBox1, 0, wxDefaultValidator, _("WxComboBox1"));
WxEdit1 = new wxTextCtrl(this, ID_WXEDIT1, _("editBox"), wxPoint(515, 112), wxSize(114, 145), 0, wxDefaultValidator, _("WxEdit1"));
WxStaticText5 = new wxStaticText(this, ID_WXSTATICTEXT5, _("源码界面+编辑框"), wxPoint(521, 78), wxDefaultSize, 0, _("WxStaticText5"));
WxStaticText5->SetBackgroundColour(wxColour(_("WHITE")));
WxToolBar1->Realize();
SetToolBar(WxToolBar1);
SetTitle(_("通用应用程序界面文件生成器"));
SetIcon(WxFrameFrm_frmNewForm_XPM);
SetSize(8,8,1000,720);
Center();
////GUI Items Creation End
}
void WxFrameFrm::OnClose(wxCloseEvent& event)
{
Destroy();
}
//打开文件
void WxFrameFrm::OnOpen(wxCommandEvent& WXUNUSED(event))
{
}
/*
* WxToolBar1Menu
*/
void WxFrameFrm::WxToolBar1Menu(wxCommandEvent& event)
{
// insert your code here
}
/*
* WxFrameFrmMouseEvents
*/
//鼠标事件
void WxFrameFrm::WxFrameFrmMouseEvents(wxMouseEvent& event)
{
printf("mouse event");
if(event.Moving())
{
printf("mouse moved");
}
//if event
// insert your code here
}
/*
* WxFrameFrmKeyDown
*/
void WxFrameFrm::WxFrameFrmKeyDown(wxKeyEvent& event)
{
printf("on key down");
// insert your code here
}
/*
* Showabout
*/
void WxFrameFrm::Showabout(wxCommandEvent& event)
{
wxString msg;
msg.Printf("这个软件由小沙盒工作室创始人128hh开发,小沙盒工作室保留版权,此软件为开源软件,处于积极开发状态,作者是个中职技校生,专业不是学习的编程");
wxMessageBox(msg,"关于",wxOK,this);
// insert your code here
}
/*
* SaveFIle
*/
void WxFrameFrm::SaveFIle(wxCommandEvent& event)
{
//保存文件
//弹出窗口
WxSaveFileDialog1->ShowModal();
//saveFileDialog(this,"save");
// insert your code here
}
/*
* WxListBox1Selected
*/
void WxFrameFrm::WxListBox1Selected(wxCommandEvent& event)
{
// insert your code here
}
/*
* Mnu1015Click
*/
void WxFrameFrm::Mnu1015Click(wxCommandEvent& event)
{
// insert your code here
}
/*
* 打开文件openFile
*/
void WxFrameFrm::openFile(wxCommandEvent& event)
{
// WxOpenFileDialog1.GetCurrentlySelectedFilename();
int FileOpenReturnState=WxOpenFileDialog1->ShowModal();
// wxLogError("test error on File Open");
if(FileOpenReturnState==wxID_OK)
{
wxLogError("文件打开后返回OK");
}
else
{
wxLogError("遇到一个错误!!");
}
// wxLogError(FileOpenReturnState);
// insert your code here
}
/*
* HowToUse
*/
void WxFrameFrm::HowToUse(wxCommandEvent& event)
{
wxString msg;
msg.Printf("首先新建文件或者打开文件,然后再设计模式里进行编辑,最后选择导出build,根据自己的需求,选择是否导出对应平台的界面文件");
wxMessageBox(msg,"关于",wxOK,this);
// insert your code here
}
/*
* WxEdit1Updated
*/
void WxFrameFrm::WxEdit1Updated(wxCommandEvent& event)
{
// insert your code here
}
/*
* SetUpLanguage
*/
void WxFrameFrm::SetUpLanguage(wxCommandEvent& event)
{
wxString msg;
msg.Printf("此功能未开发,其他部分也有很多未开发的地方,欢迎各位大佬加入这个开源项目,贡献代码,通用应用程序界面生成器,帮助别人就是帮助自己,这是个辅助编程软件");
wxMessageBox(msg,"设置语言",wxOK,this);
// insert your code here
}
/*
* CreateNewFile
*/
void WxFrameFrm::CreateNewFile(wxCommandEvent& event)
{
int FileOpenReturnState=WxOpenFileDialog1->ShowModal();
// wxLogError("test error on File Open");
if(FileOpenReturnState==wxID_OK)
{
wxLogError("文件打开后返回OK");
}
else
{
wxLogError("遇到一个错误!!");
}
// insert your code here
}