Mercurial > mercurial > hgweb_rsearcher.cgi
comparison include/rsearcher.h @ 6:9a8b581c1993
improve performance.
| author | pyon@macmini |
|---|---|
| date | Tue, 23 Oct 2018 19:15:22 +0900 |
| parents | e3b10fb860b3 |
| children | 29829e98d510 |
comparison
equal
deleted
inserted
replaced
| 5:e3b10fb860b3 | 6:9a8b581c1993 |
|---|---|
| 1 // Filename : rsearcher.h | 1 // Filename : rsearcher.h |
| 2 // Last Change: 2018-10-22 ŒŽ 13:08:14. | 2 // Last Change: 2018-10-23 ‰Î 14:26:02. |
| 3 // | 3 // |
| 4 | 4 |
| 5 #ifndef __RSEARCH_H__ | 5 #ifndef __RSEARCH_H__ |
| 6 #define __RSEARCH_H__ | 6 #define __RSEARCH_H__ |
| 7 | 7 |
| 60 class MyStaticBitmap : public wxStaticBitmap | 60 class MyStaticBitmap : public wxStaticBitmap |
| 61 { | 61 { |
| 62 private: | 62 private: |
| 63 int m_dragx, m_dragy; // for image drag | 63 int m_dragx, m_dragy; // for image drag |
| 64 int cx, cy; // for mouse-gesture | 64 int cx, cy; // for mouse-gesture |
| 65 int m_zoom = 0; | 65 wxBitmap m_bmp0; |
| 66 wxBitmap m_bmp[5]; | |
| 67 wxScrolledWindow* m_parent; | 66 wxScrolledWindow* m_parent; |
| 68 int select_tab = 0; | 67 |
| 68 public: | |
| 69 int zoom = 0; | |
| 69 | 70 |
| 70 public: | 71 public: |
| 71 MyStaticBitmap( wxScrolledWindow *parent, wxWindowID id, const wxBitmap &label, const wxPoint &pos, const wxSize &size, long style, const wxString &name ); | 72 MyStaticBitmap( wxScrolledWindow *parent, wxWindowID id, const wxBitmap &label, const wxPoint &pos, const wxSize &size, long style, const wxString &name ); |
| 72 ~MyStaticBitmap(); | 73 ~MyStaticBitmap(); |
| 73 | 74 |
| 75 void OnLeftUp( wxMouseEvent& event ); | 76 void OnLeftUp( wxMouseEvent& event ); |
| 76 void OnStartRGesture( wxMouseEvent& event ); | 77 void OnStartRGesture( wxMouseEvent& event ); |
| 77 void OnEndRGesture( wxMouseEvent& event ); | 78 void OnEndRGesture( wxMouseEvent& event ); |
| 78 void OnMotion( wxMouseEvent& event ); | 79 void OnMotion( wxMouseEvent& event ); |
| 79 void OnWheel( wxMouseEvent& event ); | 80 void OnWheel( wxMouseEvent& event ); |
| 80 void SetImage( int i, wxBitmap bmp ) { m_bmp[i] = bmp; }; | 81 void SetOrigImage( wxBitmap bmp ) { m_bmp0 = bmp; }; |
| 81 void SetZoom( int m_zoom ); | 82 wxBitmap GetOrigImage( void ) { return m_bmp0; }; |
| 82 void ChangeBook( int i ); | 83 void ChangeBook( int i ); |
| 83 }; | 84 }; |
| 84 | 85 |
| 85 class MainFrame : public wxFrame | 86 class MainFrame : public wxFrame |
| 86 { | 87 { |
| 91 wxString m_hhs; | 92 wxString m_hhs; |
| 92 wxString m_user; | 93 wxString m_user; |
| 93 wxArrayString m_index; | 94 wxArrayString m_index; |
| 94 wxTimer m_timer; | 95 wxTimer m_timer; |
| 95 HhsHash hhash; | 96 HhsHash hhash; |
| 97 bool m_dark = false; | |
| 96 | 98 |
| 97 protected: | 99 protected: |
| 98 MySearchCtrl* m_searchCtrl; | 100 MySearchCtrl* m_searchCtrl; |
| 99 MyStaticBitmap* m_staticBitmap1; | 101 MyStaticBitmap* m_staticBitmap1; |
| 100 MyStaticBitmap* m_staticBitmap2; | 102 MyStaticBitmap* m_staticBitmap2; |
| 115 wxTextCtrl* m_textCtrlAddr; | 117 wxTextCtrl* m_textCtrlAddr; |
| 116 wxDataViewListCtrl* m_dataViewListCtrl; | 118 wxDataViewListCtrl* m_dataViewListCtrl; |
| 117 wxDataViewColumn* m_dataViewListColumnNo; | 119 wxDataViewColumn* m_dataViewListColumnNo; |
| 118 wxDataViewColumn* m_dataViewListColumnDate; | 120 wxDataViewColumn* m_dataViewListColumnDate; |
| 119 wxTextCtrl* m_textCtrlLog; | 121 wxTextCtrl* m_textCtrlLog; |
| 120 wxSlider* m_slider; | |
| 121 wxButton* m_buttonPsearch; | 122 wxButton* m_buttonPsearch; |
| 122 wxButton* m_buttonPrint; | 123 wxButton* m_buttonPrint; |
| 124 | |
| 125 // invisible button for shortcut-key | |
| 126 wxSlider* m_slider; | |
| 127 wxButton* m_buttonPzoom; | |
| 128 wxButton* m_buttonMzoom; | |
| 129 wxButton* m_buttonDark; | |
| 123 wxButton* m_buttonHelp; | 130 wxButton* m_buttonHelp; |
| 124 wxButton* m_buttonLogout; | 131 wxButton* m_buttonLogout; |
| 125 | 132 |
| 126 public: | 133 public: |
| 127 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 ); | 134 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 ); |
| 133 void SetAccelerator( void ); | 140 void SetAccelerator( void ); |
| 134 void Cmd( wxString cmd ); | 141 void Cmd( wxString cmd ); |
| 135 void Search( void ); | 142 void Search( void ); |
| 136 void PasteSeaarch( void ); | 143 void PasteSeaarch( void ); |
| 137 void LoadDB( void ); | 144 void LoadDB( void ); |
| 138 bool LoadBitmap( wxScrolledWindow* sc, wxStaticBitmap* sb, wxString file ); | 145 bool LoadBitmap( wxScrolledWindow* sc, MyStaticBitmap* sb, wxString file ); |
| 139 bool LoadBitmaps( wxString date, bool reload ); | 146 bool LoadBitmaps( wxString date, bool reload ); |
| 147 void ChangeCZoom( int z ); | |
| 148 void ChangeZoom( wxScrolledWindow* sc, MyStaticBitmap* sb, int z ); | |
| 149 void ChangeColor( MyStaticBitmap* sb ); | |
| 140 void GetImages( wxString hhs, wxString date ); | 150 void GetImages( wxString hhs, wxString date ); |
| 141 void PrintImages( void ); | 151 void PrintImages( void ); |
| 142 void WriteLog( wxString msg ); | 152 void WriteLog( wxString msg ); |
| 143 void RemoveFile( wxString pattern ); | |
| 144 void InDevelop( bool ); | 153 void InDevelop( bool ); |
| 145 | 154 |
| 146 void OnItemSelected( wxDataViewEvent& event ); | 155 void OnItemSelected( wxDataViewEvent& event ); |
| 147 void OnItemDClicked( wxDataViewEvent& event ); | 156 void OnItemDClicked( wxDataViewEvent& event ); |
| 148 void OnNBookChanged( wxBookCtrlEvent& event ); | 157 void OnNBookChanged( wxBookCtrlEvent& event ); |
| 149 void OnPasteSearch( wxCommandEvent& event ); | 158 void OnPasteSearch( wxCommandEvent& event ); |
| 150 void OnPrint( wxCommandEvent& event ); | 159 void OnPrint( wxCommandEvent& event ); |
| 151 void OnClose( wxCloseEvent& event ); // save config | 160 void OnClose( wxCloseEvent& event ); // save config |
| 152 void OnIdle( wxIdleEvent& event ); | 161 void OnIdle( wxIdleEvent& event ); |
| 153 void OnTimer( wxTimerEvent& event ); | 162 void OnTimer( wxTimerEvent& event ); |
| 163 void OnPlusZoom( wxCommandEvent& event ); | |
| 164 void OnMinusZoom( wxCommandEvent& event ); | |
| 165 void OnDark( wxCommandEvent& event ); | |
| 154 void OnHelp( wxCommandEvent& event ); | 166 void OnHelp( wxCommandEvent& event ); |
| 155 void OnLogout( wxCommandEvent& event ); | 167 void OnLogout( wxCommandEvent& event ); |
| 156 }; | 168 }; |
| 157 | 169 |
| 158 #endif // __RSEARCH_H__ | 170 #endif // __RSEARCH_H__ |
