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