0
|
1 // Filename : rsearcher.h
|
6
|
2 // Last Change: 2018-10-23 ‰Î 14:26:02.
|
0
|
3 //
|
|
4
|
|
5 #ifndef __RSEARCH_H__
|
|
6 #define __RSEARCH_H__
|
|
7
|
|
8 #include <wx/artprov.h>
|
|
9 #include <wx/xrc/xmlres.h>
|
|
10 #include <wx/string.h>
|
|
11 #include <wx/srchctrl.h>
|
|
12 #include <wx/gdicmn.h>
|
|
13 #include <wx/font.h>
|
|
14 #include <wx/colour.h>
|
|
15 #include <wx/settings.h>
|
|
16 #include <wx/textctrl.h>
|
|
17 #include <wx/button.h>
|
|
18 #include <wx/notebook.h>
|
|
19 #include <wx/dataview.h>
|
|
20 #include <wx/slider.h>
|
|
21 #include <wx/sizer.h>
|
|
22 #include <wx/html/htmlwin.h>
|
|
23 #include <wx/frame.h>
|
|
24 #include <wx/statbmp.h>
|
|
25 #include <wx/msgdlg.h>
|
2
|
26 #include <wx/filefn.h>
|
0
|
27 #include <wx/regex.h>
|
3
|
28 #include <wx/progdlg.h>
|
|
29 #include <wx/utils.h>
|
2
|
30 #include <wx/textfile.h>
|
3
|
31 #include <wx/timer.h>
|
5
|
32 #include <wx/hashmap.h>
|
0
|
33
|
5
|
34 /* Data Class */
|
|
35 class HhsClass {
|
|
36 public:
|
|
37 wxString no;
|
|
38 wxString birth;
|
|
39 wxString name;
|
|
40 wxString kana;
|
|
41 wxString addr;
|
|
42 wxString sex;
|
|
43
|
|
44 HhsClass( wxArrayString& buf );
|
|
45 };
|
|
46
|
|
47 WX_DECLARE_HASH_MAP( wxString, HhsClass*, wxStringHash, wxStringEqual, HhsHash );
|
|
48
|
|
49 /* Control-Window Class */
|
0
|
50 class MySearchCtrl : public wxSearchCtrl
|
|
51 {
|
|
52 DECLARE_EVENT_TABLE()
|
|
53 public:
|
|
54 MySearchCtrl( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style );
|
|
55 ~MySearchCtrl();
|
|
56
|
|
57 void OnKey( wxKeyEvent& event );
|
|
58 };
|
|
59
|
|
60 class MyStaticBitmap : public wxStaticBitmap
|
|
61 {
|
|
62 private:
|
3
|
63 int m_dragx, m_dragy; // for image drag
|
|
64 int cx, cy; // for mouse-gesture
|
6
|
65 wxBitmap m_bmp0;
|
0
|
66 wxScrolledWindow* m_parent;
|
6
|
67
|
|
68 public:
|
|
69 int zoom = 0;
|
0
|
70
|
|
71 public:
|
|
72 MyStaticBitmap( wxScrolledWindow *parent, wxWindowID id, const wxBitmap &label, const wxPoint &pos, const wxSize &size, long style, const wxString &name );
|
|
73 ~MyStaticBitmap();
|
|
74
|
|
75 void OnLeftDown( wxMouseEvent& event );
|
|
76 void OnLeftUp( wxMouseEvent& event );
|
3
|
77 void OnStartRGesture( wxMouseEvent& event );
|
|
78 void OnEndRGesture( wxMouseEvent& event );
|
0
|
79 void OnMotion( wxMouseEvent& event );
|
|
80 void OnWheel( wxMouseEvent& event );
|
6
|
81 void SetOrigImage( wxBitmap bmp ) { m_bmp0 = bmp; };
|
|
82 wxBitmap GetOrigImage( void ) { return m_bmp0; };
|
4
|
83 void ChangeBook( int i );
|
0
|
84 };
|
|
85
|
|
86 class MainFrame : public wxFrame
|
|
87 {
|
|
88 DECLARE_EVENT_TABLE()
|
|
89 private:
|
2
|
90 bool startup = true;
|
|
91 wxString m_server;
|
|
92 wxString m_hhs;
|
3
|
93 wxString m_user;
|
2
|
94 wxArrayString m_index;
|
3
|
95 wxTimer m_timer;
|
5
|
96 HhsHash hhash;
|
6
|
97 bool m_dark = false;
|
0
|
98
|
|
99 protected:
|
|
100 MySearchCtrl* m_searchCtrl;
|
|
101 MyStaticBitmap* m_staticBitmap1;
|
|
102 MyStaticBitmap* m_staticBitmap2;
|
|
103 MyStaticBitmap* m_staticBitmap3;
|
|
104 MyStaticBitmap* m_staticBitmap4;
|
|
105 MyStaticBitmap* m_staticBitmap5;
|
1
|
106 MyStaticBitmap* m_staticBitmap6;
|
0
|
107
|
|
108 wxNotebook* m_notebook;
|
|
109 wxScrolledWindow* m_scrolledWindow1;
|
|
110 wxScrolledWindow* m_scrolledWindow2;
|
|
111 wxScrolledWindow* m_scrolledWindow3;
|
|
112 wxScrolledWindow* m_scrolledWindow4;
|
|
113 wxScrolledWindow* m_scrolledWindow5;
|
|
114 wxScrolledWindow* m_scrolledWindow6;
|
|
115
|
|
116 wxTextCtrl* m_textCtrlName;
|
|
117 wxTextCtrl* m_textCtrlAddr;
|
|
118 wxDataViewListCtrl* m_dataViewListCtrl;
|
|
119 wxDataViewColumn* m_dataViewListColumnNo;
|
|
120 wxDataViewColumn* m_dataViewListColumnDate;
|
|
121 wxTextCtrl* m_textCtrlLog;
|
5
|
122 wxButton* m_buttonPsearch;
|
0
|
123 wxButton* m_buttonPrint;
|
6
|
124
|
|
125 // invisible button for shortcut-key
|
|
126 wxSlider* m_slider;
|
|
127 wxButton* m_buttonPzoom;
|
|
128 wxButton* m_buttonMzoom;
|
|
129 wxButton* m_buttonDark;
|
5
|
130 wxButton* m_buttonHelp;
|
3
|
131 wxButton* m_buttonLogout;
|
0
|
132
|
|
133 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 );
|
|
135 ~MainFrame();
|
3
|
136
|
2
|
137 void SetServer( wxString server ) { m_server = server; };
|
5
|
138 void SetUser( wxString user ) { m_user = user; WriteLog( wxT( "[login] " ) + m_user ); };
|
2
|
139 void CreateControls( void );
|
5
|
140 void SetAccelerator( void );
|
2
|
141 void Cmd( wxString cmd );
|
|
142 void Search( void );
|
5
|
143 void PasteSeaarch( void );
|
3
|
144 void LoadDB( void );
|
6
|
145 bool LoadBitmap( wxScrolledWindow* sc, MyStaticBitmap* sb, wxString file );
|
5
|
146 bool LoadBitmaps( wxString date, bool reload );
|
6
|
147 void ChangeCZoom( int z );
|
|
148 void ChangeZoom( wxScrolledWindow* sc, MyStaticBitmap* sb, int z );
|
|
149 void ChangeColor( MyStaticBitmap* sb );
|
2
|
150 void GetImages( wxString hhs, wxString date );
|
3
|
151 void PrintImages( void );
|
5
|
152 void WriteLog( wxString msg );
|
2
|
153 void InDevelop( bool );
|
|
154
|
|
155 void OnItemSelected( wxDataViewEvent& event );
|
0
|
156 void OnItemDClicked( wxDataViewEvent& event );
|
|
157 void OnNBookChanged( wxBookCtrlEvent& event );
|
5
|
158 void OnPasteSearch( wxCommandEvent& event );
|
3
|
159 void OnPrint( wxCommandEvent& event );
|
|
160 void OnClose( wxCloseEvent& event ); // save config
|
|
161 void OnIdle( wxIdleEvent& event );
|
|
162 void OnTimer( wxTimerEvent& event );
|
6
|
163 void OnPlusZoom( wxCommandEvent& event );
|
|
164 void OnMinusZoom( wxCommandEvent& event );
|
|
165 void OnDark( wxCommandEvent& event );
|
5
|
166 void OnHelp( wxCommandEvent& event );
|
3
|
167 void OnLogout( wxCommandEvent& event );
|
0
|
168 };
|
|
169
|
|
170 #endif // __RSEARCH_H__
|
|
171
|