Go to the documentation of this file.
90 const wxString& name) :
91 wxPanel(parent,
id, pos, size, wxTAB_TRAVERSAL, name),
100 unsignedValidator_(NULL),
101 floatValidator_(NULL) {
138 wxSizer* sizer =
new wxBoxSizer(wxHORIZONTAL);
140 int textWidth = size.GetWidth();
143 if (textWidth < 20) {
151 wxSize(textWidth, -1));
153 sizer->Add(
text_, 0, wxALIGN_CENTER_VERTICAL);
180 sizer->Add(
modeChoice_, 0, wxALIGN_CENTER_VERTICAL);
215 binString = binString.substr(0, binString.length() - 1);
224 hexString = hexString.substr(2, hexString.length() - 2);
274 if (stringValue ==
"") {
277 wxCommandEvent textEvent(wxEVT_COMMAND_TEXT_UPDATED, GetId());
278 GetParent()->GetEventHandler()->AddPendingEvent(textEvent);
289 stringValue = stringValue +
"b";
293 stringValue =
"0x" + stringValue;
312 wxCommandEvent textEvent(wxEVT_COMMAND_TEXT_UPDATED, GetId());
313 GetParent()->GetEventHandler()->AddPendingEvent(textEvent);
315 if (
text_->IsModified()) {
330 wxCommandEvent
dummy;
466 string procName =
"NubmerControl::setIntMode";
497 string procName =
"NubmerControl::setBinMode";
504 new wxTextValidator(wxFILTER_INCLUDE_CHAR_LIST, &
stringValue_);
506 #if wxCHECK_VERSION(2, 5, 4)
507 wxArrayString includes;
508 includes.Add(_T(
"0"));
509 includes.Add(_T(
"1"));
513 wxStringList(_T(
"0"), _T(
"1"), NULL));
540 string procName =
"NubmerControl::setHexMode";
547 new wxTextValidator(wxFILTER_INCLUDE_CHAR_LIST, &
stringValue_);
549 #if wxCHECK_VERSION(2, 5, 4)
550 wxArrayString includes;
551 includes.Add(_T(
"0"));
552 includes.Add(_T(
"1"));
553 includes.Add(_T(
"2"));
554 includes.Add(_T(
"3"));
555 includes.Add(_T(
"4"));
556 includes.Add(_T(
"5"));
557 includes.Add(_T(
"6"));
558 includes.Add(_T(
"7"));
559 includes.Add(_T(
"8"));
560 includes.Add(_T(
"9"));
561 includes.Add(_T(
"a"));
562 includes.Add(_T(
"b"));
563 includes.Add(_T(
"c"));
564 includes.Add(_T(
"d"));
565 includes.Add(_T(
"e"));
566 includes.Add(_T(
"f"));
567 includes.Add(_T(
"A"));
568 includes.Add(_T(
"B"));
569 includes.Add(_T(
"C"));
570 includes.Add(_T(
"D"));
571 includes.Add(_T(
"E"));
572 includes.Add(_T(
"F"));
576 wxStringList(_T(
"0"), _T(
"1"), _T(
"2"), _T(
"3"), _T(
"4"), _T(
"5"),
577 _T(
"6"), _T(
"7"), _T(
"8"), _T(
"9"),
578 _T(
"a"), _T(
"b"), _T(
"c"), _T(
"d"), _T(
"e"), _T(
"f"),
579 _T(
"A"), _T(
"B"), _T(
"C"), _T(
"D"),
580 _T(
"E"), _T(
"F"), NULL));
606 string procName =
"NubmerControl::setUnsignedMode";
613 new wxTextValidator(wxFILTER_INCLUDE_CHAR_LIST, &
stringValue_);
615 #if wxCHECK_VERSION(2, 5, 4)
616 wxArrayString includes;
617 includes.Add(_T(
"0"));
618 includes.Add(_T(
"1"));
619 includes.Add(_T(
"2"));
620 includes.Add(_T(
"3"));
621 includes.Add(_T(
"4"));
622 includes.Add(_T(
"5"));
623 includes.Add(_T(
"6"));
624 includes.Add(_T(
"7"));
625 includes.Add(_T(
"8"));
626 includes.Add(_T(
"9"));
630 wxStringList(_T(
"0"), _T(
"1"), _T(
"2"), _T(
"3"), _T(
"4"), _T(
"5"),
631 _T(
"6"), _T(
"7"), _T(
"8"), _T(
"9"), NULL));
657 string procName =
"NubmerControl::setFloatMode";
664 new wxTextValidator(wxFILTER_INCLUDE_CHAR_LIST, &
stringValue_);
666 #if wxCHECK_VERSION(2, 5, 4)
667 wxArrayString includes;
668 includes.Add(_T(
"0"));
669 includes.Add(_T(
"1"));
670 includes.Add(_T(
"2"));
671 includes.Add(_T(
"3"));
672 includes.Add(_T(
"4"));
673 includes.Add(_T(
"5"));
674 includes.Add(_T(
"6"));
675 includes.Add(_T(
"7"));
676 includes.Add(_T(
"8"));
677 includes.Add(_T(
"9"));
678 includes.Add(_T(
"e"));
679 includes.Add(_T(
"."));
680 includes.Add(_T(
"-"));
681 includes.Add(_T(
"+"));
685 wxStringList(_T(
"0"), _T(
"1"), _T(
"2"), _T(
"3"), _T(
"4"),
686 _T(
"5"), _T(
"6"), _T(
"7"), _T(
"8"), _T(
"9"),
687 _T(
"e"), _T(
"."), _T(
"-"), _T(
"+"), NULL));
713 string procName =
"NubmerControl::setDoubleMode";
720 new wxTextValidator(wxFILTER_INCLUDE_CHAR_LIST, &
stringValue_);
722 #if wxCHECK_VERSION(2, 5, 4)
723 wxArrayString includes;
724 includes.Add(_T(
"0"));
725 includes.Add(_T(
"1"));
726 includes.Add(_T(
"2"));
727 includes.Add(_T(
"3"));
728 includes.Add(_T(
"4"));
729 includes.Add(_T(
"5"));
730 includes.Add(_T(
"6"));
731 includes.Add(_T(
"7"));
732 includes.Add(_T(
"8"));
733 includes.Add(_T(
"9"));
734 includes.Add(_T(
"e"));
735 includes.Add(_T(
"."));
736 includes.Add(_T(
"-"));
737 includes.Add(_T(
"+"));
741 wxStringList(_T(
"0"), _T(
"1"), _T(
"2"), _T(
"3"), _T(
"4"),
742 _T(
"5"), _T(
"6"), _T(
"7"), _T(
"8"), _T(
"9"),
743 _T(
"e"), _T(
"."), _T(
"-"), _T(
"+"), NULL));
unsigned int unsignedValue() const
Value value_
Current value of the widget.
static wxString toWxString(const std::string &source)
static const wxString MODE_STRING_DOUBLE
Choicer item string for the double mode.
static const int CHOICER_WIDTH
Mode choicer width.
static const wxString MODE_STRING_INT
Choicer item string for the integer mode.
wxTextValidator * floatValidator_
Float input validator.
static const wxString MODE_STRING_HEX
Choicer item string for the hexadecimal mode.
void setValue(const ULongWord value)
static std::string toString(const T &source)
long style_
Current style flags of the widget.
#define assert(condition)
static double toDouble(const T &source)
void onText(wxCommandEvent &event)
unsigned int unsignedValue
double doubleValue() const
SimValue dummy(32)
a dummy simvalue which is given for operands that are not bound
static const wxString MODE_STRING_UNSIGNED
Choicer item string for the unsigned mode.
FocusTrackingTextCtrl * text_
Text field widget.
static const long MODE_INT
Style flag for signed integer mode availablity.
static std::string toHexString(T source, std::size_t digits=0, bool include0x=true)
static const wxString MODE_STRING_FLOAT
Choicer item string for the float mode.
static const long NO_MODE_CHOICER
Style flag for base choicer visibility.
static const long MODE_UNSIGNED
Style flag for unsigned integer mode availability.
wxTextValidator * hexValidator_
Hexadecimal input validator.
static unsigned int toUnsignedInt(const T &source)
static const wxString MODE_STRING_BIN
Choicer item string for the binary mode.
static const long MODE_HEXADECIMAL
Style flag for hexadecimal mode availability.
wxChoice * modeChoice_
Mode choicer widget.
long mode_
Current mode of the widget.
static const long MODE_BINARY
Style flag for binary mode availability.
static std::string toBinString(int source)
wxTextValidator * unsignedValidator_
Unsigned integer input validator.
static int toInt(const T &source)
wxTextValidator * intValidator_
Signed integer input validator.
wxTextValidator * binValidator_
Binary input validator.
static std::string toString(const wxString &source)
static const long MODE_FLOAT
Style flag for float mode availability.
wxString stringValue_
Dummy value string for the validators.
void create(const wxSize &size)
static const long MODE_DOUBLE
Style flag for double mode availability.
END_EVENT_TABLE() using namespace IDF
static float toFloat(const T &source)
void onModeChoice(wxCommandEvent &event)