BT-MatML-Editor 0.1.4
Editor for the MatML 3.1 XML Schema
BT_MatML_Unit_GUI.h
1
2// Name: BT_MatML_Unit_GUI.h
3// Purpose: Classes of Unit_GUI Base and Derived.
4// Author: Paul McGrath
5// Modified by:
6// Created:
7// Copyright: (c) Paul McGrath
8// Licence: CC licence
10#pragma once
11
12
13// For compilers that support precompilation, includes "wx/wx.h".
14#include "wx/wxprec.h"
15
16
17#ifndef WX_PRECOMP
18#include "wx/wx.h"
19#endif
20
21#include "wx/dcsvg.h"
22#include "wx/notebook.h"
23#include <wx/statline.h>
24
25#include <boost/shared_ptr.hpp>
26#include <math.h>
27#include "StringStream.h"
28#include "matml31.hxx"
29
30#include "BT_MatML_Base_GUI.h"
31#include "BT_MatML_MatMLInfo_GUI.h"
32#include "BT_MatML_ID_GUI.h"
33
34#include "BT_MatML_GUI.h"
35#include "BT_MatML_MatMLTreeItemData.h"
36#include "BT_MatML_TreeCtrlSorted.h"
37
38namespace bellshire {
39
41 {
42 public:
43 wxNotebook* m_GUI;
44 wxTextCtrl* m_UnitNameTextCtrl;
45 wxCheckBox* m_UnitCurrencyCheckBox;
46 wxChoice* m_UnitCurrencyChoice;
47 wxTextCtrl* m_UnitPowerTextCtrl;
48 wxTextCtrl* m_UnitDescriptionTextCtrl;
49
51 Unit_GUI_Base(wxWindow* parent);
52 static wxNotebook* Create(wxWindow* parent, wxTextCtrl*& UnitNameTextCtrl, wxCheckBox*& UnitCurrencyCheckBox, wxChoice*& UnitCurrencyChoice, wxTextCtrl*& UnitPowerTextCtrl, wxTextCtrl*& UnitDescriptionTextCtrl);
53 virtual ~Unit_GUI_Base();
54
55 void Show(bool show = true) { if (m_GUI != nullptr) m_GUI->Show(show); };
56 bool IsShown() { return m_GUI->IsShown(); };
57 wxNotebook* get() { return m_GUI; };
58
59 void Update( Unit* element);
60 static wxTreeItemId SetupMatMLTreeCtrl(TreeCtrlSorted*& MatMLTreeCtrl,
61 const wxTreeItemId& ParentId,
62 Unit& Element,
63 const wxTreeItemId& PreviousId
64 );
65
66 void SetConnect();
67 virtual void OnUnitNotebook(wxNotebookEvent& event) { event.Skip(); }
68 virtual void OnUnitNameTextCtrl(wxCommandEvent& event) { event.Skip(); }
69 virtual void OnUnitCurrencyCheckBox(wxCommandEvent& event) { event.Skip(); }
70 virtual void OnUnitCurrencyChoice(wxCommandEvent& event) { event.Skip(); }
71 virtual void OnUnitPowerTextCtrl(wxCommandEvent& event) { event.Skip(); }
72 virtual void OnUnitDescriptionTextCtrl(wxCommandEvent& event) { event.Skip(); }
73
74 virtual void OnInsertName(wxCommandEvent& event) { event.Skip(); }
75 virtual void OnInsertCurrency(wxCommandEvent& event) { event.Skip(); }
76
77 virtual void OnDeleteName(wxCommandEvent& event) { event.Skip(); }
78
79 virtual void OnPasteName(wxCommandEvent& event){ event.Skip(); }
80 virtual void OnPasteCurrencyCode(wxCommandEvent& event){ event.Skip(); }
81
82 virtual void OnBumpDown(wxCommandEvent& event) { event.Skip(); }
83 virtual void OnBumpUp(wxCommandEvent& event) { event.Skip(); }
84
85 private:
86 };
87
88 class Unit_GUI : public Unit_GUI_Base
89 {
90 public:
91
92 TreeCtrlSorted* m_MatMLTreeCtrl;//Required before Event Handling.
93 ::boost::any m_MatMLItemToCopy;//Required before Paste Event Handling.
94
95 Unit_GUI();
96 Unit_GUI(wxWindow* parent);
97
98 virtual ~Unit_GUI();
99
100 void SetEvtHandlerVar(TreeCtrlSorted*& MatMLTreeCtrl);//Required before Event Handling.
101 void SetMatMLTreeCtrl(TreeCtrlSorted*& MatMLTreeCtrl);
102 void SetMatMLItemToCopy(const ::boost::any& MatMLItemToCopy);
103
104 //Overwrites the base class functions
105 void OnUnitNameTextCtrl(wxCommandEvent& event);
106 void OnUnitCurrencyCheckBox(wxCommandEvent& event);
107 void OnUnitCurrencyChoice(wxCommandEvent& event);
108 void OnUnitPowerTextCtrl(wxCommandEvent& event);
109 void OnUnitDescriptionTextCtrl(wxCommandEvent& event);
110
111 void OnInsertName(wxCommandEvent& event);
112 void OnInsertCurrency(wxCommandEvent& event);
113
114 void OnDeleteName(wxCommandEvent& event);
115
116 void OnPasteName(wxCommandEvent& event);
117 void OnPasteCurrencyCode(wxCommandEvent& event);
118
119 void OnBumpDown(wxCommandEvent& event);
120 void OnBumpUp(wxCommandEvent& event);
121
122 private:
123 };
124
125}; //namespace bellshire end
126
Definition: matml31.hxx:1705
Definition: matml31.hxx:3850
Definition: BT_MatML_Base_GUI.h:163
Definition: BT_MatML_TreeCtrlSorted.h:19
Definition: BT_MatML_Unit_GUI.h:41
static wxTreeItemId SetupMatMLTreeCtrl(TreeCtrlSorted *&MatMLTreeCtrl, const wxTreeItemId &ParentId, Unit &Element, const wxTreeItemId &PreviousId)
This set-up the Parent MatML Data into a wxTreeCtrl element and then call on the Children to do the s...
Definition: BT_MatML_Unit_GUI.cpp:193
static wxNotebook * Create(wxWindow *parent, wxTextCtrl *&UnitNameTextCtrl, wxCheckBox *&UnitCurrencyCheckBox, wxChoice *&UnitCurrencyChoice, wxTextCtrl *&UnitPowerTextCtrl, wxTextCtrl *&UnitDescriptionTextCtrl)
Create the GUI for the Unit MatML Data and Info
Definition: BT_MatML_Unit_GUI.cpp:47
Definition: BT_MatML_Unit_GUI.h:89
void SetEvtHandlerVar(TreeCtrlSorted *&MatMLTreeCtrl)
Function used to set up this objects member variables which is used in the EventHandler's functions....
Definition: BT_MatML_Unit_GUI.cpp:267
virtual ~Unit_GUI()
Destructor for the derived class
Definition: BT_MatML_Unit_GUI.cpp:258
void SetMatMLTreeCtrl(TreeCtrlSorted *&MatMLTreeCtrl)
Set the Event Handler associated with the MatML wxTreeCtrl Required before using the derived class's ...
Definition: BT_MatML_Unit_GUI.cpp:278
Unit_GUI()
Constructor for the derived class
Definition: BT_MatML_Unit_GUI.cpp:239
Contains the GUI and GUI associated classes. OnInit() calls the creation of the MaterialFrame GUI
Definition: BT_MatML_App.h:39