45
|
1 // Filename : searcher.h
|
47
|
2 // Last Change: 2020-04-21 火 09:23:17.
|
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>
|
|
34 #include <wx/scrolwin.h>
|
|
35 #include <wx/gbsizer.h>
|
|
36
|
46
|
37 class SearchFrame;
|
|
38
|
45
|
39 class MyStaticBitmap : public wxStaticBitmap
|
|
40 {
|
|
41 private:
|
|
42 int m_dragx, m_dragy; // for image drag
|
|
43 int cx, cy; // for mouse-gesture
|
|
44 //bool with_stl = false;
|
|
45 wxScrolledWindow* m_parent;
|
46
|
46 wxNotebook* m_parent1;
|
|
47 SearchFrame* m_parent2;
|
45
|
48
|
|
49 public:
|
|
50 int zoom = 0;
|
|
51
|
|
52 public:
|
|
53 MyStaticBitmap(wxScrolledWindow *parent, wxWindowID id, const wxBitmap &label, const wxPoint &pos, const wxSize &size, long style, const wxString &name);
|
|
54 ~MyStaticBitmap();
|
|
55
|
|
56 void OnLeftDown(wxMouseEvent& event);
|
|
57 void OnLeftUp(wxMouseEvent& event);
|
|
58 void OnLeftDClick(wxMouseEvent& event);
|
|
59 void OnRightDClick(wxMouseEvent& event);
|
|
60 void OnStartRGesture(wxMouseEvent& event);
|
|
61 void OnEndRGesture(wxMouseEvent& event);
|
|
62 void OnMotion(wxMouseEvent& event);
|
|
63 void OnWheel(wxMouseEvent& event);
|
46
|
64
|
|
65 void ChangeBook(int i);
|
|
66 void SetParentWidows(SearchFrame *sf, wxNotebook *nb) {m_parent2 = sf; m_parent1 = nb;};
|
45
|
67 void ParentWinGetSize(int *ww, int *wh) {m_parent->GetSize(ww, wh);};
|
|
68 void ParentWinScroll(int x, int y) {m_parent->Scroll(x, y);};
|
|
69 void ParentWinSetScrollbars(int x, int y, int s, int t) {m_parent->SetScrollbars(x, y, s, t);};
|
|
70 };
|
|
71
|
|
72 class SearchFrame : public wxFrame
|
|
73 {
|
|
74 private:
|
|
75 wxString m_workdir;
|
47
|
76 wxString m_hhscsv;
|
45
|
77 wxString m_addr, m_port;
|
|
78 wxRect m_mask1, m_mask2, m_mask3;
|
|
79 int m_searchmode;
|
|
80 wxArrayString m_hist;
|
|
81
|
|
82 MyStaticBitmap* m_staticBitmap1;
|
|
83 MyStaticBitmap* m_staticBitmap2;
|
|
84 MyStaticBitmap* m_staticBitmap3;
|
|
85 MyStaticBitmap* m_staticBitmap4;
|
|
86 MyStaticBitmap* m_staticBitmap5;
|
|
87
|
|
88 protected:
|
|
89 wxNotebook* m_notebook;
|
|
90
|
|
91 wxScrolledWindow* m_scrolledWindow1;
|
|
92 wxScrolledWindow* m_scrolledWindow2;
|
|
93 wxScrolledWindow* m_scrolledWindow3;
|
|
94 wxScrolledWindow* m_scrolledWindow4;
|
|
95 wxScrolledWindow* m_scrolledWindow5;
|
|
96 wxPanel* m_panelBatch;
|
|
97 wxPanel* m_panelMainte;
|
|
98
|
|
99 // Batch-Print
|
|
100 wxFilePickerCtrl* m_filePicker;
|
|
101 wxButton* m_buttonRead;
|
|
102 wxDataViewListCtrl* m_dataViewListCtrlBatch;
|
|
103 wxDataViewColumn* m_dataViewListColumnBPNo;
|
|
104 wxDataViewColumn* m_dataViewListColumnBPHno;
|
|
105 wxDataViewColumn* m_dataViewListColumnBPName;
|
|
106 wxDataViewColumn* m_dataViewListColumnBPDate;
|
|
107 wxDataViewColumn* m_dataViewListColumnOnlyIk;
|
|
108 wxDataViewColumn* m_dataViewListColumnProgress;
|
|
109 wxDataViewColumn* m_dataViewListColumnDummy;
|
|
110
|
|
111 // Index
|
|
112 wxStaticText* m_staticTextIndex;
|
|
113 wxStaticText* m_staticTextDrive;
|
|
114 wxStaticText* m_staticTextYear;
|
|
115 wxStaticText* m_staticTextDate;
|
46
|
116 wxStaticText* m_staticTextCcn;
|
45
|
117 wxStaticText* m_staticTextData;
|
|
118
|
46
|
119 wxStaticText* m_staticTextDB;
|
45
|
120 wxChoice* m_choiceIdxYear;
|
|
121 wxDataViewListCtrl* m_dataViewListCtrlIdxDate;
|
|
122 wxDataViewColumn* m_dataViewListColumnIdxDateNo;
|
|
123 wxDataViewColumn* m_dataViewListColumnIdxDate;
|
46
|
124 wxStaticText* m_staticTextIdxCcn;
|
45
|
125 wxDataViewListCtrl* m_dataViewListCtrlIdx;
|
|
126 wxDataViewColumn* m_dataViewListColumnIdxNo;
|
|
127 wxDataViewColumn* m_dataViewListColumnIdxHno;
|
|
128 wxDataViewColumn* m_dataViewListColumnIdxName;
|
46
|
129 // -
|
|
130 wxChoice* m_choiceDrv;
|
45
|
131 wxChoice* m_choiceDrvYear;
|
|
132 wxDataViewListCtrl* m_dataViewListCtrlDrvDate;
|
|
133 wxDataViewColumn* m_dataViewListColumnDrvDateNo;
|
|
134 wxDataViewColumn* m_dataViewListColumnDrvDate;
|
46
|
135 wxDataViewListCtrl* m_dataViewListCtrlDrvCcn;
|
|
136 wxDataViewColumn* m_dataViewListColumnDrvCcn;
|
45
|
137 wxDataViewListCtrl* m_dataViewListCtrlDrv;
|
|
138 wxDataViewColumn* m_dataViewListColumnDrvNo;
|
|
139 wxDataViewColumn* m_dataViewListColumnDrvHno;
|
|
140 wxDataViewColumn* m_dataViewListColumnDrvName;
|
|
141
|
|
142 wxStaticLine* m_staticline;
|
|
143
|
|
144 wxStaticText* m_staticTextDBmainte;
|
|
145 wxStaticText* m_staticTextHhsDB;
|
|
146 wxFilePickerCtrl* m_filePickerHhsDB;
|
|
147 wxButton* m_buttonRegHhs;
|
|
148 wxTextCtrl* m_textCtrlLastHhsDB;
|
|
149
|
|
150 wxStaticText* m_staticTextRegImg;
|
|
151 wxDatePickerCtrl* m_datePicker;
|
|
152 wxButton* m_buttonRegImg;
|
|
153
|
|
154 // Right-Pane
|
|
155 wxSearchCtrl* m_searchCtrl;
|
|
156 wxButton* m_buttonHist;
|
|
157 wxTextCtrl* m_textCtrlName;
|
|
158 wxTextCtrl* m_textCtrlAddr;
|
|
159 wxDataViewListCtrl* m_dataViewListCtrlAny;
|
|
160 wxDataViewColumn* m_dataViewListColumnAnyNo;
|
|
161 wxDataViewColumn* m_dataViewListColumnAny1; // ymd, hno, kana
|
|
162 wxDataViewColumn* m_dataViewListColumnAny2; // -, name, name
|
|
163 wxDataViewColumn* m_dataViewListColumnAny3; // -, -, addr
|
|
164 wxDataViewColumn* m_dataViewListColumnAny4; // -, -, hno
|
|
165 wxListBox* m_listBox2;
|
|
166 wxCheckBox* m_checkBoxMask;
|
|
167 wxButton* m_buttonPrint;
|
|
168 wxSpinCtrl* m_spinCtrl;
|
|
169 wxTextCtrl* m_textCtrlPasswd;
|
|
170
|
|
171 // Virtual event handlers, overide them in your derived class
|
|
172 virtual void OnChar(wxKeyEvent& event);
|
46
|
173 virtual void OnPageChanged(wxNotebookEvent& event);
|
45
|
174 virtual void OnFile(wxFileDirPickerEvent& event);
|
|
175 virtual void OnRead(wxCommandEvent& event);
|
|
176 virtual void OnHist(wxCommandEvent& event);
|
46
|
177 virtual void OnSelectBatchListCtrlA(wxKeyEvent& event);
|
|
178 virtual void OnSelectBatchDClick(wxDataViewEvent& event);
|
45
|
179 virtual void OnSelectListAnyItem(wxDataViewEvent& event);
|
|
180 virtual void OnPrint(wxCommandEvent& event);
|
|
181 virtual void OnIdxYearChoice(wxCommandEvent& event);
|
|
182 virtual void OnIdxDateSelected(wxDataViewEvent& event);
|
|
183 virtual void OnDrvYearChoice(wxCommandEvent& event);
|
46
|
184 virtual void OnDrvDateSelected(wxDataViewEvent& event);
|
45
|
185 virtual void OnDrvDateDClicked(wxDataViewEvent& event);
|
46
|
186 virtual void OnDrvCcnSelected(wxDataViewEvent& event);
|
|
187 virtual void OnDrvCcnDClicked(wxDataViewEvent& event);
|
45
|
188 virtual void OnDrvDClicked(wxDataViewEvent& event);
|
|
189 virtual void OnUploadHhsDB(wxCommandEvent& event);
|
|
190 virtual void OnUploadImage(wxCommandEvent& event);
|
|
191 virtual void OnClose(wxCloseEvent& event);
|
|
192
|
|
193 void CreateControls();
|
|
194 void InitializeControlsValue();
|
|
195 void SetHhsInfo(wxString h);
|
|
196 void SetListAny(wxString s);
|
|
197 void SetImages();
|
|
198 void LoadBookImage(MyStaticBitmap& mysb, wxString file);
|
|
199 void LoadBookImages();
|
|
200 void ReadCSV();
|
|
201 void RemoveTemp();
|
|
202 void MaskImage1();
|
|
203
|
|
204 public:
|
|
205 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);
|
|
206 ~SearchFrame();
|
|
207 };
|
|
208
|