27#include <wx/combobox.h>
29#include <wx/dynarray.h>
33#include <wx/stattext.h>
45#include "REST_server_gui.h"
51 EVT_BUTTON(ID_STG_CANCEL, AcceptObjectDialog::OnCancelClick)
52 EVT_BUTTON(ID_STG_OK, AcceptObjectDialog::OnOKClick)
57 m_CancelButton = NULL;
61AcceptObjectDialog::AcceptObjectDialog(wxWindow* parent, wxWindowID
id,
62 const wxString& caption,
const wxString& hint,
63 const wxPoint& pos,
const wxSize& size,
long style) {
64 wxFont* pif = FontMgr::Get().GetFont(_T(
"Dialog"));
66 Create(parent,
id, caption, hint, pos, size, style);
69AcceptObjectDialog::~AcceptObjectDialog() {
71 delete m_CancelButton;
74bool AcceptObjectDialog::Create(wxWindow* parent, wxWindowID
id,
75 const wxString& caption,
const wxString& hint,
76 const wxPoint& pos,
const wxSize& size,
long style) {
77 SetExtraStyle(GetExtraStyle() | wxWS_EX_BLOCK_EVENTS);
78 wxDialog::Create(parent,
id, caption, pos, size, style);
81 GetSizer()->Fit(
this);
82 GetSizer()->SetSizeHints(
this);
88void AcceptObjectDialog::CreateControls(
const wxString& hint) {
91 wxBoxSizer* itemBoxSizer2 =
new wxBoxSizer(wxVERTICAL);
92 SetSizer(itemBoxSizer2);
96 itemBoxSizer2->AddSpacer(20);
98 premtext =
new wxStaticText(
this, -1,
"A loooooooooooooooooooooooooooooooooooooooooooooong line\n");
99 itemBoxSizer2->Add(premtext, 0, wxEXPAND | wxALL, 10);
110 m_pCheck1 =
new wxCheckBox(
this, ID_STG_CHECK1, m_checkbox1_msg);
111 itemBoxSizer2->Add(m_pCheck1, 0, wxEXPAND | wxALL, 10);
113 if(!m_checkbox1_msg.Length())
118 wxBoxSizer* itemBoxSizer16 =
new wxBoxSizer(wxHORIZONTAL);
119 itemBoxSizer2->Add(itemBoxSizer16, 0, wxALIGN_RIGHT | wxALL, 5);
121 m_CancelButton =
new wxButton(itemDialog1, ID_STG_CANCEL, _(
"Cancel"),
122 wxDefaultPosition, wxDefaultSize, 0);
123 itemBoxSizer16->Add(m_CancelButton, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
125 m_OKButton =
new wxButton(itemDialog1, ID_STG_OK,
"OK",
126 wxDefaultPosition, wxDefaultSize, 0);
127 itemBoxSizer16->Add(m_OKButton, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
128 m_OKButton->SetDefault();
131void AcceptObjectDialog::SetMessage(
const wxString &msg) {
133 premtext->SetLabel(msg);
134 premtext->Refresh(
true);
138void AcceptObjectDialog::SetCheck1Message(
const wxString &msg) {
139 m_checkbox1_msg = msg;
140 m_pCheck1->SetLabel(msg);
142 GetSizer()->Fit(
this);
145void AcceptObjectDialog::OnOKClick(wxCommandEvent& event) {
149void AcceptObjectDialog::OnCancelClick(wxCommandEvent& event) {
150 EndModal(ID_STG_CANCEL);
157 EVT_BUTTON(ID_STG_CANCEL, PINCreateDialog::OnCancelClick)
158 EVT_BUTTON(ID_STG_OK, PINCreateDialog::OnOKClick)
163 m_CancelButton = NULL;
167PINCreateDialog::PINCreateDialog(wxWindow* parent, wxWindowID
id,
168 const wxString& caption,
const wxString& hint,
169 const wxPoint& pos,
const wxSize& size,
long style) {
170 wxFont* pif = FontMgr::Get().GetFont(_T(
"Dialog"));
172 Create(parent,
id, caption, hint, pos, size, style);
175PINCreateDialog::~PINCreateDialog() {
177 delete m_CancelButton;
180bool PINCreateDialog::Create(wxWindow* parent, wxWindowID
id,
181 const wxString& caption,
const wxString& hint,
182 const wxPoint& pos,
const wxSize& size,
long style) {
183 SetExtraStyle(GetExtraStyle() | wxWS_EX_BLOCK_EVENTS);
184 wxDialog::Create(parent,
id, caption, pos, size, style);
186 CreateControls(hint);
187 GetSizer()->Fit(
this);
188 GetSizer()->SetSizeHints(
this);
194void PINCreateDialog::CreateControls(
const wxString& hint) {
197 wxBoxSizer* itemBoxSizer2 =
new wxBoxSizer(wxVERTICAL);
198 SetSizer(itemBoxSizer2);
202 itemBoxSizer2->AddSpacer(20);
204 premtext =
new wxStaticText(
this, -1,
"A loooooooooooooooooooooooooooooooooooooooooooooong line\n");
205 itemBoxSizer2->Add(premtext, 0, wxEXPAND | wxALL, 10);
207 m_pText1 =
new wxTextCtrl(
this, wxID_ANY, wxEmptyString,
208 wxDefaultPosition, wxDefaultSize, wxTE_READONLY | wxTE_CENTRE);
209 itemBoxSizer2->Add(m_pText1, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 10);
210 m_pText1->SetMinSize(wxSize(6 * GetCharWidth(), -1));
213 wxBoxSizer* itemBoxSizer16 =
new wxBoxSizer(wxHORIZONTAL);
214 itemBoxSizer2->Add(itemBoxSizer16, 0, wxALIGN_RIGHT | wxALL, 5);
216 m_CancelButton =
new wxButton(itemDialog1, ID_STG_CANCEL, _(
"Cancel"),
217 wxDefaultPosition, wxDefaultSize, 0);
218 itemBoxSizer16->Add(m_CancelButton, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
220 m_OKButton =
new wxButton(itemDialog1, ID_STG_OK,
"OK",
221 wxDefaultPosition, wxDefaultSize, 0);
222 itemBoxSizer16->Add(m_OKButton, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
223 m_OKButton->SetDefault();
226void PINCreateDialog::SetMessage(
const wxString &msg) {
228 premtext->SetLabel(msg);
229 premtext->Refresh(
true);
233void PINCreateDialog::SetText1Message(
const wxString &msg) {
234 m_pText1->ChangeValue(msg);
236 GetSizer()->Fit(
this);
239void PINCreateDialog::OnOKClick(wxCommandEvent& event) {
243void PINCreateDialog::OnCancelClick(wxCommandEvent& event) {
"Accept Object" Dialog Definition