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:
@@ -134,15 +134,6 @@ wxButton::~wxButton()
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// flags
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
WXDWORD wxButton::MSWGetStyle(long style, WXDWORD *exstyle) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// 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
|
||||
|
||||
|
@@ -2,10 +2,10 @@
|
||||
// Name: src/palmos/checkbox.cpp
|
||||
// Purpose: wxCheckBox
|
||||
// Author: William Osborne - minimal working wxPalmOS port
|
||||
// Modified by:
|
||||
// Modified by: Wlodzimierz ABX Skiba - native implementation
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) William Osborne
|
||||
// Copyright: (c) William Osborne, Wlodzimierz Skiba
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -37,20 +37,6 @@
|
||||
#include "wx/settings.h"
|
||||
#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
|
||||
// ============================================================================
|
||||
@@ -112,11 +98,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxCheckBox, wxControl)
|
||||
// wxCheckBox
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxCheckBox::MSWCommand(WXUINT WXUNUSED(param), WXWORD WXUNUSED(id))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxCheckBox::Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& label,
|
||||
@@ -125,11 +106,8 @@ bool wxCheckBox::Create(wxWindow *parent,
|
||||
const wxValidator& validator,
|
||||
const wxString& name)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxCheckBox::SetLabel(const wxString& label)
|
||||
{
|
||||
wxControl::PalmCreateControl(checkboxCtl, parent, id, label, pos, size);
|
||||
return true;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
}
|
||||
|
@@ -2,10 +2,10 @@
|
||||
// Name: src/palmos/control.cpp
|
||||
// Purpose: wxControl class
|
||||
// Author: William Osborne - minimal working wxPalmOS port
|
||||
// Modified by:
|
||||
// Modified by: Wlodzimierz ABX Skiba - native implementation
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) William Osborne
|
||||
// Copyright: (c) William Osborne, Wlodzimierz Skiba
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -39,6 +39,10 @@
|
||||
#endif
|
||||
|
||||
#include "wx/control.h"
|
||||
#include "wx/toplevel.h"
|
||||
#include "wx/button.h"
|
||||
#include "wx/checkbox.h"
|
||||
#include "wx/tglbtn.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxWin macros
|
||||
@@ -92,8 +96,19 @@ bool wxControl::PalmCreateControl(ControlStyleType style,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size)
|
||||
{
|
||||
FormType* form = FrmGetActiveForm ();
|
||||
m_control = CtlNewControl (
|
||||
wxWindow* parentTLW = parent;
|
||||
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,
|
||||
id,
|
||||
style,
|
||||
@@ -110,8 +125,6 @@ bool wxControl::PalmCreateControl(ControlStyleType style,
|
||||
if(m_control==NULL)
|
||||
return false;
|
||||
|
||||
form = FrmGetActiveForm ();
|
||||
m_objectIndex = FrmGetObjectIndex(form, id);
|
||||
Show();
|
||||
return true;
|
||||
}
|
||||
@@ -158,12 +171,36 @@ bool wxControl::IsShown() const
|
||||
bool wxControl::Show( bool show )
|
||||
{
|
||||
if(show)
|
||||
FrmShowObject(FrmGetActiveForm(), m_objectIndex);
|
||||
CtlShowControl(m_control);
|
||||
else
|
||||
FrmHideObject(FrmGetActiveForm(), m_objectIndex);
|
||||
CtlHideControl(m_control);
|
||||
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
|
||||
wxControl::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
|
||||
{
|
||||
|
@@ -2,10 +2,10 @@
|
||||
// Name: src/palmos/slider.cpp
|
||||
// Purpose: wxSlider
|
||||
// Author: William Osborne - minimal working wxPalmOS port
|
||||
// Modified by:
|
||||
// Modified by: Wlodzimierz ABX Skiba - native implementation
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) William Osborne
|
||||
// Copyright: (c) William Osborne, Wlodzimierz Skiba
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -28,8 +28,7 @@
|
||||
#include "wx/slider.h"
|
||||
#endif
|
||||
|
||||
#include "wx/palmos/slider.h"
|
||||
#include "wx/palmos/private.h"
|
||||
#include "wx/toplevel.h"
|
||||
|
||||
#if wxUSE_EXTENDED_RTTI
|
||||
WX_DEFINE_FLAGS( wxSliderStyle )
|
||||
@@ -110,22 +109,74 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id,
|
||||
const wxValidator& validator,
|
||||
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,
|
||||
WXWORD WXUNUSED(pos), WXHWND control)
|
||||
{
|
||||
return false;
|
||||
SetParent(parent);
|
||||
|
||||
SliderControlType *slider = CtlNewSliderControl (
|
||||
(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()
|
||||
{
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
return 0;
|
||||
uint16_t ret;
|
||||
CtlGetSliderValues(m_control, NULL, NULL, NULL, &ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
}
|
||||
@@ -169,11 +214,6 @@ void wxSlider::SetPageSize(int pageSize)
|
||||
{
|
||||
}
|
||||
|
||||
int wxSlider::GetPageSize() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
}
|
||||
|
||||
bool wxSlider::Show(bool show)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // wxUSE_SLIDER
|
||||
|
@@ -3,10 +3,10 @@
|
||||
// Purpose: Definition of the wxToggleButton class, which implements a
|
||||
// toggle button.
|
||||
// Author: William Osborne - minimal working wxPalmOS port
|
||||
// Modified by:
|
||||
// Modified by: Wlodzimierz ABX Skiba - native implementation
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) William Osborne
|
||||
// Copyright: (c) William Osborne, Wlodzimierz Skiba
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#include "wx/tglbtn.h"
|
||||
|
||||
#if wxUSE_TOGGLEBTN
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
@@ -37,7 +35,7 @@
|
||||
#include "wx/log.h"
|
||||
#endif // WX_PRECOMP
|
||||
|
||||
#include "wx/palmos/private.h"
|
||||
#include "wx/tglbtn.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// macros
|
||||
@@ -46,8 +44,6 @@
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxToggleButton, wxControl)
|
||||
DEFINE_EVENT_TYPE(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED)
|
||||
|
||||
#define BUTTON_HEIGHT_FROM_CHAR_HEIGHT(cy) (11*EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy)/10)
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
@@ -56,15 +52,6 @@ DEFINE_EVENT_TYPE(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED)
|
||||
// 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
|
||||
bool wxToggleButton::Create(wxWindow *parent, wxWindowID id,
|
||||
const wxString& label,
|
||||
@@ -73,7 +60,8 @@ bool wxToggleButton::Create(wxWindow *parent, wxWindowID id,
|
||||
const wxValidator& validator,
|
||||
const wxString& name)
|
||||
{
|
||||
return false;
|
||||
wxControl::PalmCreateControl(pushButtonCtl, parent, id, label, pos, size);
|
||||
return true;
|
||||
}
|
||||
|
||||
wxBorder wxToggleButton::GetDefaultBorder() const
|
||||
@@ -81,15 +69,6 @@ wxBorder wxToggleButton::GetDefaultBorder() const
|
||||
return wxBORDER_NONE;
|
||||
}
|
||||
|
||||
WXDWORD wxToggleButton::MSWGetStyle(long style, WXDWORD *exstyle) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void wxToggleButton::SetLabel(const wxString& label)
|
||||
{
|
||||
}
|
||||
|
||||
wxSize wxToggleButton::DoGetBestSize() const
|
||||
{
|
||||
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
|
||||
{
|
||||
return false;
|
||||
|
@@ -210,6 +210,11 @@ bool wxTopLevelWindowPalm::EnableCloseButton(bool enable)
|
||||
return false;
|
||||
}
|
||||
|
||||
FormType *wxTopLevelWindowPalm::GetForm()
|
||||
{
|
||||
return FrmGetActiveForm ();
|
||||
}
|
||||
|
||||
#ifndef __WXWINCE__
|
||||
|
||||
bool wxTopLevelWindowPalm::SetShape(const wxRegion& region)
|
||||
|
Reference in New Issue
Block a user