2
The contents of this file are subject to the Initial Developer's Public
3
License Version 1.0 (the "License"); you may not use this file except in
4
compliance with the License. You may obtain a copy of the License here:
5
http://www.flamerobin.org/license.html.
7
Software distributed under the License is distributed on an "AS IS"
8
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
9
License for the specific language governing rights and limitations under
12
The Original Code is FlameRobin (TM).
14
The Initial Developer of the Original Code is Milan Babuskov.
16
Portions created by the original developer
17
are Copyright (C) 2004 Milan Babuskov.
23
Contributor(s): Michael Hieke
26
// For compilers that support precompilation, includes "wx/wx.h".
27
#include "wx/wxprec.h"
33
// for all others, include the necessary headers (this file is usually all you
34
// need because it includes almost all "standard" wxWindows headers
38
//-----------------------------------------------------------------------------
39
// -*- C++ -*- generated by wxGlade 0.2.2 on Fri Jul 02 11:09:50 2004
41
#include "ServerRegistrationInfoFrame.h"
43
#include "styleguide.h"
45
ServerRegistrationInfoFrame::ServerRegistrationInfoFrame(wxWindow* parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long style):
46
BaseDialog(parent, id, title, pos, size, style)
48
// begin wxGlade: ServerRegistrationInfoFrame::ServerRegistrationInfoFrame
49
label_1 = new wxStaticText(this, -1, _("Hostname:"));
50
text_ctrl_1 = new wxTextCtrl(this, ID_textctrl_server, wxT("localhost"));
51
label_2 = new wxStaticText(this, -1, _("Port number:"));
52
text_ctrl_2 = new wxTextCtrl(this, -1, wxT("3050"));
53
button_ok = new wxButton(this, ID_button_ok, _("OK"));
54
button_cancel = new wxButton(this, ID_button_cancel, _("Cancel"));
62
void ServerRegistrationInfoFrame::set_properties()
64
button_ok->SetDefault();
68
void ServerRegistrationInfoFrame::do_layout()
70
#if wxCHECK_VERSION(2, 5, 3)
71
// create sizer for controls
72
wxFlexGridSizer* sizerControls = new wxFlexGridSizer(2, 2,
73
styleguide().getRelatedControlMargin(wxVERTICAL),
74
styleguide().getControlLabelMargin());
75
sizerControls->AddGrowableCol(1);
77
sizerControls->Add(label_1, 0, wxALIGN_CENTER_VERTICAL);
78
sizerControls->Add(text_ctrl_1, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL);
79
sizerControls->Add(label_2, 0, wxALIGN_CENTER_VERTICAL);
80
sizerControls->Add(text_ctrl_2, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL);
82
// make all labels have the same width to simulate a grid of controls
83
std::list<wxWindow*> controls;
84
controls.push_back(label_1);
85
controls.push_back(label_2);
86
adjustControlsMinWidth(controls);
89
// create sizers hierarchy for controls
90
wxBoxSizer* sizerRow1 = new wxBoxSizer(wxHORIZONTAL);
91
sizerRow1->Add(label_1, 0, wxALIGN_CENTER_VERTICAL);
92
sizerRow1->Add(styleguide().getControlLabelMargin(), 0);
93
sizerRow1->Add(text_ctrl_1, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL);
95
wxBoxSizer* sizerRow2 = new wxBoxSizer(wxHORIZONTAL);
96
sizerRow2->Add(label_2, 0, wxALIGN_CENTER_VERTICAL);
97
sizerRow2->Add(styleguide().getControlLabelMargin(), 0);
98
sizerRow2->Add(text_ctrl_2, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL);
100
wxBoxSizer* sizerControls = new wxBoxSizer(wxVERTICAL);
101
sizerControls->Add(sizerRow1, 0, wxEXPAND);
102
sizerControls->Add(0, styleguide().getRelatedControlMargin(wxVERTICAL));
103
sizerControls->Add(sizerRow2, 0, wxEXPAND);
106
// create sizer for buttons -> styleguide class will align it correctly
107
wxSizer* sizerButtons = styleguide().createButtonSizer(button_ok, button_cancel);
109
// use method in base class to set everything up
110
layoutSizers(sizerControls, sizerButtons);