wxButton, wxCheckBox, wxSlider, wxToggleButton native implementations for PalmOS.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31589 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2005-01-25 06:55:10 +00:00
parent 3a0c618112
commit bdb5436554
17 changed files with 151 additions and 162 deletions

View File

@@ -114,6 +114,9 @@ wxPalmOS:
- native wxColourDialog implementation - native wxColourDialog implementation
- native wxSystemSettings colours - native wxSystemSettings colours
- native wxButton implementation - native wxButton implementation
- native wxCheckBox implementation
- native wxSlider implementation
- native wxToggleButton implementation
2.5.3 2.5.3

View File

@@ -135,6 +135,8 @@ private:
#include "wx/cocoa/checkbox.h" #include "wx/cocoa/checkbox.h"
#elif defined(__WXPM__) #elif defined(__WXPM__)
#include "wx/os2/checkbox.h" #include "wx/os2/checkbox.h"
#elif defined(__WXPALMOS__)
#include "wx/palmos/checkbox.h"
#endif #endif
#endif // wxUSE_CHECKBOX #endif // wxUSE_CHECKBOX

View File

@@ -51,7 +51,6 @@ public:
// implementation from now on // implementation from now on
virtual void Command(wxCommandEvent& event); virtual void Command(wxCommandEvent& event);
virtual bool MSWCommand(WXUINT param, WXWORD id);
virtual void ApplyParentThemeBackground(const wxColour& bg) virtual void ApplyParentThemeBackground(const wxColour& bg)
{ {
@@ -72,7 +71,6 @@ protected:
// usually overridden base class virtuals // usually overridden base class virtuals
virtual wxSize DoGetBestSize() const; virtual wxSize DoGetBestSize() const;
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const ;
private: private:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxButton) DECLARE_DYNAMIC_CLASS_NO_COPY(wxButton)

View File

@@ -2,10 +2,10 @@
// Name: wx/palmos/checkbox.h // Name: wx/palmos/checkbox.h
// Purpose: wxCheckBox class // Purpose: wxCheckBox class
// Author: William Osborne - minimal working wxPalmOS port // Author: William Osborne - minimal working wxPalmOS port
// Modified by: // Modified by: Wlodzimierz ABX Skiba - native implementation
// Created: 10/13/04 // Created: 10/13/04
// RCS-ID: $Id$ // RCS-ID: $Id$
// Copyright: (c) William Osborne // Copyright: (c) William Osborne, Wlodzimierz Skiba
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
@@ -45,9 +45,6 @@ public:
virtual void SetValue(bool value); virtual void SetValue(bool value);
virtual bool GetValue() const; virtual bool GetValue() const;
virtual void SetLabel(const wxString& label);
virtual bool MSWCommand(WXUINT param, WXWORD id);
virtual void Command(wxCommandEvent& event); virtual void Command(wxCommandEvent& event);
protected: protected:

View File

@@ -2,10 +2,10 @@
// Name: wx/palmos/control.h // Name: wx/palmos/control.h
// Purpose: wxControl class // Purpose: wxControl class
// Author: William Osborne - minimal working wxPalmOS port // Author: William Osborne - minimal working wxPalmOS port
// Modified by: // Modified by: Wlodzimierz ABX Skiba - native implementation
// Created: 10/13/04 // Created: 10/13/04
// RCS-ID: $Id$ // RCS-ID: $Id$
// Copyright: (c) William Osborne // Copyright: (c) William Osborne, Wlodzimierz Skiba
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
@@ -50,6 +50,9 @@ public:
virtual bool Show( bool show = true ); virtual bool Show( bool show = true );
virtual bool IsShown() const; virtual bool IsShown() const;
virtual void SetLabel(const wxString& label);
virtual wxString GetLabel();
// implementation from now on // implementation from now on
// -------------------------- // --------------------------
@@ -103,7 +106,6 @@ protected:
wxArrayLong m_subControls; wxArrayLong m_subControls;
ControlType *m_control; ControlType *m_control;
uint16_t m_objectIndex;
private: private:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxControl) DECLARE_DYNAMIC_CLASS_NO_COPY(wxControl)

