projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
don't run vsnprintf() test if we're using the system version, there is nothing we...
[wxWidgets.git]
/
src
/
palmos
/
control.cpp
diff --git
a/src/palmos/control.cpp
b/src/palmos/control.cpp
index 3b9b881995a1914e6f47fb3811597882f4537597..39033e863d4d3c87d377e345e2d8959f6ece8a15 100644
(file)
--- a/
src/palmos/control.cpp
+++ b/
src/palmos/control.cpp
@@
-17,10
+17,6
@@
// headers
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
- #pragma implementation "control.h"
-#endif
-
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
@@
-30,21
+26,30
@@
#if wxUSE_CONTROLS
#if wxUSE_CONTROLS
+#include "wx/control.h"
+
#ifndef WX_PRECOMP
#include "wx/event.h"
#include "wx/app.h"
#include "wx/dcclient.h"
#include "wx/log.h"
#include "wx/settings.h"
#ifndef WX_PRECOMP
#include "wx/event.h"
#include "wx/app.h"
#include "wx/dcclient.h"
#include "wx/log.h"
#include "wx/settings.h"
+ #include "wx/button.h"
+ #include "wx/checkbox.h"
+ #include "wx/radiobut.h"
+ #include "wx/slider.h"
+ #include "wx/toplevel.h"
#endif
#endif
-#include "wx/control.h"
-#include "wx/toplevel.h"
-#include "wx/button.h"
-#include "wx/checkbox.h"
#include "wx/tglbtn.h"
#include "wx/tglbtn.h"
-#include "wx/radiobut.h"
-#include "wx/slider.h"
+
+#include <Control.h>
+#include <Form.h>
+#ifdef __WXPALMOS6__
+ #include <StatusBar.h>
+#else
+ #include <PenInputMgr.h>
+#endif // __WXPALMOS6__
// ----------------------------------------------------------------------------
// wxWin macros
// ----------------------------------------------------------------------------
// wxWin macros
@@
-78,7
+83,7
@@
wxControl::~wxControl()
DestroyChildren();
uint16_t index;
DestroyChildren();
uint16_t index;
- FormType* form = GetObjectFormIndex(index);
+ FormType* form =
(FormType*)
GetObjectFormIndex(index);
if(form!=NULL && index!=frmInvalidObjectId)
{
FrmRemoveObject((FormType **)&form,index);
if(form!=NULL && index!=frmInvalidObjectId)
{
FrmRemoveObject((FormType **)&form,index);
@@
-107,13
+112,13
@@
bool wxControl::Create(wxWindow *parent,
return true;
}
return true;
}
-bool wxControl::PalmCreateControl(
ControlStyleType
style,
+bool wxControl::PalmCreateControl(
int
style,
const wxString& label,
const wxPoint& pos,
const wxSize& size,
uint8_t groupID)
{
const wxString& label,
const wxPoint& pos,
const wxSize& size,
uint8_t groupID)
{
- FormType* form = GetParentForm();
+ FormType* form =
(FormType*)
GetParentForm();
if(form==NULL)
return false;
if(form==NULL)
return false;
@@
-135,8
+140,8
@@
bool wxControl::PalmCreateControl(ControlStyleType style,
ControlType *control = CtlNewControl(
(void **)&form,
GetId(),
ControlType *control = CtlNewControl(
(void **)&form,
GetId(),
- style,
-
wxEmptyString
,
+
(ControlStyleType)
style,
+
NULL
,
x,
y,
w,
x,
y,
w,
@@
-151,7
+156,7
@@
bool wxControl::PalmCreateControl(ControlStyleType style,
m_palmControl = true;
m_palmControl = true;
- SetInitial
Best
Size(size);
+ SetInitialSize(size);
SetLabel(label);
Show();
return true;
SetLabel(label);
Show();
return true;
@@
-162,9
+167,9
@@
bool wxControl::PalmCreateField(const wxString& label,
const wxSize& size,
bool editable,
bool underlined,
const wxSize& size,
bool editable,
bool underlined,
-
JustificationType
justification)
+
int
justification)
{
{
- FormType* form = GetParentForm();
+ FormType* form =
(FormType*)
GetParentForm();
if(form==NULL)
return false;
if(form==NULL)
return false;
@@
-190,7
+195,7
@@
bool wxControl::PalmCreateField(const wxString& label,
underlined,
false,
false,
underlined,
false,
false,
- justification,
+
(JustificationType)
justification,
false,
false,
false
false,
false,
false
@@
-201,7
+206,7
@@
bool wxControl::PalmCreateField(const wxString& label,
m_palmField = true;
m_palmField = true;
- SetInitial
Best
Size(size);
+ SetInitialSize(size);
SetLabel(label);
Show();
return true;
SetLabel(label);
Show();
return true;
@@
-211,7
+216,7
@@
bool wxControl::PalmCreateField(const wxString& label,
// various accessors
// ----------------------------------------------------------------------------
// various accessors
// ----------------------------------------------------------------------------
-
FormType*
wxControl::GetParentForm() const
+
WXFORMPTR
wxControl::GetParentForm() const
{
wxWindow* parentTLW = GetParent();
while ( parentTLW && !parentTLW->IsTopLevel() )
{
wxWindow* parentTLW = GetParent();
while ( parentTLW && !parentTLW->IsTopLevel() )
@@
-224,9
+229,9
@@
FormType* wxControl::GetParentForm() const
return tlw->GetForm();
}
return tlw->GetForm();
}
-
FormType*
wxControl::GetObjectFormIndex(uint16_t& index) const
+
WXFORMPTR
wxControl::GetObjectFormIndex(uint16_t& index) const
{
{
- FormType* form = GetParentForm();
+ FormType* form =
(FormType* )
GetParentForm();
if(form!=NULL)
index = FrmGetObjectIndex(form, GetId());
else
if(form!=NULL)
index = FrmGetObjectIndex(form, GetId());
else
@@
-237,7
+242,7
@@
FormType* wxControl::GetObjectFormIndex(uint16_t& index) const
void* wxControl::GetObjectPtr() const
{
uint16_t index;
void* wxControl::GetObjectPtr() const
{
uint16_t index;
- FormType* form = GetObjectFormIndex(index);
+ FormType* form =
(FormType*)
GetObjectFormIndex(index);
if(form==NULL || index==frmInvalidObjectId)return NULL;
return FrmGetObjectPtr(form,index);
}
if(form==NULL || index==frmInvalidObjectId)return NULL;
return FrmGetObjectPtr(form,index);
}
@@
-252,7
+257,7
@@
wxBorder wxControl::GetDefaultBorder() const
void wxControl::SetIntValue(int val)
{
void wxControl::SetIntValue(int val)
{
- FormType* form = GetParentForm();
+ FormType* form =
(FormType*)
GetParentForm();
if(form==NULL)
return;
uint16_t index = FrmGetObjectIndex(form, GetId());
if(form==NULL)
return;
uint16_t index = FrmGetObjectIndex(form, GetId());
@@
-268,7
+273,7
@@
void wxControl::SetBoolValue(bool val)
bool wxControl::GetBoolValue() const
{
bool wxControl::GetBoolValue() const
{
- FormType* form = GetParentForm();
+ FormType* form =
(FormType*)
GetParentForm();
if(form==NULL)
return false;
uint16_t index = FrmGetObjectIndex(form, GetId());
if(form==NULL)
return false;
uint16_t index = FrmGetObjectIndex(form, GetId());
@@
-282,26
+287,30
@@
wxSize wxControl::DoGetBestSize() const
return wxSize(16, 16);
}
return wxSize(16, 16);
}
-void wxControl::DoGetBounds(
RectangleType &
rect ) const
+void wxControl::DoGetBounds(
WXRECTANGLEPTR
rect ) const
{
{
- FormType* form = GetParentForm();
+ if(rect==NULL)
+ return;
+ FormType* form = (FormType*)GetParentForm();
if(form==NULL)
return;
uint16_t index = FrmGetObjectIndex(form,GetId());
if(index==frmInvalidObjectId)
return;
if(form==NULL)
return;
uint16_t index = FrmGetObjectIndex(form,GetId());
if(index==frmInvalidObjectId)
return;
- FrmGetObjectBounds(form,index,
&
rect);
+ FrmGetObjectBounds(form,index,
(RectangleType*)
rect);
}
}
-void wxControl::DoSetBounds(
RectangleType &
rect )
+void wxControl::DoSetBounds(
WXRECTANGLEPTR
rect )
{
{
- FormType* form = GetParentForm();
+ if(rect==NULL)
+ return;
+ FormType* form = (FormType*)GetParentForm();
if(form==NULL)
return;
uint16_t index = FrmGetObjectIndex(form,GetId());
if(index==frmInvalidObjectId)
return;
if(form==NULL)
return;
uint16_t index = FrmGetObjectIndex(form,GetId());
if(index==frmInvalidObjectId)
return;
- FrmSetObjectBounds(form,index,
&
rect);
+ FrmSetObjectBounds(form,index,
(RectangleType*)
rect);
}
void wxControl::DoGetPosition( int *x, int *y ) const
}
void wxControl::DoGetPosition( int *x, int *y ) const
@@
-310,7
+319,7
@@
void wxControl::DoGetPosition( int *x, int *y ) const
AdjustForParentClientOrigin(ox, oy);
RectangleType rect;
AdjustForParentClientOrigin(ox, oy);
RectangleType rect;
- DoGetBounds(rect);
+ DoGetBounds(
&
rect);
if(x)
*x = rect.topLeft.x - ox;
if(x)
*x = rect.topLeft.x - ox;
@@
-321,7
+330,7
@@
void wxControl::DoGetPosition( int *x, int *y ) const
void wxControl::DoGetSize( int *width, int *height ) const
{
RectangleType rect;
void wxControl::DoGetSize( int *width, int *height ) const
{
RectangleType rect;
- DoGetBounds(rect);
+ DoGetBounds(
&
rect);
if(width)
*width = rect.extent.x;
if(width)
*width = rect.extent.x;
@@
-337,7
+346,7
@@
void wxControl::DoMoveWindow(int x, int y, int width, int height)
rect.topLeft.y = y;
rect.extent.x = width;
rect.extent.y = height;
rect.topLeft.y = y;
rect.extent.x = width;
rect.extent.y = height;
- DoSetBounds(rect);
+ DoSetBounds(
&
rect);
GetParent()->Refresh(true, &area);
}
GetParent()->Refresh(true, &area);
}
@@
-367,7
+376,7
@@
bool wxControl::IsShown() const
bool wxControl::Show( bool show )
{
bool wxControl::Show( bool show )
{
- FormType* form = GetParentForm();
+ FormType* form =
(FormType*)
GetParentForm();
if(form==NULL)
return false;
uint16_t index = FrmGetObjectIndex(form,GetId());
if(form==NULL)
return false;
uint16_t index = FrmGetObjectIndex(form,GetId());
@@
-386,7
+395,7
@@
void wxControl::SetFieldLabel(const wxString& label)
if(field==NULL)
return;
if(field==NULL)
return;
- uint16_t newSize = label.
L
ength() + 1;
+ uint16_t newSize = label.
l
ength() + 1;
MemHandle strHandle = FldGetTextHandle(field);
FldSetTextHandle(field, NULL );
if (strHandle)
MemHandle strHandle = FldGetTextHandle(field);
FldSetTextHandle(field, NULL );
if (strHandle)
@@
-416,7
+425,7
@@
void wxControl::SetControlLabel(const wxString& label)
ControlType* control = (ControlType*)GetObjectPtr();
if(control==NULL)
return;
ControlType* control = (ControlType*)GetObjectPtr();
if(control==NULL)
return;
- CtlSetLabel(control,
wxEmptyString
);
+ CtlSetLabel(control,
""
);
m_label = label;
if(!m_label.empty())
CtlSetLabel(control,m_label.c_str());
m_label = label;
if(!m_label.empty())
CtlSetLabel(control,m_label.c_str());
@@
-447,7
+456,7
@@
wxString wxControl::GetControlLabel()
return wxEmptyString;
return CtlGetLabel(control);
}
return wxEmptyString;
return CtlGetLabel(control);
}
-
+#if 0
wxString wxControl::GetLabel()
{
if(IsPalmField())
wxString wxControl::GetLabel()
{
if(IsPalmField())
@@
-459,7
+468,7
@@
wxString wxControl::GetLabel()
return wxEmptyString;
}
return wxEmptyString;
}
-
+#endif
/* static */ wxVisualAttributes
wxControl::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
{
/* static */ wxVisualAttributes
wxControl::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
{
@@
-496,7
+505,7
@@
wxControl::GetCompositeControlsDefaultAttributes(wxWindowVariant WXUNUSED(varian
bool wxControl::ProcessCommand(wxCommandEvent& event)
{
bool wxControl::ProcessCommand(wxCommandEvent& event)
{
- return
GetEventHandler()->Process
Event(event);
+ return
HandleWindow
Event(event);
}
void wxControl::OnEraseBackground(wxEraseEvent& event)
}
void wxControl::OnEraseBackground(wxEraseEvent& event)