Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / ACE / examples / ConfigViewer / ValueDlg.cpp
blobcef585b48da1c3e2ff9413262a2c22e8c373138d
1 #include "stdafx.h"
2 #include "ValueDlg.h"
4 ValueDlg::ValueDlg(wxWindow* pParent, bool String)
5 : wxDialog(pParent, -1, String ? "New String" : "New Value", wxDefaultPosition, wxSize(300,140))
7 m_pName= new wxStaticText(this, -1, "Name:", wxPoint(20, 20));
8 m_pNameText = new wxTextCtrl(this, -1, "", wxPoint(60, 20), wxDefaultSize, 0, wxTextValidator(wxFILTER_NONE, &m_Name));
9 m_pValue = new wxStaticText(this, -1, "Value:", wxPoint(20, 50));
10 m_pValueText = new wxTextCtrl(this, -1, "", wxPoint(60, 50), wxDefaultSize, 0, wxTextValidator(String ? wxFILTER_NONE : wxFILTER_NUMERIC, &m_Value));
11 m_pOK = new wxButton(this, wxID_OK, "OK", wxPoint(60, 80));
12 m_pCancel = new wxButton(this, wxID_CANCEL, "Cancel", wxPoint(160, 80));
15 ValueDlg::ValueDlg(wxWindow* pParent, wxString& Name, wxString& Value)
16 : wxDialog(pParent, -1, "Edit String", wxDefaultPosition, wxSize(300,140))
18 m_Name = Name;
19 m_Value = Value;
20 m_pName= new wxStaticText(this, -1, "Name:", wxPoint(20, 20));
21 m_pNameText = new wxTextCtrl(this, -1, "", wxPoint(60, 20), wxDefaultSize, 0, wxTextValidator(wxFILTER_NONE, &m_Name));
22 m_pNameText->SetEditable(false);
23 m_pValue = new wxStaticText(this, -1, "Value:", wxPoint(20, 50));
24 m_pValueText = new wxTextCtrl(this, -1, Value, wxPoint(60, 50), wxDefaultSize, 0, wxTextValidator(wxFILTER_NONE, &m_Value));
25 m_pOK = new wxButton(this, wxID_OK, "OK", wxPoint(60, 80));
26 m_pCancel = new wxButton(this, wxID_CANCEL, "Cancel", wxPoint(160, 80));
29 ValueDlg::ValueDlg(wxWindow* pParent, wxString& Name, u_int Value)
30 : wxDialog(pParent, -1, "Edit String", wxDefaultPosition, wxSize(300,140))
32 m_Name = Name;
33 m_Value.sprintf("%d", Value);
34 m_pName= new wxStaticText(this, -1, "Name:", wxPoint(20, 20));
35 m_pNameText = new wxTextCtrl(this, -1, "", wxPoint(60, 20), wxDefaultSize, 0, wxTextValidator(wxFILTER_NONE, &m_Name));
36 m_pNameText->SetEditable(false);
37 m_pValue = new wxStaticText(this, -1, "Value:", wxPoint(20, 50));
38 m_pValueText = new wxTextCtrl(this, -1, m_Value, wxPoint(60, 50), wxDefaultSize, 0, wxTextValidator(wxFILTER_NUMERIC, &m_Value));
39 m_pOK = new wxButton(this, wxID_OK, "OK", wxPoint(60, 80));
40 m_pCancel = new wxButton(this, wxID_CANCEL, "Cancel", wxPoint(160, 80));
44 ValueDlg::~ValueDlg()
48 const wxString& ValueDlg::GetName()
50 return m_Name;
53 const wxString& ValueDlg::GetStringValue()
55 return m_Value;
58 u_int ValueDlg::GetUINTValue()
60 return ACE_OS::atoi(m_Value);