changeset 2:7fe3417cefc8

GUI.
author pyon@macmini
date Tue, 02 Oct 2018 21:20:05 +0900
parents eaa27e4ed5be
children db4813125eb8
files bat/make_go.bat bat/upgrade.bat doc/Todo image/testpattern.jpg include/main.h include/rsearcher.h src/main.cpp src/rsearcher.cpp
diffstat 8 files changed, 191 insertions(+), 114 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bat/make_go.bat	Tue Oct 02 21:20:05 2018 +0900
@@ -0,0 +1,8 @@
+@echo off
+set GOARCH=386
+
+set GOOS=freebsd
+go build -o %1 %1.go 
+
+set GOOS=windows
+go build %1.go 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bat/upgrade.bat	Tue Oct 02 21:20:05 2018 +0900
@@ -0,0 +1,4 @@
+@echo off
+echo "Updrading Re:Searcher..."
+client -r 192.168.21.151:80
+rename client1.exe client.exe
--- a/doc/Todo	Mon Oct 01 23:18:29 2018 +0900
+++ b/doc/Todo	Tue Oct 02 21:20:05 2018 +0900
@@ -8,8 +8,8 @@
 
 * 毎回 clientで auth.db と hhs.db を取得
 	> client -u 192.168.0.1:3910
-    # GET /db/auth.db, /db/hhs.db, /db/index.db (5day)
-	+ GUI(grsearchr) 終了時に auth.db と hhs.db は削除
+    # GET /db/auth.db, /db/hhs.db, /db/index.db (10day)
+	+ GUI(grsearcher) 終了時に auth.db と hhs.db は削除
 	* auth.db は任意の、hhs.db は月一のアップデートだが、漏洩防止のため毎回削除
     * 毎月10のつく日に index.db を取得
 
@@ -33,8 +33,8 @@
 		* -d で復号化、-e で暗号化
 			> crypto.exe -d hhs.db key > hhs.csv
 			> crypto.exe -e hhs.csv > hhs.db
-		* -f と -g で 認証チェック
-			> crypto.exe -f hhs.db -g hhs key
+		* -f で 認証チェック
+			> crypto.exe -f hhs.db hhs key
 			+ hhs/key が一致したら "39 hhs" を返す
 
 ** imgtgz の機能 ****************************************************************
@@ -42,28 +42,36 @@
 
 ** server の機能 ****************************************************************
 * 単なる web-server
-    + log 機能を追加 ( ver1.1 )
+    + upload 機能を追加 ( ver1.1 )
+    + log 機能を追加 ( ver1.2 )
+
+** grsearcher の機能 ****************************************************************
+ * 10分間 Idle なら password
+ * auth.cpp pw の最後にカーソル、 xボタン無効化
+ * mouse gesture 次、前のタブへ
+ * dark-mode の搭載
+ * プライベートフォルダに写真 userid/startup.jpg, default.jpg, avatar.jpg
 
 ** その他 ***********************************************************************
 * IP Address
 	Seibu		kai-cl11	192.168.31.202	75-1130
 	Rokugo		kai-cl26	192.168.14.201	88-8404
-	Nishiki		kai-cl17	192.168.16.202	49-6210
+	Nishiki		kai-cl??	192.168.16.203	49-6210
 	#Nishiki	kai-cl25	192.168.16.201
-	Isono					192.168.21.151
-	Fuguta					192.168.21.153
+	Isono					192.168.21.151          # nginx:3910
+	Fuguta					192.168.21.153          # server:3910
 
 * server ( FreeBSD )
  server_root/server, crypto, imgtgz
             + db/auth.db, hhs.db, index.db
-            + release/grsearchr.exe, client.exe
+            + release/grsearcher.exe, client.exe
             + images/20180707/0800012345.tgz, ...
 
 * client ( Windows )
  rsearcher_root/grsearcher.exe, client.exe, crypto.exe
                 auth.db, hhs.db, index.db
                + .cache/20180707_1.jpg, ...
