45
|
1 // Filename : searcher.h
|
48
|
2 // Last Change: 2020-04-22 水 16:26:06.
|
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;
|
|
82
|
|
83 MyStaticBitmap* m_staticBitmap1;
|
|
84 MyStaticBitmap* m_staticBitmap2;
|
|
85 MyStaticBitmap* m_staticBitmap3;
|
|
86 MyStaticBitmap* m_staticBitmap4;
|
|
87 MyStaticBitmap* m_staticBitmap5;
|
|
88
|
|
89 protected:
|
|
90 wxNotebook* m_notebook;
|
|
91
|
|
92 wxScrolledWindow* m_scrolledWindow1;
|
|
93 wxScrolledWindow* m_scrolledWindow2;
|
|
94 wxScrolledWindow* m_scrolledWindow3;
|
|
95 wxScrolledWindow* m_scrolledWindow4;
|
|
96 wxScrolledWindow* m_scrolledWindow5;
|
|
97 wxPanel* m_panelBatch;
|
|
98 wxPanel* m_panelMainte;
|
|
99
|
|
100 // Batch-Print
|
|
101 wxFilePickerCtrl* m_filePicker;
|
|
102 wxButton* m_buttonRead;
|
|
103 wxDataViewListCtrl* m_dataViewListCtrlBatch;
|
|
104 wxDataViewColumn* m_dataViewListColumnBPNo;
|
|
105 wxDataViewColumn* m_dataViewListColumnBPHno;
|
|
106 wxDataViewColumn* m_dataViewListColumnBPName;
|
|
107 wxDataViewColumn* m_dataViewListColumnBPDate;
|
|
108 wxDataViewColumn* m_dataViewListColumnOnlyIk;
|
|
109 wxDataViewColumn* m_dataViewListColumnProgress;
|
|
110 wxDataViewColumn* m_dataViewListColumnDummy;
|
|
111
|
|
112 // Index
|
|
113 wxStaticText* m_staticTextIndex;
|
|
114 wxStaticText* m_staticTextDrive;
|
|
115 wxStaticText* m_staticTextYear;
|
|
116 wxStaticText* m_staticTextDate;
|
46
|
117 wxStaticText* m_staticTextCcn;
|
45
|
118 wxStaticText* m_staticTextData;
|
|
119
|
46
|
120 wxStaticText* m_staticTextDB;
|
45
|
121 wxChoice* m_choiceIdxYear;
|
|
122 wxDataViewListCtrl* m_dataViewListCtrlIdxDate;
|
|
123 wxDataViewColumn* m_dataViewListColumnIdxDateNo;
|
|
124 wxDataViewColumn* m_dataViewListColumnIdxDate;
|
46
|
125 wxStaticText* m_staticTextIdxCcn;
|
45
|
126 wxDataViewListCtrl* m_dataViewListCtrlIdx;
|
|
127 wxDataViewColumn* m_dataViewListColumnIdxNo;
|
|
128 wxDataViewColumn* m_dataViewListColumnIdxHno;
|
|
129 wxDataViewColumn* m_dataViewListColumnIdxName;
|
46
|
130 // -
|
|
131 wxChoice* m_choiceDrv;
|
45
|
132 wxChoice* m_choiceDrvYear;
|
|
133 wxDataViewListCtrl* m_dataViewListCtrlDrvDate;
|
|
134 wxDataViewColumn* m_dataViewListColumnDrvDateNo;
|
|
135 wxDataViewColumn* m_dataViewListColumnDrvDate;
|
46
|
136 wxDataViewListCtrl* m_dataViewListCtrlDrvCcn;
|
|
137 wxDataViewColumn* m_dataViewListColumnDrvCcn;
|
45
|
138 wxDataViewListCtrl* m_dataViewListCtrlDrv;
|
|
139 wxDataViewColumn* m_dataViewListColumnDrvNo;
|
|
140 wxDataViewColumn* m_dataViewListColumnDrvHno;
|
|
141 wxDataViewColumn* m_dataViewListColumnDrvName;
|
|
142
|
|
143 wxStaticLine* m_staticline;
|
|
144
|
|
145 wxStaticText* m_staticTextDBmainte;
|
|
146 wxStaticText* m_staticTextHhsDB;
|
|
147 wxFilePickerCtrl* m_filePickerHhsDB;
|
|
148 wxButton* m_buttonRegHhs;
|
|
149 wxTextCtrl* m_textCtrlLastHhsDB;
|
|
150
|
|
151 wxStaticText* m_staticTextRegImg;
|
|
152 wxDatePickerCtrl* m_datePicker;
|
|
153 wxButton* m_buttonRegImg;
|
48
|
154 wxTextCtrl* m_textCtrlLastIndex;
|
45
|
155
|
|
156 // Right-Pane
|
|
157 wxSearchCtrl* m_searchCtrl;
|
|
158 wxButton* m_buttonHist;
|
|
159 wxTextCtrl* m_textCtrlName;
|
|
160 wxTextCtrl* m_textCtrlAddr;
|
|
161 wxDataViewListCtrl* m_dataViewListCtrlAny;
|
|
162 wxDataViewColumn* m_dataViewListColumnAnyNo;
|
|
163 wxDataViewColumn* m_dataViewListColumnAny1; // ymd, hno, kana
|
|
164 wxDataViewColumn* m_dataViewListColumnAny2; // -, name, name
|
|
165 wxDataViewColumn* m_dataViewListColumnAny3; // -, -, addr
|
|
166 wxDataViewColumn* m_dataViewListColumnAny4; // -, -, hno
|
|
167 wxCheckBox* m_checkBoxMask;
|
48
|
168 wxCheckBox* m_checkBoxBoth;
|
45
|
169 wxButton* m_buttonPrint;
|
|
170 wxSpinCtrl* m_spinCtrl;
|
48
|
171 wxGauge* m_gauge;
|
45
|
172 wxTextCtrl* m_textCtrlPasswd;
|
|
173
|
|
174 // Virtual event handlers, overide them in your derived class
|
|
175 virtual void OnChar(wxKeyEvent& event);
|
46
|
176 virtual void OnPageChanged(wxNotebookEvent& event);
|
45
|
177 virtual void OnFile(wxFileDirPickerEvent& event);
|
|
178 virtual void OnRead(wxCommandEvent& event);
|
|
179 virtual void OnHist(wxCommandEvent& event);
|
46
|
180 virtual void OnSelectBatchListCtrlA(wxKeyEvent& event);
|
48
|
181 virtual void OnSelectBatchDClicked(wxDataViewEvent& event);
|
45
|
182 virtual void OnSelectListAnyItem(wxDataViewEvent& event);
|
|
183 virtual void OnPrint(wxCommandEvent& event);
|
|
184 virtual void OnIdxYearChoice(wxCommandEvent& event);
|
|
185 virtual void OnIdxDateSelected(wxDataViewEvent& event);
|
48
|
186 virtual void OnIdxDClicked(wxDataViewEvent& event);
|
45
|
187 virtual void OnDrvYearChoice(wxCommandEvent& event);
|
46
|
188 virtual void OnDrvDateSelected(wxDataViewEvent& event);
|
45
|
189 virtual void OnDrvDateDClicked(wxDataViewEvent& event);
|
46
|
190 virtual void OnDrvCcnSelected(wxDataViewEvent& event);
|
|
191 virtual void OnDrvCcnDClicked(wxDataViewEvent& event);
|
45
|
192 virtual void OnDrvDClicked(wxDataViewEvent& event);
|
|
193 virtual void OnUploadHhsDB(wxCommandEvent& event);
|
|
194 virtual void OnUploadImage(wxCommandEvent& event);
|
|
195 virtual void OnClose(wxCloseEvent& event);
|
|
196
|
|
197 void CreateControls();
|
|
198 void InitializeControlsValue();
|
|
199 void SetHhsInfo(wxString h);
|
|
200 void SetListAny(wxString s);
|
|
201 void SetImages();
|
|
202 void LoadBookImage(MyStaticBitmap& mysb, wxString file);
|
|
203 void LoadBookImages();
|
|
204 void ReadCSV();
|
|
205 void RemoveTemp();
|
|
206 void MaskImage1();
|
|
207
|
|
208 public:
|
|
209 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);
|
|
210 ~SearchFrame();
|
|
211 };
|
|
212
|