BT-MatML-Editor 0.1.4
Editor for the MatML 3.1 XML Schema
BT_MatML_Scale_GUI.h
1
2// Name: BT_MatML_Scale_GUI.h
3// Purpose: Classes of Scale_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#include <wx/checkbox.h>
25
26#include <boost/shared_ptr.hpp>
27#include <boost/lexical_cast.hpp>
28#include <boost/algorithm/string.hpp>
29#include <boost/algorithm/string/classification.hpp>
30
31#include <math.h>
32#include "StringStream.h"
33#include "matml31.hxx"
34
35#include "BT_MatML_Base_GUI.h"
36#include "BT_MatML_MatMLInfo_GUI.h"
37
38#include "BT_MatML_GUI.h"
39#include "BT_MatML_MatMLTreeItemData.h"
40#include "BT_MatML_TreeCtrlSorted.h"
41
42#include "BT_MatML_StringValidator.h"
43
44namespace bellshire {
45
47 {
48 public:
49 wxNotebook* m_GUI;
50 wxChoice* m_ScaleChoice;
51
52 Scale_GUI_Base();//ctor
53 Scale_GUI_Base(wxWindow* parent);//ctor
54 virtual ~Scale_GUI_Base();//dtor
55
56 static wxNotebook* Create(wxWindow* parent,
57 wxChoice*& ScaleChoice
58 );
59
60 void Show(bool show = true) { if (m_GUI != nullptr) m_GUI->Show(show); };
61 bool IsShown() { return m_GUI->IsShown(); };
62 wxNotebook* get() { return m_GUI; };
63
64 void Update( Scale* element);
65 static wxTreeItemId SetupMatMLTreeCtrl(TreeCtrlSorted*& MatMLTreeCtrl,
66 const wxTreeItemId& ParentId,
67 Scale& Element,
68 const wxTreeItemId& PreviousId
69 );
70
71 void SetConnect();
72 virtual void OnScaleChoiceKillFocus(wxCommandEvent& event) { event.Skip(); }
73
74 private:
75 };
76
78 {
79 public:
80
81 Scale_GUI();//ctor
82 Scale_GUI(wxWindow* parent);//ctor
83
84 virtual ~Scale_GUI();//dtor
85
86 void SetEvtHandlerVar(TreeCtrlSorted*& MatMLTreeCtrl);//Required before Event Handling.
87
88 // Overwrites the base class functions
89 void OnScaleChoiceKillFocus(wxCommandEvent& event);
90
91 // validator for wxWidget ScaletextCtrl
92 class ScaleChoiceValidator : public wxValidator
93 {
94 public:
95 TreeCtrlSorted* m_MatMLTreeCtrl;
96
98 ) : m_MatMLTreeCtrl(MatMLTreeCtrl)
99 { };
100
101 virtual bool Validate(wxWindow* parent) wxOVERRIDE;
102 virtual wxObject* Clone() const wxOVERRIDE { return new ScaleChoiceValidator(*this); }
103
104 // Called to transfer data to the window
105 virtual bool TransferToWindow() wxOVERRIDE;
106
107 // Called to transfer data from the window
108 virtual bool TransferFromWindow() wxOVERRIDE;
109
110 private:
111
112 };
113
114 private:
115 ScaleChoiceValidator* m_ScaleChoiceValidator;
116
117 };
118
119}; //namespace bellshire end
120
Definition: matml31.hxx:1705
Definition: matml31.hxx:5963
Definition: BT_MatML_Base_GUI.h:163
Definition: BT_MatML_Scale_GUI.h:93
Definition: BT_MatML_Scale_GUI.h:47
static wxNotebook * Create(wxWindow *parent, wxChoice *&ScaleChoice)
Create the GUI for the Data MatML Data and Info
Definition: BT_MatML_Scale_GUI.cpp:31
static wxTreeItemId SetupMatMLTreeCtrl(TreeCtrlSorted *&MatMLTreeCtrl, const wxTreeItemId &ParentId, Scale &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_Scale_GUI.cpp:91
Definition: BT_MatML_Scale_GUI.h:78
void SetEvtHandlerVar(TreeCtrlSorted *&MatMLTreeCtrl)
Function used to set up this objects member variables which is used in the EventHandler's functions....
Definition: BT_MatML_Scale_GUI.cpp:161
virtual ~Scale_GUI()
Destructor for the derived class
Definition: BT_MatML_Scale_GUI.cpp:150
Scale_GUI()
Constructor for the derived class
Definition: BT_MatML_Scale_GUI.cpp:127
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