View File

@@ -512,7 +512,7 @@
#define wxUSE_BUTTON 1 // wxButton #define wxUSE_BUTTON 1 // wxButton
#define wxUSE_BMPBUTTON 0 // wxBitmapButton #define wxUSE_BMPBUTTON 0 // wxBitmapButton
#define wxUSE_CALENDARCTRL 0 // wxCalendarCtrl #define wxUSE_CALENDARCTRL 0 // wxCalendarCtrl
#define wxUSE_CHECKBOX 0 // wxCheckBox #define wxUSE_CHECKBOX 1 // wxCheckBox
#define wxUSE_CHECKLISTBOX 0 // wxCheckListBox (requires wxUSE_OWNER_DRAWN) #define wxUSE_CHECKLISTBOX 0 // wxCheckListBox (requires wxUSE_OWNER_DRAWN)
#define wxUSE_CHOICE 0 // wxChoice #define wxUSE_CHOICE 0 // wxChoice
#define wxUSE_COMBOBOX 0 // wxComboBox #define wxUSE_COMBOBOX 0 // wxComboBox
@@ -523,7 +523,7 @@
#define wxUSE_RADIOBOX 0 // wxRadioBox #define wxUSE_RADIOBOX 0 // wxRadioBox
#define wxUSE_RADIOBTN 0 // wxRadioButton #define wxUSE_RADIOBTN 0 // wxRadioButton
#define wxUSE_SCROLLBAR 0 // wxScrollBar #define wxUSE_SCROLLBAR 0 // wxScrollBar
#define wxUSE_SLIDER 0 // wxSlider #define wxUSE_SLIDER 1 // wxSlider
#define wxUSE_SPINBTN 0 // wxSpinButton #define wxUSE_SPINBTN 0 // wxSpinButton
#define wxUSE_SPINCTRL 0 // wxSpinCtrl #define wxUSE_SPINCTRL 0 // wxSpinCtrl
#define wxUSE_STATBOX 0 // wxStaticBox #define wxUSE_STATBOX 0 // wxStaticBox
@@ -531,7 +531,7 @@
#define wxUSE_STATTEXT 0 // wxStaticText #define wxUSE_STATTEXT 0 // wxStaticText
#define wxUSE_STATBMP 0 // wxStaticBitmap #define wxUSE_STATBMP 0 // wxStaticBitmap
#define wxUSE_TEXTCTRL 0 // wxTextCtrl #define wxUSE_TEXTCTRL 0 // wxTextCtrl
#define wxUSE_TOGGLEBTN 0 // requires wxButton #define wxUSE_TOGGLEBTN 1 // requires wxButton
#define wxUSE_TREECTRL 0 // wxTreeCtrl #define wxUSE_TREECTRL 0 // wxTreeCtrl
// Use a status bar class? Depending on the value of wxUSE_NATIVE_STATUSBAR // Use a status bar class? Depending on the value of wxUSE_NATIVE_STATUSBAR

View File

