0
|
1 // Filename : rsearcher.h
|
5
|
2 // Last Change: 2018-10-22 ŒŽ 13:08:14.
|
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
|
0
|
65 int m_zoom = 0;
|
|
66 wxBitmap m_bmp[5];
|
|
67 wxScrolledWindow* m_parent;
|
4
|
68 int select_tab = 0;
|
0
|
69
|
|
70 public:
|
|
71 MyStaticBitmap( wxScrolledWindow *parent, wxWindowID id, const wxBitmap &label, const wxPoint &pos, const wxSize &size, long style, const wxString &name );
|
|
72 ~MyStaticBitmap();
|
|
73
|
|
74 void OnLeftDown( wxMouseEvent& event );
|
|
75 void OnLeftUp( wxMouseEvent& event );
|
3
|
76 void OnStartRGesture( wxMouseEvent& event );
|
|
77 void OnEndRGesture( wxMouseEvent& event );
|
0
|
78 void OnMotion( wxMouseEvent& event );
|
|
79 void OnWheel( wxMouseEvent& event );
|
|
80 void SetImage( int i, wxBitmap bmp ) { m_bmp[i] = bmp; };
|
|
81 void SetZoom( int m_zoom );
|
4
|
82 void ChangeBook( int i );
|
0
|
83 };
|
|
84
|
|
85 class MainFrame : public wxFrame
|
|
86 {
|
|
87 DECLARE_EVENT_TABLE()
|
|
88 private:
|
2
|
89 bool startup = true;
|
|
90 wxString m_server;
|
|
91 wxString m_hhs;
|
3
|
92 wxString m_user;
|
2
|
93 wxArrayString m_index;
|
3
|
94 wxTimer m_timer;
|
5
|
95 HhsHash hhash;
|
0
|
96
|
|
97 protected:
|
|
98 MySearchCtrl* m_searchCtrl;
|
|
99 MyStaticBitmap* m_staticBitmap1;
|
|
100 MyStaticBitmap* m_staticBitmap2;
|
|
101 MyStaticBitmap* m_staticBitmap3;
|
|
102 MyStaticBitmap* m_staticBitmap4;
|
|
103 MyStaticBitmap* m_staticBitmap5;
|
1
|
104 MyStaticBitmap* m_staticBitmap6;
|
0
|
105
|
|
106 wxNotebook* m_notebook;
|
|
107 wxScrolledWindow* m_scrolledWindow1;
|
|
108 wxScrolledWindow* m_scrolledWindow2;
|
|
109 wxScrolledWindow* m_scrolledWindow3;
|
|
110 wxScrolledWindow* m_scrolledWindow4;
|
|
111 wxScrolledWindow* m_scrolledWindow5;
|
|
112 wxScrolledWindow* m_scrolledWindow6;
|
|
113
|
|
114 wxTextCtrl* m_textCtrlName;
|
|
115 wxTextCtrl* m_textCtrlAddr;
|
|
116 wxDataViewListCtrl* m_dataViewListCtrl;
|
|
117 wxDataViewColumn* m_dataViewListColumnNo;
|
|
118 wxDataViewColumn* m_dataViewListColumnDate;
|
|
119 wxTextCtrl* m_textCtrlLog;
|
|
120 wxSlider* m_slider;
|
5
|
121 wxButton* m_buttonPsearch;
|
0
|
122 wxButton* m_buttonPrint;
|
5
|
123 wxButton* m_buttonHelp;
|
3
|
124 wxButton* m_buttonLogout;
|
0
|
125
|
|
126 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 );
|
|
128 ~MainFrame();
|
3
|
129
|
2
|
130 void SetServer( wxString server ) { m_server = server; };
|
5
|
131 void SetUser( wxString user ) { m_user = user; WriteLog( wxT( "[login] " ) + m_user ); };
|
2
|
132 void CreateControls( void );
|
5
|
133 void SetAccelerator( void );
|
2
|
134 void Cmd( wxString cmd );
|
|
135 void Search( void );
|
5
|
136 void PasteSeaarch( void );
|
3
|
137 void LoadDB( void );
|
5
|
138 bool LoadBitmap( wxScrolledWindow* sc, wxStaticBitmap* sb, wxString file );
|
|
139 bool LoadBitmaps( wxString date, bool reload );
|
2
|
140 void GetImages( wxString hhs, wxString date );
|
3
|
141 void PrintImages( void );
|
5
|
142 void WriteLog( wxString msg );
|
2
|
143 void RemoveFile( wxString pattern );
|
|
144 void InDevelop( bool );
|
|
145
|
|
146 void OnItemSelected( wxDataViewEvent& event );
|
0
|
147 void OnItemDClicked( wxDataViewEvent& event );
|
|
148 void OnNBookChanged( wxBookCtrlEvent& event );
|
5
|
149 void OnPasteSearch( wxCommandEvent& event );
|
3
|
150 void OnPrint( wxCommandEvent& event );
|
|
151 void OnClose( wxCloseEvent& event ); // save config
|
|
152 void OnIdle( wxIdleEvent& event );
|
|
153 void OnTimer( wxTimerEvent& event );
|
5
|
154 void OnHelp( wxCommandEvent& event );
|
3
|
155 void OnLogout( wxCommandEvent& event );
|
0
|
156 };
|
|
157
|
|
158 #endif // __RSEARCH_H__
|
|
159
|