TBTK
Need a break? Support the development by playing Polarity Puzzles
IndexPanel.h
1 /* Copyright 2017 Kristofer Björnson
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
17 
24 #ifndef COM_DAFER45_TBTK_INDEX_PANEL
25 #define COM_DAFER45_TBTK_INDEX_PANEL
26 
27 #include "TBTK/Index.h"
28 
29 #include <wx/wx.h>
30 #include <wx/sizer.h>
31 
32 namespace TBTK{
33 
34 class IndexPanel : public wxPanel{
35 public:
37  IndexPanel(wxWindow *parent, wxWindowID id = wxID_ANY);
38 
40  ~IndexPanel();
41 
43  void setIndex(const Index &index);
44 
46  const Index& getIndex() const;
47 
49  void onPaintEvent(wxPaintEvent &event);
50 
52  void onSizeEvent(wxSizeEvent &event);
53 
55  void onIndexChanged(wxCommandEvent &event);
56 
58  void redraw();
59 protected:
60  DECLARE_EVENT_TABLE();
61 private:
63  Index index;
64 
66  wxStaticText indexLabel;
67 
69  wxTextCtrl indexTextBox;
70 
71  static const wxWindowID INDEX_ID;
72 };
73 
74 inline const Index& IndexPanel::getIndex() const{
75  return index;
76 }
77 
78 }; //End namespace TBTK
79 
80 #endif
81 
Physical index.
Definition: Boolean.h:32