0
|
1 // Filename : rsearcher.h
|
3
|
2 // Last Change: 2018-10-11 –Ø 18:29:13.
|
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;
|
|
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 );
|
3
|
58 void OnStartRGesture( wxMouseEvent& event );
|
|
59 void OnEndRGesture( wxMouseEvent& event );
|
0
|
60 void OnMotion( wxMouseEvent& event );
|
|
61 void OnWheel( wxMouseEvent& event );
|
|
62 void SetImage( int i, wxBitmap bmp ) { m_bmp[i] = bmp; };
|
|
63 void SetZoom( int m_zoom );
|
|
64 };
|
|
65
|
|
66 class MainFrame : public wxFrame
|
|
67 {
|
|
68 DECLARE_EVENT_TABLE()
|
|
69 private:
|
2
|
70 bool startup = true;
|
|
71 wxString m_server;
|
|
72 wxString m_hhs;
|
3
|
73 wxString m_user;
|
2
|
74 wxArrayString m_index;
|
3
|
75 wxTimer m_timer;
|
0
|
76
|
|
77 protected:
|
|
78 enum {
|
|
79 ID_SEARCH = wxID_HIGHEST + 100,
|
|
80 ID_LIST,
|
|
81 ID_NBOOK,
|
|
82 ID_SLDR,
|
3
|
83 ID_TIMER,
|
|
84 ID_LOGOUT,
|
0
|
85 ID_TEST,
|
|
86 };
|
|
87
|
|
88 MySearchCtrl* m_searchCtrl;
|
|
89 MyStaticBitmap* m_staticBitmap1;
|
|
90 MyStaticBitmap* m_staticBitmap2;
|
|
91 MyStaticBitmap* m_staticBitmap3;
|
|
92 MyStaticBitmap* m_staticBitmap4;
|
|
93 MyStaticBitmap* m_staticBitmap5;
|
1
|
94 MyStaticBitmap* m_staticBitmap6;
|
0
|
95
|
|
96 wxNotebook* m_notebook;
|
|
97 wxScrolledWindow* m_scrolledWindow1;
|
|
98 wxScrolledWindow* m_scrolledWindow2;
|
|
99 wxScrolledWindow* m_scrolledWindow3;
|
|
100 wxScrolledWindow* m_scrolledWindow4;
|
|
101 wxScrolledWindow* m_scrolledWindow5;
|
|
102 wxScrolledWindow* m_scrolledWindow6;
|
|
103
|
|
104 wxTextCtrl* m_textCtrlName;
|
|
105 wxTextCtrl* m_textCtrlAddr;
|
|
106 wxDataViewListCtrl* m_dataViewListCtrl;
|
|
107 wxDataViewColumn* m_dataViewListColumnNo;
|
|
108 wxDataViewColumn* m_dataViewListColumnDate;
|
|
109 wxTextCtrl* m_textCtrlLog;
|
|
110 wxSlider* m_slider;
|
|
111 wxButton* m_buttonPrint;
|
3
|
112 wxButton* m_buttonLogout;
|
1
|
113 wxButton* m_buttonTest;
|
0
|
114
|
|
115 public:
|
|
116 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 );
|
|
117 ~MainFrame();
|
3
|
118
|
2
|
119 void SetServer( wxString server ) { m_server = server; };
|
3
|
120 void SetUser( wxString user ) { m_user = user; };
|
2
|
121 void CreateControls( void );
|
|
122 void Cmd( wxString cmd );
|
|
123 void Search( void );
|
3
|
124 void LoadDB( void );
|
2
|
125 void LoadBitmap( wxScrolledWindow* sc, wxStaticBitmap* sb, wxString file );
|
|
126 void LoadBitmaps( wxString date );
|
|
127 void GetImages( wxString hhs, wxString date );
|
3
|
128 void PrintImages( void );
|
2
|
129 void RemoveFile( wxString pattern );
|
|
130 void InDevelop( bool );
|
|
131
|
|
132 void OnItemSelected( wxDataViewEvent& event );
|
0
|
133 void OnItemDClicked( wxDataViewEvent& event );
|
|
134 void OnNBookChanged( wxBookCtrlEvent& event );
|
3
|
135 void OnPrint( wxCommandEvent& event );
|
|
136 void OnClose( wxCloseEvent& event ); // save config
|
|
137 void OnIdle( wxIdleEvent& event );
|
|
138 void OnTimer( wxTimerEvent& event );
|
|
139 void OnLogout( wxCommandEvent& event );
|
0
|
140 void OnTestButton( wxCommandEvent& event );
|
|
141 };
|
|
142
|
|
143
|
|
144 #endif // __RSEARCH_H__
|
|
145
|