@@ -2,10 +2,10 @@
// Name: wx/palmos/slider95.h // Name: wx/palmos/slider95.h
// Purpose: wxSlider class // Purpose: wxSlider class
// Author: William Osborne - minimal working wxPalmOS port // Author: William Osborne - minimal working wxPalmOS port
// Modified by: // Modified by: Wlodzimierz ABX Skiba - native implementation
// Created: 10/13/04 // Created: 10/13/04
// RCS-ID: $Id$ // RCS-ID: $Id$
// Copyright: (c) William Osborne // Copyright: (c) William Osborne, Wlodzimierz Skiba
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
@@ -48,16 +48,14 @@ public:
void GetPosition(int *x, int *y) const; void GetPosition(int *x, int *y) const;
bool Show(bool show = TRUE);
void SetRange(int minValue, int maxValue); void SetRange(int minValue, int maxValue);
int GetMin() const { return m_rangeMin; } int GetMin() const;
int GetMax() const { return m_rangeMax; } int GetMax() const;
// For trackbars only // For trackbars only
void SetTickFreq(int n, int pos); void SetTickFreq(int n, int pos);
int GetTickFreq() const { return m_tickFreq; } int GetTickFreq() const { return GetPageSize(); }
void SetPageSize(int pageSize); void SetPageSize(int pageSize);
int GetPageSize() const; int GetPageSize() const;
void ClearSel(); void ClearSel();
@@ -71,28 +69,10 @@ public:
int GetThumbLength() const; int GetThumbLength() const;
void SetTick(int tickPos); void SetTick(int tickPos);
// IMPLEMENTATION // implementation
WXHWND GetStaticMin() const { return m_staticMin; }
WXHWND GetStaticMax() const { return m_staticMax; }
WXHWND GetEditValue() const { return m_staticValue; }
virtual bool ContainsHWND(WXHWND hWnd) const;
void Command(wxCommandEvent& event); void Command(wxCommandEvent& event);
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
virtual bool MSWOnScroll(int orientation, WXWORD wParam,
WXWORD pos, WXHWND control);
protected: protected:
WXHWND m_staticMin;
WXHWND m_staticMax;
WXHWND m_staticValue;
int m_rangeMin;
int m_rangeMax;
int m_pageSize;
int m_lineSize;
int m_tickFreq;
virtual void DoGetSize(int *width, int *height) const; virtual void DoGetSize(int *width, int *height) const;
virtual void DoSetSize(int x, int y, virtual void DoSetSize(int x, int y,

View File

@@ -3,10 +3,10 @@
// Purpose: Declaration of the wxToggleButton class, which implements a // Purpose: Declaration of the wxToggleButton class, which implements a
// toggle button under Palm OS. // toggle button under Palm OS.
// Author: William Osborne - minimal working wxPalmOS port // Author: William Osborne - minimal working wxPalmOS port
// Modified by: // Modified by: Wlodzimierz ABX Skiba - native implementation
// Created: 10/13/04 // Created: 10/13/04
// RCS-ID: $Id$ // RCS-ID: $Id$
// Copyright: (c) William Osborne // Copyright: (c) William Osborne, Wlodzimierz Skiba
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
@@ -44,14 +44,11 @@ public:
virtual void SetValue(bool value); virtual void SetValue(bool value);
virtual bool GetValue() const ; virtual bool GetValue() const ;
virtual bool MSWCommand(WXUINT param, WXWORD id);
virtual void SetLabel(const wxString& label);
virtual void Command(wxCommandEvent& event); virtual void Command(wxCommandEvent& event);
protected: protected:
virtual wxSize DoGetBestSize() const; virtual wxSize DoGetBestSize() const;
virtual wxBorder GetDefaultBorder() const; virtual wxBorder GetDefaultBorder() const;
virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle = NULL) const;
private: private:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxToggleButton) DECLARE_DYNAMIC_CLASS_NO_COPY(wxToggleButton)

View File

@@ -81,6 +81,9 @@ public:
void SetLastFocus(wxWindow *win) { m_winLastFocused = win; } void SetLastFocus(wxWindow *win) { m_winLastFocused = win; }
wxWindow *GetLastFocus() const { return m_winLastFocused; } wxWindow *GetLastFocus() const { return m_winLastFocused; }
// interface to native frame structure
FormType *GetForm();
protected: protected:
// common part of all ctors // common part of all ctors
void Init(); void Init();

View File