-               + image/*.png
+               + image/*.png, *.jpg
 
 __DONE__
 
Binary file image/testpattern.jpg has changed
--- a/include/main.h	Mon Oct 01 23:18:29 2018 +0900
+++ b/include/main.h	Tue Oct 02 21:20:05 2018 +0900
@@ -1,5 +1,5 @@
 // Filename   : main.h
-// Last Change: 2018-10-01 Mon 23:13:17.
+// Last Change: 2018-10-02 Tue 21:17:28.
 //
 #include <wx/wx.h>
 #include <wx/config.h>
@@ -17,6 +17,7 @@
 	private:
 		wxFileConfig *config;
 		wxString      conf_file;
+		wxString	  m_server;
         bool          develop;
 
 	public:
@@ -31,8 +32,7 @@
 		void InitSetting();
 		void SaveSetting();
         void GetData();
-        void DeleteData();
 };
 
-DECLARE_APP(MyApp)
+DECLARE_APP( MyApp )
 
--- a/include/rsearcher.h	Mon Oct 01 23:18:29 2018 +0900
+++ b/include/rsearcher.h	Tue Oct 02 21:20:05 2018 +0900
@@ -1,5 +1,5 @@
 // Filename   : rsearcher.h
-// Last Change: 2018-10-01 Mon 23:08:37.
+// Last Change: 2018-10-02 Tue 19:36:21.
 //
 
 #ifndef __RSEARCH_H__
@@ -23,7 +23,9 @@
 #include <wx/frame.h>
 #include <wx/statbmp.h>
 #include <wx/msgdlg.h> 
+#include <wx/filefn.h> 
 #include <wx/regex.h>
+#include <wx/textfile.h>
 
 class MySearchCtrl : public wxSearchCtrl
 {
@@ -59,6 +61,10 @@
 {
 	DECLARE_EVENT_TABLE()
 	private:
+		bool		  startup = true;
+		wxString	  m_server;
+		wxString	  m_hhs;
+		wxArrayString m_index;
 	
 	protected:
 		enum {
@@ -99,17 +105,23 @@
 	public:
 		MainFrame( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT( "Searcher Remote" ), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,300 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL );
 		~MainFrame();
+		void SetServer( wxString server ) { m_server = server; };
+		void CreateControls( void );
+		void Cmd( wxString cmd );
+		void Search( void );
+		void LoadIndex( void );
+        void LoadBitmap( wxScrolledWindow* sc, wxStaticBitmap* sb, wxString file );
+        void LoadBitmaps( wxString date );
+        void GetImages( wxString hhs, wxString date );
+		void RemoveFile( wxString pattern );
+		void SaveConfig( wxCloseEvent& event );
+        void InDevelop( bool );
+
+		void OnItemSelected( wxDataViewEvent& event );
 		void OnItemDClicked( wxDataViewEvent& event );
         void OnNBookChanged( wxBookCtrlEvent& event );
 		//void OnIdle( wxIdleEvent& event );
-		void Cmd( wxString cmd );
-		void SaveConfig( wxCloseEvent& event );
-		void CreateControls( void );
-        void LoadBitmaps( void );
-        void LoadBitmap( wxScrolledWindow* sc, wxStaticBitmap* sb, wxString file );
-        void GetImage( wxString hhs, wxString no );
         void OnTestButton( wxCommandEvent& event );
-        void InDevelop( bool );
 };
 
 
--- a/src/main.cpp	Mon Oct 01 23:18:29 2018 +0900
+++ b/src/main.cpp	Tue Oct 02 21:20:05 2018 +0900
@@ -1,5 +1,5 @@
 // Filename   : main.cpp
-// Last Change: 2018-10-01 Mon 23:14:59.
+// Last Change: 2018-10-02 Tue 21:00:32.
 //
 #include "main.h"
 #include "auth.h"
@@ -26,8 +26,9 @@
 	InitSetting();
     GetData();
 
-    AuthDialog *authdlg = new AuthDialog( NULL, wxID_ANY, wxT( "" ), wxDefaultPosition, wxDefaultSize );
+    AuthDialog *authdlg = new AuthDialog( NULL, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize );
     MainFrame *mainframe = new MainFrame( NULL, ID_MAIN, wxT( "Re:Searcher" ), wxPoint( rect.x, rect.y ), rect.GetSize(), wxDEFAULT_FRAME_STYLE );
+	mainframe->SetServer( m_server );
 
     if ( develop ) {
         authdlg->InDevelop( true );
@@ -45,21 +46,28 @@
 int MyApp::OnExit()
 {
 	SaveSetting();
-    DeleteData();
     return 0;
 }
 
 void MyApp::InitSetting()
 {
-    conf_file = wxGetCwd() + wxFILE_SEP_PATH + wxT("app.conf");
-    config = new wxFileConfig( wxT("MyApp"), wxT("T.Mutoh"), conf_file, wxEmptyString, wxCONFIG_USE_LOCAL_FILE );
+    conf_file = wxGetCwd() + wxFILE_SEP_PATH + wxT( "app.conf" );
+    config = new wxFileConfig( wxT( "MyApp" ), wxT( "T.Mutoh" ), conf_file, wxEmptyString, wxCONFIG_USE_LOCAL_FILE );
+
+    config->SetPath( wxT( "/Geometry" ) );
+    config->Read( wxT( "x" ), &rect.x );
+    config->Read( wxT( "y" ), &rect.y );
+    config->Read( wxT( "w" ), &rect.width );
+    config->Read( wxT( "h" ), &rect.height );
 
-    config->SetPath( wxT("/Geometry") );
-    config->Read( wxT("x"), &rect.x );
-    config->Read( wxT("y"), &rect.y );
-    config->Read( wxT("w"), &rect.width );
-    config->Read( wxT("h"), &rect.height );
+    config->SetPath( wxT( "/Server" ) );
+    config->Read( wxT( "server" ), &m_server );
+    config->Read( wxT( "proxy" ),  &m_server );
     delete config;
+
+	//m_server = wxT( "192.168.79.124:80" );
+    if ( m_server.IsSameAs( wxEmptyString, false ) ) 
+        m_server = wxT( "192.168.21.151:80" );	// nginx
 }
 
 void MyApp::SaveSetting()
@@ -76,11 +84,17 @@
 
 void MyApp::GetData()
 {
+	/*
     // Go 縺ョ繝励Ο繧ー繝ゥ繝繧定オキ蜍輔@シ梧囓蜿キ蛹悶&縺 auth, hhs, index 繝繝シ繧ソ繧貞叙蠕
+	wxArrayString output, errors;
+	wxString cmd = wxT( "./client.exe -u " ) + m_server;
+	wxExecute( cmd, output, errors, wxEXEC_SYNC, NULL ); // ok
+	*/
+	wxArrayString args;	// http get
+	args.Add( wxT( "client.exe -u" ) );
+	args.Add( m_server );
+
+	//wxMessageBox( wxJoin( args, ' ', '\\' ) );
+	wxExecute( wxJoin( args, ' ', '\\' ), wxEXEC_ASYNC|wxEXEC_HIDE_CONSOLE );
 }
 
