Add wxSpinCtrl::SetBase() to allow entering hexadecimal numbers.

Add a generic SetBase() API even though right now only bases 10 and 16 are
supported as we might support other ones (e.g. 8?) in the future. Implement it
for MSW, GTK and generic versions.

Add controls allowing to test this feature to the widgets sample.

Add "base" property support to the XRC handler for wxSpinCtrl, document it and
test it in the xrc sample.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72414 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-08-30 20:24:38 +00:00
parent 36090ae57e
commit 9e565667d0
14 changed files with 328 additions and 23 deletions

View File

@@ -62,6 +62,11 @@ public:
// another wxTextCtrl-like method
void SetSelection(long from, long to);
// wxSpinCtrlBase methods
virtual int GetBase() const;
virtual bool SetBase(int base);
// implementation only from now on
// -------------------------------
@@ -148,6 +153,12 @@ private:
// Common part of all ctors.
void Init();
// Adjust the text control style depending on whether we need to enter only
// digits or may need to enter something else (e.g. "-" sign, "x"
// hexadecimal prefix, ...) in it.
void UpdateBuddyStyle();
DECLARE_DYNAMIC_CLASS(wxSpinCtrl)
DECLARE_EVENT_TABLE()
wxDECLARE_NO_COPY_CLASS(wxSpinCtrl);