Merge branch 'spinctrl-fixes'
Various improvements to wxSpinCtrl and wxGridCellNumberEditor, using it. Closes https://github.com/wxWidgets/wxWidgets/pull/1588
This commit is contained in:
@@ -115,6 +115,11 @@ public:
|
||||
wxSize GetSizeFromTextSize(const wxSize& tsize) const
|
||||
{ return DoGetSizeFromTextSize(tsize.x, tsize.y); }
|
||||
|
||||
wxSize GetSizeFromText(const wxString& text) const
|
||||
{
|
||||
return GetSizeFromTextSize(GetTextExtent(text).GetWidth());
|
||||
}
|
||||
|
||||
|
||||
// static utilities for mnemonics char (&) handling
|
||||
// ------------------------------------------------
|
||||
|
@@ -116,6 +116,8 @@ public:
|
||||
wxWindowID id,
|
||||
wxEvtHandler* evtHandler) wxOVERRIDE;
|
||||
|
||||
virtual void SetSize(const wxRect& rect) wxOVERRIDE;
|
||||
|
||||
virtual bool IsAcceptedKey(wxKeyEvent& event) wxOVERRIDE;
|
||||
virtual void BeginEdit(int row, int col, wxGrid* grid) wxOVERRIDE;
|
||||
virtual bool EndEdit(int row, int col, const wxGrid* grid,
|
||||
|
@@ -168,6 +168,9 @@ private:
|
||||
// (up-down control) and the text control (buddy window).
|
||||
int GetOverlap() const;
|
||||
|
||||
// Calculate the best size for the number with the given number of digits.
|
||||
wxSize GetBestSizeFromDigitsCount(int digitsCount) const;
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS(wxSpinCtrl);
|
||||
wxDECLARE_EVENT_TABLE();
|
||||
wxDECLARE_NO_COPY_CLASS(wxSpinCtrl);
|
||||
|
@@ -143,6 +143,11 @@ namespace wxPrivate
|
||||
// string containing hexadecimal representation of the given number.
|
||||
extern wxString wxSpinCtrlFormatAsHex(long val, long maxVal);
|
||||
|
||||
// The helper function to determine the best size for the given control.
|
||||
// We can't implement this function in the wxSpinCtrlBase because MSW implementation
|
||||
// of wxSpinCtrl is derived from wxSpinButton but uses the same algorithm.
|
||||
extern wxSize wxSpinCtrlGetBestSize(const wxControl* spin, int minVal, int maxVal, int base);
|
||||
|
||||
} // namespace wxPrivate
|
||||
|
||||
// old wxEVT_COMMAND_* constants
|
||||
|
Reference in New Issue
Block a user