comparison include/rsearcher.h @ 7:29829e98d510

add net.cpp
author pyon@macmini
date Fri, 26 Oct 2018 21:05:11 +0900
parents 9a8b581c1993
children 82f9af6aa7e4
comparison
equal deleted inserted replaced
6:9a8b581c1993 7:29829e98d510
1 // Filename : rsearcher.h 1 // Filename : rsearcher.h
2 // Last Change: 2018-10-23 ‰Î 14:26:02. 2 // Last Change: 2018-10-26 ‹à 15:10:47.
3 // 3 //
4 4
5 #ifndef __RSEARCH_H__ 5 #ifndef __RSEARCH_H__
6 #define __RSEARCH_H__ 6 #define __RSEARCH_H__
7 7
28 #include <wx/progdlg.h> 28 #include <wx/progdlg.h>
29 #include <wx/utils.h> 29 #include <wx/utils.h>
30 #include <wx/textfile.h> 30 #include <wx/textfile.h>
31 #include <wx/timer.h> 31 #include <wx/timer.h>
32 #include <wx/hashmap.h> 32 #include <wx/hashmap.h>
33 #include "net.h"
33 34
34 /* Data Class */ 35 /* Data Class */
35 class HhsClass { 36 class HhsClass {
36 public: 37 public:
37 wxString no; 38 wxString no;
92 wxString m_hhs; 93 wxString m_hhs;
93 wxString m_user; 94 wxString m_user;
94 wxArrayString m_index; 95 wxArrayString m_index;
95 wxTimer m_timer; 96 wxTimer m_timer;
96 HhsHash hhash; 97 HhsHash hhash;
98 RsHttp http;
97 bool m_dark = false; 99 bool m_dark = false;
98 100
99 protected: 101 protected:
100 MySearchCtrl* m_searchCtrl; 102 MySearchCtrl* m_searchCtrl;
101 MyStaticBitmap* m_staticBitmap1; 103 MyStaticBitmap* m_staticBitmap1;
122 wxButton* m_buttonPsearch; 124 wxButton* m_buttonPsearch;
123 wxButton* m_buttonPrint; 125 wxButton* m_buttonPrint;
124 126
125 // invisible button for shortcut-key 127 // invisible button for shortcut-key
126 wxSlider* m_slider; 128 wxSlider* m_slider;
129 wxButton* m_buttonFocus;
127 wxButton* m_buttonPzoom; 130 wxButton* m_buttonPzoom;
128 wxButton* m_buttonMzoom; 131 wxButton* m_buttonMzoom;
129 wxButton* m_buttonDark; 132 wxButton* m_buttonDark;
130 wxButton* m_buttonHelp; 133 wxButton* m_buttonHelp;
134 wxButton* m_buttonClose;
131 wxButton* m_buttonLogout; 135 wxButton* m_buttonLogout;
132 136
133 public: 137 public:
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 ); 138 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 );
135 ~MainFrame(); 139 ~MainFrame();
136 140
137 void SetServer( wxString server ) { m_server = server; }; 141 void SetServer( wxString addr, int port ) { http.SetServer( addr, port ); m_server = wxString::Format(wxT("%s:%d"),addr,port);};
142 void GetDB( void ) { http.GetDB(); };
138 void SetUser( wxString user ) { m_user = user; WriteLog( wxT( "[login] " ) + m_user ); }; 143 void SetUser( wxString user ) { m_user = user; WriteLog( wxT( "[login] " ) + m_user ); };
139 void CreateControls( void ); 144 void CreateControls( void );
140 void SetAccelerator( void ); 145 void SetAccelerator( void );
141 void Cmd( wxString cmd ); 146 void Cmd( wxString cmd );
142 void Search( void ); 147 void Search( void );
145 bool LoadBitmap( wxScrolledWindow* sc, MyStaticBitmap* sb, wxString file ); 150 bool LoadBitmap( wxScrolledWindow* sc, MyStaticBitmap* sb, wxString file );
146 bool LoadBitmaps( wxString date, bool reload ); 151 bool LoadBitmaps( wxString date, bool reload );
147 void ChangeCZoom( int z ); 152 void ChangeCZoom( int z );
148 void ChangeZoom( wxScrolledWindow* sc, MyStaticBitmap* sb, int z ); 153 void ChangeZoom( wxScrolledWindow* sc, MyStaticBitmap* sb, int z );
149 void ChangeColor( MyStaticBitmap* sb ); 154 void ChangeColor( MyStaticBitmap* sb );
155 void GetImages2( wxString hhs, wxString date );
150 void GetImages( wxString hhs, wxString date ); 156 void GetImages( wxString hhs, wxString date );
151 void PrintImages( void ); 157 void PrintImages( void );
152 void WriteLog( wxString msg ); 158 void WriteLog( wxString msg );
159 void Close( void );
153 void InDevelop( bool ); 160 void InDevelop( bool );
154 161
155 void OnItemSelected( wxDataViewEvent& event ); 162 void OnItemSelected( wxDataViewEvent& event );
156 void OnItemDClicked( wxDataViewEvent& event ); 163 void OnItemDClicked( wxDataViewEvent& event );
157 void OnNBookChanged( wxBookCtrlEvent& event ); 164 void OnNBookChanged( wxBookCtrlEvent& event );
158 void OnPasteSearch( wxCommandEvent& event ); 165 void OnPasteSearch( wxCommandEvent& event );
159 void OnPrint( wxCommandEvent& event ); 166 void OnPrint( wxCommandEvent& event );
160 void OnClose( wxCloseEvent& event ); // save config 167 void OnClose( wxCloseEvent& event );
168 void OnBClose( wxCommandEvent& event );
161 void OnIdle( wxIdleEvent& event ); 169 void OnIdle( wxIdleEvent& event );
162 void OnTimer( wxTimerEvent& event ); 170 void OnTimer( wxTimerEvent& event );
171
172 // for shortcut-key
173 void OnFocus( wxCommandEvent& event );
163 void OnPlusZoom( wxCommandEvent& event ); 174 void OnPlusZoom( wxCommandEvent& event );
164 void OnMinusZoom( wxCommandEvent& event ); 175 void OnMinusZoom( wxCommandEvent& event );
165 void OnDark( wxCommandEvent& event ); 176 void OnDark( wxCommandEvent& event );
166 void OnHelp( wxCommandEvent& event ); 177 void OnHelp( wxCommandEvent& event );
167 void OnLogout( wxCommandEvent& event ); 178 void OnLogout( wxCommandEvent& event );