- Render <th> element contents in bold in wxHTML.
- Added wxGrid::{Set,Get}{Row,Col}Sizes() methods (Andrey Putrin).
- Add support for wxSP_WRAP in the generic version of wxSpinCtrlDouble.
+- Add alignment flags support to wxSpinCtrl[Double] (Andrew Radke).
- Added wxGetSelectedChoices() replacing wxGetMultipleChoices() (Kolya Kosenko).
wxGTK:
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
- long style = wxSP_ARROW_KEYS | wxTE_RIGHT,
+ long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
double min = 0, double max = 100, double initial = 0,
double inc = 1,
const wxString& name = _T("wxSpinCtrl"));
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
- long style = wxSP_ARROW_KEYS | wxTE_RIGHT,
+ long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
double min = 0, double max = 100, double initial = 0,
double inc = 1,
const wxString& name = _T("wxSpinCtrl"))
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
- long style = wxSP_ARROW_KEYS | wxTE_RIGHT,
+ long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
int min = 0, int max = 100, int initial = 0,
const wxString& name = _T("wxSpinCtrl"))
{
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
- long style = wxSP_ARROW_KEYS | wxTE_RIGHT,
+ long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
int min = 0, int max = 100, int initial = 0,
const wxString& name = _T("wxSpinCtrl"))
{
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
- long style = wxSP_ARROW_KEYS | wxTE_RIGHT,
+ long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
double min = 0, double max = 100, double initial = 0,
double inc = 1,
const wxString& name = _T("wxSpinCtrlDouble"))
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
- long style = wxSP_ARROW_KEYS | wxTE_RIGHT,
+ long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
double min = 0, double max = 100, double initial = 0,
double inc = 1,
const wxString& name = _T("wxSpinCtrlDouble"))
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
- long style = wxSP_ARROW_KEYS | wxTE_RIGHT,
+ long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
int min = 0, int max = 100, int initial = 0,
const wxString& name = _T("wxSpinCtrl"))
{
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
- long style = wxSP_ARROW_KEYS | wxTE_RIGHT,
+ long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
int min = 0, int max = 100, int initial = 0,
const wxString& name = _T("wxSpinCtrl"));
// without tons of #ifdefs.
// ----------------------------------------------------------------------------
-#if wxUSE_SPINBTN
+#if wxUSE_SPINBTN
#include "wx/containr.h"
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
- long style = wxSP_ARROW_KEYS | wxTE_RIGHT,
+ long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
int min = 0, int max = 100, int initial = 0,
const wxString& name = _T("wxSpinCtrl"))
{
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
- long style = wxSP_ARROW_KEYS | wxTE_RIGHT,
+ long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
int min = 0, int max = 100, int initial = 0,
const wxString& name = _T("wxSpinCtrl"));
// the subcontrols
wxTextCtrl *m_text;
wxSpinButton *m_btn;
-
+
friend class wxSpinCtrlText;
friend class wxSpinCtrlButton;
-
+
int m_oldValue;
private:
DECLARE_EVENT_TABLE()
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
- long style = wxSP_ARROW_KEYS | wxTE_RIGHT,
+ long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
int min = 0, int max = 100, int initial = 0,
const wxString& name = _T("wxSpinCtrl"))
{
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
- long style = wxSP_ARROW_KEYS | wxTE_RIGHT,
+ long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
int min = 0, int max = 100, int initial = 0,
const wxString& name = _T("wxSpinCtrl"))
{
events. Using this style will prevent the user from using the Enter key
for dialog navigation (e.g. activating the default button in the
dialog) under MSW.
- @style{wxTE_LEFT}
- Same as for wxTextCtrl: the text is left aligned.
- @style{wxTE_CENTER}
- Same as for wxTextCtrl: the text is centered.
- @style{wxTE_RIGHT}
- Same as for wxTextCtrl: the text is right aligned (this is the
- default).
+ @style{wxALIGN_LEFT}
+ Same as wxTE_LEFT for wxTextCtrl: the text is left aligned.
+ @style{wxALIGN_CENTRE}
+ Same as wxTE_CENTRE for wxTextCtrl: the text is centered.
+ @style{wxALIGN_RIGHT}
+ Same as wxTE_RIGHT for wxTextCtrl: the text is right aligned (this is
+ the default).
@endStyleTable
m_value = gtk_spin_button_get_value( GTK_SPIN_BUTTON(m_widget));
gfloat align;
- if ( HasFlag(wxTE_RIGHT) )
+ if ( HasFlag(wxALIGN_RIGHT) )
align = 1.0;
- else if ( HasFlag(wxTE_CENTRE) )
+ else if ( HasFlag(wxALIGN_CENTRE) )
align = 0.5;
else
align = 0.0;
WXDWORD msStyle = MSWGetStyle(GetWindowStyle(), & exStyle) ;
// propagate text alignment style to text ctrl
- if ( style & wxTE_RIGHT )
+ if ( style & wxALIGN_RIGHT )
msStyle |= ES_RIGHT;
- else if ( style & wxTE_CENTER )
+ else if ( style & wxALIGN_CENTER )
msStyle |= ES_CENTER;
-
+
// this control is used for numeric entry so normally using these flags by
// default shouldn't be a problem, if it is we can always add a style such
// as wxSP_NON_NUMERIC later
void wxSpinCtrl::SetValue(int val)
{
m_blockEvent = true;
-
+
wxSpinButton::SetValue(val);
// normally setting the value of the spin button is enough as it updates
}
m_oldValue = GetValue();
-
+
m_blockEvent = false;
}
event.SetEventObject( GetParent() );
GetParent()->HandleWindowEvent(event);
}
-
+
void OnKillFocus(wxFocusEvent& event)
{
long l;
m_spin->m_oldValue = l;
}
-
+
// delegate to parent control
event.SetEventObject( GetParent() );
GetParent()->HandleWindowEvent(event);
XRC_ADD_STYLE(wxSP_VERTICAL);
XRC_ADD_STYLE(wxSP_ARROW_KEYS);
XRC_ADD_STYLE(wxSP_WRAP);
- XRC_ADD_STYLE(wxTE_LEFT);
- XRC_ADD_STYLE(wxTE_CENTER);
- XRC_ADD_STYLE(wxTE_RIGHT);
+ XRC_ADD_STYLE(wxALIGN_LEFT);
+ XRC_ADD_STYLE(wxALIGN_CENTER);
+ XRC_ADD_STYLE(wxALIGN_RIGHT);
}
wxObject *wxSpinCtrlXmlHandler::DoCreateResource()
GetID(),
GetText(wxT("value")),
GetPosition(), GetSize(),
- GetStyle(wxT("style"), wxSP_ARROW_KEYS | wxTE_RIGHT),
+ GetStyle(wxT("style"), wxSP_ARROW_KEYS | wxALIGN_RIGHT),
GetLong(wxT("min"), DEFAULT_MIN),
GetLong(wxT("max"), DEFAULT_MAX),
GetLong(wxT("value"), DEFAULT_VALUE),