-void MyApp::DeleteData()
-{
-    // auth.db 縺ィ hhs.db 繧貞炎髯、
-}
-
--- a/src/rsearcher.cpp	Mon Oct 01 23:18:29 2018 +0900
+++ b/src/rsearcher.cpp	Tue Oct 02 21:20:05 2018 +0900
@@ -1,7 +1,8 @@
 // Filename   : rsearcher.cpp
-// Last Change: 2018-10-01 Mon 23:15:33.
+// Last Change: 2018-10-02 Tue 19:43:14.
 //
 
+#include <wx/arrstr.h> 
 #include "rsearcher.h"
 #include "main.h"
 
@@ -37,13 +38,11 @@
     int kc = event.GetKeyCode();
 
     if ( kc == 13 ) {	// Enter
-		// select all
-		wxString s = GetValue();
+		SelectAll();
 
 		MainFrame* f = (MainFrame*)FindWindowById( ID_MAIN );
-		f->Cmd( s );
+		f->Cmd( GetValue() );
 
-        wxMessageBox( "Enter ed" );
         event.Skip();
         return;
     }
@@ -147,15 +146,20 @@
 MainFrame::MainFrame( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) 
 	: wxFrame( parent, id, title, pos, size, style )
 {
+	LoadIndex();
 	CreateControls();
 }
 
 MainFrame::~MainFrame()
 {
+	RemoveFile( wxT( "auth.db" ) );
+	RemoveFile( wxT( "hhs.db" ) );
+	RemoveFile( wxT( ".cache/*" )  );
 }
 
 // Event Table
 BEGIN_EVENT_TABLE( MainFrame, wxFrame )
+    EVT_DATAVIEW_SELECTION_CHANGED( ID_LIST, MainFrame::OnItemSelected )
     EVT_DATAVIEW_ITEM_ACTIVATED( ID_LIST, MainFrame::OnItemDClicked )
     EVT_NOTEBOOK_PAGE_CHANGED( ID_NBOOK, MainFrame::OnNBookChanged )
 	EVT_BUTTON( ID_TEST, MainFrame::OnTestButton )
@@ -165,13 +169,23 @@
 
 
 // Event Handler
