0
|
1 // Filename: mainframe.h
|
1
|
2 // Last Change: 2015-09-13 Sun 13:44:36.
|
0
|
3 //
|
|
4 #ifndef __MAINFRAME_H__
|
|
5 #define __MAINFRAME_H__
|
|
6
|
|
7 #include <wx/listctrl.h>
|
1
|
8 #include <wx/listbox.h>
|
0
|
9 #include <wx/gdicmn.h>
|
|
10 #include <wx/font.h>
|
|
11 #include <wx/colour.h>
|
|
12 #include <wx/settings.h>
|
|
13 #include <wx/string.h>
|
|
14 #include <wx/stattext.h>
|
|
15 #include <wx/button.h>
|
|
16 #include <wx/tglbtn.h>
|
|
17 #include <wx/sizer.h>
|
|
18 #include <wx/icon.h>
|
|
19 #include <wx/menu.h>
|
|
20 #include <wx/frame.h>
|
|
21 #include <wx/timer.h>
|
|
22
|
1
|
23 #include "qdata.h"
|
|
24 WX_DECLARE_HASH_MAP( int, QlipData*, wxIntegerHash, wxIntegerEqual, QlipDataHash );
|
|
25
|
0
|
26 class MainFrame : public wxFrame
|
|
27 {
|
|
28 DECLARE_EVENT_TABLE()
|
|
29 private:
|
1
|
30 wxTimer m_timer;
|
|
31 int m_current;
|
|
32 int m_counter;
|
|
33 int m_period;
|
|
34 bool m_bottom;
|
|
35 QlipDataHash QH;
|
0
|
36
|
|
37 protected:
|
|
38 enum
|
|
39 {
|
1
|
40 ID_MNAPPDIR = wxID_HIGHEST + 1,
|
|
41 ID_MNINTERVAL,
|
|
42 ID_MNABOUT,
|
0
|
43 ID_MNEXIT,
|
|
44 ID_MNLDPGIN,
|
|
45 ID_MNSVPGIN,
|
|
46
|
|
47 ID_TIMER,
|
|
48 ID_TGL,
|
1
|
49 ID_LISTVIEW,
|
|
50 ID_LISTBOX,
|
0
|
51
|
|
52 ID_BTNUP,
|
|
53 ID_BTNDOWN,
|
|
54 ID_BTNDEL,
|
|
55 ID_BTNADD,
|
|
56 ID_EXIT,
|
|
57 };
|
|
58
|
|
59 wxMenuBar* m_menubar;
|
|
60 wxMenu* m_menuFile;
|
|
61 wxMenu* m_menuPlugin;
|
|
62
|
|
63 wxTextCtrl* m_textCtrlShow;
|
1
|
64 wxTextCtrl* m_textCtrlRemain;
|
0
|
65 wxToggleButton* m_toggleBtn;
|
|
66
|
1
|
67 wxStaticText* m_staticTextCycle;
|
|
68 wxListView* m_lisViewCycle;
|
|
69 wxStaticText* m_staticTextHist;
|
|
70 wxListBox* m_listBoxHist;
|
0
|
71
|
|
72 wxButton* m_buttonUp;
|
|
73 wxButton* m_buttonDown;
|
|
74 wxButton* m_buttonDel;
|
|
75 wxButton* m_buttonAdd;
|
|
76 wxButton* m_buttonExit;
|
|
77
|
|
78 public:
|
|
79 MainFrame( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style );
|
|
80 ~MainFrame();
|
|
81
|
|
82 // Event Handlers
|
1
|
83 void OnMNAppdir( wxCommandEvent& );
|
|
84 void OnMNInterval( wxCommandEvent& );
|
0
|
85 void OnMNAbout( wxCommandEvent& );
|
|
86 void OnMNExit( wxCommandEvent& );
|
|
87 void OnMNLoad( wxCommandEvent& );
|
|
88 void OnMNSaveAs( wxCommandEvent& );
|
|
89
|
1
|
90 void OnLViewDClickItem( wxListEvent& );
|
|
91 void OnLViewSelectItem( wxListEvent& );
|
|
92 void OnLBoxDClickItem( wxCommandEvent& );
|
0
|
93
|
|
94 void OnToggle( wxCommandEvent& );
|
|
95 void OnTimer( wxTimerEvent& );
|
|
96
|
|
97 void OnBtnUp( wxCommandEvent& );
|
|
98 void OnBtnDown( wxCommandEvent& );
|
|
99 void OnBtnDel( wxCommandEvent& );
|
|
100 void OnBtnAdd( wxCommandEvent& );
|
|
101 void OnBtnExit( wxCommandEvent& );
|
|
102
|
|
103 // Functions
|
|
104 void EnableButtons( bool );
|
|
105 void SwapListItem( long, long );
|
|
106 void ReNumberList();
|
1
|
107 int CreateID();
|
|
108 void AddStackTime();
|
|
109 void UpdateView();
|
|
110 void UpdateHistory( wxString );
|
|
111 int GetEmptyStack();
|
|
112 int ToInt( wxString );
|
0
|
113 };
|
|
114
|
|
115 #endif //__MAINFRAME_H__
|
|
116
|