Further cleaning of the wxPalmOS radiobox code. Sending update event from slider. New styles for wxRadioBox and wxRadioButton for using alternative appearance of the control.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31690 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -72,6 +72,7 @@ void wxControl::Init()
|
||||
|
||||
wxControl::~wxControl()
|
||||
{
|
||||
SetLabel(wxEmptyString);
|
||||
m_isBeingDeleted = true;
|
||||
}
|
||||
|
||||
@@ -107,13 +108,11 @@ bool wxControl::PalmCreateControl(ControlStyleType style,
|
||||
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,
|
||||
@@ -128,6 +127,7 @@ bool wxControl::PalmCreateControl(ControlStyleType style,
|
||||
|
||||
m_palmControl = true;
|
||||
|
||||
SetLabel(label);
|
||||
Show();
|
||||
return true;
|
||||
}
|
||||
@@ -350,6 +350,13 @@ void wxControl::SetFieldLabel(const wxString& label)
|
||||
|
||||
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)
|
||||
|
@@ -38,8 +38,6 @@
|
||||
#include "wx/log.h"
|
||||
#endif
|
||||
|
||||
#include "wx/palmos/private.h"
|
||||
|
||||
#if wxUSE_TOOLTIPS
|
||||
#include "wx/tooltip.h"
|
||||
#endif // wxUSE_TOOLTIPS
|
||||
@@ -102,19 +100,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl)
|
||||
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
|
||||
// ===========================================================================
|
||||
@@ -234,14 +219,6 @@ void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
{
|
||||
}
|
||||
|
||||
void wxRadioBox::GetSize(int *width, int *height) const
|
||||
{
|
||||
}
|
||||
|
||||
void wxRadioBox::GetPosition(int *x, int *y) const
|
||||
{
|
||||
}
|
||||
|
||||
void wxRadioBox::SetFocus()
|
||||
{
|
||||
}
|
||||
@@ -267,19 +244,10 @@ void wxRadioBox::Show(int item, bool show)
|
||||
{
|
||||
}
|
||||
|
||||
bool wxRadioBox::ContainsHWND(WXHWND hWnd) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxRadioBox::Command(wxCommandEvent & event)
|
||||
{
|
||||
}
|
||||
|
||||
void wxRadioBox::SubclassRadioButton(WXHWND hWndBtn)
|
||||
{
|
||||
}
|
||||
|
||||
void wxRadioBox::SendNotificationEvent()
|
||||
{
|
||||
}
|
||||
@@ -289,17 +257,4 @@ bool wxRadioBox::SetFont(const wxFont& font)
|
||||
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
|
||||
|
@@ -114,6 +114,10 @@ bool wxRadioButton::Create(wxWindow *parent,
|
||||
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;
|
||||
|
||||
|
@@ -251,6 +251,18 @@ void wxSlider::SetTick(int tickPos)
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// 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)
|
||||
{
|
||||
}
|
||||
|
@@ -47,6 +47,7 @@
|
||||
#include "wx/checkbox.h"
|
||||
#include "wx/radiobut.h"
|
||||
#include "wx/tglbtn.h"
|
||||
#include "wx/slider.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// globals
|
||||
@@ -268,6 +269,10 @@ bool wxTopLevelWindowPalm::HandleControlSelect(EventType* event)
|
||||
if(radio)
|
||||
return radio->SendClickEvent();
|
||||
|
||||
wxSlider* slider = wxDynamicCast(win,wxSlider);
|
||||
if(slider)
|
||||
return slider->SendUpdatedEvent();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user