+void MainFrame::OnItemSelected( wxDataViewEvent& WXUNUSED(event) )
+{
+    int r = m_dataViewListCtrl->GetSelectedRow();
+    wxString ready = m_dataViewListCtrl->GetTextValue( r, 2 );
+	if ( ready.IsSameAs( wxT( "ok" ), true ) ) {
+		wxString buf = m_dataViewListCtrl->GetTextValue( r, 1 );
+		LoadBitmaps( wxT( "00000000" ) );
+	}
+}
+
 void MainFrame::OnItemDClicked( wxDataViewEvent& WXUNUSED(event) )
 {
-    wxMessageBox( "dcli" );
     int r = m_dataViewListCtrl->GetSelectedRow();
-    wxString no = m_dataViewListCtrl->GetTextValue( r, 0 );
-
-    LoadBitmaps();
+    wxString date = m_dataViewListCtrl->GetTextValue( r, 1 );
+	date.Replace( wxT( "-" ), wxEmptyString, true );
+	GetImages( m_hhs, date );
+	LoadBitmaps( wxT( "00000000" ) );
 }
 
 void MainFrame::OnNBookChanged( wxBookCtrlEvent& WXUNUSED(event) )
@@ -183,19 +197,12 @@
 }
 
 /*
-void MainFrame::OnItemSelected( wxDataViewEvent& event )
-{
-    dclick or select ?
-}
-*/
-
-
-/*
 void MainFrame::OnIdle( wxIdleEvent& WXUNUSED(event) )
 {
 }
 
 */
+
 void MainFrame::SaveConfig( wxCloseEvent& WXUNUSED(event) )
 {
     if ( !IsIconized() && !IsMaximized() ) {
@@ -206,29 +213,7 @@
 
 void MainFrame::OnTestButton( wxCommandEvent& WXUNUSED(event) )
 {
-    /* ok
-    Cmd( m_searchCtrl->GetValue() );
-    Cmd( wxT( "0100012345" ) );
-    */
-
-    wxBitmap bmp( wxT(".cache/01_1"), wxBITMAP_TYPE_JPEG );
-    int width  = bmp.GetWidth();
-    int height = bmp.GetHeight();
-    wxImage img = bmp.ConvertToImage();
-
-    int ww, wh;
-    m_scrolledWindow6->GetSize( &ww, &wh );
-
-    float w = ww;
-    float h = w * height / width;
-    m_staticBitmap6->SetBitmap( wxBitmap( img.Scale( w, h, wxIMAGE_QUALITY_HIGH ) ) );
-    m_scrolledWindow6->SetScrollbars( 10, 10, w / 10, h / 10 );
-
-    for ( int i = 0; i < 5; i++ ) {
-        w *= 1.1;
-        h *= 1.1;
-        //m_staticBitmap6->SetImage( i, wxBitmap( img.Scale( w, h, wxIMAGE_QUALITY_HIGH ) ) );
-    }
+	return;
 }
 
 // Functions
@@ -237,6 +222,7 @@
     this->SetIcon( wxIcon( wxT( "sample" ) ) );
 	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
 	//this->SetBackgroundColour( wxColour( 0, 150, 230 ) );
+	this->SetBackgroundColour( wxColour( 153, 153, 153 ) );
 
 	wxBoxSizer* bSizerTop = new wxBoxSizer( wxHORIZONTAL );
 	
@@ -287,20 +273,21 @@
 	m_textCtrlName->SetBackgroundColour( wxColour( 180, 210, 240 ) );
 	bSizerRight->Add( m_textCtrlName, 0, wxALL, 5 );
 	
-	m_textCtrlAddr = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 120, -1 ), 0 );
+	m_textCtrlAddr = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 160, -1 ), 0 );
 	m_textCtrlAddr->SetBackgroundColour( wxColour( 180, 210, 240 ) );
 	bSizerRight->Add( m_textCtrlAddr, 0, wxALL|wxEXPAND, 5 );
 	
 	m_dataViewListCtrl = new wxDataViewListCtrl( this, ID_LIST, wxDefaultPosition, wxDefaultSize, wxDV_ROW_LINES|wxDV_SINGLE );