@@ -108,6 +108,8 @@ private:
#include "wx/cocoa/slider.h" #include "wx/cocoa/slider.h"
#elif defined(__WXPM__) #elif defined(__WXPM__)
#include "wx/os2/slider.h" #include "wx/os2/slider.h"
#elif defined(__WXPALMOS__)
#include "wx/palmos/slider.h"
#endif #endif
#endif // wxUSE_SLIDER #endif // wxUSE_SLIDER

View File

@@ -34,6 +34,8 @@ END_DECLARE_EVENT_TYPES()
#include "wx/motif/tglbtn.h" #include "wx/motif/tglbtn.h"
#elif defined(__WXMAC__) #elif defined(__WXMAC__)
#include "wx/mac/tglbtn.h" #include "wx/mac/tglbtn.h"
#elif defined(__WXPALMOS__)
#include "wx/palmos/tglbtn.h"
/* /*
# elif defined(__WXPM__) # elif defined(__WXPM__)
# include "wx/os2/tglbtn.h" # include "wx/os2/tglbtn.h"

View File

@@ -134,15 +134,6 @@ wxButton::~wxButton()
{ {
} }
// ----------------------------------------------------------------------------
// flags
// ----------------------------------------------------------------------------
WXDWORD wxButton::MSWGetStyle(long style, WXDWORD *exstyle) const
{
return 0;
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// size management including autosizing // size management including autosizing
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -189,14 +180,5 @@ void wxButton::Command(wxCommandEvent & event)
{ {
} }
// ----------------------------------------------------------------------------
// event/message handlers
// ----------------------------------------------------------------------------
bool wxButton::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
{
return false;
}
#endif // wxUSE_BUTTON #endif // wxUSE_BUTTON

View File

@@ -2,10 +2,10 @@
// Name: src/palmos/checkbox.cpp // Name: src/palmos/checkbox.cpp
// Purpose: wxCheckBox // Purpose: wxCheckBox
// Author: William Osborne - minimal working wxPalmOS port // Author: William Osborne - minimal working wxPalmOS port
// Modified by: // Modified by: Wlodzimierz ABX Skiba - native implementation
// Created: 10/13/04 // Created: 10/13/04
// RCS-ID: $Id$ // RCS-ID: $Id$
// Copyright: (c) William Osborne // Copyright: (c) William Osborne, Wlodzimierz Skiba
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
@@ -37,20 +37,6 @@
#include "wx/settings.h" #include "wx/settings.h"
#endif #endif
#include "wx/palmos/private.h"
#ifndef BST_UNCHECKED
#define BST_UNCHECKED 0x0000
#endif
#ifndef BST_CHECKED
#define BST_CHECKED 0x0001
#endif
#ifndef BST_INDETERMINATE
#define BST_INDETERMINATE 0x0002
#endif
// ============================================================================ // ============================================================================
// implementation // implementation
// ============================================================================ // ============================================================================
@@ -112,11 +98,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxCheckBox, wxControl)
// wxCheckBox // wxCheckBox
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
bool wxCheckBox::MSWCommand(WXUINT WXUNUSED(param), WXWORD WXUNUSED(id))
{
return true;
}
bool wxCheckBox::Create(wxWindow *parent, bool wxCheckBox::Create(wxWindow *parent,
wxWindowID id, wxWindowID id,
const wxString& label, const wxString& label,
@@ -125,11 +106,8 @@ bool wxCheckBox::Create(wxWindow *parent,
const wxValidator& validator, const wxValidator& validator,
const wxString& name) const wxString& name)
{ {
return false; wxControl::PalmCreateControl(checkboxCtl, parent, id, label, pos, size);
} return true;
void wxCheckBox::SetLabel(const wxString& label)
{
} }
wxSize wxCheckBox::DoGetBestSize() const wxSize wxCheckBox::DoGetBestSize() const
@@ -150,10 +128,6 @@ void wxCheckBox::Command(wxCommandEvent& event)
{ {
} }
wxCOMPILE_TIME_ASSERT(wxCHK_UNCHECKED == BST_UNCHECKED
&& wxCHK_CHECKED == BST_CHECKED
&& wxCHK_UNDETERMINED == BST_INDETERMINATE, EnumValuesIncorrect);
void wxCheckBox::DoSet3StateValue(wxCheckBoxState state) void wxCheckBox::DoSet3StateValue(wxCheckBoxState state)
{ {
} }

View File

@@ -2,10 +2,10 @@
// Name: src/palmos/control.cpp // Name: src/palmos/control.cpp
// Purpose: wxControl class // Purpose: wxControl class
// Author: William Osborne - minimal working wxPalmOS port // Author: William Osborne - minimal working wxPalmOS port
// Modified by: // Modified by: Wlodzimierz ABX Skiba - native implementation
// Created: 10/13/04 // Created: 10/13/04
// RCS-ID: $Id$ // RCS-ID: $Id$
// Copyright: (c) William Osborne // Copyright: (c) William Osborne, Wlodzimierz Skiba
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
@@ -39,6 +39,10 @@
#endif #endif
#include "wx/control.h" #include "wx/control.h"
#include "wx/toplevel.h"
#include "wx/button.h"
#include "wx/checkbox.h"
#include "wx/tglbtn.h"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxWin macros // wxWin macros
@@ -92,8 +96,19 @@ bool wxControl::PalmCreateControl(ControlStyleType style,
const wxPoint& pos, const wxPoint& pos,
const wxSize& size) const wxSize& size)
{ {
FormType* form = FrmGetActiveForm (); wxWindow* parentTLW = parent;
m_control = CtlNewControl ( while ( parentTLW && !parentTLW->IsTopLevel() )
{
parentTLW = parentTLW->GetParent();
}
wxTopLevelWindowPalm* tlw = wxDynamicCast(parentTLW, wxTopLevelWindowPalm);
if(!tlw)
return false;
FormType* form = tlw->GetForm();
SetParent(parent);
m_control = CtlNewControl(
(void **)&form, (void **)&form,
id, id,
style, style,
@@ -110,8 +125,6 @@ bool wxControl::PalmCreateControl(ControlStyleType style,
if(m_control==NULL) if(m_control==NULL)
return false; return false;
form = FrmGetActiveForm ();
m_objectIndex = FrmGetObjectIndex(form, id);
Show(); Show();
return true; return true;
} }
@@ -158,12 +171,36 @@ bool wxControl::IsShown() const
bool wxControl::Show( bool show ) bool wxControl::Show( bool show )
{ {
if(show) if(show)
FrmShowObject(FrmGetActiveForm(), m_objectIndex); CtlShowControl(m_control);
else else
FrmHideObject(FrmGetActiveForm(), m_objectIndex); CtlHideControl(m_control);
return true; return true;
} }
void wxControl::SetLabel(const wxString& label)
{
// setting in wrong control causes crash
if ( ( wxDynamicCast(this,wxButton) != NULL ) ||
( wxDynamicCast(this,wxCheckBox) != NULL ) ||
( wxDynamicCast(this,wxToggleButton) != NULL ) )
{
CtlSetLabel(m_control,label);
}
}
wxString wxControl::GetLabel()
{
// setting in wrong control causes crash
if ( wxDynamicCast(this,wxButton) ||
wxDynamicCast(this,wxCheckBox) ||
wxDynamicCast(this,wxToggleButton) )
{
return CtlGetLabel(m_control);
}
return wxEmptyString;
}
/* static */ wxVisualAttributes /* static */ wxVisualAttributes
wxControl::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant)) wxControl::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
{ {

View File

@@ -2,10 +2,10 @@
// Name: src/palmos/slider.cpp // Name: src/palmos/slider.cpp
// Purpose: wxSlider // Purpose: wxSlider
// Author: William Osborne - minimal working wxPalmOS port // Author: William Osborne - minimal working wxPalmOS port
// Modified by: // Modified by: Wlodzimierz ABX Skiba - native implementation
// Created: 10/13/04 // Created: 10/13/04
// RCS-ID: $Id$ // RCS-ID: $Id$
// Copyright: (c) William Osborne // Copyright: (c) William Osborne, Wlodzimierz Skiba
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
@@ -28,8 +28,7 @@
#include "wx/slider.h" #include "wx/slider.h"
#endif #endif
#include "wx/palmos/slider.h" #include "wx/toplevel.h"
#include "wx/palmos/private.h"
#if wxUSE_EXTENDED_RTTI #if wxUSE_EXTENDED_RTTI
WX_DEFINE_FLAGS( wxSliderStyle ) WX_DEFINE_FLAGS( wxSliderStyle )
@@ -110,22 +109,74 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id,
const wxValidator& validator, const wxValidator& validator,
const wxString& name) const wxString& name)
{ {
return false; wxWindow* parentTLW = GetParent();
} while ( parentTLW && !parentTLW->IsTopLevel() )
{
parentTLW = parentTLW->GetParent();
}
wxTopLevelWindowPalm* tlw = wxDynamicCast(parentTLW, wxTopLevelWindowPalm);
if(!tlw)
return false;
FormType* form = tlw->GetForm();
bool wxSlider::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam, SetParent(parent);
WXWORD WXUNUSED(pos), WXHWND control)
{ SliderControlType *slider = CtlNewSliderControl (
return false; (void **)&form,
id,
feedbackSliderCtl,
NULL,
0,
0,
pos.x,
pos.y,
size.x,
size.y,
minValue,
maxValue,
1,
value
);
m_control = (ControlType*) slider;
if(m_control==NULL)
return false;
Show();
return true;
} }
wxSlider::~wxSlider() wxSlider::~wxSlider()
{ {
} }
int wxSlider::GetMin() const
{
uint16_t ret;
CtlGetSliderValues(m_control, &ret, NULL, NULL, NULL);
return ret;
}
int wxSlider::GetMax() const
{
uint16_t ret;
CtlGetSliderValues(m_control, NULL, &ret, NULL, NULL);
return ret;
}
int wxSlider::GetPageSize() const
{
uint16_t ret;
CtlGetSliderValues(m_control, NULL, NULL, &ret, NULL);
return ret;
}
int wxSlider::GetValue() const int wxSlider::GetValue() const
{ {
return 0; uint16_t ret;
CtlGetSliderValues(m_control, NULL, NULL, NULL, &ret);
return ret;
} }
void wxSlider::SetValue(int value) void wxSlider::SetValue(int value)
@@ -155,12 +206,6 @@ void wxSlider::SetRange(int minValue, int maxValue)
{ {
} }
WXHBRUSH wxSlider::OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
{
return 0;
}
void wxSlider::SetTickFreq(int n, int pos) void wxSlider::SetTickFreq(int n, int pos)
{ {
} }
@@ -169,11 +214,6 @@ void wxSlider::SetPageSize(int pageSize)
{ {
} }
int wxSlider::GetPageSize() const
{
return 0;
}
void wxSlider::ClearSel() void wxSlider::ClearSel()
{ {
} }
@@ -218,18 +258,8 @@ void wxSlider::SetTick(int tickPos)
{ {
} }
bool wxSlider::ContainsHWND(WXHWND hWnd) const
{
return false;
}
void wxSlider::Command (wxCommandEvent & event) void wxSlider::Command (wxCommandEvent & event)
{ {
} }
bool wxSlider::Show(bool show)
{
return false;
}
#endif // wxUSE_SLIDER #endif // wxUSE_SLIDER

