1 // @file wxAddNameServerDlg.cpp
3 // @author Charlie Frasch <cfrasch@atdesk.com>
5 #include "wxAddNameServerDlg.h"
7 #include "wxNamingViewer.h"
10 #include "wx/textctrl.h"
12 namespace // anonymous
14 void create_dialog_components( wxDialog
* dialog
)
16 wxBoxSizer
*topsizer
= new wxBoxSizer( wxVERTICAL
);
19 wxBoxSizer
*sizer
= new wxBoxSizer( wxHORIZONTAL
);
21 new wxStaticText( dialog
, -1, "Name:" ),
25 wxTextCtrl
* text
= new wxTextCtrl(
29 text
->SetName( "nameText");
38 wxALIGN_LEFT
| wxEXPAND
);
42 wxBoxSizer
*sizer
= new wxBoxSizer( wxHORIZONTAL
);
44 new wxStaticText( dialog
, -1, "IOR:" ),
48 wxTextCtrl
* text
= new wxTextCtrl(
52 text
->SetName( "iorText");
61 wxALIGN_LEFT
| wxEXPAND
);
64 wxBoxSizer
*button_sizer
= new wxBoxSizer( wxHORIZONTAL
);
66 wxButton
* okButton
= new wxButton( dialog
, wxID_OK
, "OK" );
67 okButton
->SetName( "okButton");
76 new wxButton( dialog
, wxID_CANCEL
, "Cancel" ),
86 dialog
->SetSizer( topsizer
);
87 topsizer
->SetSizeHints( dialog
);
91 WxAddNameServerDlg::WxAddNameServerDlg( wxWindow
* parent
)
92 #if defined(wxUSE_RESOURCES) && (wxUSE_RESOURCES == 1)
101 wxRAISED_BORDER
| wxCAPTION
| wxTHICK_FRAME
| wxSYSTEM_MENU
,
103 #endif // defined(wxUSE_RESOURCES) && (wxUSE_RESOURCES == 1)
107 #if defined(wxUSE_RESOURCES) && (wxUSE_RESOURCES == 1)
108 LoadFromResource( parent
, "addNameServer");
110 create_dialog_components( this);
111 #endif // defined(wxUSE_RESOURCES) && (wxUSE_RESOURCES == 1)
112 wxButton
* ctrl
= static_cast<wxButton
*>( wxFindWindowByName(
120 bool WxAddNameServerDlg::TransferDataFromWindow()
122 wxTextCtrl
* ctrl
= static_cast<wxTextCtrl
*>( wxFindWindowByName(
126 ior
= ctrl
->GetValue();
128 ctrl
= static_cast<wxTextCtrl
*>( wxFindWindowByName(
132 serverName
= ctrl
->GetValue();