-	m_dataViewListColumnNo   = m_dataViewListCtrl->AppendTextColumn( wxT( "No" ),   wxDATAVIEW_CELL_INERT,  30, wxALIGN_RIGHT,  wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE );
-	m_dataViewListColumnDate = m_dataViewListCtrl->AppendTextColumn( wxT( "Date" ), wxDATAVIEW_CELL_INERT, 120, wxALIGN_CENTER, wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE );
+	m_dataViewListColumnNo   = m_dataViewListCtrl->AppendTextColumn( wxT( "No" ),    wxDATAVIEW_CELL_INERT, 30, wxALIGN_RIGHT,  wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE );
+	m_dataViewListColumnDate = m_dataViewListCtrl->AppendTextColumn( wxT( "Date" ),  wxDATAVIEW_CELL_INERT, 80, wxALIGN_CENTER, wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE );
+	m_dataViewListColumnDate = m_dataViewListCtrl->AppendTextColumn( wxT( "Ready" ), wxDATAVIEW_CELL_INERT, 60, wxALIGN_CENTER, wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE );
 
 	bSizerRight->Add( m_dataViewListCtrl, 1, wxALL|wxEXPAND, 5 );
 	
 	m_textCtrlLog = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
 	bSizerRight->Add( m_textCtrlLog, 1, wxALL|wxEXPAND, 5 );
 
-	m_slider = new wxSlider( this, ID_SLDR, 1, 1, 5, wxDefaultPosition, wxSize( -1,200 ), wxSL_AUTOTICKS|wxSL_INVERSE|wxSL_LABELS|wxSL_VERTICAL );
+	m_slider = new wxSlider( this, ID_SLDR, 1, 1, 5, wxDefaultPosition, wxSize( -1, 200 ), wxSL_AUTOTICKS|wxSL_INVERSE|wxSL_LABELS|wxSL_VERTICAL );
 	bSizerRight->Add( m_slider, 0, wxALL, 5 );
 	
 	m_buttonPrint = new wxButton( this, ID_PRINT, wxT( "Print" ), wxDefaultPosition, wxDefaultSize, 0 );
