0
|
1 // Filename : rsearcher.h
|
4
|
2 // Last Change: 2018-10-12 ‹à 16:16:26.
|
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>
|
0
|
32
|
|
33 class MySearchCtrl : public wxSearchCtrl
|
|
34 {
|
|
35 DECLARE_EVENT_TABLE()
|
|
36 public:
|
|
37 MySearchCtrl( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style );
|
|
38 ~MySearchCtrl();
|
|
39
|
|
40 void OnKey( wxKeyEvent& event );
|
|
41 };
|
|
42
|
|
43 class MyStaticBitmap : public wxStaticBitmap
|
|
44 {
|
|
45 private:
|
3
|
46 int m_dragx, m_dragy; // for image drag
|
|
47 int cx, cy; // for mouse-gesture
|
0
|
48 int m_zoom = 0;
|
|
49 wxBitmap m_bmp[5];
|
|
50 wxScrolledWindow* m_parent;
|
4
|
51 int select_tab = 0;
|
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 );
|
3
|
59 void OnStartRGesture( wxMouseEvent& event );
|
|
60 void OnEndRGesture( wxMouseEvent& event );
|
0
|
61 void OnMotion( wxMouseEvent& event );
|
|
62 void OnWheel( wxMouseEvent& event );
|
|
63 void SetImage( int i, wxBitmap bmp ) { m_bmp[i] = bmp; };
|
|
64 void SetZoom( int m_zoom );
|
4
|
65 void ChangeBook( int i );
|
0
|
66 };
|
|
67
|
|
68 class MainFrame : public wxFrame
|
|
69 {
|
|
70 DECLARE_EVENT_TABLE()
|
|
71 private:
|
2
|
72 bool startup = true;
|
|
73 wxString m_server;
|
|
74 wxString m_hhs;
|
3
|
75 wxString m_user;
|
2
|
76 wxArrayString m_index;
|
3
|
77 wxTimer m_timer;
|
0
|
78
|
|
79 protected:
|
|
80 MySearchCtrl* m_searchCtrl;
|
|
81 MyStaticBitmap* m_staticBitmap1;
|
|
82 MyStaticBitmap* m_staticBitmap2;
|
|
83 MyStaticBitmap* m_staticBitmap3;
|
|
84 MyStaticBitmap* m_staticBitmap4;
|
|
85 MyStaticBitmap* m_staticBitmap5;
|
1
|
86 MyStaticBitmap* m_staticBitmap6;
|
0
|
87
|
|
88 wxNotebook* m_notebook;
|
|
89 wxScrolledWindow* m_scrolledWindow1;
|
|
90 wxScrolledWindow* m_scrolledWindow2;
|
|
91 wxScrolledWindow* m_scrolledWindow3;
|
|
92 wxScrolledWindow* m_scrolledWindow4;
|
|
93 wxScrolledWindow* m_scrolledWindow5;
|
|
94 wxScrolledWindow* m_scrolledWindow6;
|
|
95
|
|
96 wxTextCtrl* m_textCtrlName;
|
|
97 wxTextCtrl* m_textCtrlAddr;
|
|
98 wxDataViewListCtrl* m_dataViewListCtrl;
|
|
99 wxDataViewColumn* m_dataViewListColumnNo;
|
|
100 wxDataViewColumn* m_dataViewListColumnDate;
|
|
101 wxTextCtrl* m_textCtrlLog;
|
|
102 wxSlider* m_slider;
|
|
103 wxButton* m_buttonPrint;
|
3
|
104 wxButton* m_buttonLogout;
|
1
|
105 wxButton* m_buttonTest;
|
0
|
106
|
|
107 public:
|
|
108 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 );
|
|
109 ~MainFrame();
|
3
|
110
|
2
|
111 void SetServer( wxString server ) { m_server = server; };
|
3
|
112 void SetUser( wxString user ) { m_user = user; };
|
2
|
113 void CreateControls( void );
|
|
114 void Cmd( wxString cmd );
|
|
115 void Search( void );
|
3
|
116 void LoadDB( void );
|
2
|
117 void LoadBitmap( wxScrolledWindow* sc, wxStaticBitmap* sb, wxString file );
|
|
118 void LoadBitmaps( wxString date );
|
|
119 void GetImages( wxString hhs, wxString date );
|
3
|
120 void PrintImages( void );
|
2
|
121 void RemoveFile( wxString pattern );
|
|
122 void InDevelop( bool );
|
|
123
|
|
124 void OnItemSelected( wxDataViewEvent& event );
|
0
|
125 void OnItemDClicked( wxDataViewEvent& event );
|
|
126 void OnNBookChanged( wxBookCtrlEvent& event );
|
3
|
127 void OnPrint( wxCommandEvent& event );
|
|
128 void OnClose( wxCloseEvent& event ); // save config
|
|
129 void OnIdle( wxIdleEvent& event );
|
|
130 void OnTimer( wxTimerEvent& event );
|
|
131 void OnLogout( wxCommandEvent& event );
|
0
|
132 void OnTestButton( wxCommandEvent& event );
|
|
133 };
|
|
134
|
|
135 #endif // __RSEARCH_H__
|
|
136
|