TBTK
IndexPanel.h
Go to the documentation of this file.
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 
23 #ifndef COM_DAFER45_TBTK_INDEX_PANEL
24 #define COM_DAFER45_TBTK_INDEX_PANEL
25 
26 #include "TBTK/Index.h"
27 
28 #include <wx/wx.h>
29 #include <wx/sizer.h>
30 
31 namespace TBTK{
32 
33 class IndexPanel : public wxPanel{
34 public:
36  IndexPanel(wxWindow *parent, wxWindowID id = wxID_ANY);
37 
39  ~IndexPanel();
40 
42  void setIndex(const Index &index);
43 
45  const Index& getIndex() const;
46 
48  void onPaintEvent(wxPaintEvent &event);
49 
51  void onSizeEvent(wxSizeEvent &event);
52 
54  void onIndexChanged(wxCommandEvent &event);
55 
57  void redraw();
58 protected:
59  DECLARE_EVENT_TABLE();
60 private:
62  Index index;
63 
65  wxStaticText indexLabel;
66 
68  wxTextCtrl indexTextBox;
69 
70  static const wxWindowID INDEX_ID;
71 };
72 
73 inline const Index& IndexPanel::getIndex() const{
74  return index;
75 }
76 
77 }; //End namespace TBTK
78 
79 #endif
void setIndex(const Index &index)
Flexible physical index.
void onIndexChanged(wxCommandEvent &event)
IndexPanel(wxWindow *parent, wxWindowID id=wxID_ANY)
Flexible physical index.
Definition: Index.h:70
Definition: ModelFactory.h:35
Definition: IndexPanel.h:33
const Index & getIndex() const
Definition: IndexPanel.h:73
void onPaintEvent(wxPaintEvent &event)
void onSizeEvent(wxSizeEvent &event)