0
|
1 // Filename : myframe.cpp
|
10
|
2 // Last Change: 28-Apr-2014.
|
0
|
3 //
|
|
4 #include "main.h"
|
1
|
5 #include "db.h"
|
0
|
6 #include "about.h"
|
|
7 #include "kana.h"
|
|
8 #include "hist.h"
|
9
|
9 #include "preview.h"
|
0
|
10 #include "index.h"
|
4
|
11 #include "param.h"
|
2
|
12 #include "marksheet.h"
|
|
13 #include "myframe.h"
|
|
14 #include "bprint.h"
|
0
|
15
|
10
|
16 #define DEBUG 1
|
9
|
17
|
1
|
18 ///////////////////////////////////////////////////////////////
|
|
19 // カスタム検索ボックス
|
|
20 MySearchBox::MySearchBox( wxWindow* parent, wxWindowID id, const wxString& value, const wxPoint& pos, const wxSize& size, long style )
|
|
21 : wxSearchCtrl( parent, id, value, pos, size, style )
|
|
22 {
|
|
23 }
|
|
24
|
|
25 MySearchBox::~MySearchBox()
|
|
26 {
|
|
27 }
|
|
28
|
9
|
29 void MySearchBox::SetMessage( wxString msg )
|
|
30 {
|
|
31 wxFrame* p = (wxFrame*)FindWindowById( ID_MAIN );
|
|
32 p->SetStatusText( msg, 0 );
|
|
33 }
|
|
34
|
1
|
35 // Event Table
|
|
36 BEGIN_EVENT_TABLE( MySearchBox, wxSearchCtrl )
|
|
37 EVT_CHAR( MySearchBox::OnKey )
|
|
38 END_EVENT_TABLE()
|
|
39
|
|
40 // Event Handlers & Functions
|
|
41 void MySearchBox::OnKey( wxKeyEvent& event )
|
|
42 {
|
9
|
43 int kc = event.GetKeyCode();
|
1
|
44 wxString s = GetValue();
|
|
45
|
9
|
46 if ( kc == 13 ) {
|
|
47 event.Skip();
|
|
48 return;
|
|
49 }
|
|
50
|
|
51 if ( kc == 45 ) { // テンキーの '-' キーで1文字削除
|
1
|
52 wxString t = GetStringSelection();
|
|
53 if ( t.IsEmpty() ) {
|
|
54 long p = GetInsertionPoint();
|
|
55 if ( p > 0 ) Remove( p - 1, p );
|
|
56 }
|
|
57 else {
|
|
58 Cut();
|
|
59 }
|
|
60 return;
|
|
61 }
|
|
62
|
9
|
63 if ( kc == WXK_ESCAPE ) { // clear by ESC
|
2
|
64 this->Clear();
|
1
|
65 return;
|
|
66 }
|
|
67
|
9
|
68 // auto-complete
|
|
69 Cut();
|
|
70 if ( kc >=48 && kc<=57 ) { // [0-9]
|
|
71 kc -= 48;
|
|
72 wxString input = GetValue() + wxString::Format( wxT("%d"), kc );
|
|
73 if ( input.Len() < 5 ) {
|
|
74 event.Skip();
|
|
75 return;
|
|
76 }
|
|
77 for ( unsigned int i = 0; i < m_jhhsno.GetCount(); i++ ) {
|
|
78 if ( m_jhhsno[i].StartsWith( input ) ) {
|
|
79 ChangeValue( m_jhhsno[i] );
|
|
80 SetSelection( input.Len(), 10 );
|
|
81
|
|
82 wxArrayString s = wxSplit( GetHhsInfoByHhsNo( m_jhhsno[i] ), '_', '\\' );
|
|
83 wxString msg = wxT("もしかして... ") + s[0] + wxT(" ?!");
|
|
84 SetMessage( msg );
|
|
85 return;
|
|
86 }
|
|
87 SetMessage( wxEmptyString );
|
|
88 }
|
|
89 event.Skip();
|
|
90 return;
|
|
91 }
|
1
|
92 event.Skip();
|
|
93 }
|
|
94
|
9
|
95 ///////////////////////////////////////////////////////////////
|
|
96 // サムネイルパネル
|
|
97 #define THUMB_W 60
|
|
98 #define THUMB_H 75
|
|
99 ThumbnailPanel::ThumbnailPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
|
|
100 : wxPanel( parent, id, pos, size, style )
|
|
101 {
|
|
102 wxBoxSizer* bSizer = new wxBoxSizer( wxHORIZONTAL );
|
|
103 this->SetBackgroundColour( wxColour( 192, 192, 192 ) );
|
|
104
|
|
105 wxString thumb = wxGetCwd() + wxFILE_SEP_PATH + wxT("image") + wxFILE_SEP_PATH + wxT("thumbnail.png");
|
|
106 wxBitmap bmp = wxBitmap( thumb, wxBITMAP_TYPE_PNG );
|
|
107
|
10
|
108 m_bitmap0 = new wxStaticBitmap( this, wxID_ANY, bmp, wxDefaultPosition, wxSize( THUMB_W, THUMB_H ), 0 );
|
9
|
109 bSizer->Add( m_bitmap0, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
|
|
110 m_bitmap0->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( ThumbnailPanel::OnDClick0 ), NULL, this );
|
|
111
|
10
|
112 m_bitmap1 = new wxStaticBitmap( this, wxID_ANY, bmp, wxDefaultPosition, wxSize( THUMB_W, THUMB_H ), 0 );
|
9
|
113 bSizer->Add( m_bitmap1, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
|
|
114 m_bitmap1->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( ThumbnailPanel::OnDClick1 ), NULL, this );
|
|
115
|
10
|
116 m_bitmap2 = new wxStaticBitmap( this, wxID_ANY, bmp, wxDefaultPosition, wxSize( THUMB_W, THUMB_H ), 0 );
|
9
|
117 bSizer->Add( m_bitmap2, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
|
|
118 m_bitmap2->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( ThumbnailPanel::OnDClick2 ), NULL, this );
|
|
119
|
10
|
120 m_bitmap3 = new wxStaticBitmap( this, wxID_ANY, bmp, wxDefaultPosition, wxSize( THUMB_W, THUMB_H ), 0 );
|
9
|
121 bSizer->Add( m_bitmap3, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
|
|
122 m_bitmap3->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( ThumbnailPanel::OnDClick3 ), NULL, this );
|
|
123
|
10
|
124 m_bitmap4 = new wxStaticBitmap( this, wxID_ANY, bmp, wxDefaultPosition, wxSize( THUMB_W, THUMB_H ), 0 );
|
9
|
125 bSizer->Add( m_bitmap4, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
|
|
126 m_bitmap4->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( ThumbnailPanel::OnDClick4 ), NULL, this );
|
|
127
|
10
|
128 m_bitmap5 = new wxStaticBitmap( this, wxID_ANY, bmp, wxDefaultPosition, wxSize( THUMB_W, THUMB_H ), 0 );
|
9
|
129 bSizer->Add( m_bitmap5, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
|
|
130 m_bitmap5->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( ThumbnailPanel::OnDClick5 ), NULL, this );
|
|
131
|
|
132 this->SetSizer( bSizer );
|
|
133 this->Layout();
|
|
134 }
|
|
135
|
|
136 ThumbnailPanel::~ThumbnailPanel()
|
|
137 {
|
|
138 m_bitmap0->Disconnect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( ThumbnailPanel::OnDClick0 ), NULL, this );
|
|
139 m_bitmap1->Disconnect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( ThumbnailPanel::OnDClick1 ), NULL, this );
|
|
140 m_bitmap2->Disconnect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( ThumbnailPanel::OnDClick2 ), NULL, this );
|
|
141 m_bitmap3->Disconnect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( ThumbnailPanel::OnDClick3 ), NULL, this );
|
|
142 m_bitmap4->Disconnect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( ThumbnailPanel::OnDClick4 ), NULL, this );
|
|
143 m_bitmap5->Disconnect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( ThumbnailPanel::OnDClick5 ), NULL, this );
|
|
144 }
|
|
145
|
|
146 // Functions
|
|
147 /* サムネイル表示 */
|
10
|
148 void ThumbnailPanel::SetCacheImages( wxString dirpath )
|
9
|
149 {
|
|
150 wxDir dir( dirpath );
|
|
151 if ( !dir.IsOpened() ) return;
|
10
|
152
|
9
|
153 m_imagefiles.Clear();
|
|
154 wxDir::GetAllFiles( dirpath, &m_imagefiles, wxT("*.jpg"), wxDIR_FILES );
|
|
155
|
|
156 wxString cachedir = wxT("cache") + dirpath.AfterLast( ':' );
|
|
157 wxDir cdir( cachedir );
|
|
158 if ( !cdir.IsOpened() ) return;
|
|
159
|
10
|
160 m_cachefiles.Clear();
|
|
161 wxDir::GetAllFiles( cachedir, &m_cachefiles, wxT("*.png"), wxDIR_FILES );
|
9
|
162
|
|
163 wxString thumb = wxGetCwd() + wxFILE_SEP_PATH + wxT("image") + wxFILE_SEP_PATH + wxT("thumbnail.png");
|
10
|
164 int n = m_cachefiles.GetCount();
|
9
|
165 if ( n < 6 ) {
|
|
166 while ( n < 6 ) {
|
10
|
167 m_cachefiles.Add( thumb );
|
9
|
168 n++;
|
|
169 }
|
|
170 }
|
|
171
|
|
172 wxBitmap bmp;
|
10
|
173 bmp.LoadFile( m_cachefiles[0], wxBITMAP_TYPE_PNG ); m_bitmap0->SetBitmap( bmp );
|
|
174 bmp.LoadFile( m_cachefiles[1], wxBITMAP_TYPE_PNG ); m_bitmap1->SetBitmap( bmp );
|
|
175 bmp.LoadFile( m_cachefiles[2], wxBITMAP_TYPE_PNG ); m_bitmap2->SetBitmap( bmp );
|
|
176 bmp.LoadFile( m_cachefiles[3], wxBITMAP_TYPE_PNG ); m_bitmap3->SetBitmap( bmp );
|
|
177 bmp.LoadFile( m_cachefiles[4], wxBITMAP_TYPE_PNG ); m_bitmap4->SetBitmap( bmp );
|
|
178 bmp.LoadFile( m_cachefiles[5], wxBITMAP_TYPE_PNG ); m_bitmap5->SetBitmap( bmp );
|
9
|
179 }
|
10
|
180 /* 画像クリックダブルで拡大表示 */
|
|
181 void ThumbnailPanel::OnDClick0( wxMouseEvent& WXUNUSED(event) ) { DoPreview( 0 ); }
|
|
182 void ThumbnailPanel::OnDClick1( wxMouseEvent& WXUNUSED(event) ) { DoPreview( 1 ); }
|
|
183 void ThumbnailPanel::OnDClick2( wxMouseEvent& WXUNUSED(event) ) { DoPreview( 2 ); }
|
|
184 void ThumbnailPanel::OnDClick3( wxMouseEvent& WXUNUSED(event) ) { DoPreview( 3 ); }
|
|
185 void ThumbnailPanel::OnDClick4( wxMouseEvent& WXUNUSED(event) ) { DoPreview( 4 ); }
|
|
186 void ThumbnailPanel::OnDClick5( wxMouseEvent& WXUNUSED(event) ) { DoPreview( 5 ); }
|
|
187 void ThumbnailPanel::DoPreview( int n )
|
9
|
188 {
|
10
|
189 if ( m_imagefiles.GetCount() < n + 1 ) return;
|
9
|
190
|
|
191 PreviewDialog* pd = new PreviewDialog( this, wxID_ANY, wxT("プレビュー"), wxDefaultPosition, wxDefaultSize, wxCAPTION|wxFRAME_NO_TASKBAR );
|
|
192 pd->Show();
|
|
193 pd->Maximize( true );
|
10
|
194 pd->SetFiles( m_imagefiles, m_cachefiles );
|
|
195 pd->SetPreviewImage( n );
|
9
|
196 }
|
2
|
197
|
1
|
198 ///////////////////////////////////////////////////////////////
|
|
199 // メインフレーム
|
2
|
200 #define WINL_W 480
|
0
|
201 #define LOGO_W 200
|
|
202 #define LOGO_H 92
|
|
203
|
|
204 // resources
|
|
205 #if !defined(__WXMSW__) && !defined(__WXPM__)
|
|
206 #include "sample.xpm"
|
|
207 #endif
|
|
208
|
|
209 MyFrame::MyFrame( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style )
|
|
210 : wxFrame( parent, id, title, pos, size, style )
|
|
211 {
|
|
212 this->SetSizeHints( wxSize( WINL_W, 500 ), wxDefaultSize );
|
9
|
213 //this->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER ) );
|
|
214 this->SetBackgroundColour( wxColour(wxT("WHEAT")) );
|
0
|
215
|
|
216 // set the frame icon
|
|
217 SetIcon(wxICON(sample));
|
|
218
|
|
219 // メニューバー Menu
|
|
220 m_menubar = new wxMenuBar( 0 );
|
|
221 m_menuFile = new wxMenu();
|
|
222
|
2
|
223 wxMenuItem* m_menuItemBPrintMode = new wxMenuItem( m_menuFile, ID_MNBPNT, wxString( wxT("バッチ印刷モード\tF12") ) , wxT("Batch Print Mode"), wxITEM_NORMAL );
|
|
224 m_menuFile->Append( m_menuItemBPrintMode );
|
|
225
|
|
226 wxMenuItem* m_menuItemIndex = new wxMenuItem( m_menuFile, ID_MNINDEX, wxString( wxT("インデックス\tF11") ) , wxT("Update index"), wxITEM_NORMAL );
|
|
227 m_menuFile->Append( m_menuItemIndex );
|
0
|
228
|
|
229 m_menuFile->AppendSeparator(); // ----
|
|
230
|
2
|
231 wxMenuItem* m_menuItemBkup = new wxMenuItem( m_menuFile, ID_MNDBBKUP, wxString( wxT("DBバックアップ(&B)") ) , wxT("Backup databases"), wxITEM_NORMAL );
|
|
232 m_menuFile->Append( m_menuItemBkup );
|
|
233
|
4
|
234 // params
|
|
235 m_menuParam = new wxMenu();
|
|
236 wxMenuItem* m_menuItemMask = new wxMenuItem( m_menuParam, ID_MNMASKPARAM, wxString( wxT("マスク(&M)") ) , wxT("Setup mask parameters"), wxITEM_NORMAL );
|
|
237 m_menuParam->Append( m_menuItemMask );
|
0
|
238
|
4
|
239 wxMenuItem* m_menuItemMark = new wxMenuItem( m_menuParam, ID_MNMARKPARAM, wxString( wxT("マークシート(&S)") ) , wxT("Setup marksheet parameters"), wxITEM_NORMAL );
|
|
240 m_menuParam->Append( m_menuItemMark );
|
|
241
|
|
242 m_menuFile->Append( -1, wxT("パラメータ(&P)"), m_menuParam );
|
|
243
|
|
244 //
|
2
|
245 wxMenuItem* m_menuItemAppDir = new wxMenuItem( m_menuFile, ID_MNAPPDIR, wxString( wxT("アプリケーションフォルダを開く(&O)") ) , wxT("Open application directory"), wxITEM_NORMAL );
|
0
|
246 m_menuFile->Append( m_menuItemAppDir );
|
|
247
|
|
248 m_menuFile->AppendSeparator(); // ----
|
|
249
|
|
250 wxMenuItem* m_menuItemAbout = new wxMenuItem( m_menuFile, ID_MNABOUT, wxString( wxT("&About...\tF1") ) , wxT("Show about dialog"), wxITEM_NORMAL );
|
|
251 m_menuFile->Append( m_menuItemAbout );
|
|
252
|
|
253 m_menubar->Append( m_menuFile, wxT("ファイル(&F)") );
|
|
254
|
|
255 this->SetMenuBar( m_menubar );
|
|
256
|
|
257 //
|
|
258 wxBoxSizer* bSizerTop = new wxBoxSizer( wxVERTICAL );
|
|
259
|
9
|
260 m_panelMain = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
|
261
|
2
|
262 wxBoxSizer* bSizerMain = new wxBoxSizer( wxVERTICAL );
|
0
|
263
|
|
264 wxString logo = wxGetCwd() + wxFILE_SEP_PATH + wxT("image") + wxFILE_SEP_PATH + wxT("logo.png");
|
|
265 wxBitmap bmp = wxBitmap( logo, wxBITMAP_TYPE_PNG );
|
2
|
266 m_bitmap = new wxStaticBitmap( m_panelMain, wxID_ANY, bmp, wxDefaultPosition, wxSize( LOGO_W, LOGO_H ), 0 );
|
|
267 bSizerMain->Add( m_bitmap, 0, wxALL, 5 );
|
0
|
268
|
2
|
269 m_textCtrlName = new wxTextCtrl( m_panelMain, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 200, -1 ), 0 );
|
|
270 bSizerMain->Add( m_textCtrlName, 0, wxALL, 5 );
|
0
|
271
|
2
|
272 m_textCtrlAddr = new wxTextCtrl( m_panelMain, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 380, -1 ), 0 );
|
|
273 bSizerMain->Add( m_textCtrlAddr, 0, wxALL, 5 );
|
0
|
274
|
2
|
275 m_listCtrl = new wxListCtrl( m_panelMain, ID_LIST, wxDefaultPosition, wxDefaultSize, wxLC_REPORT );
|
0
|
276 wxListItem itemCol;
|
|
277 itemCol.SetText( wxT("通番") );
|
|
278 m_listCtrl->InsertColumn( 0, itemCol );
|
|
279 m_listCtrl->SetColumnWidth( 0, 50 );
|
|
280 itemCol.SetText( wxT("年月日") );
|
|
281 m_listCtrl->InsertColumn( 1, itemCol );
|
|
282 m_listCtrl->SetColumnWidth( 1, 80 );
|
|
283 itemCol.SetText( wxT("場所") );
|
|
284 m_listCtrl->InsertColumn( 2, itemCol );
|
|
285 m_listCtrl->SetColumnWidth( 2, 300 );
|
9
|
286 bSizerMain->Add( m_listCtrl, 1, wxRIGHT|wxLEFT|wxBOTTOM|wxEXPAND, 5 );
|
|
287
|
|
288 m_thumbPanel = new ThumbnailPanel( m_panelMain, wxID_ANY, wxDefaultPosition, wxSize( -1, 100 ), wxSUNKEN_BORDER );
|
|
289 bSizerMain->Add( m_thumbPanel, 0, wxRIGHT|wxLEFT|wxBOTTOM|wxEXPAND, 5 );
|
0
|
290
|
9
|
291 //
|
0
|
292 wxBoxSizer* bSizerCmd = new wxBoxSizer( wxHORIZONTAL );
|
|
293
|
2
|
294 m_staticText = new wxStaticText( m_panelMain, wxID_ANY, wxT("コマンド?"), wxDefaultPosition, wxDefaultSize, 0 );
|
1
|
295 bSizerCmd->Add( m_staticText, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
|
0
|
296
|
2
|
297 m_searchBox = new MySearchBox( m_panelMain, ID_SEARCH, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
|
9
|
298 m_searchBox->SetJudgedHhs( GetJudgedHhsNo() );
|
0
|
299 #ifndef __WXMAC__
|
1
|
300 m_searchBox->ShowSearchButton( true );
|
0
|
301 #endif
|
1
|
302 m_searchBox->ShowCancelButton( false );
|
|
303 m_searchBox->SetFocus();
|
2
|
304 bSizerCmd->Add( m_searchBox, 1, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
|
0
|
305
|
2
|
306 m_buttonKana = new wxButton( m_panelMain, ID_KANA, wxT("カナ検索"), wxDefaultPosition, wxSize( 65, -1 ), 0 );
|
1
|
307 bSizerCmd->Add( m_buttonKana, 0, wxLEFT|wxALIGN_CENTER_VERTICAL, 20 );
|
0
|
308
|
2
|
309 m_buttonHist = new wxButton( m_panelMain, ID_HIST, wxT("検索履歴"), wxDefaultPosition, wxSize( 65, -1 ), 0 );
|
0
|
310 bSizerCmd->Add( m_buttonHist, 0, wxALL, 5 );
|
|
311
|
9
|
312 //
|
2
|
313 bSizerMain->Add( bSizerCmd, 0, wxEXPAND, 5 );
|
0
|
314
|
2
|
315 m_panelMain->SetSizer( bSizerMain );
|
|
316 m_panelMain->Layout();
|
|
317 bSizerMain->Fit( m_panelMain );
|
9
|
318 bSizerTop->Add( m_panelMain, 1, wxEXPAND|wxALL, 5 );
|
2
|
319
|
|
320 //
|
0
|
321 this->SetSizer( bSizerTop );
|
|
322 this->Layout();
|
|
323
|
|
324 // ステータスバー Statusbar
|
1
|
325 m_statusBar = new wxStatusBar( this, wxID_ANY, wxST_SIZEGRIP );
|
2
|
326 int widths[] = { 200, -1, 10, 90 };
|
1
|
327 m_statusBar->SetFieldsCount( 4, widths );
|
|
328 this->SetStatusBar( m_statusBar );
|
|
329 SetStatusText( wxT("被保番を入力してスタート!") );
|
0
|
330
|
|
331 this->Centre( wxBOTH );
|
4
|
332 LoadParam();
|
0
|
333 }
|
|
334
|
|
335 MyFrame::~MyFrame()
|
|
336 {
|
|
337 }
|
|
338
|
|
339 // Event Table
|
|
340 BEGIN_EVENT_TABLE( MyFrame, wxFrame )
|
9
|
341 EVT_MENU( ID_MNABOUT, MyFrame::OnAbout )
|
|
342 EVT_MENU( wxID_EXIT, MyFrame::OnQuit )
|
|
343 EVT_MENU( ID_MNBPNT, MyFrame::OnBPrintMode )
|
|
344 EVT_MENU( ID_MNINDEX, MyFrame::OnIndex )
|
|
345 EVT_MENU( ID_MNDBBKUP, MyFrame::OnDBBackup )
|
0
|
346 EVT_MENU( ID_MNMASKPARAM, MyFrame::OnMaskParam )
|
5
|
347 EVT_MENU( ID_MNMARKPARAM, MyFrame::OnMarkParam )
|
9
|
348 EVT_MENU( ID_MNAPPDIR, MyFrame::OnOpenAppDir )
|
|
349 EVT_LIST_ITEM_SELECTED( ID_LIST, MyFrame::OnSelectItem )
|
|
350 EVT_LIST_ITEM_ACTIVATED( ID_LIST, MyFrame::OnDClickItem )
|
0
|
351 EVT_BUTTON( ID_KANA, MyFrame::OnKana )
|
|
352 EVT_BUTTON( ID_HIST, MyFrame::OnHistory )
|
9
|
353 EVT_TEXT_ENTER( ID_SEARCH, MyFrame::OnCommand )
|
0
|
354 EVT_SIZE( MyFrame::OnWinSize )
|
|
355 EVT_MOVE( MyFrame::OnWinMove )
|
|
356 EVT_CLOSE( MyFrame::SaveConfig )
|
|
357 END_EVENT_TABLE()
|
|
358
|
|
359 // Event Handlers & Functions
|
2
|
360 /* エンターキーフック */
|
|
361 void MyFrame::OnCommand( wxCommandEvent& event )
|
0
|
362 {
|
9
|
363 wxString s = m_searchBox->GetLineText(0);
|
|
364
|
|
365 if ( s.IsSameAs( wxT(".") ) ) {
|
|
366 OpenAppDir();
|
|
367 return;
|
|
368 }
|
2
|
369
|
|
370 if ( s.IsSameAs( wxT("99") ) ) {
|
|
371 Close();
|
|
372 return;
|
|
373 }
|
|
374
|
|
375 if ( s.IsSameAs( wxT("+") ) ) {
|
|
376 PrintImages( m_hhsno );
|
|
377 return;
|
|
378 }
|
|
379
|
|
380 wxRegEx reHhs( wxT("^0[1238][0-9]{8}$") );
|
|
381 if ( reHhs.Matches( s ) ) {
|
|
382 m_hhsno = s;
|
|
383 UpdateList( m_hhsno );
|
9
|
384 UpdateThumbmail( 0 );
|
2
|
385 return;
|
|
386 }
|
|
387
|
|
388 wxRegEx reNo( wxT("^[0-9]{1,2}$") );
|
|
389 if ( reNo.Matches( s ) ) {
|
|
390 long n;
|
|
391 s.ToLong( &n, 10 );
|
|
392 n--;
|
|
393 OpenHhsDir( (int)n );
|
|
394 return;
|
|
395 }
|
|
396
|
|
397 SetStatusMessage( wxT("不適切な入力です."), 0 );
|
|
398 return;
|
|
399
|
|
400 event.Skip();
|
0
|
401 }
|
4
|
402 /* パラメータを設定ファイルから読み込む */
|
|
403 void MyFrame::LoadParam( void )
|
1
|
404 {
|
|
405 conf_file = wxGetCwd() + wxFILE_SEP_PATH + wxT("app.conf");
|
|
406 config = new wxFileConfig( wxT("MyApp"), wxT("T.Mutoh"), conf_file, wxEmptyString, wxCONFIG_USE_LOCAL_FILE );
|
|
407
|
|
408 int x, y, w, h;
|
|
409
|
|
410 config->SetPath( wxT("/Mask") );
|
|
411
|
|
412 config->Read( wxT("x1"), &x );
|
|
413 config->Read( wxT("y1"), &y );
|
|
414 config->Read( wxT("w1"), &w );
|
|
415 config->Read( wxT("h1"), &h );
|
|
416 m_mask1.SetPosition( wxPoint( x, y ) );
|
|
417 m_mask1.SetSize( wxSize( w, h ) );
|
|
418
|
|
419 config->Read( wxT("x2"), &x );
|
|
420 config->Read( wxT("y2"), &y );
|
|
421 config->Read( wxT("w2"), &w );
|
|
422 config->Read( wxT("h2"), &h );
|
|
423 m_mask2.SetPosition( wxPoint( x, y ) );
|
|
424 m_mask2.SetSize( wxSize( w, h ) );
|
|
425
|
|
426 config->Read( wxT("x3"), &x );
|
|
427 config->Read( wxT("y3"), &y );
|
|
428 config->Read( wxT("w3"), &w );
|
|
429 config->Read( wxT("h3"), &h );
|
|
430 m_mask3.SetPosition( wxPoint( x, y ) );
|
|
431 m_mask3.SetSize( wxSize( w, h ) );
|
|
432
|
2
|
433 config->Read( wxT("x1o"), &x );
|
|
434 config->Read( wxT("y1o"), &y );
|
|
435 config->Read( wxT("w1o"), &w );
|
|
436 config->Read( wxT("h1o"), &h );
|
|
437 m_mask1old.SetPosition( wxPoint( x, y ) );
|
|
438 m_mask1old.SetSize( wxSize( w, h ) );
|
|
439
|
|
440 config->Read( wxT("x2o"), &x );
|
|
441 config->Read( wxT("y2o"), &y );
|
|
442 config->Read( wxT("w2o"), &w );
|
|
443 config->Read( wxT("h2o"), &h );
|
|
444 m_mask2old.SetPosition( wxPoint( x, y ) );
|
|
445 m_mask2old.SetSize( wxSize( w, h ) );
|
|
446
|
|
447 config->Read( wxT("x3o"), &x );
|
|
448 config->Read( wxT("y3o"), &y );
|
|
449 config->Read( wxT("w3o"), &w );
|
|
450 config->Read( wxT("h3o"), &h );
|
|
451 m_mask3old.SetPosition( wxPoint( x, y ) );
|
|
452 m_mask3old.SetSize( wxSize( w, h ) );
|
5
|
453
|
|
454 //
|
|
455 config->SetPath( wxT("/Marksheet") );
|
|
456
|
|
457 config->Read( wxT("lmin"), &lmin );
|
|
458 config->Read( wxT("lmax"), &lmax );
|
|
459 config->Read( wxT("zmin"), &zmin );
|
|
460 config->Read( wxT("zmax"), &zmax );
|
9
|
461
|
2
|
462 }
|
|
463 /* 印刷 */
|
|
464 void MyFrame::PrintImages( wxString hhsno )
|
|
465 {
|
7
|
466 bool mask_flag = false;
|
9
|
467 wxMessageDialog md( this, wxT("マスクしますか?"), wxT("印刷オプション"), wxYES_NO, wxDefaultPosition );
|
7
|
468 if ( md.ShowModal() == wxID_YES ) {
|
|
469 mask_flag = true;
|
|
470 }
|
|
471
|
2
|
472 // 印刷用の html を作成
|
|
473 wxArrayString path = GetPathByHhsNo( hhsno );
|
|
474 if ( path.IsEmpty() ) return;
|
|
475
|
|
476 wxDir dir( path[0] );
|
|
477 if ( !dir.IsOpened() ) return;
|
|
478
|
|
479 wxString html;
|
|
480 html = html + wxT("<html><body>\n");
|
|
481
|
|
482 wxString file;
|
|
483 bool cout = dir.GetFirst( &file, wxT("*.jpg"), wxDIR_FILES );
|
4
|
484 bool notyet_mask = true;
|
2
|
485 int n = 0;
|
|
486 wxString tmpdir = wxGetCwd() + wxFILE_SEP_PATH + wxT("tmp") + wxFILE_SEP_PATH;
|
|
487 while ( cout ) {
|
|
488 file = path[0] + wxFILE_SEP_PATH + file;
|
|
489 file.Replace( wxFILE_SEP_PATH, wxT("/") );
|
|
490 wxString tmpjpg = wxString::Format( wxT("%stmp%d.jpg"), tmpdir, n );
|
4
|
491
|
|
492 if ( notyet_mask && IsMarksheet( file, zmin, zmax, lmin, lmax ) ) { // マークシート表面をマスクする
|
2
|
493 wxImage img_org( file, wxBITMAP_TYPE_JPEG );
|
7
|
494 if ( mask_flag ) {
|
|
495 int ver = GetMarksheetVersion( file );
|
|
496 if ( ver == 2 ) {
|
|
497 img_org.SetRGB( m_mask1, 255, 255, 255 ); // cm name
|
|
498 img_org.SetRGB( m_mask2, 255, 255, 255 ); // cm no.
|
|
499 img_org.SetRGB( m_mask3, 255, 255, 255 ); // barcode
|
|
500 }
|
|
501 else { // 古いマークシート ver == 1
|
|
502 img_org.SetRGB( m_mask1old, 255, 255, 255 ); // cm name
|
|
503 img_org.SetRGB( m_mask2old, 255, 255, 255 ); // cm no.
|
|
504 img_org.SetRGB( m_mask3old, 255, 255, 255 ); // barcode
|
|
505 }
|
2
|
506 }
|
|
507 img_org.SaveFile( tmpjpg );
|
4
|
508 notyet_mask = false;
|
2
|
509 }
|
|
510 else {
|
|
511 wxCopyFile( file, tmpjpg, true );
|
|
512 }
|
|
513 html = html + wxT("<img src=\"") + tmpjpg + wxT("\" width=\"750\" height=\"1060\"/>");
|
|
514 cout = dir.GetNext( &file );
|
|
515 n++;
|
|
516 }
|
|
517 html = html + wxT("</body></html>");
|
|
518
|
|
519 // start printing
|
|
520 wxHtmlPrintout hpout( wxT("Searcher03") );
|
|
521 hpout.SetMargins( 0, 0, 0, 0, 0 );
|
|
522 wxPrintDialogData pd;
|
|
523 wxPrinter p( &pd );
|
|
524
|
|
525 hpout.SetHtmlText( html, wxEmptyString, false );
|
|
526 p.Print( NULL, &hpout, true );
|
|
527
|
|
528 // end
|
|
529 SetStatusMessage( wxT("被保番かフォルダ番号を."), 0 );
|
|
530 }
|
|
531 /* 一括印刷モード */
|
|
532 void MyFrame::OnBPrintMode( wxCommandEvent& WXUNUSED(event) )
|
|
533 {
|
8
|
534 FrameBatchPrint* bp = new FrameBatchPrint( this, wxID_ANY, wxT("一括印刷"), wxDefaultPosition, wxSize( 700, 600 ), wxCAPTION|wxFRAME_NO_TASKBAR );
|
2
|
535 bp->SetMask1( m_mask1 );
|
|
536 bp->SetMask2( m_mask2 );
|
|
537 bp->SetMask3( m_mask3 );
|
|
538 bp->SetMask1Old( m_mask1old );
|
|
539 bp->SetMask2Old( m_mask2old );
|
|
540 bp->SetMask3Old( m_mask3old );
|
5
|
541 bp->SetMark( lmin, lmax, zmin, zmax );
|
2
|
542 bp->Show( true );
|
|
543 }
|
|
544 /* インデックス作成ダイアログ */
|
|
545 void MyFrame::OnIndex( wxCommandEvent& WXUNUSED(event) )
|
|
546 {
|
|
547 wxString rootdir;
|
|
548 config->SetPath( wxT("/Index") );
|
|
549 config->Read( wxT("rootdir"), &rootdir );
|
|
550
|
7
|
551 IndexDialog* index = new IndexDialog( this, wxID_ANY, wxT("インデックス作成"), wxDefaultPosition, wxSize( 700, 600 ), wxDEFAULT_DIALOG_STYLE|wxSTAY_ON_TOP );
|
8
|
552 index->SetRootdir( rootdir );
|
7
|
553 index->ShowModal();
|
1
|
554 }
|
4
|
555 /* マークシートパラメータ設定ダイアログ */
|
|
556 void MyFrame::OnMarkParam( wxCommandEvent& WXUNUSED(event) )
|
|
557 {
|
5
|
558 SetParams( 2 );
|
4
|
559 }
|
0
|
560 /* マスクパラメータ設定ダイアログ */
|
|
561 void MyFrame::OnMaskParam( wxCommandEvent& WXUNUSED(event) )
|
|
562 {
|
5
|
563 SetParams( 0 );
|
|
564 }
|
|
565 /* 設定を保存 */
|
|
566 void MyFrame::SetParams( int tab )
|
|
567 {
|
|
568 ParamDialog* param = new ParamDialog( this, wxID_ANY, wxT("各種パラメータの指定"), wxDefaultPosition, wxSize( 350, 250 ), wxCAPTION|wxFRAME_NO_TASKBAR|wxSTAY_ON_TOP|wxTAB_TRAVERSAL );
|
4
|
569 param->SetMask1( m_mask1 );
|
|
570 param->SetMask2( m_mask2 );
|
|
571 param->SetMask3( m_mask3 );
|
|
572 param->SetMask1Old( m_mask1old );
|
|
573 param->SetMask2Old( m_mask2old );
|
|
574 param->SetMask3Old( m_mask3old );
|
5
|
575 param->SetMark( lmin, lmax, zmin, zmax );
|
4
|
576 param->LoadParams();
|
|
577 param->ShowWithEffect( wxSHOW_EFFECT_SLIDE_TO_BOTTOM );
|
5
|
578 param->SelectTAb( tab );
|
1
|
579
|
4
|
580 if ( param->ShowModal() == wxID_OK ) {
|
|
581 m_mask1 = param->GetMask1();
|
|
582 m_mask2 = param->GetMask2();
|
|
583 m_mask3 = param->GetMask3();
|
|
584 m_mask1old = param->GetMask1Old();
|
|
585 m_mask2old = param->GetMask2Old();
|
|
586 m_mask3old = param->GetMask3Old();
|
5
|
587 lmin = param->GetLmin();
|
|
588 lmax = param->GetLmax();
|
|
589 zmin = param->GetZmin();
|
|
590 zmax = param->GetZmax();
|
1
|
591
|
|
592 config->SetPath( wxT("/Mask") );
|
|
593
|
|
594 config->Write( wxT("x1"), m_mask1.GetX() );
|
|
595 config->Write( wxT("y1"), m_mask1.GetY() );
|
|
596 config->Write( wxT("w1"), m_mask1.GetWidth() );
|
|
597 config->Write( wxT("h1"), m_mask1.GetHeight() );
|
|
598
|
|
599 config->Write( wxT("x2"), m_mask2.GetX() );
|
|
600 config->Write( wxT("y2"), m_mask2.GetY() );
|
|
601 config->Write( wxT("w2"), m_mask2.GetWidth() );
|
|
602 config->Write( wxT("h2"), m_mask2.GetHeight() );
|
|
603
|
|
604 config->Write( wxT("x3"), m_mask3.GetX() );
|
|
605 config->Write( wxT("y3"), m_mask3.GetY() );
|
|
606 config->Write( wxT("w3"), m_mask3.GetWidth() );
|
|
607 config->Write( wxT("h3"), m_mask3.GetHeight() );
|
|
608
|
2
|
609 config->Write( wxT("x1o"), m_mask1old.GetX() );
|
|
610 config->Write( wxT("y1o"), m_mask1old.GetY() );
|
|
611 config->Write( wxT("w1o"), m_mask1old.GetWidth() );
|
|
612 config->Write( wxT("h1o"), m_mask1old.GetHeight() );
|
|
613
|
|
614 config->Write( wxT("x2o"), m_mask2old.GetX() );
|
|
615 config->Write( wxT("y2o"), m_mask2old.GetY() );
|
|
616 config->Write( wxT("w2o"), m_mask2old.GetWidth() );
|
|
617 config->Write( wxT("h2o"), m_mask2old.GetHeight() );
|
|
618
|
|
619 config->Write( wxT("x3o"), m_mask3old.GetX() );
|
|
620 config->Write( wxT("y3o"), m_mask3old.GetY() );
|
|
621 config->Write( wxT("w3o"), m_mask3old.GetWidth() );
|
|
622 config->Write( wxT("h3o"), m_mask3old.GetHeight() );
|
|
623
|
5
|
624 config->SetPath( wxT("/Marksheet") );
|
|
625
|
|
626 config->Write( wxT("lmin"), lmin );
|
|
627 config->Write( wxT("lmax"), lmax );
|
|
628 config->Write( wxT("zmin"), zmin );
|
|
629 config->Write( wxT("zmax"), zmax );
|
|
630
|
2
|
631 config->Flush( false );
|
1
|
632 }
|
0
|
633 }
|
2
|
634 /* データベースファイルのバックアップ */
|
|
635 void MyFrame::OnDBBackup( wxCommandEvent& WXUNUSED(event) )
|
|
636 {
|
|
637 wxDateTime now = wxDateTime::Now();
|
|
638 wxString str = now.Format( wxT("%Y%m%d%H%M%S") );
|
|
639
|
|
640 wxString org, bk;
|
|
641 wxString dbdir = wxGetCwd() + wxFILE_SEP_PATH + wxT("db");
|
|
642
|
|
643 org = dbdir + wxFILE_SEP_PATH + wxT("hhs.db");
|
|
644 bk = dbdir + wxFILE_SEP_PATH + str + wxT("_hhs.db");
|
|
645 wxCopyFile( org, bk, false );
|
|
646
|
|
647 org = dbdir + wxFILE_SEP_PATH + wxT("ccn.db");
|
|
648 bk = dbdir + wxFILE_SEP_PATH + str + wxT("_ccn.db");
|
|
649 wxCopyFile( org, bk, false );
|
|
650
|
|
651 wxMessageBox( wxT("バックアップ終了.") );
|
|
652 return;
|
|
653 }
|
0
|
654 /* アプリフォルダを開く */
|
|
655 void MyFrame::OnOpenAppDir( wxCommandEvent& WXUNUSED(event) )
|
|
656 {
|
9
|
657 OpenAppDir();
|
|
658 }
|
|
659 void MyFrame::OpenAppDir( )
|
|
660 {
|
0
|
661 wxString appdir = wxGetCwd();
|
|
662 wxString execmd = wxT("explorer ") + appdir;
|
|
663 wxExecute( execmd );
|
|
664 }
|
|
665 /* 被保険者フォルダを開く */
|
9
|
666 void MyFrame::OnDClickItem( wxListEvent& event )
|
0
|
667 {
|
|
668 int i = event.GetIndex();
|
2
|
669 OpenHhsDir( i );
|
9
|
670 UpdateThumbmail( i );
|
2
|
671 }
|
|
672 /* 番号で指定したフォルダを開く */
|
|
673 void MyFrame::OpenHhsDir( int n )
|
|
674 {
|
0
|
675 wxListItem item;
|
2
|
676 item.SetId( n );
|
|
677 item.SetColumn( 2 );
|
|
678 item.SetMask( wxLIST_MASK_TEXT );
|
|
679 m_listCtrl->GetItem( item );
|
|
680 wxString dir = item.GetText();
|
|
681 wxString execmd = wxT("explorer ") + dir;
|
|
682 wxExecute( execmd );
|
0
|
683 }
|
1
|
684
|
0
|
685 /* カナ検索ダイアログ */
|
|
686 void MyFrame::OnKana( wxCommandEvent& WXUNUSED(event) )
|
|
687 {
|
2
|
688 KanaDialog* kana = new KanaDialog( this, wxID_ANY, wxT("カナ氏名で被保番を検索"), wxDefaultPosition, wxSize( 640, 600 ), wxCAPTION|wxFRAME_NO_TASKBAR|wxRESIZE_BORDER|wxSTAY_ON_TOP|wxTAB_TRAVERSAL );
|
0
|
689 kana->ShowWithEffect( wxSHOW_EFFECT_SLIDE_TO_BOTTOM );
|
1
|
690
|
|
691 if ( kana->ShowModal() == wxID_OK ) {
|
2
|
692 m_hhsno = kana->GetHhsNo();
|
|
693 UpdateList( m_hhsno );
|
9
|
694 UpdateThumbmail( 0 );
|
1
|
695 }
|
0
|
696 }
|
|
697 /* 検索履歴検索ダイアログ */
|
|
698 void MyFrame::OnHistory( wxCommandEvent& WXUNUSED(event) )
|
|
699 {
|
2
|
700 HistDialog* hist = new HistDialog( this, wxID_ANY, wxT("検索履歴"), wxDefaultPosition, wxSize( 600, 500 ), wxCAPTION|wxFRAME_NO_TASKBAR|wxSTAY_ON_TOP|wxTAB_TRAVERSAL );
|
0
|
701 hist->ShowWithEffect( wxSHOW_EFFECT_SLIDE_TO_BOTTOM );
|
1
|
702
|
|
703 if ( hist->ShowModal() == wxID_OK ) {
|
2
|
704 m_hhsno = hist->GetHhsNo();
|
|
705 UpdateList( m_hhsno );
|
9
|
706 UpdateThumbmail( 0 );
|
1
|
707 }
|
|
708 }
|
|
709
|
|
710 /* 検索結果をリストアップ */
|
2
|
711 void MyFrame::UpdateList( wxString hhsno )
|
1
|
712 {
|
|
713 m_listCtrl->DeleteAllItems();
|
2
|
714 for ( int i = 0; i < m_statusBar->GetFieldsCount(); i++ ) {
|
|
715 SetStatusMessage( wxEmptyString, i );
|
|
716 }
|
|
717
|
|
718 //
|
|
719 wxArrayString s = wxSplit( GetHhsInfoByHhsNo( hhsno ), '_', '\\' );
|
|
720 wxString history;
|
|
721 if ( s.IsEmpty() ) {
|
|
722 SetStatusMessage( wxT("データベースに存在しない被保険者です."), 0 );
|
|
723 history = hhsno + wxT("###");
|
|
724 }
|
|
725 else {
|
|
726 m_textCtrlName->SetValue( s[0] );
|
|
727 m_textCtrlAddr->SetValue( s[1] );
|
|
728 history = hhsno + wxT("#") + s[0] + wxT("#") + s[1] + wxT("#");
|
|
729 }
|
|
730 m_searchBox->SetValue( hhsno );
|
|
731 m_searchBox->SelectAll();
|
|
732 m_searchBox->SetFocus();
|
|
733
|
|
734 wxArrayString path = GetPathByHhsNo( hhsno );
|
|
735 if ( path.IsEmpty() ) {
|
|
736 SetStatusMessage( wxT("審査会履歴がありません."), 1 );
|
|
737 return;
|
|
738 }
|
|
739
|
|
740 wxRegEx reDate(wxT("(^.*20[0-9]{2}.)(20[0-9]{2})([0-2][0-9])([0-9]{2})(.*$)"));
|
|
741 for ( int i = 0; i < path.GetCount(); i++ ) {
|
|
742 wxString date = path[i];
|
|
743 reDate.ReplaceAll( &date, wxT("\\2-\\3-\\4") );
|
|
744
|
|
745 m_listCtrl->InsertItem( i, -1 );
|
|
746 m_listCtrl->SetItem( i, 0,wxString::Format( wxT("%d"), i + 1 ) , -1 ); // No
|
|
747 m_listCtrl->SetItem( i, 1, date, -1 );
|
|
748 m_listCtrl->SetItem( i, 2, path[i], -1 );
|
|
749
|
|
750 if ( i % 2 ) m_listCtrl->SetItemBackgroundColour( i, wxColour( wxT("WHEAT") ) );
|
|
751 }
|
|
752
|
|
753 SetStatusMessage( wxT("「+」キーで通番1を印刷."), 0 );
|
|
754
|
|
755 //
|
|
756 wxString filename = wxGetCwd() + wxFILE_SEP_PATH + wxT("tmp") + wxFILE_SEP_PATH + wxT("history");
|
|
757 wxDateTime now = wxDateTime::Now();
|
|
758 history = history + now.Format( wxT("%Y-%m-%d %H:%M:%S") );
|
|
759
|
|
760 wxTextFile hist( filename );
|
|
761 hist.Open();
|
|
762 hist.RemoveLine( 20 );
|
|
763 hist.InsertLine( history, 0 );
|
|
764 hist.Write();
|
|
765 hist.Close();
|
1
|
766 }
|
9
|
767 /* フォルダを選択したとき */
|
|
768 void MyFrame::OnSelectItem( wxListEvent& event )
|
|
769 {
|
|
770 UpdateThumbmail( event.GetIndex() );
|
|
771 }
|
|
772 /* サムネイルを更新 */
|
|
773 void MyFrame::UpdateThumbmail( int n )
|
|
774 {
|
|
775 wxListItem item;
|
|
776 item.SetId( n );
|
|
777
|
|
778 item.SetColumn( 2 );
|
|
779 item.SetMask( wxLIST_MASK_TEXT );
|
|
780 m_listCtrl->GetItem( item );
|
|
781
|
10
|
782 m_thumbPanel->SetCacheImages( item.GetText() );
|
9
|
783 }
|
1
|
784 /* ステータスバーにメッセージを出力 */
|
|
785 void MyFrame::SetStatusMessage( wxString msg, long n )
|
|
786 {
|
|
787 if ( GetStatusBar() )
|
|
788 SetStatusText( msg, n );
|
0
|
789 }
|
|
790
|
|
791 /* サイズ変更 */
|
|
792 void MyFrame::OnWinSize( wxSizeEvent& event )
|
|
793 {
|
|
794 this->Refresh( true, NULL );
|
|
795 TellLocation();
|
|
796 event.Skip();
|
|
797 }
|
|
798 /* ウィンドウ移動 */
|
|
799 void MyFrame::OnWinMove( wxMoveEvent& WXUNUSED(event) )
|
|
800 {
|
|
801 TellLocation();
|
|
802 return;
|
|
803 }
|
|
804 /* ウィンドウ位置とサイズを表示 */
|
|
805 void MyFrame::TellLocation( void )
|
|
806 {
|
|
807 wxRect r = this->GetRect();
|
|
808 int x = r.GetX();
|
|
809 int y = r.GetY();
|
|
810 int w = r.GetWidth();
|
|
811 int h = r.GetHeight();
|
1
|
812
|
|
813 if ( GetStatusBar() )
|
|
814 SetStatusText( wxString::Format(wxT( "(%d,%d) %dx%d"),x,y,w,h ), 3 );
|
0
|
815 }
|
|
816 /* 終了 */
|
|
817 void MyFrame::OnQuit( wxCommandEvent& WXUNUSED(event) )
|
|
818 {
|
|
819 Close( true );
|
|
820 }
|
|
821 /* 設定を保存 */
|
|
822 void MyFrame::SaveConfig( wxCloseEvent& WXUNUSED(event) )
|
|
823 {
|
|
824 if ( !IsIconized() && !IsMaximized() ) {
|
|
825 wxGetApp().rect = this->GetRect();
|
|
826 }
|
9
|
827 delete config;
|
0
|
828 Destroy();
|
|
829 }
|
|
830 /* アバウトダイアログ */
|
|
831 void MyFrame::OnAbout( wxCommandEvent& WXUNUSED(event) )
|
|
832 {
|
|
833 AboutDialog* aboutDlg = new AboutDialog( this, wxID_ANY, wxT("About this Software"), wxDefaultPosition, wxSize(320,280), wxDEFAULT_DIALOG_STYLE|wxSTAY_ON_TOP );
|
|
834 aboutDlg->ShowModal();
|
|
835 }
|
|
836
|