#endif
#if wxUSE_RADIOBOX
-# if !wxUSE_RADIOBTN || !wxUSE_STATBOX
+# if !wxUSE_RADIOBTN
# ifdef wxABORT_ON_CONFIG_ERROR
-# error "wxUSE_RADIOBOX requires wxUSE_RADIOBTN and wxUSE_STATBOX"
+# error "wxUSE_RADIOBOX requires wxUSE_RADIOBTN"
# else
# undef wxUSE_RADIOBTN
-# undef wxUSE_STATBOX
# define wxUSE_RADIOBTN 1
+# endif
+# endif
+# if !wxUSE_STATBOX && !defined(__WXPALMOS__)
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "wxUSE_RADIOBOX requires wxUSE_STATBOX"
+# else
+# undef wxUSE_STATBOX
# define wxUSE_STATBOX 1
# endif
# endif
#define wxRA_HORIZONTAL wxHORIZONTAL
#define wxRA_VERTICAL wxVERTICAL
+/* Use alternative object for single control */
+
+#define wxRA_USE_SUBSTITUTE 0x0010
+
/*
* wxRadioButton style flag
*/
#define wxRB_GROUP 0x0004
#define wxRB_SINGLE 0x0008
+#define wxRB_USE_SUBSTITUTE 0x0010
/*
* wxSlider flags
long style = wxRA_HORIZONTAL,
const wxValidator& val = wxDefaultValidator,
const wxString& name = wxRadioBoxNameStr);
+
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& title,
// implementation only from now on
// -------------------------------
- // FIXME: are they used? missing "Do" prefix?
- void GetSize(int *x, int *y) const;
- void GetPosition(int *x, int *y) const;
-
virtual bool SetFont(const wxFont& font);
- virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
- WXUINT message,
- WXWPARAM wParam, WXLPARAM lParam);
- WXHWND *GetRadioButtons() const { return m_radioButtons; }
- bool ContainsHWND(WXHWND hWnd) const;
void SendNotificationEvent();
// get the number of buttons per column/row
// we can't compute our best size before the items are added to the control
virtual void SetInitialBestSize(const wxSize& WXUNUSED(size)) { }
- // subclass one radio button
- void SubclassRadioButton(WXHWND hWndBtn);
-
// get the max size of radio buttons
wxSize GetMaxButtonSize() const;
// get the total size occupied by the radio box buttons
wxSize GetTotalButtonSize(const wxSize& sizeBtn) const;
- WXHWND * m_radioButtons;
int m_majorDim;
int * m_radioWidth; // for bitmaps
int * m_radioHeight;
#define wxUSE_GAUGE 0 // wxGauge
#define wxUSE_LISTBOX 0 // wxListBox
#define wxUSE_LISTCTRL 0 // wxListCtrl
-#define wxUSE_RADIOBOX 0 // wxRadioBox
+#define wxUSE_RADIOBOX 1 // wxRadioBox
#define wxUSE_RADIOBTN 1 // wxRadioButton
#define wxUSE_SCROLLBAR 0 // wxScrollBar
#define wxUSE_SLIDER 1 // wxSlider
// implementation
void Command(wxCommandEvent& event);
+ // send a notification event, return true if processed
+ bool SendUpdatedEvent();
+
protected:
virtual wxSize DoGetBestSize() const;
wxControl::~wxControl()
{
+ SetLabel(wxEmptyString);
m_isBeingDeleted = true;
}
if(form==NULL)
return false;
- m_label = label;
-
ControlType *control = CtlNewControl(
(void **)&form,
GetId(),
style,
- m_label.c_str(),
+ wxEmptyString,
( pos.x == wxDefaultCoord ) ? winUndefConstraint : pos.x,
( pos.y == wxDefaultCoord ) ? winUndefConstraint : pos.y,
( size.x == wxDefaultCoord ) ? winUndefConstraint : size.x,
m_palmControl = true;
+ SetLabel(label);
Show();
return true;
}
void wxControl::SetControlLabel(const wxString& label)
{
+ ControlType* control = (ControlType*)GetObjectPtr();
+ if(control==NULL)
+ return;
+ CtlSetLabel(control,wxEmptyString);
+ m_label = label;
+ if(!m_label.empty())
+ CtlSetLabel(control,m_label.c_str());
}
void wxControl::SetLabel(const wxString& label)
#include "wx/log.h"
#endif
-#include "wx/palmos/private.h"
-
#if wxUSE_TOOLTIPS
#include "wx/tooltip.h"
#endif // wxUSE_TOOLTIPS
item
*/
-#define RADIOBTN_PARENT_IS_RADIOBOX 0
-
-// ---------------------------------------------------------------------------
-// private functions
-// ---------------------------------------------------------------------------
-
-// ---------------------------------------------------------------------------
-// global vars
-// ---------------------------------------------------------------------------
-
-// the pointer to standard radio button wnd proc
-static WXFARPROC s_wndprocRadioBtn = (WXFARPROC)NULL;
-
// ===========================================================================
// implementation
// ===========================================================================
{
}
-void wxRadioBox::GetSize(int *width, int *height) const
-{
-}
-
-void wxRadioBox::GetPosition(int *x, int *y) const
-{
-}
-
void wxRadioBox::SetFocus()
{
}
{
}
-bool wxRadioBox::ContainsHWND(WXHWND hWnd) const
-{
- return false;
-}
-
void wxRadioBox::Command(wxCommandEvent & event)
{
}
-void wxRadioBox::SubclassRadioButton(WXHWND hWndBtn)
-{
-}
-
void wxRadioBox::SendNotificationEvent()
{
}
return false;
}
-// ----------------------------------------------------------------------------
-// our window proc
-// ----------------------------------------------------------------------------
-
-WXHBRUSH wxRadioBox::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor),
- WXUINT WXUNUSED(message),
- WXWPARAM WXUNUSED(wParam),
- WXLPARAM WXUNUSED(lParam)
- )
-{
- return (WXHBRUSH)0;
-}
-
#endif // wxUSE_RADIOBOX
const wxValidator& validator,
const wxString& name)
{
+ // replace native push button with native checkbox
+ if ( style & wxRB_USE_SUBSTITUTE )
+ m_radioStyle = checkboxCtl;
+
if(!wxControl::Create(parent, id, pos, size, style, validator, name))
return false;
{
}
+// ----------------------------------------------------------------------------
+// helpers
+// ----------------------------------------------------------------------------
+
+bool wxSlider::SendUpdatedEvent()
+{
+ wxCommandEvent event(wxEVT_COMMAND_SLIDER_UPDATED, GetId());
+ event.SetEventObject(this);
+ event.SetInt(GetValue());
+ return ProcessCommand(event);
+}
+
void wxSlider::Command (wxCommandEvent & event)
{
}
#include "wx/checkbox.h"
#include "wx/radiobut.h"
#include "wx/tglbtn.h"
+#include "wx/slider.h"
// ----------------------------------------------------------------------------
// globals
if(radio)
return radio->SendClickEvent();
+ wxSlider* slider = wxDynamicCast(win,wxSlider);
+ if(slider)
+ return slider->SendUpdatedEvent();
+
return false;
}