diff include/rsearcher.h @ 6:9a8b581c1993

improve performance.
author pyon@macmini
date Tue, 23 Oct 2018 19:15:22 +0900
parents e3b10fb860b3
children 29829e98d510
line wrap: on
line diff
--- a/include/rsearcher.h	Mon Oct 22 22:17:02 2018 +0900
+++ b/include/rsearcher.h	Tue Oct 23 19:15:22 2018 +0900
@@ -1,5 +1,5 @@
 // Filename   : rsearcher.h
-// Last Change: 2018-10-22 ŒŽ 13:08:14.
+// Last Change: 2018-10-23 ‰Î 14:26:02.
 //
 
 #ifndef __RSEARCH_H__
@@ -62,10 +62,11 @@
 	private:
         int m_dragx, m_dragy;	// for image drag
 		int cx, cy;             // for mouse-gesture
-        int m_zoom = 0;
-        wxBitmap m_bmp[5];
+        wxBitmap m_bmp0;
 		wxScrolledWindow* m_parent;
-		int select_tab = 0;
+
+	public:
+		int zoom = 0;
 
 	public:
         MyStaticBitmap( wxScrolledWindow *parent, wxWindowID id, const wxBitmap &label, const wxPoint &pos, const wxSize &size, long style, const wxString &name );
@@ -77,8 +78,8 @@
 		void OnEndRGesture( wxMouseEvent& event );
         void OnMotion( wxMouseEvent& event );
         void OnWheel( wxMouseEvent& event );
-        void SetImage( int i, wxBitmap bmp ) { m_bmp[i] = bmp; };
-        void SetZoom( int m_zoom );
+        void SetOrigImage( wxBitmap bmp ) { m_bmp0 = bmp; };
+        wxBitmap GetOrigImage( void ) { return m_bmp0; };
 		void ChangeBook( int i );
 };
 
@@ -93,6 +94,7 @@
 		wxArrayString m_index;
 		wxTimer       m_timer;
 		HhsHash       hhash;
+		bool		  m_dark = false;
 	
 	protected:
 		MySearchCtrl*		m_searchCtrl;
@@ -117,9 +119,14 @@
 		wxDataViewColumn* 	m_dataViewListColumnNo;
 		wxDataViewColumn* 	m_dataViewListColumnDate;
 		wxTextCtrl* 		m_textCtrlLog;
-		wxSlider*           m_slider;
 		wxButton*           m_buttonPsearch;
 		wxButton*           m_buttonPrint;
+
+		// invisible button for shortcut-key
+		wxSlider*           m_slider;
+		wxButton*           m_buttonPzoom;
+		wxButton*           m_buttonMzoom;
+		wxButton*           m_buttonDark;
 		wxButton*           m_buttonHelp;
 		wxButton*           m_buttonLogout;
 	
@@ -135,12 +142,14 @@
 		void Search( void );
 		void PasteSeaarch( void );
 		void LoadDB( void );
-        bool LoadBitmap( wxScrolledWindow* sc, wxStaticBitmap* sb, wxString file );
+        bool LoadBitmap( wxScrolledWindow* sc, MyStaticBitmap* sb, wxString file );
         bool LoadBitmaps( wxString date, bool reload );
+		void ChangeCZoom( int z );
+		void ChangeZoom( wxScrolledWindow* sc, MyStaticBitmap* sb, int z );
+		void ChangeColor( MyStaticBitmap* sb );
         void GetImages( wxString hhs, wxString date );
 		void PrintImages( void );
 		void WriteLog( wxString msg );
-		void RemoveFile( wxString pattern );
         void InDevelop( bool );
 
 		void OnItemSelected( wxDataViewEvent& event );
@@ -151,6 +160,9 @@
 		void OnClose( wxCloseEvent& event );	// save config
 		void OnIdle( wxIdleEvent& event );
 		void OnTimer( wxTimerEvent& event );
+        void OnPlusZoom( wxCommandEvent& event );
+        void OnMinusZoom( wxCommandEvent& event );
+        void OnDark( wxCommandEvent& event );
         void OnHelp( wxCommandEvent& event );
         void OnLogout( wxCommandEvent& event );
 };