Blame view

GUI/SW1/SRC/MESH_PARAM.cpp 5.3 KB
886c558b   Steve Greedy   SACAMOS Public Re...
1
2
3
4
5
6
7
8
9
10
11
12
13
#include "MESH_PARAM.h"

//(*InternalHeaders(MESH_PARAM)
#include <wx/settings.h>
#include <wx/intl.h>
#include <wx/string.h>
//*)

//(*IdInit(MESH_PARAM)
const long MESH_PARAM::ID_STATICTEXT1 = wxNewId();
const long MESH_PARAM::ID_TEXTCTRL1 = wxNewId();
const long MESH_PARAM::ID_STATICTEXT2 = wxNewId();
const long MESH_PARAM::ID_TEXTCTRL2 = wxNewId();
dd86ff43   Steve Greedy   Updates to SW1
14
15
16
17
const long MESH_PARAM::ID_STATICTEXT3 = wxNewId();
const long MESH_PARAM::ID_TEXTCTRL3 = wxNewId();
const long MESH_PARAM::ID_STATICTEXT4 = wxNewId();
const long MESH_PARAM::ID_TEXTCTRL4 = wxNewId();
886c558b   Steve Greedy   SACAMOS Public Re...
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
const long MESH_PARAM::ID_BUTTON1 = wxNewId();
const long MESH_PARAM::ID_BUTTON2 = wxNewId();
//*)

BEGIN_EVENT_TABLE(MESH_PARAM,wxDialog)
	//(*EventTable(MESH_PARAM)
	//*)
END_EVENT_TABLE()

MESH_PARAM::MESH_PARAM(wxWindow* parent,wxWindowID id,const wxPoint& pos,const wxSize& size)
{
	//(*Initialize(MESH_PARAM)
	wxFlexGridSizer* FlexGridSizer2;
	wxBoxSizer* BoxSizer1;
	wxStaticBoxSizer* StaticBoxSizer1;
	wxFlexGridSizer* FlexGridSizer1;

	Create(parent, id, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE, _T("id"));
	SetClientSize(wxDefaultSize);
	Move(wxDefaultPosition);
	FlexGridSizer1 = new wxFlexGridSizer(0, 3, 0, 0);
	StaticBoxSizer1 = new wxStaticBoxSizer(wxVERTICAL, this, _("SACAMOS: Laplace Mesh Parameters"));
	FlexGridSizer2 = new wxFlexGridSizer(0, 2, 0, 0);
	StaticText1 = new wxStaticText(this, ID_STATICTEXT1, _("Boundary Constant"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT1"));
dd86ff43   Steve Greedy   Updates to SW1
42
	FlexGridSizer2->Add(StaticText1, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
886c558b   Steve Greedy   SACAMOS Public Re...
43
44
45
46
	TextCtrl1 = new wxTextCtrl(this, ID_TEXTCTRL1, _("3"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL1"));
	TextCtrl1->SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
	FlexGridSizer2->Add(TextCtrl1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	StaticText2 = new wxStaticText(this, ID_STATICTEXT2, _("Surface Mesh Constant"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT2"));
dd86ff43   Steve Greedy   Updates to SW1
47
	FlexGridSizer2->Add(StaticText2, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
886c558b   Steve Greedy   SACAMOS Public Re...
48
49
	TextCtrl2 = new wxTextCtrl(this, ID_TEXTCTRL2, _("3"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL2"));
	FlexGridSizer2->Add(TextCtrl2, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
dd86ff43   Steve Greedy   Updates to SW1
50
51
52
53
54
55
56
57
58
	StaticText3 = new wxStaticText(this, ID_STATICTEXT3, _("Max Mesh Edge Length"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT3"));
	FlexGridSizer2->Add(StaticText3, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl3 = new wxTextCtrl(this, ID_TEXTCTRL3, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL3"));
	FlexGridSizer2->Add(TextCtrl3, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	StaticText4 = new wxStaticText(this, ID_STATICTEXT4, _("Ground Plane Mesh Edge Length"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT4"));
	FlexGridSizer2->Add(StaticText4, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl4 = new wxTextCtrl(this, ID_TEXTCTRL4, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL4"));
	FlexGridSizer2->Add(TextCtrl4, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	StaticBoxSizer1->Add(FlexGridSizer2, 3, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
886c558b   Steve Greedy   SACAMOS Public Re...
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
	BoxSizer1 = new wxBoxSizer(wxHORIZONTAL);
	Button1 = new wxButton(this, ID_BUTTON1, _("OK"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON1"));
	BoxSizer1->Add(Button1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	Button2 = new wxButton(this, ID_BUTTON2, _("CLOSE"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON2"));
	BoxSizer1->Add(Button2, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	StaticBoxSizer1->Add(BoxSizer1, 1, wxALL|wxEXPAND, 5);
	FlexGridSizer1->Add(StaticBoxSizer1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	SetSizer(FlexGridSizer1);
	FlexGridSizer1->Fit(this);
	FlexGridSizer1->SetSizeHints(this);

	Connect(ID_TEXTCTRL1,wxEVT_COMMAND_TEXT_UPDATED,(wxObjectEventFunction)&MESH_PARAM::OnTextCtrl1Text);
	Connect(ID_TEXTCTRL2,wxEVT_COMMAND_TEXT_UPDATED,(wxObjectEventFunction)&MESH_PARAM::OnTextCtrl2Text);
	Connect(ID_BUTTON1,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&MESH_PARAM::OnButton1Click);
	Connect(ID_BUTTON2,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&MESH_PARAM::OnButton2Click);
	Connect(wxID_ANY,wxEVT_INIT_DIALOG,(wxObjectEventFunction)&MESH_PARAM::OnInit);
	//*)
}

MESH_PARAM::~MESH_PARAM()
{
	//(*Destroy(MESH_PARAM)
	//*)
}



void MESH_PARAM::OnButton1Click(wxCommandEvent& event)
{
    SetReturnCode(wxID_OK);
    EndModal(wxID_OK);
}

void MESH_PARAM::OnButton2Click(wxCommandEvent& event)
{
    SetReturnCode(wxID_CANCEL);
    EndModal(wxID_OK);
}

void MESH_PARAM::OnTextCtrl1Text(wxCommandEvent& event)
{
    TextCtrl1->SetForegroundColour(*wxBLACK);
    int IsError = 0;
    check_is_numeric(TextCtrl1, &IsError);
}

void MESH_PARAM::OnTextCtrl2Text(wxCommandEvent& event)
{
    TextCtrl2->SetForegroundColour(*wxBLACK);
    int IsError = 0;
    check_is_numeric(TextCtrl2, &IsError);
}

void MESH_PARAM::OnInit(wxInitDialogEvent& event)
{
    TextCtrl1->SetForegroundColour(*wxLIGHT_GREY);
    TextCtrl2->SetForegroundColour(*wxLIGHT_GREY);

}