45
|
1 // Filename : searcher.h
|
50
|
2 // Last Change: 2020-04-24 金 09:50:28.
|
45
|
3 //
|
|
4 #pragma once
|
|
5
|
|
6 #include <wx/artprov.h>
|
|
7 #include <wx/xrc/xmlres.h>
|
|
8 #include <wx/string.h>
|
|
9 #include <wx/stattext.h>
|
|
10 #include <wx/gdicmn.h>
|
|
11 #include <wx/font.h>
|
|
12 #include <wx/colour.h>
|
|
13 #include <wx/settings.h>
|
|
14 #include <wx/listctrl.h>
|
|
15 #include <wx/bitmap.h>
|
|
16 #include <wx/image.h>
|
|
17 #include <wx/icon.h>
|
|
18 #include <wx/button.h>
|
|
19 #include <wx/sizer.h>
|
|
20 #include <wx/frame.h>
|
|
21 #include <wx/dataview.h>
|
|
22 #include <wx/statbmp.h>
|
|
23 #include <wx/textctrl.h>
|
|
24 #include <wx/dateevt.h>
|
|
25 #include <wx/notebook.h>
|
|
26 #include <wx/srchctrl.h>
|
|
27 #include <wx/statline.h>
|
|
28 #include <wx/datectrl.h>
|
|
29 #include <wx/filepicker.h>
|
|
30 #include <wx/spinctrl.h>
|
|
31 #include <wx/choice.h>
|
|
32 #include <wx/listbox.h>
|
|
33 #include <wx/checkbox.h>
|
48
|
34 #include <wx/gauge.h>
|
45
|
35 #include <wx/scrolwin.h>
|
|
36 #include <wx/gbsizer.h>
|
|
37
|
46
|
38 class SearchFrame;
|
|
39
|
45
|
40 class MyStaticBitmap : public wxStaticBitmap
|
|
41 {
|
|
42 private:
|
|
43 int m_dragx, m_dragy; // for image drag
|
|
44 int cx, cy; // for mouse-gesture
|
|
45 //bool with_stl = false;
|
|
46 wxScrolledWindow* m_parent;
|
46
|
47 wxNotebook* m_parent1;
|
|
48 SearchFrame* m_parent2;
|
45
|
49
|
|
50 public:
|
|
51 int zoom = 0;
|
|
52
|
|
53 public:
|
|
54 MyStaticBitmap(wxScrolledWindow *parent, wxWindowID id, const wxBitmap &label, const wxPoint &pos, const wxSize &size, long style, const wxString &name);
|
|
55 ~MyStaticBitmap();
|
|
56
|
|
57 void OnLeftDown(wxMouseEvent& event);
|
|
58 void OnLeftUp(wxMouseEvent& event);
|
|
59 void OnLeftDClick(wxMouseEvent& event);
|
|
60 void OnRightDClick(wxMouseEvent& event);
|
|
61 void OnStartRGesture(wxMouseEvent& event);
|
|
62 void OnEndRGesture(wxMouseEvent& event);
|
|
63 void OnMotion(wxMouseEvent& event);
|
|
64 void OnWheel(wxMouseEvent& event);
|
46
|
65
|
|
66 void ChangeBook(int i);
|
|
67 void SetParentWidows(SearchFrame *sf, wxNotebook *nb) {m_parent2 = sf; m_parent1 = nb;};
|
45
|
68 void ParentWinGetSize(int *ww, int *wh) {m_parent->GetSize(ww, wh);};
|
|
69 void ParentWinScroll(int x, int y) {m_parent->Scroll(x, y);};
|
|
70 void ParentWinSetScrollbars(int x, int y, int s, int t) {m_parent->SetScrollbars(x, y, s, t);};
|
|
71 };
|
|
72
|
|
73 class SearchFrame : public wxFrame
|
|
74 {
|
|
75 private:
|
|
76 wxString m_workdir;
|
47
|
77 wxString m_hhscsv;
|
45
|
78 wxString m_addr, m_port;
|
|
79 wxRect m_mask1, m_mask2, m_mask3;
|
|
80 int m_searchmode;
|
|
81 wxArrayString m_hist;
|
49
|
82 wxString m_user, m_usergroup;
|
45
|
83
|
|
84 MyStaticBitmap* m_staticBitmap1;
|
|
85 MyStaticBitmap* m_staticBitmap2;
|
|
86 MyStaticBitmap* m_staticBitmap3;
|
|
87 MyStaticBitmap* m_staticBitmap4;
|
|
88 MyStaticBitmap* m_staticBitmap5;
|
|
89
|
|
90 protected:
|
|
91 wxNotebook* m_notebook;
|
|
92
|
|
93 wxScrolledWindow* m_scrolledWindow1;
|
|
94 wxScrolledWindow* m_scrolledWindow2;
|
|
95 wxScrolledWindow* m_scrolledWindow3;
|
|
96 wxScrolledWindow* m_scrolledWindow4;
|
|
97 wxScrolledWindow* m_scrolledWindow5;
|
|
98 wxPanel* m_panelBatch;
|
|
99 wxPanel* m_panelMainte;
|
|
100
|
|
101 // Batch-Print
|
|
102 wxFilePickerCtrl* m_filePicker;
|
|
103 wxButton* m_buttonRead;
|
|
104 wxDataViewListCtrl* m_dataViewListCtrlBatch;
|
|
105 wxDataViewColumn* m_dataViewListColumnBPNo;
|
|
106 wxDataViewColumn* m_dataViewListColumnBPHno;
|
|
107 wxDataViewColumn* m_dataViewListColumnBPName;
|
|
108 wxDataViewColumn* m_dataViewListColumnBPDate;
|
|
109 wxDataViewColumn* m_dataViewListColumnOnlyIk;
|
|
110 wxDataViewColumn* m_dataViewListColumnProgress;
|
|
111 wxDataViewColumn* m_dataViewListColumnDummy;
|
|
112
|
50
|
113 // Mainte(Index)
|
45
|
114 wxStaticText* m_staticTextIndex;
|
|
115 wxStaticText* m_staticTextDrive;
|
|
116 wxStaticText* m_staticTextYear;
|
|
117 wxStaticText* m_staticTextDate;
|
46
|
118 wxStaticText* m_staticTextCcn;
|
45
|
119 wxStaticText* m_staticTextData;
|
|
120
|
46
|
121 wxStaticText* m_staticTextDB;
|
45
|
122 wxChoice* m_choiceIdxYear;
|
|
123 wxDataViewListCtrl* m_dataViewListCtrlIdxDate;
|
|
124 wxDataViewColumn* m_dataViewListColumnIdxDateNo;
|
|
125 wxDataViewColumn* m_dataViewListColumnIdxDate;
|
46
|
126 wxStaticText* m_staticTextIdxCcn;
|
45
|
127 wxDataViewListCtrl* m_dataViewListCtrlIdx;
|
|
128 wxDataViewColumn* m_dataViewListColumnIdxNo;
|
|
129 wxDataViewColumn* m_dataViewListColumnIdxHno;
|
|
130 wxDataViewColumn* m_dataViewListColumnIdxName;
|
46
|
131 // -
|
|
132 wxChoice* m_choiceDrv;
|
45
|
133 wxChoice* m_choiceDrvYear;
|
|
134 wxDataViewListCtrl* m_dataViewListCtrlDrvDate;
|
|
135 wxDataViewColumn* m_dataViewListColumnDrvDateNo;
|
|
136 wxDataViewColumn* m_dataViewListColumnDrvDate;
|
46
|
137 wxDataViewListCtrl* m_dataViewListCtrlDrvCcn;
|
49
|
138 wxDataViewColumn* m_dataViewListColumnDrvCcnNo;
|
46
|
139 wxDataViewColumn* m_dataViewListColumnDrvCcn;
|
45
|
140 wxDataViewListCtrl* m_dataViewListCtrlDrv;
|
|
141 wxDataViewColumn* m_dataViewListColumnDrvNo;
|
|
142 wxDataViewColumn* m_dataViewListColumnDrvHno;
|
|
143 wxDataViewColumn* m_dataViewListColumnDrvName;
|
|
144
|
|
145 wxStaticLine* m_staticline;
|
|
146
|
|
147 wxStaticText* m_staticTextDBmainte;
|
|
148 wxStaticText* m_staticTextHhsDB;
|
|
149 wxFilePickerCtrl* m_filePickerHhsDB;
|
|
150 wxButton* m_buttonRegHhs;
|
|
151 wxTextCtrl* m_textCtrlLastHhsDB;
|
|
152
|
|
153 wxStaticText* m_staticTextRegImg;
|
|
154 wxDatePickerCtrl* m_datePicker;
|
|
155 wxButton* m_buttonRegImg;
|
48
|
156 wxTextCtrl* m_textCtrlLastIndex;
|
45
|
157
|
50
|
158 // Setup
|
|
159 wxPanel* m_panelSetup;
|
|
160 wxDataViewListCtrl* m_dataViewListCtrlPw;
|
|
161 wxDataViewColumn* m_dataViewListColumnUId;
|
|
162 wxDataViewColumn* m_dataViewListColumnUName;
|
|
163 wxDataViewColumn* m_dataViewListColumnUGroup;
|
|
164 wxDataViewColumn* m_dataViewListColumnUPw;
|
|
165 wxTextCtrl* m_textCtrlUPassword;
|
|
166 wxButton* m_buttonPw;
|
|
167
|
45
|
168 // Right-Pane
|
|
169 wxSearchCtrl* m_searchCtrl;
|
|
170 wxButton* m_buttonHist;
|
|
171 wxTextCtrl* m_textCtrlName;
|
|
172 wxTextCtrl* m_textCtrlAddr;
|
|
173 wxDataViewListCtrl* m_dataViewListCtrlAny;
|
|
174 wxDataViewColumn* m_dataViewListColumnAnyNo;
|
|
175 wxDataViewColumn* m_dataViewListColumnAny1; // ymd, hno, kana
|
|
176 wxDataViewColumn* m_dataViewListColumnAny2; // -, name, name
|
|
177 wxDataViewColumn* m_dataViewListColumnAny3; // -, -, addr
|
|
178 wxDataViewColumn* m_dataViewListColumnAny4; // -, -, hno
|
|
179 wxCheckBox* m_checkBoxMask;
|
48
|
180 wxCheckBox* m_checkBoxBoth;
|
45
|
181 wxButton* m_buttonPrint;
|
|
182 wxSpinCtrl* m_spinCtrl;
|
48
|
183 wxGauge* m_gauge;
|
45
|
184 wxTextCtrl* m_textCtrlPasswd;
|
|
185
|
|
186 // Virtual event handlers, overide them in your derived class
|
46
|
187 virtual void OnPageChanged(wxNotebookEvent& event);
|
49
|
188
|
45
|
189 virtual void OnFile(wxFileDirPickerEvent& event);
|
|
190 virtual void OnRead(wxCommandEvent& event);
|
49
|
191
|
46
|
192 virtual void OnSelectBatchListCtrlA(wxKeyEvent& event);
|
48
|
193 virtual void OnSelectBatchDClicked(wxDataViewEvent& event);
|
49
|
194
|
45
|
195 virtual void OnIdxYearChoice(wxCommandEvent& event);
|
|
196 virtual void OnIdxDateSelected(wxDataViewEvent& event);
|
48
|
197 virtual void OnIdxDClicked(wxDataViewEvent& event);
|
49
|
198
|
45
|
199 virtual void OnDrvYearChoice(wxCommandEvent& event);
|
46
|
200 virtual void OnDrvDateSelected(wxDataViewEvent& event);
|
45
|
201 virtual void OnDrvDateDClicked(wxDataViewEvent& event);
|
46
|
202 virtual void OnDrvCcnSelected(wxDataViewEvent& event);
|
|
203 virtual void OnDrvCcnDClicked(wxDataViewEvent& event);
|
45
|
204 virtual void OnDrvDClicked(wxDataViewEvent& event);
|
49
|
205
|
45
|
206 virtual void OnUploadHhsDB(wxCommandEvent& event);
|
|
207 virtual void OnUploadImage(wxCommandEvent& event);
|
49
|
208
|
50
|
209 virtual void OnUPassword(wxCommandEvent& event);
|
|
210 virtual void OnSavePw(wxCommandEvent& event);
|
|
211
|
49
|
212 virtual void OnChar(wxKeyEvent& event);
|
|
213 virtual void OnHist(wxCommandEvent& event);
|
|
214 virtual void OnSelectAnyListItem(wxDataViewEvent& event);
|
|
215 virtual void OnPrint(wxCommandEvent& event);
|
|
216 virtual void OnPassword(wxCommandEvent& event);
|
|
217
|
45
|
218 virtual void OnClose(wxCloseEvent& event);
|
|
219
|
|
220 void CreateControls();
|
|
221 void InitializeControlsValue();
|
|
222 void SetHhsInfo(wxString h);
|
|
223 void SetListAny(wxString s);
|
|
224 void SetImages();
|
|
225 void LoadBookImage(MyStaticBitmap& mysb, wxString file);
|
|
226 void LoadBookImages();
|
|
227 void ReadCSV();
|
50
|
228 void LoadPasswd(bool show);
|
|
229 void SavePasswd();
|
45
|
230 void RemoveTemp();
|
|
231 void MaskImage1();
|
|
232
|
|
233 public:
|
|
234 SearchFrame(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 800,697 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL);
|
|
235 ~SearchFrame();
|
|
236 };
|
|
237
|