File: ValueDlg.cpp

package info (click to toggle)
ace 6.2.8%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 49,348 kB
  • ctags: 42,082
  • sloc: cpp: 342,284; perl: 32,718; ansic: 20,838; sh: 3,759; python: 828; exp: 787; yacc: 511; xml: 330; lex: 158; lisp: 116; makefile: 82; csh: 20; tcl: 5
file content (63 lines) | stat: -rw-r--r-- 2,512 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// $Id: ValueDlg.cpp 80826 2008-03-04 14:51:23Z wotte $
#include "stdafx.h"
#include "ValueDlg.h"

ValueDlg::ValueDlg(wxWindow* pParent, bool String)
: wxDialog(pParent, -1, String ? "New String" : "New Value", wxDefaultPosition, wxSize(300,140))
{
  m_pName= new wxStaticText(this, -1, "Name:", wxPoint(20, 20));
  m_pNameText = new wxTextCtrl(this, -1, "", wxPoint(60, 20), wxDefaultSize, 0, wxTextValidator(wxFILTER_NONE, &m_Name));
  m_pValue = new wxStaticText(this, -1, "Value:", wxPoint(20, 50));
  m_pValueText = new wxTextCtrl(this, -1, "", wxPoint(60, 50), wxDefaultSize, 0, wxTextValidator(String ? wxFILTER_NONE : wxFILTER_NUMERIC, &m_Value));
  m_pOK = new wxButton(this, wxID_OK, "OK", wxPoint(60, 80));
  m_pCancel = new wxButton(this, wxID_CANCEL, "Cancel", wxPoint(160, 80));
}

ValueDlg::ValueDlg(wxWindow* pParent, wxString& Name, wxString& Value)
: wxDialog(pParent, -1, "Edit String", wxDefaultPosition, wxSize(300,140))
{
  m_Name = Name;
  m_Value = Value;
  m_pName= new wxStaticText(this, -1, "Name:", wxPoint(20, 20));
  m_pNameText = new wxTextCtrl(this, -1, "", wxPoint(60, 20), wxDefaultSize, 0, wxTextValidator(wxFILTER_NONE, &m_Name));
  m_pNameText->SetEditable(false);
  m_pValue = new wxStaticText(this, -1, "Value:", wxPoint(20, 50));
  m_pValueText = new wxTextCtrl(this, -1, Value, wxPoint(60, 50), wxDefaultSize, 0, wxTextValidator(wxFILTER_NONE, &m_Value));
  m_pOK = new wxButton(this, wxID_OK, "OK", wxPoint(60, 80));
  m_pCancel = new wxButton(this, wxID_CANCEL, "Cancel", wxPoint(160, 80));
}

ValueDlg::ValueDlg(wxWindow* pParent, wxString& Name, u_int Value)
: wxDialog(pParent, -1, "Edit String", wxDefaultPosition, wxSize(300,140))
{
  m_Name = Name;
  m_Value.sprintf("%d", Value);
  m_pName= new wxStaticText(this, -1, "Name:", wxPoint(20, 20));
  m_pNameText = new wxTextCtrl(this, -1, "", wxPoint(60, 20), wxDefaultSize, 0, wxTextValidator(wxFILTER_NONE, &m_Name));
  m_pNameText->SetEditable(false);
  m_pValue = new wxStaticText(this, -1, "Value:", wxPoint(20, 50));
  m_pValueText = new wxTextCtrl(this, -1, m_Value, wxPoint(60, 50), wxDefaultSize, 0, wxTextValidator(wxFILTER_NUMERIC, &m_Value));
  m_pOK = new wxButton(this, wxID_OK, "OK", wxPoint(60, 80));
  m_pCancel = new wxButton(this, wxID_CANCEL, "Cancel", wxPoint(160, 80));
}


ValueDlg::~ValueDlg()
{
}

const wxString& ValueDlg::GetName()
{
  return m_Name;
}

const wxString& ValueDlg::GetStringValue()
{
  return m_Value;
}

u_int ValueDlg::GetUINTValue()
{
  return ACE_OS::atoi(m_Value);
}