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:
@@ -51,6 +51,10 @@ public:
|
||||
virtual void SetSnapToTicks(bool snap_to_ticks) = 0;
|
||||
// void SetDigits(unsigned digits) - wxSpinCtrlDouble only
|
||||
|
||||
// The base for numbers display, e.g. 10 or 16.
|
||||
virtual int GetBase() const = 0;
|
||||
virtual bool SetBase(int base) = 0;
|
||||
|
||||
// Select text in the textctrl
|
||||
virtual void SetSelection(long from, long to) = 0;
|
||||
|
||||
@@ -134,6 +138,15 @@ typedef void (wxEvtHandler::*wxSpinDoubleEventFunction)(wxSpinDoubleEvent&);
|
||||
#include "wx/generic/spinctlg.h"
|
||||
#endif
|
||||
|
||||
namespace wxPrivate
|
||||
{
|
||||
|
||||
// This is an internal helper function currently used by all ports: return the
|
||||
// string containing hexadecimal representation of the given number.
|
||||
extern wxString wxSpinCtrlFormatAsHex(long val, long maxVal);
|
||||
|
||||
} // namespace wxPrivate
|
||||
|
||||
#endif // wxUSE_SPINCTRL
|
||||
|
||||
#endif // _WX_SPINCTRL_H_
|
||||
|
Reference in New Issue
Block a user