View File

@@ -3,10 +3,10 @@
// Purpose: Definition of the wxToggleButton class, which implements a // Purpose: Definition of the wxToggleButton class, which implements a
// toggle button. // toggle button.
// Author: William Osborne - minimal working wxPalmOS port // Author: William Osborne - minimal working wxPalmOS port
// Modified by: // Modified by: Wlodzimierz ABX Skiba - native implementation
// Created: 10/13/04 // Created: 10/13/04
// RCS-ID: $Id$ // RCS-ID: $Id$
// Copyright: (c) William Osborne // Copyright: (c) William Osborne, Wlodzimierz Skiba
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
@@ -24,8 +24,6 @@
#pragma hdrstop #pragma hdrstop
#endif #endif
#include "wx/tglbtn.h"
#if wxUSE_TOGGLEBTN #if wxUSE_TOGGLEBTN
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
@@ -37,7 +35,7 @@
#include "wx/log.h" #include "wx/log.h"
#endif // WX_PRECOMP #endif // WX_PRECOMP
#include "wx/palmos/private.h" #include "wx/tglbtn.h"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// macros // macros
@@ -46,8 +44,6 @@
IMPLEMENT_DYNAMIC_CLASS(wxToggleButton, wxControl) IMPLEMENT_DYNAMIC_CLASS(wxToggleButton, wxControl)
DEFINE_EVENT_TYPE(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED) DEFINE_EVENT_TYPE(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED)
#define BUTTON_HEIGHT_FROM_CHAR_HEIGHT(cy) (11*EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy)/10)
// ============================================================================ // ============================================================================
// implementation // implementation
// ============================================================================ // ============================================================================
@@ -56,15 +52,6 @@ DEFINE_EVENT_TYPE(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED)
// wxToggleButton // wxToggleButton
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
bool wxToggleButton::MSWCommand(WXUINT WXUNUSED(param), WXWORD WXUNUSED(id))
{
wxCommandEvent event(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, m_windowId);
event.SetInt(GetValue());
event.SetEventObject(this);
ProcessCommand(event);
return TRUE;
}
// Single check box item // Single check box item
bool wxToggleButton::Create(wxWindow *parent, wxWindowID id, bool wxToggleButton::Create(wxWindow *parent, wxWindowID id,
const wxString& label, const wxString& label,
@@ -73,7 +60,8 @@ bool wxToggleButton::Create(wxWindow *parent, wxWindowID id,
const wxValidator& validator, const wxValidator& validator,
const wxString& name) const wxString& name)
{ {
return false; wxControl::PalmCreateControl(pushButtonCtl, parent, id, label, pos, size);
return true;
} }
wxBorder wxToggleButton::GetDefaultBorder() const wxBorder wxToggleButton::GetDefaultBorder() const
@@ -81,15 +69,6 @@ wxBorder wxToggleButton::GetDefaultBorder() const
return wxBORDER_NONE; return wxBORDER_NONE;
} }
WXDWORD wxToggleButton::MSWGetStyle(long style, WXDWORD *exstyle) const
{
return 0;
}
void wxToggleButton::SetLabel(const wxString& label)
{
}
wxSize wxToggleButton::DoGetBestSize() const wxSize wxToggleButton::DoGetBestSize() const
{ {
return wxSize(0,0); return wxSize(0,0);
@@ -99,10 +78,6 @@ void wxToggleButton::SetValue(bool val)
{ {
} }
#ifndef BST_CHECKED
#define BST_CHECKED 0x0001
#endif
bool wxToggleButton::GetValue() const bool wxToggleButton::GetValue() const
{ {
return false; return false;

View File

@@ -210,6 +210,11 @@ bool wxTopLevelWindowPalm::EnableCloseButton(bool enable)
return false; return false;
} }
FormType *wxTopLevelWindowPalm::GetForm()
{
return FrmGetActiveForm ();
}
#ifndef __WXWINCE__ #ifndef __WXWINCE__
bool wxTopLevelWindowPalm::SetShape(const wxRegion& region) bool wxTopLevelWindowPalm::SetShape(const wxRegion& region)