@@ -326,12 +313,19 @@
 void MainFrame::Cmd( wxString cmd )
 {
 	m_dataViewListCtrl->DeleteAllItems();
+	LoadBitmaps( wxEmptyString );
 
-    if ( cmd.Cmp( wxT( "q" ) ) == 0 || cmd.Cmp( wxT( "9" ) ) == 0 ) {
+    if ( cmd.IsSameAs( wxT( "q" ), true ) || cmd.IsSameAs( wxT( "9" ), true ) ) {
         Close();
+		return;
     }
 
-    if ( cmd.Cmp( wxT( "." ) ) == 0 ) {
+    if ( cmd.IsSameAs( wxT( "c" ), true ) || cmd.IsSameAs( wxT( "cmd" ), true ) ) {
+        Close();
+		return;
+    }
+
+    if ( cmd.IsSameAs( wxT( "." ), true ) ) {
         wxString appdir = wxGetCwd();
         wxString execmd = wxT( "explorer " ) + appdir;
         wxExecute( execmd );
@@ -340,30 +334,21 @@
 
     wxRegEx reHhs( wxT( "^0[1238][0-9]{8}$" ) );
     if ( reHhs.Matches( cmd ) ) {
-        wxArrayString output, errors;
-        cmd = wxT( "./rsearcher -q " ) + cmd;
-        wxExecute( cmd, output, errors, wxEXEC_SYNC, NULL ); // ok
+		m_hhs = m_searchCtrl->GetValue();
+		Search();
+		return;
+	}
 
-        if ( output.GetCount() > 0 ) {
-            m_textCtrlName->SetValue( output[0] );
-            m_textCtrlAddr->SetValue( output[2] );
-            for ( int i = 5, n = 1; i < output.GetCount(); i++, n++ ) {
-                wxVector<wxVariant> data;
-                data.push_back( wxString::Format( wxT( "%02d" ), n ) );
-                data.push_back( output[i] );
-                m_dataViewListCtrl->AppendItem( data );
-                data.clear();
-            }
-        }
-    
-        if ( errors.GetCount() > 0 ) {
-            wxMessageBox( errors[0], wxT( "Error" ) );
-        }
-    }
+	wxMessageBox( wxT( "Bad Input!!" ) );
 }
 
 void MainFrame::LoadBitmap( wxScrolledWindow* sc, wxStaticBitmap* sb, wxString file )
 {
+	if ( startup ) {
+		file = wxT( "image/hw201810.jpg" );
+		startup = false;
+	}
+	if ( !wxFileExists( file ) ) file = wxT( "image/testpattern.jpg" );
     wxBitmap bmp( file, wxBITMAP_TYPE_JPEG );
     int width  = bmp.GetWidth();
     int height = bmp.GetHeight();
@@ -384,36 +369,82 @@
     }
 }
 
-void MainFrame::LoadBitmaps( void )
+void MainFrame::LoadBitmaps( wxString date )
 {
-    int date = 0;
-    LoadBitmap( m_scrolledWindow1, m_staticBitmap1, wxString::Format( ".cache/%08d_1", date ) );
-    LoadBitmap( m_scrolledWindow2, m_staticBitmap2, wxString::Format( ".cache/%08d_2", date ) );
-    LoadBitmap( m_scrolledWindow3, m_staticBitmap3, wxString::Format( ".cache/%08d_3", date ) );
-    LoadBitmap( m_scrolledWindow4, m_staticBitmap4, wxString::Format( ".cache/%08d_4", date ) );
-    LoadBitmap( m_scrolledWindow5, m_staticBitmap5, wxString::Format( ".cache/%08d_5", date ) );
+    LoadBitmap( m_scrolledWindow1, m_staticBitmap1, wxString::Format( wxT( ".cache/%08s_1" ), date ) );
+    LoadBitmap( m_scrolledWindow2, m_staticBitmap2, wxString::Format( wxT( ".cache/%08s_2" ), date ) );
+    LoadBitmap( m_scrolledWindow3, m_staticBitmap3, wxString::Format( wxT( ".cache/%08s_3" ), date ) );
+    LoadBitmap( m_scrolledWindow4, m_staticBitmap4, wxString::Format( wxT( ".cache/%08s_4" ), date ) );
+    LoadBitmap( m_scrolledWindow5, m_staticBitmap5, wxString::Format( wxT( ".cache/%08s_5" ), date ) );
+}
+
+void MainFrame::GetImages( wxString hhs, wxString date )
+{
+	wxArrayString args;	// http get
+	args.Add( wxT( "client.exe" ) );
+	args.Add( m_server );
+	args.Add( hhs );
+	args.Add( date );
+
+	//wxMessageBox( wxJoin( args, ' ', '\\' ) );
+	wxExecute( wxJoin( args, ' ', '\\' ), wxEXEC_ASYNC|wxEXEC_HIDE_CONSOLE );
 }
 
-void MainFrame::GetImage( wxString hhs, wxString no )
+void MainFrame::Search( void )
 {
-    // http get
+	wxString date;
+	int match_cnt = 0;
+	for ( int i = 0; i < m_index.GetCount(); i++ ) {
+		if ( m_index[i].StartsWith( m_hhs, &date ) ) {
+			wxVector<wxVariant> data;
+			data.push_back( wxString::Format( wxT( "%02d" ), ++match_cnt ) );
+			date = date.Mid( 1, 4 ) + wxT( "-" ) + date.Mid( 5, 2 ) + wxT( "-" ) + date.Mid( 7, 2 );
+			data.push_back( date );
+			data.push_back( wxEmptyString );
+			m_dataViewListCtrl->AppendItem( data );
+			data.clear();
+		}
+	}
+	if ( match_cnt == 0 ) wxMessageBox( wxT( "Not Matched!!" ) );
+}
+
+void MainFrame::LoadIndex( void )
+{
+	wxTextFile file;
+	file.Open( wxT( "index.db" ) );
+	for ( int i = 0; i < file.GetLineCount(); i++ )
+		m_index.Add( file.GetLine( i ) );
+	file.Close();
+	m_index.Sort( true );
+}
+
+void MainFrame::RemoveFile( wxString pattern )
+{
+	wxString file = wxFindFirstFile( pattern );
+	while ( !file.empty() ) {
+		wxRemoveFile( file  );
+		file = wxFindNextFile();
+	}
 }
 
 void MainFrame::InDevelop( bool flag )
 {
     if ( !flag ) return;
-    LoadBitmaps();
+    //LoadBitmaps( wxT( "00000000" ) );
+    LoadBitmaps( wxEmptyString );
     
 	m_slider->Enable( false );
 	m_slider->Show( false );
 
+	bool pr = true;
 	m_buttonPrint->Enable( false );
-	m_buttonPrint->Show( false );
+	m_buttonPrint->Show( true );
 
-	bool tb = false;
+	bool tb = true;
 	m_buttonTest->Enable( tb );
 	m_buttonTest->Show( tb );
 
-	m_searchCtrl->Enable( false );
+	bool srch = true;
+	m_searchCtrl->Enable( srch );
 }