BT-MatML-Editor 0.1.4
Editor for the MatML 3.1 XML Schema
BT_MatML_Qualifier_GUI.h
1
2// Name: BT_MatML_Qualifier_GUI.h
3// Purpose: Classes of Qualifier_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
33#include "BT_MatML_GUI.h"
34#include "BT_MatML_MatMLTreeItemData.h"
35#include "BT_MatML_TreeCtrlSorted.h"
36
37namespace bellshire {
38
40 {
41 public:
42 wxNotebook* m_GUI;
43 wxTextCtrl* m_QualifierTextCtrl;
44 wxButton* m_ValidationButton;
45 wxCheckBox* m_ValidationNewLineRemovalCheckBox;
46
48 Qualifier_GUI_Base(wxWindow* parent);
49 static wxNotebook* Create(wxWindow* parent,
50 wxTextCtrl*& QualifierTextCtrl,
51 wxButton*& ValidationButton,
52 wxCheckBox*& ValidationNewLineRemovalCheckBox
53 );
54 virtual ~Qualifier_GUI_Base();
55
56 void Show(bool show = true) { if (m_GUI != nullptr) m_GUI->Show(show); };
57 bool IsShown() { return m_GUI->IsShown(); };
58 wxNotebook* get() { return m_GUI; };
59
60 void Update( Qualifier* element);
61 static wxTreeItemId SetupMatMLTreeCtrl(TreeCtrlSorted*& MatMLTreeCtrl,
62 const wxTreeItemId& ParentId,
64 const wxTreeItemId& PreviousId
65 );
66
67 void SetConnect();
68 virtual void OnQualifierTextCtrlKillFocus(wxCommandEvent& event) { event.Skip(); }
69 virtual void OnValidationButtonButton(wxCommandEvent& event) { event.Skip(); }
70
71 virtual void OnBumpDown(wxCommandEvent& event) { event.Skip(); }
72 virtual void OnBumpUp(wxCommandEvent& event) { event.Skip(); }
73
74 private:
75 };
76
78 {
79 public:
80
81 TreeCtrlSorted* m_MatMLTreeCtrl;//Required before Event Handling.
82
84 Qualifier_GUI(wxWindow* parent);
85
86 virtual ~Qualifier_GUI();
87
88 void SetEvtHandlerVar(TreeCtrlSorted*& MatMLTreeCtrl);//Required before Event Handling.
89 void SetMatMLTreeCtrl(TreeCtrlSorted*& MatMLTreeCtrl);
90
91 //Overwrites the base class functions
92 void OnQualifierTextCtrlKillFocus(wxCommandEvent& event);
93 void OnValidationButtonButton(wxCommandEvent& event);
94
95 void OnBumpDown(wxCommandEvent& event);
96 void OnBumpUp(wxCommandEvent& event);
97
98 private:
99 // validator for wxWidget Data1textCtrl
100 class TextCtrlValidator : public wxValidator, public StringValidator
101 {
102 public:
103 TreeCtrlSorted* m_MatMLTreeCtrl;
104 wxCheckBox* m_ValidationNewLineRemovalCheckBox;
105
106 TextCtrlValidator(TreeCtrlSorted* MatMLTreeCtrl,
107 wxCheckBox* ValidationNewLineRemovalCheckBox
108 ) : m_MatMLTreeCtrl(MatMLTreeCtrl),
109 m_ValidationNewLineRemovalCheckBox(ValidationNewLineRemovalCheckBox)
110 { };
111
112 virtual bool Validate(wxWindow* parent) wxOVERRIDE;
113 virtual wxObject* Clone() const wxOVERRIDE { return new TextCtrlValidator(*this); }
114
115 // Called to transfer data to the window
116 virtual bool TransferToWindow() wxOVERRIDE;
117
118 // Called to transfer data from the window
119 virtual bool TransferFromWindow() wxOVERRIDE;
120
121
122 private:
123
124 };
125
126 TextCtrlValidator* m_TextCtrlValidator;
127 };
128
129}; //namespace bellshire end
130
Definition: matml31.hxx:1705
Definition: matml31.hxx:3429
Definition: BT_MatML_Base_GUI.h:163
Definition: BT_MatML_Qualifier_GUI.h:40
static wxTreeItemId SetupMatMLTreeCtrl(TreeCtrlSorted *&MatMLTreeCtrl, const wxTreeItemId &ParentId, Qualifier &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_Qualifier_GUI.cpp:120
static wxNotebook * Create(wxWindow *parent, wxTextCtrl *&QualifierTextCtrl, wxButton *&ValidationButton, wxCheckBox *&ValidationNewLineRemovalCheckBox)
Create the GUI for the Qualifier MatML Data and Info
Definition: BT_MatML_Qualifier_GUI.cpp:41
Definition: BT_MatML_Qualifier_GUI.h:78
virtual ~Qualifier_GUI()
Destructor for the derived class
Definition: BT_MatML_Qualifier_GUI.cpp:180
void SetMatMLTreeCtrl(TreeCtrlSorted *&MatMLTreeCtrl)
Set the Event Handler associated with the MatML wxTreeCtrl Required before using the derived class's ...
Definition: BT_MatML_Qualifier_GUI.cpp:205
void SetEvtHandlerVar(TreeCtrlSorted *&MatMLTreeCtrl)
Function used to set up this objects member variables which is used in the EventHandler's functions....
Definition: BT_MatML_Qualifier_GUI.cpp:191
Qualifier_GUI()
Constructor for the derived class
Definition: BT_MatML_Qualifier_GUI.cpp:156
Definition: BT_MatML_StringValidator.h:23
Definition: BT_MatML_TreeCtrlSorted.h:19
Contains the GUI and GUI associated classes. OnInit() calls the creation of the MaterialFrame GUI
Definition: BT_MatML_App.h:39