0
|
1 // Filename : rsearcher.cpp
|
2
|
2 // Last Change: 2018-10-02 Tue 19:43:14.
|
0
|
3 //
|
|
4
|
2
|
5 #include <wx/arrstr.h>
|
0
|
6 #include "rsearcher.h"
|
|
7 #include "main.h"
|
|
8
|
|
9 /********************/
|
|
10 /** MySearchCtrl **/
|
|
11 /********************/
|
|
12 MySearchCtrl::MySearchCtrl( wxWindow* parent, wxWindowID id, const wxString& value, const wxPoint& pos, const wxSize& size, long style )
|
|
13 : wxSearchCtrl( parent, id, value, pos, size, style )
|
|
14 {
|
|
15 m_parent = parent;
|
|
16 SetMaxLength( 10 );
|
|
17 #ifndef __WXMAC__
|
|
18 ShowSearchButton( true );
|
|
19 #endif
|
|
20 ShowCancelButton( false );
|
|
21
|
|
22 wxFont font( 12, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD );
|
|
23 SetFont( font );
|
|
24 }
|
|
25
|
|
26 MySearchCtrl::~MySearchCtrl()
|
|
27 {
|
|
28 }
|
|
29
|
|
30 // Event Table
|
|
31 BEGIN_EVENT_TABLE( MySearchCtrl, wxSearchCtrl )
|
|
32 EVT_CHAR( MySearchCtrl::OnKey )
|
|
33 END_EVENT_TABLE()
|
|
34
|
|
35 // Event Handlers & Functions
|
|
36 void MySearchCtrl::OnKey( wxKeyEvent& event )
|
|
37 {
|
|
38 int kc = event.GetKeyCode();
|
|
39
|
|
40 if ( kc == 13 ) { // Enter
|
2
|
41 SelectAll();
|
0
|
42
|
|
43 MainFrame* f = (MainFrame*)FindWindowById( ID_MAIN );
|
2
|
44 f->Cmd( GetValue() );
|
0
|
45
|
|
46 event.Skip();
|
|
47 return;
|
|
48 }
|
|
49
|
|
50 if ( kc == 45 ) { // Num-Key '-' as Backspace
|
|
51 wxString t = GetStringSelection();
|
|
52 if ( t.IsEmpty() ) {
|
|
53 long p = GetInsertionPoint();
|
|
54 if ( p > 0 ) Remove( p - 1, p );
|
|
55 }
|
|
56 else {
|
|
57 Cut();
|
|
58 }
|
|
59 return;
|
|
60 }
|
|
61
|
|
62 if ( kc == WXK_ESCAPE ) { // clear by ESC
|
|
63 this->Clear();
|
|
64 return;
|
|
65 }
|
|
66
|
|
67 event.Skip();
|
|
68 }
|
|
69
|
|
70 /********************/
|
|
71 /** MyStaticBitmap **/
|
|
72 /********************/
|
|
73 MyStaticBitmap::MyStaticBitmap( wxScrolledWindow *parent, wxWindowID id, const wxBitmap &label, const wxPoint &pos, const wxSize &size, long style, const wxString &name )
|
|
74 : wxStaticBitmap( parent, id, label, pos, size, style, name )
|
|
75 {
|
|
76 m_parent = parent;
|
|
77 Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( MyStaticBitmap::OnLeftDown ), NULL, this );
|
|
78 Connect( wxEVT_LEFT_UP, wxMouseEventHandler( MyStaticBitmap::OnLeftUp ), NULL, this );
|
|
79 Connect( wxEVT_MOTION, wxMouseEventHandler( MyStaticBitmap::OnMotion ), NULL, this );
|
|
80 Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( MyStaticBitmap::OnWheel ), NULL, this );
|
|
81 }
|
|
82
|
|
83 MyStaticBitmap::~MyStaticBitmap()
|
|
84 {
|
|
85 Disconnect( wxEVT_LEFT_DOWN, wxMouseEventHandler( MyStaticBitmap::OnLeftDown ), NULL, this );
|
|
86 Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( MyStaticBitmap::OnLeftUp ), NULL, this );
|
|
87 Disconnect( wxEVT_MOTION, wxMouseEventHandler( MyStaticBitmap::OnMotion ), NULL, this );
|
|
88 Disconnect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( MyStaticBitmap::OnWheel ), NULL, this );
|
|
89 }
|
|
90
|
|
91 // Event Handlers
|
|
92 void MyStaticBitmap::OnWheel( wxMouseEvent& event )
|
|
93 {
|
|
94 if ( event.ControlDown() ) {
|
|
95 if ( event.GetWheelRotation() < 0 ) {
|
|
96 if ( m_zoom < 4 ) m_zoom++;
|
|
97 }
|
|
98 else {
|
|
99 if ( m_zoom > 0 ) m_zoom--;
|
|
100 }
|
|
101 SetBitmap( m_bmp[ m_zoom ] );
|
|
102 m_parent->SetScrollbars( 10, 10, m_bmp[ m_zoom ].GetWidth() / 10, m_bmp[ m_zoom ].GetHeight() / 10 );
|
|
103 return;
|
|
104 }
|
|
105 event.Skip();
|
|
106 }
|
|
107
|
|
108 void MyStaticBitmap::OnLeftDown( wxMouseEvent& event )
|
|
109 {
|
|
110 event.GetPosition( &m_dragx, &m_dragy );
|
|
111 SetCursor( wxCursor( wxCURSOR_SIZING ) );
|
|
112 }
|
|
113
|
|
114 void MyStaticBitmap::OnLeftUp( wxMouseEvent& WXUNUSED(event) )
|
|
115 {
|
|
116 SetCursor( wxCursor( wxCURSOR_ARROW ) );
|
|
117 }
|
|
118
|
|
119 void MyStaticBitmap::OnMotion( wxMouseEvent& event )
|
|
120 {
|
|
121 if ( event.Dragging() ) {
|
|
122 int xv, yv, x, y;
|
|
123 m_parent->GetViewStart( &xv, &yv );
|
|
124
|
|
125 event.GetPosition( &x, &y );
|
|
126
|
|
127 int xa = abs( x - m_dragx );
|
|
128 int ya = abs( y - m_dragy );
|
|
129 int xs = x - m_dragx < 0 ? -1 : 1;
|
|
130 int ys = y - m_dragy < 0 ? -1 : 1;
|
|
131
|
|
132 /* handai dakedo sumu-zu
|
|
133 m_parent->Scroll( xv + xs * log10( xa + 1 ), yv + ys * log10( ya + 1 ) );
|
|
134 */
|
|
135 m_parent->Scroll( xv + xs * log10( xa + 1 ), yv + ys * log10( ya + 1 ) );
|
|
136
|
|
137 m_dragx = x; m_dragy = y;
|
|
138 }
|
|
139 }
|
|
140
|
|
141 // Functions
|
|
142
|
|
143 /********************/
|
|
144 /** Main Frame **/
|
|
145 /********************/
|
|
146 MainFrame::MainFrame( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style )
|
|
147 : wxFrame( parent, id, title, pos, size, style )
|
|
148 {
|
2
|
149 LoadIndex();
|
1
|
150 CreateControls();
|
|
151 }
|
|
152
|
|
153 MainFrame::~MainFrame()
|
|
154 {
|
2
|
155 RemoveFile( wxT( "auth.db" ) );
|
|
156 RemoveFile( wxT( "hhs.db" ) );
|
|
157 RemoveFile( wxT( ".cache/*" ) );
|
1
|
158 }
|
|
159
|
|
160 // Event Table
|
|
161 BEGIN_EVENT_TABLE( MainFrame, wxFrame )
|
2
|
162 EVT_DATAVIEW_SELECTION_CHANGED( ID_LIST, MainFrame::OnItemSelected )
|
1
|
163 EVT_DATAVIEW_ITEM_ACTIVATED( ID_LIST, MainFrame::OnItemDClicked )
|
|
164 EVT_NOTEBOOK_PAGE_CHANGED( ID_NBOOK, MainFrame::OnNBookChanged )
|
|
165 EVT_BUTTON( ID_TEST, MainFrame::OnTestButton )
|
|
166 EVT_CLOSE( MainFrame::SaveConfig )
|
|
167 //EVT_IDLE( MainFrame::OnIdle )
|
|
168 END_EVENT_TABLE()
|
|
169
|
|
170
|
|
171 // Event Handler
|
2
|
172 void MainFrame::OnItemSelected( wxDataViewEvent& WXUNUSED(event) )
|
|
173 {
|
|
174 int r = m_dataViewListCtrl->GetSelectedRow();
|
|
175 wxString ready = m_dataViewListCtrl->GetTextValue( r, 2 );
|
|
176 if ( ready.IsSameAs( wxT( "ok" ), true ) ) {
|
|
177 wxString buf = m_dataViewListCtrl->GetTextValue( r, 1 );
|
|
178 LoadBitmaps( wxT( "00000000" ) );
|
|
179 }
|
|
180 }
|
|
181
|
1
|
182 void MainFrame::OnItemDClicked( wxDataViewEvent& WXUNUSED(event) )
|
|
183 {
|
|
184 int r = m_dataViewListCtrl->GetSelectedRow();
|
2
|
185 wxString date = m_dataViewListCtrl->GetTextValue( r, 1 );
|
|
186 date.Replace( wxT( "-" ), wxEmptyString, true );
|
|
187 GetImages( m_hhs, date );
|
|
188 LoadBitmaps( wxT( "00000000" ) );
|
1
|
189 }
|
|
190
|
|
191 void MainFrame::OnNBookChanged( wxBookCtrlEvent& WXUNUSED(event) )
|
|
192 {
|
|
193 for ( int i = 0; i < m_notebook->GetPageCount(); i++ ) {
|
|
194 m_notebook->SetPageImage( i, 1 );
|
|
195 }
|
|
196 m_notebook->SetPageImage( m_notebook->GetSelection(), 0 );
|
|
197 }
|
|
198
|
|
199 /*
|
|
200 void MainFrame::OnIdle( wxIdleEvent& WXUNUSED(event) )
|
|
201 {
|
|
202 }
|
|
203
|
|
204 */
|
2
|
205
|
1
|
206 void MainFrame::SaveConfig( wxCloseEvent& WXUNUSED(event) )
|
|
207 {
|
|
208 if ( !IsIconized() && !IsMaximized() ) {
|
|
209 wxGetApp().rect = this->GetRect();
|
|
210 }
|
|
211 Destroy();
|
|
212 }
|
|
213
|
|
214 void MainFrame::OnTestButton( wxCommandEvent& WXUNUSED(event) )
|
|
215 {
|
2
|
216 return;
|
1
|
217 }
|
|
218
|
|
219 // Functions
|
|
220 void MainFrame::CreateControls( void )
|
|
221 {
|
0
|
222 this->SetIcon( wxIcon( wxT( "sample" ) ) );
|
|
223 this->SetSizeHints( wxDefaultSize, wxDefaultSize );
|
|
224 //this->SetBackgroundColour( wxColour( 0, 150, 230 ) );
|
2
|
225 this->SetBackgroundColour( wxColour( 153, 153, 153 ) );
|
0
|
226
|
|
227 wxBoxSizer* bSizerTop = new wxBoxSizer( wxHORIZONTAL );
|
|
228
|
|
229 // Left
|
|
230 wxImageList* imgList = new wxImageList( 16, 16, false, 1 );
|
|
231 wxBitmap bmp( wxT( "image/blue.png" ), wxBITMAP_TYPE_PNG );
|
|
232 imgList->Add( bmp, wxNullBitmap );
|
|
233 bmp.LoadFile( wxT( "image/water.png" ), wxBITMAP_TYPE_PNG );
|
|
234 imgList->Add( bmp, wxNullBitmap );
|
|
235
|
|
236 m_notebook = new wxNotebook( this, ID_NBOOK, wxDefaultPosition, wxDefaultSize, 0 );
|
|
237 m_notebook->SetImageList( imgList );
|
|
238
|
|
239 m_scrolledWindow1 = new wxScrolledWindow( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL );
|
|
240 m_scrolledWindow1->SetScrollRate( 5, 5 );
|
|
241 m_notebook->AddPage( m_scrolledWindow1, wxT( "Image-01" ), false, 0 );
|
|
242
|
|
243 m_scrolledWindow2 = new wxScrolledWindow( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL );
|
|
244 m_scrolledWindow2->SetScrollRate( 5, 5 );
|
|
245 m_notebook->AddPage( m_scrolledWindow2, wxT( "Image-02" ), false, 0 );
|
|
246
|
|
247 m_scrolledWindow3 = new wxScrolledWindow( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL );
|
|
248 m_scrolledWindow3->SetScrollRate( 5, 5 );
|
|
249 m_notebook->AddPage( m_scrolledWindow3, wxT( "Image-03" ), false, 0 );
|
|
250
|
|
251 m_scrolledWindow4 = new wxScrolledWindow( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL );
|
|
252 m_scrolledWindow4->SetScrollRate( 5, 5 );
|
|
253 m_notebook->AddPage( m_scrolledWindow4, wxT( "Image-04" ), false, 0 );
|
|
254
|
|
255 m_scrolledWindow5 = new wxScrolledWindow( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL );
|
|
256 m_scrolledWindow5->SetScrollRate( 5, 5 );
|
|
257 m_notebook->AddPage( m_scrolledWindow5, wxT( "Image-05" ), false, 0 );
|
|
258
|
|
259 m_scrolledWindow6 = new wxScrolledWindow( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL );
|
|
260 m_scrolledWindow6->SetScrollRate( 5, 5 );
|
|
261 m_notebook->AddPage( m_scrolledWindow6, wxT( "Image-06" ), false, 0 );
|
|
262
|
|
263 bSizerTop->Add( m_notebook, 1, wxEXPAND|wxALL, 5 );
|
|
264
|
|
265 // Right
|
|
266 wxBoxSizer* bSizerRight = new wxBoxSizer( wxVERTICAL );
|
|
267
|
|
268 m_searchCtrl = new MySearchCtrl( this, ID_SEARCH, wxEmptyString, wxDefaultPosition, wxSize( -1, 24 ), wxTE_PROCESS_ENTER );
|
|
269 bSizerRight->Add( m_searchCtrl, 0, wxALL, 5 );
|
|
270 m_searchCtrl->SetFocus();
|
|
271
|
|
272 m_textCtrlName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80, -1 ), 0 );
|
|
273 m_textCtrlName->SetBackgroundColour( wxColour( 180, 210, 240 ) );
|
|
274 bSizerRight->Add( m_textCtrlName, 0, wxALL, 5 );
|
|
275
|
2
|
276 m_textCtrlAddr = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 160, -1 ), 0 );
|
0
|
277 m_textCtrlAddr->SetBackgroundColour( wxColour( 180, 210, 240 ) );
|
|
278 bSizerRight->Add( m_textCtrlAddr, 0, wxALL|wxEXPAND, 5 );
|
|
279
|
|
280 m_dataViewListCtrl = new wxDataViewListCtrl( this, ID_LIST, wxDefaultPosition, wxDefaultSize, wxDV_ROW_LINES|wxDV_SINGLE );
|
2
|
281 m_dataViewListColumnNo = m_dataViewListCtrl->AppendTextColumn( wxT( "No" ), wxDATAVIEW_CELL_INERT, 30, wxALIGN_RIGHT, wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE );
|
|
282 m_dataViewListColumnDate = m_dataViewListCtrl->AppendTextColumn( wxT( "Date" ), wxDATAVIEW_CELL_INERT, 80, wxALIGN_CENTER, wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE );
|
|
283 m_dataViewListColumnDate = m_dataViewListCtrl->AppendTextColumn( wxT( "Ready" ), wxDATAVIEW_CELL_INERT, 60, wxALIGN_CENTER, wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE );
|
0
|
284
|
|
285 bSizerRight->Add( m_dataViewListCtrl, 1, wxALL|wxEXPAND, 5 );
|
|
286
|
|
287 m_textCtrlLog = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
|
288 bSizerRight->Add( m_textCtrlLog, 1, wxALL|wxEXPAND, 5 );
|
|
289
|
2
|
290 m_slider = new wxSlider( this, ID_SLDR, 1, 1, 5, wxDefaultPosition, wxSize( -1, 200 ), wxSL_AUTOTICKS|wxSL_INVERSE|wxSL_LABELS|wxSL_VERTICAL );
|
0
|
291 bSizerRight->Add( m_slider, 0, wxALL, 5 );
|
|
292
|
|
293 m_buttonPrint = new wxButton( this, ID_PRINT, wxT( "Print" ), wxDefaultPosition, wxDefaultSize, 0 );
|
|
294 bSizerRight->Add( m_buttonPrint, 0, wxALL, 5 );
|
|
295
|
1
|
296 m_buttonTest = new wxButton( this, ID_TEST, wxT( "Test" ), wxDefaultPosition, wxDefaultSize, 0 );
|
|
297 bSizerRight->Add( m_buttonTest, 0, wxALL, 5 );
|
0
|
298
|
|
299 bSizerTop->Add( bSizerRight, 0, wxEXPAND, 5 );
|
|
300
|
|
301 this->SetSizer( bSizerTop );
|
|
302 this->Layout();
|
|
303
|
|
304 //this->Centre( wxBOTH );
|
|
305
|
|
306 m_staticBitmap1 = new MyStaticBitmap( m_scrolledWindow1, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0, wxEmptyString );
|
|
307 m_staticBitmap2 = new MyStaticBitmap( m_scrolledWindow2, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0, wxEmptyString );
|
|
308 m_staticBitmap3 = new MyStaticBitmap( m_scrolledWindow3, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0, wxEmptyString );
|
|
309 m_staticBitmap4 = new MyStaticBitmap( m_scrolledWindow4, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0, wxEmptyString );
|
|
310 m_staticBitmap5 = new MyStaticBitmap( m_scrolledWindow5, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0, wxEmptyString );
|
|
311 }
|
|
312
|
|
313 void MainFrame::Cmd( wxString cmd )
|
|
314 {
|
|
315 m_dataViewListCtrl->DeleteAllItems();
|
2
|
316 LoadBitmaps( wxEmptyString );
|
0
|
317
|
2
|
318 if ( cmd.IsSameAs( wxT( "q" ), true ) || cmd.IsSameAs( wxT( "9" ), true ) ) {
|
0
|
319 Close();
|
2
|
320 return;
|
0
|
321 }
|
|
322
|
2
|
323 if ( cmd.IsSameAs( wxT( "c" ), true ) || cmd.IsSameAs( wxT( "cmd" ), true ) ) {
|
|
324 Close();
|
|
325 return;
|
|
326 }
|
|
327
|
|
328 if ( cmd.IsSameAs( wxT( "." ), true ) ) {
|
0
|
329 wxString appdir = wxGetCwd();
|
|
330 wxString execmd = wxT( "explorer " ) + appdir;
|
|
331 wxExecute( execmd );
|
|
332 return;
|
|
333 }
|
|
334
|
|
335 wxRegEx reHhs( wxT( "^0[1238][0-9]{8}$" ) );
|
|
336 if ( reHhs.Matches( cmd ) ) {
|
2
|
337 m_hhs = m_searchCtrl->GetValue();
|
|
338 Search();
|
|
339 return;
|
|
340 }
|
0
|
341
|
2
|
342 wxMessageBox( wxT( "Bad Input!!" ) );
|
0
|
343 }
|
|
344
|
1
|
345 void MainFrame::LoadBitmap( wxScrolledWindow* sc, wxStaticBitmap* sb, wxString file )
|
0
|
346 {
|
2
|
347 if ( startup ) {
|
|
348 file = wxT( "image/hw201810.jpg" );
|
|
349 startup = false;
|
|
350 }
|
|
351 if ( !wxFileExists( file ) ) file = wxT( "image/testpattern.jpg" );
|
0
|
352 wxBitmap bmp( file, wxBITMAP_TYPE_JPEG );
|
|
353 int width = bmp.GetWidth();
|
|
354 int height = bmp.GetHeight();
|
|
355 wxImage img = bmp.ConvertToImage();
|
|
356
|
|
357 int ww, wh;
|
1
|
358 sc->GetSize( &ww, &wh );
|
0
|
359
|
1
|
360 float w = ww - 50;
|
0
|
361 float h = w * height / width;
|
|
362 sb->SetBitmap( wxBitmap( img.Scale( w, h, wxIMAGE_QUALITY_HIGH ) ) );
|
1
|
363 sc->SetScrollbars( 10, 10, w / 10, h / 10 );
|
0
|
364
|
|
365 for ( int i = 0; i < 5; i++ ) {
|
|
366 w *= 1.1;
|
|
367 h *= 1.1;
|
|
368 //sb->SetImage( i, wxBitmap( img.Scale( w, h, wxIMAGE_QUALITY_HIGH ) ) );
|
|
369 }
|
|
370 }
|
|
371
|
2
|
372 void MainFrame::LoadBitmaps( wxString date )
|
0
|
373 {
|
2
|
374 LoadBitmap( m_scrolledWindow1, m_staticBitmap1, wxString::Format( wxT( ".cache/%08s_1" ), date ) );
|
|
375 LoadBitmap( m_scrolledWindow2, m_staticBitmap2, wxString::Format( wxT( ".cache/%08s_2" ), date ) );
|
|
376 LoadBitmap( m_scrolledWindow3, m_staticBitmap3, wxString::Format( wxT( ".cache/%08s_3" ), date ) );
|
|
377 LoadBitmap( m_scrolledWindow4, m_staticBitmap4, wxString::Format( wxT( ".cache/%08s_4" ), date ) );
|
|
378 LoadBitmap( m_scrolledWindow5, m_staticBitmap5, wxString::Format( wxT( ".cache/%08s_5" ), date ) );
|
|
379 }
|
|
380
|
|
381 void MainFrame::GetImages( wxString hhs, wxString date )
|
|
382 {
|
|
383 wxArrayString args; // http get
|
|
384 args.Add( wxT( "client.exe" ) );
|
|
385 args.Add( m_server );
|
|
386 args.Add( hhs );
|
|
387 args.Add( date );
|
|
388
|
|
389 //wxMessageBox( wxJoin( args, ' ', '\\' ) );
|
|
390 wxExecute( wxJoin( args, ' ', '\\' ), wxEXEC_ASYNC|wxEXEC_HIDE_CONSOLE );
|
0
|
391 }
|
|
392
|
2
|
393 void MainFrame::Search( void )
|
0
|
394 {
|
2
|
395 wxString date;
|
|
396 int match_cnt = 0;
|
|
397 for ( int i = 0; i < m_index.GetCount(); i++ ) {
|
|
398 if ( m_index[i].StartsWith( m_hhs, &date ) ) {
|
|
399 wxVector<wxVariant> data;
|
|
400 data.push_back( wxString::Format( wxT( "%02d" ), ++match_cnt ) );
|
|
401 date = date.Mid( 1, 4 ) + wxT( "-" ) + date.Mid( 5, 2 ) + wxT( "-" ) + date.Mid( 7, 2 );
|
|
402 data.push_back( date );
|
|
403 data.push_back( wxEmptyString );
|
|
404 m_dataViewListCtrl->AppendItem( data );
|
|
405 data.clear();
|
|
406 }
|
|
407 }
|
|
408 if ( match_cnt == 0 ) wxMessageBox( wxT( "Not Matched!!" ) );
|
|
409 }
|
|
410
|
|
411 void MainFrame::LoadIndex( void )
|
|
412 {
|
|
413 wxTextFile file;
|
|
414 file.Open( wxT( "index.db" ) );
|
|
415 for ( int i = 0; i < file.GetLineCount(); i++ )
|
|
416 m_index.Add( file.GetLine( i ) );
|
|
417 file.Close();
|
|
418 m_index.Sort( true );
|
|
419 }
|
|
420
|
|
421 void MainFrame::RemoveFile( wxString pattern )
|
|
422 {
|
|
423 wxString file = wxFindFirstFile( pattern );
|
|
424 while ( !file.empty() ) {
|
|
425 wxRemoveFile( file );
|
|
426 file = wxFindNextFile();
|
|
427 }
|
0
|
428 }
|
|
429
|
1
|
430 void MainFrame::InDevelop( bool flag )
|
0
|
431 {
|
1
|
432 if ( !flag ) return;
|
2
|
433 //LoadBitmaps( wxT( "00000000" ) );
|
|
434 LoadBitmaps( wxEmptyString );
|
0
|
435
|
|
436 m_slider->Enable( false );
|
|
437 m_slider->Show( false );
|
|
438
|
2
|
439 bool pr = true;
|
0
|
440 m_buttonPrint->Enable( false );
|
2
|
441 m_buttonPrint->Show( true );
|
0
|
442
|
2
|
443 bool tb = true;
|
1
|
444 m_buttonTest->Enable( tb );
|
|
445 m_buttonTest->Show( tb );
|
|
446
|
2
|
447 bool srch = true;
|
|
448 m_searchCtrl->Enable( srch );
|
0
|
449 }
|
|
450
|