Inversed slider and wrapper for datepicker control on PalmOS. WinHandle instead of HWND as WXWidget type. Cleaning from wxMSW specific API. Moving controls support. Non deprecated API in new port. Refreshing of whole and portions of windows.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32032 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2005-02-14 10:49:02 +00:00
parent e7846404f7
commit 324eeecb3c
39 changed files with 435 additions and 967 deletions

View File

@@ -200,6 +200,7 @@ SOURCES = ../../samples/minimal/minimal.cpp \
../../src/palmos/control.cpp \ ../../src/palmos/control.cpp \
../../src/palmos/cursor.cpp \ ../../src/palmos/cursor.cpp \
../../src/palmos/data.cpp \ ../../src/palmos/data.cpp \
../../src/palmos/datectrl.cpp \
../../src/palmos/dc.cpp \ ../../src/palmos/dc.cpp \
../../src/palmos/dcclient.cpp \ ../../src/palmos/dcclient.cpp \
../../src/palmos/dcmemory.cpp \ ../../src/palmos/dcmemory.cpp \

View File

@@ -988,7 +988,7 @@ Returns the grandparent of a window, or NULL if there isn't one.
\constfunc{void*}{GetHandle}{\void} \constfunc{void*}{GetHandle}{\void}
Returns the platform-specific handle of the physical window. Cast it to an appropriate Returns the platform-specific handle of the physical window. Cast it to an appropriate
handle, such as {\bf HWND} for Windows, {\bf Widget} for Motif or {\bf GtkWidget} for GTK. handle, such as {\bf HWND} for Windows, {\bf Widget} for Motif, {\bf GtkWidget} for GTK or {\bf WinHandle} for PalmOS.
\pythonnote{This method will return an integer in wxPython.} \pythonnote{This method will return an integer in wxPython.}

View File

@@ -1262,6 +1262,17 @@
# endif # endif
#endif /* wxUSE_CALENDARCTRL */ #endif /* wxUSE_CALENDARCTRL */
#if wxUSE_DATEPICKCTRL
# if !wxUSE_DATETIME
# ifdef wxABORT_ON_CONFIG_ERROR
# error wxDatePickerCtrl requires wxUSE_DATETIME"
# else
# undef wxUSE_DATETIME
# define wxUSE_DATETIME 1
# endif
# endif
#endif /* wxUSE_DATEPICKCTRL */
#if wxUSE_CHECKLISTBOX #if wxUSE_CHECKLISTBOX
# if !wxUSE_LISTBOX # if !wxUSE_LISTBOX
# ifdef wxABORT_ON_CONFIG_ERROR # ifdef wxABORT_ON_CONFIG_ERROR

View File

@@ -74,7 +74,11 @@ public:
virtual bool GetRange(wxDateTime *dt1, wxDateTime *dt2) const = 0; virtual bool GetRange(wxDateTime *dt1, wxDateTime *dt2) const = 0;
}; };
#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__) #if defined(__WXPALMOS__)
#include "wx/palmos/datectrl.h"
#define wxHAS_NATIVE_DATEPICKCTRL
#elif defined(__WXMSW__) && !defined(__WXUNIVERSAL__)
#include "wx/msw/datectrl.h" #include "wx/msw/datectrl.h"
#define wxHAS_NATIVE_DATEPICKCTRL #define wxHAS_NATIVE_DATEPICKCTRL

View File

@@ -2346,7 +2346,37 @@ DECLARE_WXCOCOA_OBJC_CLASS(NSView);
typedef WX_NSView WXWidget; /* wxWidgets BASE definition */ typedef WX_NSView WXWidget; /* wxWidgets BASE definition */
#endif /* __WXCOCOA__ */ #endif /* __WXCOCOA__ */
#if defined(__WXMSW__) || defined(__WXPALMOS__) #if defined(__WXPALMOS__)
typedef void * WXHANDLE;
typedef void * WXHICON;
typedef void * WXHFONT;
typedef void * WXHMENU;
typedef void * WXHPEN;
typedef void * WXHBRUSH;
typedef void * WXHPALETTE;
typedef void * WXHCURSOR;
typedef void * WXHRGN;
typedef void * WXHACCEL;
typedef void * WXHINSTANCE;
typedef void * WXHBITMAP;
typedef void * WXHIMAGELIST;
typedef void * WXHGLOBAL;
typedef void * WXHDC;
typedef unsigned int WXUINT;
typedef unsigned long WXDWORD;
typedef unsigned short WXWORD;
typedef unsigned long WXCOLORREF;
typedef struct tagMSG WXMSG;
typedef WinHandle WXWINHANDLE;
typedef WXWINHANDLE WXWidget;
#endif /* __WXPALMOS__ */
#if defined(__WXMSW__)
/* the keywords needed for WinMain() declaration */ /* the keywords needed for WinMain() declaration */
#ifndef WXFAR #ifndef WXFAR

View File

@@ -84,8 +84,6 @@ public:
// MSW only // MSW only
virtual bool MSWCommand(WXUINT param, WXWORD id); virtual bool MSWCommand(WXUINT param, WXWORD id);
WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
protected: protected:
virtual void DoMoveWindow(int x, int y, int width, int height); virtual void DoMoveWindow(int x, int y, int width, int height);

View File

@@ -108,9 +108,6 @@ public:
bool MSWProcessEditMsg(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam); bool MSWProcessEditMsg(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam);
virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
WXHWND GetEditHWND() const; WXHWND GetEditHWND() const;
protected: protected:

View File

@@ -72,9 +72,6 @@ public:
void OnEraseBackground(wxEraseEvent& event); void OnEraseBackground(wxEraseEvent& event);
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
protected: protected:
// regardless how deeply we are in wxWidgets hierarchy always get correct form // regardless how deeply we are in wxWidgets hierarchy always get correct form
FormType* GetParentForm() const; FormType* GetParentForm() const;
@@ -101,6 +98,7 @@ protected:
// getting and setting sizes // getting and setting sizes
virtual void DoGetPosition( int *x, int *y ) const; virtual void DoGetPosition( int *x, int *y ) const;
virtual void DoGetSize( int *width, int *height ) const; virtual void DoGetSize( int *width, int *height ) const;
virtual void DoMoveWindow(int x, int y, int width, int height);
// create the control of the given ControlStyleType: this is typically called // create the control of the given ControlStyleType: this is typically called
// from Create() method of the derived class passing its label, pos and // from Create() method of the derived class passing its label, pos and
@@ -143,6 +141,7 @@ private:
void Init(); void Init();
virtual void DoGetBounds( RectangleType &rect ) const; virtual void DoGetBounds( RectangleType &rect ) const;
virtual void DoSetBounds( RectangleType &rect );
// m_label stores label in case of wxButton, wxCheckBox, wxToggleButton etc. // m_label stores label in case of wxButton, wxCheckBox, wxToggleButton etc.
// We must ensure that it persists for as long as it is being displayed // We must ensure that it persists for as long as it is being displayed

View File

@@ -0,0 +1,62 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/palmos/datectrl.h
// Purpose: wxDatePickerCtrl for PalmOS
// Author: Wlodzimierz ABX Skiba
// Modified by:
// Created: 02/15/05
// RCS-ID: $Id$
// Copyright: (c) Wlodzimierz Skiba
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_PALMOS_DATECTRL_H_
#define _WX_PALMOS_DATECTRL_H_
// ----------------------------------------------------------------------------
// wxDatePickerCtrl
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_ADV wxDatePickerCtrl : public wxDatePickerCtrlBase
{
public:
// ctors
wxDatePickerCtrl() { }
wxDatePickerCtrl(wxWindow *parent,
wxWindowID id,
const wxDateTime& dt = wxDefaultDateTime,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDP_DEFAULT | wxDP_SHOWCENTURY,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxDatePickerCtrlNameStr)
{
Create(parent, id, dt, pos, size, style, validator, name);
}
bool Create(wxWindow *parent,
wxWindowID id,
const wxDateTime& dt = wxDefaultDateTime,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDP_DEFAULT | wxDP_SHOWCENTURY,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxDatePickerCtrlNameStr);
// set/get the date
virtual void SetValue(const wxDateTime& dt);
virtual wxDateTime GetValue() const;
// set/get the allowed valid range for the dates, if either/both of them
// are invalid, there is no corresponding limit and if neither is set
// GetRange() returns false
virtual void SetRange(const wxDateTime& dt1, const wxDateTime& dt2);
virtual bool GetRange(wxDateTime *dt1, wxDateTime *dt2) const;
protected:
virtual wxSize DoGetBestSize() const;
DECLARE_NO_COPY_CLASS(wxDatePickerCtrl)
};
#endif // _WX_PALMOS_DATECTRL_H_

View File

@@ -63,7 +63,7 @@ public:
// ------------------------------- // -------------------------------
// override some base class virtuals // override some base class virtuals
virtual bool Show(bool show = TRUE); virtual bool Show(bool show = true);
virtual void Raise(); virtual void Raise();
@@ -76,28 +76,6 @@ public:
void OnApply(wxCommandEvent& event); void OnApply(wxCommandEvent& event);
void OnCancel(wxCommandEvent& event); void OnCancel(wxCommandEvent& event);
// Responds to colour changes
void OnSysColourChanged(wxSysColourChangedEvent& event);
// Windows callbacks
WXLRESULT MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
// obsolete methods
// ----------------
// use the other ctor
wxDEPRECATED( wxDialog(wxWindow *parent,
const wxString& title, bool modal,
int x = -1, int y= -1, int width = 500, int height = 500,
long style = wxDEFAULT_DIALOG_STYLE,
const wxString& name = wxDialogNameStr) );
// just call Show() or ShowModal()
wxDEPRECATED( void SetModal(bool flag) );
// use IsModal()
wxDEPRECATED( bool IsModalShowing() const );
protected: protected:
// find the window to use as parent for this dialog if none has been // find the window to use as parent for this dialog if none has been
// specified explicitly by the user // specified explicitly by the user

View File

@@ -52,7 +52,6 @@ public:
// ------------------------------- // -------------------------------
// event handlers // event handlers
void OnSysColourChanged(wxSysColourChangedEvent& event);
void OnPaint(wxPaintEvent& event); void OnPaint(wxPaintEvent& event);
// Toolbar // Toolbar
@@ -65,8 +64,6 @@ public:
#endif // wxUSE_TOOLBAR #endif // wxUSE_TOOLBAR
// event handlers // event handlers
bool HandlePaint();
bool HandleSize(int x, int y, WXUINT flag);
bool HandleMenuLoop(const wxEventType& evtType, WXWORD isPopup); bool HandleMenuLoop(const wxEventType& evtType, WXWORD isPopup);
virtual wxPoint GetClientAreaOrigin() const; virtual wxPoint GetClientAreaOrigin() const;

View File

@@ -213,9 +213,6 @@ public:
// Add or remove a single window style // Add or remove a single window style
void SetSingleStyle(long style, bool add = true) ; void SetSingleStyle(long style, bool add = true) ;
// Set the whole window style
void SetWindowStyleFlag(long style) ;
// Searches for an item, starting from 'item'. // Searches for an item, starting from 'item'.
// item can be -1 to find the first item that matches the // item can be -1 to find the first item that matches the
// specified flags. // specified flags.
@@ -348,10 +345,6 @@ public:
static wxVisualAttributes static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
// obsolete stuff, for compatibility only -- don't use
wxDEPRECATED( int GetItemSpacing(bool isSmall) const);
protected: protected:
// common part of all ctors // common part of all ctors
void Init(); void Init();

View File

@@ -81,14 +81,8 @@ public:
// handlers // handlers
// -------- // --------
// Responds to colour changes
void OnSysColourChanged(wxSysColourChangedEvent& event);
void OnSize(wxSizeEvent& event); void OnSize(wxSizeEvent& event);
bool HandleActivate(int state, bool minimized, WXHWND activate);
bool HandleCommand(WXWORD id, WXWORD cmd, WXHWND control);
// override window proc for MDI-specific message processing // override window proc for MDI-specific message processing
virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
@@ -106,7 +100,7 @@ protected:
wxMDIChildFrame * m_currentChild; wxMDIChildFrame * m_currentChild;
wxMenu* m_windowMenu; wxMenu* m_windowMenu;
// TRUE if MDI Frame is intercepting commands, not child // true if MDI Frame is intercepting commands, not child
bool m_parentFrameActive; bool m_parentFrameActive;
private: private:
@@ -148,10 +142,10 @@ public:
long style = wxDEFAULT_FRAME_STYLE, long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr); const wxString& name = wxFrameNameStr);
virtual bool IsTopLevel() const { return FALSE; } virtual bool IsTopLevel() const { return false; }
// MDI operations // MDI operations
virtual void Maximize(bool maximize = TRUE); virtual void Maximize(bool maximize = true);
virtual void Restore(); virtual void Restore();
virtual void Activate(); virtual void Activate();
@@ -161,8 +155,6 @@ public:
// Handlers // Handlers
bool HandleMDIActivate(long bActivate, WXHWND, WXHWND); bool HandleMDIActivate(long bActivate, WXHWND, WXHWND);
bool HandleWindowPosChanging(void *lpPos); bool HandleWindowPosChanging(void *lpPos);
bool HandleCommand(WXWORD id, WXWORD cmd, WXHWND control);
bool HandleGetMinMaxInfo(void *mmInfo);
virtual WXLRESULT MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam); virtual WXLRESULT MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
virtual WXLRESULT MSWDefWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam); virtual WXLRESULT MSWDefWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
@@ -178,7 +170,7 @@ protected:
virtual void DoGetPosition(int *x, int *y) const; virtual void DoGetPosition(int *x, int *y) const;
virtual void DoSetClientSize(int width, int height); virtual void DoSetClientSize(int width, int height);
virtual void InternalSetMenuBar(); virtual void InternalSetMenuBar();
virtual bool IsMDIChild() const { return TRUE; } virtual bool IsMDIChild() const { return true; }
virtual WXHICON GetDefaultIcon() const; virtual WXHICON GetDefaultIcon() const;

View File

@@ -46,7 +46,7 @@ public:
virtual void SetThumbPosition(int viewStart); virtual void SetThumbPosition(int viewStart);
virtual void SetScrollbar(int position, int thumbSize, int range, int pageSize, virtual void SetScrollbar(int position, int thumbSize, int range, int pageSize,
bool refresh = TRUE); bool refresh = true);
// needed for RTTI // needed for RTTI
void SetThumbSize( int s ) { SetScrollbar( GetThumbPosition() , s , GetRange() , GetPageSize() , true ) ; } void SetThumbSize( int s ) { SetScrollbar( GetThumbPosition() , s , GetRange() , GetPageSize() , true ) ; }
@@ -54,8 +54,6 @@ public:
void SetRange( int s ) { SetScrollbar( GetThumbPosition() , GetThumbSize() , s , GetPageSize() , true ) ; } void SetRange( int s ) { SetScrollbar( GetThumbPosition() , GetThumbSize() , s , GetPageSize() , true ) ; }
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, virtual bool MSWOnScroll(int orientation, WXWORD wParam,
WXWORD pos, WXHWND control); WXWORD pos, WXHWND control);

View File

@@ -85,6 +85,9 @@ protected:
private: private:
void Init(); void Init();
int PalmInvertOrNot(int value) const;
int m_oldPos; // needed for tracing thumb position during scrolling int m_oldPos; // needed for tracing thumb position during scrolling
int m_oldValue; // needed for comparing thumb position before and after scrolling int m_oldValue; // needed for comparing thumb position before and after scrolling
int m_lineSize; // imitate line size int m_lineSize; // imitate line size

View File

@@ -117,9 +117,6 @@ class WXDLLEXPORT wxTabCtrl: public wxControl
virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result); virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
// Responds to colour changes
void OnSysColourChanged(wxSysColourChangedEvent& event);
protected: protected:
wxImageList* m_imageList; wxImageList* m_imageList;

View File

@@ -136,12 +136,8 @@ public:
// Implementation from now on // Implementation from now on
// -------------------------- // --------------------------
virtual void SetWindowStyleFlag(long style);
virtual void Command(wxCommandEvent& event); virtual void Command(wxCommandEvent& event);
virtual bool MSWCommand(WXUINT param, WXWORD id); virtual bool MSWCommand(WXUINT param, WXWORD id);
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
#if wxUSE_RICHEDIT #if wxUSE_RICHEDIT
virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result); virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
@@ -155,8 +151,6 @@ public:
virtual bool SetForegroundColour(const wxColour& colour); virtual bool SetForegroundColour(const wxColour& colour);
#endif // wxUSE_RICHEDIT #endif // wxUSE_RICHEDIT
virtual void AdoptAttributesFromHWND();
virtual bool AcceptsFocus() const; virtual bool AcceptsFocus() const;
// callbacks // callbacks

View File

@@ -60,10 +60,7 @@ public:
// implementation only from now on // implementation only from now on
// ------------------------------- // -------------------------------
virtual void SetWindowStyleFlag(long style);
void OnMouseEvent(wxMouseEvent& event); void OnMouseEvent(wxMouseEvent& event);
void OnSysColourChanged(wxSysColourChangedEvent& event);
void SetFocus() {} void SetFocus() {}

View File

@@ -89,6 +89,8 @@ public:
bool HandleControlRepeat(EventType* event); bool HandleControlRepeat(EventType* event);
bool HandleSize(EventType* event); bool HandleSize(EventType* event);
virtual WXWINHANDLE GetWinHandle() const;
protected: protected:
// common part of all ctors // common part of all ctors
void Init(); void Init();
@@ -102,9 +104,6 @@ protected:
// translate wxWidgets flags to Windows ones // translate wxWidgets flags to Windows ones
virtual WXDWORD PalmGetStyle(long flags, WXDWORD *exstyle) const; virtual WXDWORD PalmGetStyle(long flags, WXDWORD *exstyle) const;
// choose the right parent to use with CreateWindow()
virtual WXHWND PalmGetParent() const;
// is the window currently iconized? // is the window currently iconized?
bool m_iconized; bool m_iconized;

View File

@@ -74,12 +74,11 @@ public:
virtual void WarpPointer(int x, int y); virtual void WarpPointer(int x, int y);
virtual void Refresh( bool eraseBackground = true, virtual void Refresh( bool eraseBackground = true,
const wxRect *rect = (const wxRect *) NULL ); const wxRect *rect = NULL );
virtual void Update(); virtual void Update();
virtual void Freeze(); virtual void Freeze();
virtual void Thaw(); virtual void Thaw();
virtual void SetWindowStyleFlag( long style );
virtual bool SetCursor( const wxCursor &cursor ); virtual bool SetCursor( const wxCursor &cursor );
virtual bool SetFont( const wxFont &font ); virtual bool SetFont( const wxFont &font );
@@ -136,9 +135,8 @@ public:
// simple accessors // simple accessors
// ---------------- // ----------------
WXHWND GetHWND() const { return m_hWnd; } virtual WXWINHANDLE GetWinHandle() const { return m_handle; }
void SetHWND(WXHWND hWnd) { m_hWnd = hWnd; } virtual WXWidget GetHandle() const { return GetWinHandle(); }
virtual WXWidget GetHandle() const { return GetHWND(); }
// event handlers // event handlers
// -------------- // --------------
@@ -147,23 +145,11 @@ public:
void OnPaint(wxPaintEvent& event); void OnPaint(wxPaintEvent& event);
public: public:
// Windows subclassing
void SubclassWin(WXHWND hWnd);
void UnsubclassWin();
WXFARPROC PalmGetOldWndProc() const { return m_oldWndProc; }
void PalmSetOldWndProc(WXFARPROC proc) { m_oldWndProc = proc; }
// return true if the window is of a standard (i.e. not wxWidgets') class
//
// to understand why does it work, look at SubclassWin() code and comments
bool IsOfStandardClass() const { return m_oldWndProc != NULL; }
wxWindow *FindItem(long id) const; wxWindow *FindItem(long id) const;
wxWindow *FindItemByHWND(WXHWND hWnd, bool controlOnly = false) const; wxWindow *FindItemByWinHandle(WXWINHANDLE handle, bool controlOnly = false) const;
// Palm only: true if this control is part of the main control // Palm only: true if this control is part of the main control
virtual bool ContainsHWND(WXHWND WXUNUSED(hWnd)) const { return false; }; virtual bool ContainsWinHandle(WXWINHANDLE WXUNUSED(handle)) const { return false; };
// translate wxWidgets style flags for this control into the Windows style // translate wxWidgets style flags for this control into the Windows style
// and optional extended style for the corresponding native control // and optional extended style for the corresponding native control
@@ -188,9 +174,6 @@ public:
int& x, int& y, int& x, int& y,
int& w, int& h) const; int& w, int& h) const;
// get the HWND to be used as parent of this window with CreateWindow()
virtual WXHWND PalmGetParent() const;
// creates the window of specified Windows class with given style, extended // creates the window of specified Windows class with given style, extended
// style, title and geometry (default values // style, title and geometry (default values
// //
@@ -202,150 +185,25 @@ public:
WXDWORD style = 0, WXDWORD style = 0,
WXDWORD exendedStyle = 0); WXDWORD exendedStyle = 0);
virtual bool PalmCommand(WXUINT param, WXWORD id);
#ifndef __WXUNIVERSAL__ #ifndef __WXUNIVERSAL__
// Create an appropriate wxWindow from a HWND // Create an appropriate wxWindow from a WinHandle
virtual wxWindow* CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd); virtual wxWindow* CreateWindowFromWinHandle(wxWindow* parent, WXWINHANDLE handle);
// Make sure the window style reflects the HWND style (roughly) // Make sure the window style reflects the WinHandle style (roughly)
virtual void AdoptAttributesFromHWND(); virtual void AdoptAttributesFromWinHandle();
#endif // __WXUNIVERSAL__ #endif // __WXUNIVERSAL__
// Setup background and foreground colours correctly // Setup background and foreground colours correctly
virtual void SetupColours(); virtual void SetupColours();
// ------------------------------------------------------------------------
// helpers for message handlers: these perform the same function as the
// message crackers from <windowsx.h> - they unpack WPARAM and LPARAM into
// the correct parameters
// ------------------------------------------------------------------------
void UnpackCommand(WXWPARAM wParam, WXLPARAM lParam,
WXWORD *id, WXHWND *hwnd, WXWORD *cmd);
void UnpackActivate(WXWPARAM wParam, WXLPARAM lParam,
WXWORD *state, WXWORD *minimized, WXHWND *hwnd);
void UnpackScroll(WXWPARAM wParam, WXLPARAM lParam,
WXWORD *code, WXWORD *pos, WXHWND *hwnd);
void UnpackCtlColor(WXWPARAM wParam, WXLPARAM lParam,
WXWORD *nCtlColor, WXHDC *hdc, WXHWND *hwnd);
void UnpackMenuSelect(WXWPARAM wParam, WXLPARAM lParam,
WXWORD *item, WXWORD *flags, WXHMENU *hmenu);
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
// internal handlers for Palm messages: all handlers return a boolean value: // internal handlers for Palm messages: all handlers return a boolean value:
// true means that the handler processed the event and false that it didn't // true means that the handler processed the event and false that it didn't
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
// there are several cases where we have virtual functions for Windows
// message processing: this is because these messages often require to be
// processed in a different manner in the derived classes. For all other
// messages, however, we do *not* have corresponding PalmOnXXX() function
// and if the derived class wants to process them, it should override
// PalmWindowProc() directly.
// scroll event (both horizontal and vertical) // scroll event (both horizontal and vertical)
virtual bool PalmOnScroll(int orientation, WXWORD nSBCode, virtual bool PalmOnScroll(int orientation, WXWORD nSBCode,
WXWORD pos, WXHWND control); WXWORD pos, WXWINHANDLE control);
// owner-drawn controls need to process these messages
virtual bool PalmOnDrawItem(int id, WXDRAWITEMSTRUCT *item);
virtual bool PalmOnMeasureItem(int id, WXMEASUREITEMSTRUCT *item);
// the rest are not virtual
bool HandleCreate(WXLPCREATESTRUCT cs, bool *mayCreate);
bool HandleInitDialog(WXHWND hWndFocus);
bool HandleDestroy();
bool HandlePaint();
bool HandleEraseBkgnd(WXHDC pDC);
bool HandleMinimize();
bool HandleMaximize();
bool HandleSize(int x, int y, WXUINT flag);
bool HandleSizing(wxRect& rect);
bool HandleGetMinMaxInfo(void *mmInfo);
bool HandleShow(bool show, int status);
bool HandleActivate(int flag, bool minimized, WXHWND activate);
bool HandleCommand(WXWORD id, WXWORD cmd, WXHWND control);
bool HandleCtlColor(WXHBRUSH *hBrush,
WXHDC hdc,
WXHWND hWnd,
WXUINT nCtlColor,
WXUINT message,
WXWPARAM wParam,
WXLPARAM lParam);
bool HandlePaletteChanged(WXHWND hWndPalChange);
bool HandleQueryNewPalette();
bool HandleSysColorChange();
bool HandleDisplayChange();
bool HandleCaptureChanged(WXHWND gainedCapture);
bool HandleQueryEndSession(long logOff, bool *mayEnd);
bool HandleEndSession(bool endSession, long logOff);
bool HandleSetFocus(WXHWND wnd);
bool HandleKillFocus(WXHWND wnd);
bool HandleDropFiles(WXWPARAM wParam);
bool HandleMouseEvent(WXUINT msg, int x, int y, WXUINT flags);
bool HandleMouseMove(int x, int y, WXUINT flags);
bool HandleMouseWheel(WXWPARAM wParam, WXLPARAM lParam);
bool HandleChar(WXWPARAM wParam, WXLPARAM lParam, bool isASCII = false);
bool HandleKeyDown(WXWPARAM wParam, WXLPARAM lParam);
bool HandleKeyUp(WXWPARAM wParam, WXLPARAM lParam);
#if wxUSE_ACCEL
bool HandleHotKey(WXWPARAM wParam, WXLPARAM lParam);
#endif
bool HandleQueryDragIcon(WXHICON *hIcon);
bool HandleSetCursor(WXHWND hWnd, short nHitTest, int mouseMsg);
// Window procedure
virtual WXLRESULT PalmWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
// Calls an appropriate default window procedure
virtual WXLRESULT PalmDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
// message processing helpers
// return false if the message shouldn't be translated/preprocessed but
// dispatched normally
virtual bool PalmShouldPreProcessMessage(WXMSG* pMsg);
// return true if the message was preprocessed and shouldn't be dispatched
virtual bool PalmProcessMessage(WXMSG* pMsg);
// return true if the message was translated and shouldn't be dispatched
virtual bool PalmTranslateMessage(WXMSG* pMsg);
// called when the window is about to be destroyed
virtual void PalmDestroyWindow();
// this function should return the brush to paint the window background
// with or 0 for the default brush
virtual WXHBRUSH OnCtlColor(WXHDC hDC,
WXHWND hWnd,
WXUINT nCtlColor,
WXUINT message,
WXWPARAM wParam,
WXLPARAM lParam);
// Responds to colour changes: passes event on to children.
void OnSysColourChanged(wxSysColourChangedEvent& event);
// initialize various fields of wxMouseEvent (common part of PalmOnMouseXXX)
void InitMouseEvent(wxMouseEvent& event, int x, int y, WXUINT flags);
// check if mouse is in the window
bool IsMouseInWindow() const;
// virtual function for implementing internal idle // virtual function for implementing internal idle
// behaviour // behaviour
@@ -353,15 +211,12 @@ public:
protected: protected:
// the window handle // the window handle
WXHWND m_hWnd; WinHandle m_handle;
FormType *FrameForm; FormType *FrameForm;
FormType *GetFormPtr(); FormType *GetFormPtr();
void SetFormPtr(FormType *FormPtr); void SetFormPtr(FormType *FormPtr);
// the old window proc (we subclass all windows)
WXFARPROC m_oldWndProc;
// additional (Palm specific) flags // additional (Palm specific) flags
bool m_mouseInWindow:1; bool m_mouseInWindow:1;
bool m_lastKeydownProcessed:1; bool m_lastKeydownProcessed:1;
@@ -409,10 +264,6 @@ protected:
const wxString& ttip); const wxString& ttip);
#endif // wxUSE_TOOLTIPS #endif // wxUSE_TOOLTIPS
// the helper functions used by HandleChar/KeyXXX methods
wxKeyEvent CreateKeyEvent(wxEventType evType, int id,
WXLPARAM lParam = 0, WXWPARAM wParam = 0) const;
private: private:
// common part of all ctors // common part of all ctors
void Init(); void Init();
@@ -433,24 +284,6 @@ private:
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
// ---------------------------------------------------------------------------
// global functions
// ---------------------------------------------------------------------------
// kbd code translation
WXDLLEXPORT int wxCharCodePalmToWX(int keySym, WXLPARAM lParam = 0);
WXDLLEXPORT int wxCharCodeWXToPalm(int id, bool *IsVirtual);
// window creation helper class: before creating a new HWND, instantiate an
// object of this class on stack - this allows to process the messages sent to
// the window even before CreateWindow() returns
class wxWindowCreationHook
{
public:
wxWindowCreationHook(wxWindowPalm *winBeingCreated);
~wxWindowCreationHook();
};
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// global objects // global objects
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -459,7 +292,7 @@ public:
// needs to "see" its dtor and not just forward declaration // needs to "see" its dtor and not just forward declaration
#include "wx/hash.h" #include "wx/hash.h"
// pseudo-template HWND <-> wxWindow hash table // pseudo-template WinHandle <-> wxWindow hash table
WX_DECLARE_HASH(wxWindowPalm, wxWindowList, wxWinHashTable); WX_DECLARE_HASH(wxWindowPalm, wxWindowList, wxWinHashTable);
extern wxWinHashTable *wxWinHandleHash; extern wxWinHashTable *wxWinHandleHash;

View File

@@ -120,7 +120,7 @@ bool wxChoice::CreateAndInit(wxWindow *parent,
const wxValidator& validator, const wxValidator& validator,
const wxString& name) const wxString& name)
{ {
return FALSE; return false;
} }
bool wxChoice::Create(wxWindow *parent, bool wxChoice::Create(wxWindow *parent,
@@ -272,13 +272,4 @@ bool wxChoice::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
return false; return false;
} }
WXHBRUSH wxChoice::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor),
WXUINT WXUNUSED(message),
WXWPARAM WXUNUSED(wParam),
WXLPARAM WXUNUSED(lParam)
)
{
return (WXHBRUSH) 0;
}
#endif // wxUSE_CHOICE #endif // wxUSE_CHOICE

View File

@@ -128,27 +128,6 @@ static WNDPROC gs_wndprocEdit = (WNDPROC)NULL;
// implementation // implementation
// ============================================================================ // ============================================================================
WXHBRUSH wxComboBox::OnCtlColor(WXHDC pDC,
WXHWND WXUNUSED(pWnd),
WXUINT WXUNUSED(nCtlColor),
WXUINT WXUNUSED(message),
WXWPARAM WXUNUSED(wParam),
WXLPARAM WXUNUSED(lParam))
{
HDC hdc = (HDC)pDC;
wxColour colBack = GetBackgroundColour();
if (!IsEnabled())
colBack = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
::SetBkColor(hdc, wxColourToRGB(colBack));
::SetTextColor(hdc, wxColourToRGB(GetForegroundColour()));
wxBrush *brush = wxTheBrushList->FindOrCreateBrush(colBack, wxSOLID);
return (WXHBRUSH)brush->GetResourceHandle();
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxComboBox callbacks // wxComboBox callbacks
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -286,6 +286,17 @@ void wxControl::DoGetBounds( RectangleType &rect ) const
FrmGetObjectBounds(form,index,&rect); FrmGetObjectBounds(form,index,&rect);
} }
void wxControl::DoSetBounds( RectangleType &rect )
{
FormType* form = GetParentForm();
if(form==NULL)
return;
uint16_t index = FrmGetObjectIndex(form,GetId());
if(index==frmInvalidObjectId)
return;
FrmSetObjectBounds(form,index,&rect);
}
void wxControl::DoGetPosition( int *x, int *y ) const void wxControl::DoGetPosition( int *x, int *y ) const
{ {
RectangleType rect; RectangleType rect;
@@ -306,6 +317,18 @@ void wxControl::DoGetSize( int *width, int *height ) const
*height = rect.extent.y; *height = rect.extent.y;
} }
void wxControl::DoMoveWindow(int x, int y, int width, int height)
{
wxRect area = GetRect();
RectangleType rect;
rect.topLeft.x = x;
rect.topLeft.y = y;
rect.extent.x = width;
rect.extent.y = height;
DoSetBounds(rect);
GetParent()->Refresh(true, &area);
}
bool wxControl::Enable(bool enable) bool wxControl::Enable(bool enable)
{ {
ControlType *control = (ControlType *)GetObjectPtr(); ControlType *control = (ControlType *)GetObjectPtr();
@@ -468,17 +491,4 @@ void wxControl::OnEraseBackground(wxEraseEvent& event)
{ {
} }
WXHBRUSH wxControl::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor),
WXUINT WXUNUSED(message),
WXWPARAM WXUNUSED(wParam),
WXLPARAM WXUNUSED(lParam)
)
{
return (WXHBRUSH)0;
}
// ---------------------------------------------------------------------------
// global functions
// ---------------------------------------------------------------------------
#endif // wxUSE_CONTROLS #endif // wxUSE_CONTROLS

109
src/palmos/datectrl.cpp Normal file
View File

@@ -0,0 +1,109 @@
/////////////////////////////////////////////////////////////////////////////
// Name: src/palmos/datectrl.cpp
// Purpose: wxDatePickerCtrl implementation
// Author: Wlodzimierz ABX Skiba
// Modified by:
// Created: 02/14/05
// RCS-ID: $Id$
// Copyright: (c) Wlodzimierz Skiba
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// ============================================================================
// declarations
// ============================================================================
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#endif
#if wxUSE_DATEPICKCTRL
#include "wx/datectrl.h"
#include "wx/app.h"
#include "wx/intl.h"
#include "wx/dynlib.h"
#define _WX_DEFINE_DATE_EVENTS_
#include "wx/dateevt.h"
// ============================================================================
// implementation
// ============================================================================
// ----------------------------------------------------------------------------
// wxDatePickerCtrl creation
// ----------------------------------------------------------------------------
bool wxDatePickerCtrl::Create(wxWindow *parent,
wxWindowID id,
const wxDateTime& dt,
const wxPoint& pos,
const wxSize& size,
long style,
const wxValidator& validator,
const wxString& name)
{
if(!wxControl::Create(parent, id, pos, size, style, validator, name))
return false;
wxString label;
if ( dt.IsValid() )
label = _T("test2");
ig(!wxControl::PalmCreateControl(selectorTriggerCtl, label, pos, size))
return false;
return true;
}
// ----------------------------------------------------------------------------
// wxDatePickerCtrl geometry
// ----------------------------------------------------------------------------
wxSize wxDatePickerCtrl::DoGetBestSize() const
{
const int y = GetCharHeight();
return wxSize(DEFAULT_ITEM_WIDTH, EDIT_HEIGHT_FROM_CHAR_HEIGHT(y));
}
// ----------------------------------------------------------------------------
// wxDatePickerCtrl operations
// ----------------------------------------------------------------------------
void wxDatePickerCtrl::SetValue(const wxDateTime& dt)
{
SetLabel(_T("test1"));
}
wxDateTime wxDatePickerCtrl::GetValue() const
{
wxDateTime dt;
// TODO
return dt;
}
void wxDatePickerCtrl::SetRange(const wxDateTime& dt1, const wxDateTime& dt2)
{
// TODO
}
bool wxDatePickerCtrl::GetRange(wxDateTime *dt1, wxDateTime *dt2) const
{
// TODO
return false;
}
#endif // wxUSE_DATEPICKCTRL

View File

@@ -42,12 +42,12 @@ struct WXDLLEXPORT wxPaintDCInfo
{ {
wxPaintDCInfo(wxWindow *win, wxDC *dc) wxPaintDCInfo(wxWindow *win, wxDC *dc)
{ {
hwnd = win->GetHWND(); handle = win->GetWinHandle();
hdc = dc->GetHDC(); hdc = dc->GetHDC();
count = 1; count = 1;
} }
WXHWND hwnd; // window for this DC WXWINHANDLE handle; // window for this DC
WXHDC hdc; // the DC handle WXHDC hdc; // the DC handle
size_t count; // usage count size_t count; // usage count
}; };

View File

@@ -105,8 +105,6 @@ BEGIN_EVENT_TABLE(wxDialog, wxDialogBase)
EVT_BUTTON(wxID_APPLY, wxDialog::OnApply) EVT_BUTTON(wxID_APPLY, wxDialog::OnApply)
EVT_BUTTON(wxID_CANCEL, wxDialog::OnCancel) EVT_BUTTON(wxID_CANCEL, wxDialog::OnCancel)
EVT_SYS_COLOUR_CHANGED(wxDialog::OnSysColourChanged)
EVT_CLOSE(wxDialog::OnCloseWindow) EVT_CLOSE(wxDialog::OnCloseWindow)
END_EVENT_TABLE() END_EVENT_TABLE()
@@ -160,23 +158,6 @@ bool wxDialog::Create(wxWindow *parent,
return false; return false;
} }
// deprecated ctor
wxDialog::wxDialog(wxWindow *parent,
const wxString& title,
bool WXUNUSED(modal),
int x,
int y,
int w,
int h,
long style,
const wxString& name)
{
}
void wxDialog::SetModal(bool WXUNUSED(flag))
{
}
wxDialog::~wxDialog() wxDialog::~wxDialog()
{ {
} }
@@ -185,11 +166,6 @@ wxDialog::~wxDialog()
// showing the dialogs // showing the dialogs
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
bool wxDialog::IsModalShowing() const
{
return false;
}
wxWindow *wxDialog::FindSuitableParent() const wxWindow *wxDialog::FindSuitableParent() const
{ {
return NULL; return NULL;
@@ -234,16 +210,3 @@ void wxDialog::OnCancel(wxCommandEvent& WXUNUSED(event))
void wxDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event)) void wxDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
{ {
} }
void wxDialog::OnSysColourChanged(wxSysColourChangedEvent& WXUNUSED(event))
{
}
// ---------------------------------------------------------------------------
// dialog window proc
// ---------------------------------------------------------------------------
WXLRESULT wxDialog::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
{
return false;
}

View File

@@ -70,7 +70,6 @@
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
BEGIN_EVENT_TABLE(wxFrame, wxFrameBase) BEGIN_EVENT_TABLE(wxFrame, wxFrameBase)
EVT_SYS_COLOUR_CHANGED(wxFrame::OnSysColourChanged)
EVT_PAINT(wxFrame::OnPaint) EVT_PAINT(wxFrame::OnPaint)
END_EVENT_TABLE() END_EVENT_TABLE()
@@ -232,11 +231,6 @@ bool wxFrame::HandleMenuSelect(EventType* event)
#endif // wxUSE_MENUS_NATIVE #endif // wxUSE_MENUS_NATIVE
// Responds to colour changes, and passes event on to children.
void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event)
{
}
void wxFrame::OnPaint(wxPaintEvent& event) void wxFrame::OnPaint(wxPaintEvent& event)
{ {
#if wxUSE_STATUSBAR #if wxUSE_STATUSBAR
@@ -279,24 +273,6 @@ void wxFrame::IconizeChildFrames(bool bIconize)
{ {
} }
// ===========================================================================
// message processing
// ===========================================================================
// ---------------------------------------------------------------------------
// our private (non virtual) message handlers
// ---------------------------------------------------------------------------
bool wxFrame::HandlePaint()
{
return false;
}
bool wxFrame::HandleSize(int x, int y, WXUINT id)
{
return false;
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxFrame size management: we exclude the areas taken by menu/status/toolbars // wxFrame size management: we exclude the areas taken by menu/status/toolbars
// from the client area, so the client area is what's really available for the // from the client area, so the client area is what's really available for the

View File

@@ -191,11 +191,6 @@ void wxListCtrl::SetSingleStyle(long style, bool add)
{ {
} }
// Set the whole window style
void wxListCtrl::SetWindowStyleFlag(long flag)
{
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// accessors // accessors
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -137,7 +137,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxMDIClientWindow, wxWindow)
BEGIN_EVENT_TABLE(wxMDIParentFrame, wxFrame) BEGIN_EVENT_TABLE(wxMDIParentFrame, wxFrame)
EVT_SIZE(wxMDIParentFrame::OnSize) EVT_SIZE(wxMDIParentFrame::OnSize)
EVT_SYS_COLOUR_CHANGED(wxMDIParentFrame::OnSysColourChanged)
END_EVENT_TABLE() END_EVENT_TABLE()
BEGIN_EVENT_TABLE(wxMDIChildFrame, wxFrame) BEGIN_EVENT_TABLE(wxMDIChildFrame, wxFrame)
@@ -201,12 +200,6 @@ wxMDIClientWindow *wxMDIParentFrame::OnCreateClient()
return new wxMDIClientWindow; return new wxMDIClientWindow;
} }
// Responds to colour changes, and passes event on to children.
void wxMDIParentFrame::OnSysColourChanged(wxSysColourChangedEvent& event)
{
event.Skip();
}
WXHICON wxMDIParentFrame::GetDefaultIcon() const WXHICON wxMDIParentFrame::GetDefaultIcon() const
{ {
// we don't have any standard icons (any more) // we don't have any standard icons (any more)
@@ -248,16 +241,6 @@ WXLRESULT wxMDIParentFrame::MSWWindowProc(WXUINT message,
return 0; return 0;
} }
bool wxMDIParentFrame::HandleActivate(int state, bool minimized, WXHWND activate)
{
return false;
}
bool wxMDIParentFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND hwnd)
{
return false;
}
WXLRESULT wxMDIParentFrame::MSWDefWindowProc(WXUINT message, WXLRESULT wxMDIParentFrame::MSWDefWindowProc(WXUINT message,
WXWPARAM wParam, WXWPARAM wParam,
WXLPARAM lParam) WXLPARAM lParam)
@@ -340,11 +323,6 @@ WXLRESULT wxMDIChildFrame::MSWWindowProc(WXUINT message,
return 0; return 0;
} }
bool wxMDIChildFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND hwnd)
{
return false;
}
bool wxMDIChildFrame::HandleMDIActivate(long WXUNUSED(activate), bool wxMDIChildFrame::HandleMDIActivate(long WXUNUSED(activate),
WXHWND hwndAct, WXHWND hwndAct,
WXHWND hwndDeact) WXHWND hwndDeact)
@@ -357,11 +335,6 @@ bool wxMDIChildFrame::HandleWindowPosChanging(void *pos)
return false; return false;
} }
bool wxMDIChildFrame::HandleGetMinMaxInfo(void *mmInfo)
{
return false;
}
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// MDI specific message translation/preprocessing // MDI specific message translation/preprocessing
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------

View File

@@ -72,13 +72,13 @@ wxWindow* wxWindow::GetWindowChild(wxWindowID id)
// create wxWin window from a native HWND // create wxWin window from a native HWND
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd) wxWindow* wxWindow::CreateWindowFromWinHandle(wxWindow* parent, WXWINHANDLE handle)
{ {
return NULL; return NULL;
} }
// Make sure the window style (etc.) reflects the HWND style (roughly) // Make sure the window style (etc.) reflects the WinHandle style (roughly)
void wxWindow::AdoptAttributesFromHWND(void) void wxWindow::AdoptAttributesFromWinHandle(void)
{ {
} }

View File

@@ -120,12 +120,6 @@ void wxScrollBar::SetScrollbar(int position, int thumbSize, int range, int pageS
} }
WXHBRUSH wxScrollBar::OnCtlColor(WXHDC WXUNUSED(pDC), WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor),
WXUINT WXUNUSED(message), WXWPARAM WXUNUSED(wParam), WXLPARAM WXUNUSED(lParam))
{
return 0;
}
void wxScrollBar::Command(wxCommandEvent& event) void wxScrollBar::Command(wxCommandEvent& event)
{ {
} }

View File

@@ -117,7 +117,6 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id,
// wxSL_RIGHT is ignored - always off // wxSL_RIGHT is ignored - always off
// wxSL_TOP is ignored - always off // wxSL_TOP is ignored - always off
// wxSL_SELRANGE is ignored - always off // wxSL_SELRANGE is ignored - always off
// wxSL_INVERSE is ignored - always off
// wxSL_VERTICAL is impossible in native form // wxSL_VERTICAL is impossible in native form
wxCHECK_MSG(!(style & wxSL_VERTICAL), false, _T("non vertical slider on PalmOS")); wxCHECK_MSG(!(style & wxSL_VERTICAL), false, _T("non vertical slider on PalmOS"));
@@ -196,6 +195,14 @@ int wxSlider::GetPageSize() const
return ret; return ret;
} }
int wxSlider::PalmInvertOrNot(int value) const
{
if (m_windowStyle & wxSL_INVERSE)
return (GetMax() + GetMin()) - value;
else
return value;
}
int wxSlider::GetValue() const int wxSlider::GetValue() const
{ {
ControlType *control = (ControlType *)GetObjectPtr(); ControlType *control = (ControlType *)GetObjectPtr();
@@ -203,12 +210,12 @@ int wxSlider::GetValue() const
return 0; return 0;
uint16_t ret; uint16_t ret;
CtlGetSliderValues(control, NULL, NULL, NULL, &ret); CtlGetSliderValues(control, NULL, NULL, NULL, &ret);
return ret; return PalmInvertOrNot(ret);
} }
void wxSlider::SetValue(int value) void wxSlider::SetValue(int value)
{ {
SetIntValue(value); SetIntValue(PalmInvertOrNot(value));
m_oldValue = m_oldPos = value; m_oldValue = m_oldPos = value;
} }
@@ -328,7 +335,7 @@ bool wxSlider::SendUpdatedEvent()
bool wxSlider::SendScrollEvent(EventType* event) bool wxSlider::SendScrollEvent(EventType* event)
{ {
wxEventType scrollEvent; wxEventType scrollEvent;
int newPos = event->data.ctlRepeat.value; int newPos = PalmInvertOrNot(event->data.ctlRepeat.value);
if ( newPos == m_oldPos ) if ( newPos == m_oldPos )
{ {
// nothing changed since last event // nothing changed since last event

View File

@@ -48,8 +48,6 @@
wxStatusBarPalm::wxStatusBarPalm() wxStatusBarPalm::wxStatusBarPalm()
{ {
SetParent(NULL); SetParent(NULL);
m_hWnd = 0;
m_windowId = 0;
} }
bool wxStatusBarPalm::Create(wxWindow *parent, bool wxStatusBarPalm::Create(wxWindow *parent,
@@ -68,7 +66,6 @@ bool wxStatusBarPalm::Create(wxWindow *parent,
parent->AddChild(this); parent->AddChild(this);
SetFieldsCount(1); SetFieldsCount(1);
SubclassWin(m_hWnd);
return true; return true;
} }

View File

@@ -37,7 +37,6 @@ DEFINE_EVENT_TYPE(wxEVT_COMMAND_TAB_SEL_CHANGED)
DEFINE_EVENT_TYPE(wxEVT_COMMAND_TAB_SEL_CHANGING) DEFINE_EVENT_TYPE(wxEVT_COMMAND_TAB_SEL_CHANGING)
BEGIN_EVENT_TABLE(wxTabCtrl, wxControl) BEGIN_EVENT_TABLE(wxTabCtrl, wxControl)
EVT_SYS_COLOUR_CHANGED(wxTabCtrl::OnSysColourChanged)
END_EVENT_TABLE() END_EVENT_TABLE()
wxTabCtrl::wxTabCtrl() wxTabCtrl::wxTabCtrl()
@@ -59,11 +58,6 @@ bool wxTabCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
return false; return false;
} }
// Responds to colour changes, and passes event on to children.
void wxTabCtrl::OnSysColourChanged(wxSysColourChangedEvent& event)
{
}
// Delete all items // Delete all items
bool wxTabCtrl::DeleteAllItems() bool wxTabCtrl::DeleteAllItems()
{ {

View File

@@ -217,20 +217,11 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
return false; return false;
} }
// Make sure the window style (etc.) reflects the HWND style (roughly)
void wxTextCtrl::AdoptAttributesFromHWND()
{
}
WXDWORD wxTextCtrl::MSWGetStyle(long style, WXDWORD *exstyle) const WXDWORD wxTextCtrl::MSWGetStyle(long style, WXDWORD *exstyle) const
{ {
return 0; return 0;
} }
void wxTextCtrl::SetWindowStyleFlag(long style)
{
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// set/get the controls text // set/get the controls text
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -567,15 +558,6 @@ bool wxTextCtrl::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
return false; return false;
} }
WXHBRUSH wxTextCtrl::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor),
WXUINT WXUNUSED(message),
WXWPARAM WXUNUSED(wParam),
WXLPARAM WXUNUSED(lParam)
)
{
return (WXHBRUSH) 0;
}
bool wxTextCtrl::AdjustSpaceLimit() bool wxTextCtrl::AdjustSpaceLimit()
{ {
return false; return false;

View File

@@ -93,7 +93,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxToolBar, wxControl)
BEGIN_EVENT_TABLE(wxToolBar, wxToolBarBase) BEGIN_EVENT_TABLE(wxToolBar, wxToolBarBase)
EVT_MOUSE_EVENTS(wxToolBar::OnMouseEvent) EVT_MOUSE_EVENTS(wxToolBar::OnMouseEvent)
EVT_SYS_COLOUR_CHANGED(wxToolBar::OnSysColourChanged)
END_EVENT_TABLE() END_EVENT_TABLE()
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -248,14 +247,6 @@ void wxToolBar::UpdateSize()
{ {
} }
// ----------------------------------------------------------------------------
// toolbar styles
// ---------------------------------------------------------------------------
void wxToolBar::SetWindowStyleFlag(long style)
{
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// tool state // tool state
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -276,11 +267,6 @@ void wxToolBar::DoSetToggle(wxToolBarToolBase *WXUNUSED(tool), bool WXUNUSED(tog
// event handlers // event handlers
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Responds to colour changes, and passes event on to children.
void wxToolBar::OnSysColourChanged(wxSysColourChangedEvent& event)
{
}
void wxToolBar::OnMouseEvent(wxMouseEvent& event) void wxToolBar::OnMouseEvent(wxMouseEvent& event)
{ {
} }

View File

@@ -80,11 +80,6 @@ WXDWORD wxTopLevelWindowPalm::PalmGetStyle(long style, WXDWORD *exflags) const
return 0; return 0;
} }
WXHWND wxTopLevelWindowPalm::PalmGetParent() const
{
return NULL;
}
bool wxTopLevelWindowPalm::Create(wxWindow *parent, bool wxTopLevelWindowPalm::Create(wxWindow *parent,
wxWindowID id, wxWindowID id,
const wxString& title, const wxString& title,
@@ -147,6 +142,18 @@ wxTopLevelWindowPalm::~wxTopLevelWindowPalm()
{ {
} }
// ---------------------------------------------------------------------------
// implementation
// ---------------------------------------------------------------------------
WXWINHANDLE wxTopLevelWindowPalm::GetWinHandle() const
{
FormType *form = GetForm();
if(form)
return FrmGetWindowHandle(form);
return 0;
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxTopLevelWindowPalm showing // wxTopLevelWindowPalm showing
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -233,15 +240,11 @@ FormType *wxTopLevelWindowPalm::GetForm() const
return FrmGetActiveForm(); return FrmGetActiveForm();
} }
#ifndef __WXWINCE__
bool wxTopLevelWindowPalm::SetShape(const wxRegion& region) bool wxTopLevelWindowPalm::SetShape(const wxRegion& region)
{ {
return false; return false;
} }
#endif // !__WXWINCE__
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxTopLevelWindow native event handling // wxTopLevelWindow native event handling
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -152,28 +152,3 @@ void wxDisplaySizeMM(int *width, int *height)
void wxClientDisplayRect(int *x, int *y, int *width, int *height) void wxClientDisplayRect(int *x, int *y, int *width, int *height)
{ {
} }
// ---------------------------------------------------------------------------
// window information functions
// ---------------------------------------------------------------------------
wxString WXDLLEXPORT wxGetWindowText(WXHWND hWnd)
{
wxString str;
return str;
}
wxString WXDLLEXPORT wxGetWindowClass(WXHWND hWnd)
{
wxString str;
return str;
}
WXWORD WXDLLEXPORT wxGetWindowId(WXHWND hWnd)
{
return 0;
}

View File

@@ -93,10 +93,6 @@
wxMenu *wxCurrentPopupMenu = NULL; wxMenu *wxCurrentPopupMenu = NULL;
#endif // wxUSE_MENUS_NATIVE #endif // wxUSE_MENUS_NATIVE
// true if we had already created the std colour map, used by
// wxGetStdColourMap() and wxWindow::OnSysColourChanged() (FIXME-MT)
static bool gs_hasStdCmap = false;
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// private functions // private functions
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
@@ -218,7 +214,6 @@ wxCONSTRUCTOR_DUMMY(wxWindow)
BEGIN_EVENT_TABLE(wxWindowPalm, wxWindowBase) BEGIN_EVENT_TABLE(wxWindowPalm, wxWindowBase)
EVT_ERASE_BACKGROUND(wxWindowPalm::OnEraseBackground) EVT_ERASE_BACKGROUND(wxWindowPalm::OnEraseBackground)
EVT_SYS_COLOUR_CHANGED(wxWindowPalm::OnSysColourChanged)
EVT_INIT_DIALOG(wxWindowPalm::OnInitDialog) EVT_INIT_DIALOG(wxWindowPalm::OnInitDialog)
END_EVENT_TABLE() END_EVENT_TABLE()
@@ -237,23 +232,19 @@ wxWindow *wxWindowPalm::FindItem(long id) const
} }
// Find an item given the MS Windows handle // Find an item given the MS Windows handle
wxWindow *wxWindowPalm::FindItemByHWND(WXHWND hWnd, bool controlOnly) const wxWindow *wxWindowPalm::FindItemByWinHandle(WXWINHANDLE handle, bool controlOnly) const
{ {
// TODO
return NULL; return NULL;
} }
// Default command handler
bool wxWindowPalm::PalmCommand(WXUINT WXUNUSED(param), WXWORD WXUNUSED(id))
{
return false;
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// constructors and such // constructors and such
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void wxWindowPalm::Init() void wxWindowPalm::Init()
{ {
m_handle = 0;
} }
// Destructor // Destructor
@@ -417,31 +408,10 @@ bool wxWindowPalm::ScrollPages(int pages)
return false; return false;
} }
// ---------------------------------------------------------------------------
// subclassing
// ---------------------------------------------------------------------------
void wxWindowPalm::SubclassWin(WXHWND hWnd)
{
}
void wxWindowPalm::UnsubclassWin()
{
}
bool wxCheckWindowWndProc(WXHWND hWnd, WXFARPROC wndProc)
{
return false;
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Style handling // Style handling
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void wxWindowPalm::SetWindowStyleFlag(long flags)
{
}
WXDWORD wxWindowPalm::PalmGetStyle(long flags, WXDWORD *exstyle) const WXDWORD wxWindowPalm::PalmGetStyle(long flags, WXDWORD *exstyle) const
{ {
return 0; return 0;
@@ -452,11 +422,6 @@ void wxWindowPalm::SetupColours()
{ {
} }
bool wxWindowPalm::IsMouseInWindow() const
{
return false;
}
void wxWindowPalm::OnInternalIdle() void wxWindowPalm::OnInternalIdle()
{ {
} }
@@ -477,6 +442,23 @@ void wxWindowPalm::Thaw()
void wxWindowPalm::Refresh(bool eraseBack, const wxRect *rect) void wxWindowPalm::Refresh(bool eraseBack, const wxRect *rect)
{ {
WinHandle handle = GetWinHandle();
if(handle)
{
if(rect)
{
RectangleType dirtyRect;
dirtyRect.topLeft.x = rect->GetX();
dirtyRect.topLeft.y = rect->GetY();
dirtyRect.extent.x = rect->GetWidth();
dirtyRect.extent.y = rect->GetHeight();
WinInvalidateRect(handle, &dirtyRect);
}
else
{
WinInvalidateWindow(handle);
}
}
} }
void wxWindowPalm::Update() void wxWindowPalm::Update()
@@ -552,6 +534,61 @@ void wxWindowPalm::DoMoveWindow(int x, int y, int width, int height)
// width/height // width/height
void wxWindowPalm::DoSetSize(int x, int y, int width, int height, int sizeFlags) void wxWindowPalm::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{ {
// get the current size and position...
int currentX, currentY;
GetPosition(&currentX, &currentY);
int currentW,currentH;
GetSize(&currentW, &currentH);
// ... and don't do anything (avoiding flicker) if it's already ok
if ( x == currentX && y == currentY &&
width == currentW && height == currentH )
{
return;
}
if ( x == wxDefaultCoord && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE) )
x = currentX;
if ( y == wxDefaultCoord && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE) )
y = currentY;
AdjustForParentClientOrigin(x, y, sizeFlags);
wxSize size = wxDefaultSize;
if ( width == wxDefaultCoord )
{
if ( sizeFlags & wxSIZE_AUTO_WIDTH )
{
size = DoGetBestSize();
width = size.x;
}
else
{
// just take the current one
width = currentW;
}
}
if ( height == wxDefaultCoord )
{
if ( sizeFlags & wxSIZE_AUTO_HEIGHT )
{
if ( size.x == wxDefaultCoord )
{
size = DoGetBestSize();
}
//else: already called DoGetBestSize() above
height = size.y;
}
else
{
// just take the current one
height = currentH;
}
}
DoMoveWindow(x, y, width, height);
} }
void wxWindowPalm::DoSetClientSize(int width, int height) void wxWindowPalm::DoSetClientSize(int width, int height)
@@ -601,60 +638,15 @@ bool wxWindowPalm::DoPopupMenu(wxMenu *menu, int x, int y)
#endif // wxUSE_MENUS_NATIVE #endif // wxUSE_MENUS_NATIVE
// ===========================================================================
// pre/post message processing
// ===========================================================================
WXLRESULT wxWindowPalm::PalmDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
{
return false;
}
bool wxWindowPalm::PalmProcessMessage(WXMSG* pMsg)
{
return false;
}
bool wxWindowPalm::PalmTranslateMessage(WXMSG* pMsg)
{
return false;
}
bool wxWindowPalm::PalmShouldPreProcessMessage(WXMSG* WXUNUSED(pMsg))
{
return false;
}
// ---------------------------------------------------------------------------
// Main wxWidgets window proc and the window proc for wxWindow
// ---------------------------------------------------------------------------
// Hook for new window just as it's being created, when the window isn't yet
// associated with the handle
// implementation of wxWindowCreationHook class: it just sets gs_winBeingCreated to the
// window being created and insures that it's always unset back later
wxWindowCreationHook::wxWindowCreationHook(wxWindowPalm *winBeingCreated)
{
}
wxWindowCreationHook::~wxWindowCreationHook()
{
}
WXLRESULT wxWindowPalm::PalmWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
{
return false;
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxWindow <-> HWND map // wxWindow <-> HWND map
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
wxWinHashTable *wxWinHandleHash = NULL; wxWinHashTable *wxWinHandleHash = NULL;
wxWindow *wxFindWinFromHandle(WXHWND hWnd) wxWindow *wxFindWinFromWinHandle(WXWINHANDLE handle)
{ {
// TODO
return NULL; return NULL;
} }
@@ -663,15 +655,9 @@ void wxRemoveHandleAssociation(wxWindowPalm *win)
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// various Palm speciic class dependent functions // various Palm specific class dependent functions
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Default destroyer - override if you destroy it in some other way
// (e.g. with MDI child windows)
void wxWindowPalm::PalmDestroyWindow()
{
}
bool wxWindowPalm::PalmGetCreateWindowCoords(const wxPoint& pos, bool wxWindowPalm::PalmGetCreateWindowCoords(const wxPoint& pos,
const wxSize& size, const wxSize& size,
int& x, int& y, int& x, int& y,
@@ -680,11 +666,6 @@ bool wxWindowPalm::PalmGetCreateWindowCoords(const wxPoint& pos,
return false; return false;
} }
WXHWND wxWindowPalm::PalmGetParent() const
{
return NULL;
}
bool wxWindowPalm::PalmCreate(const wxChar *wclass, bool wxWindowPalm::PalmCreate(const wxChar *wclass,
const wxChar *title, const wxChar *title,
const wxPoint& pos, const wxPoint& pos,
@@ -699,183 +680,15 @@ bool wxWindowPalm::PalmCreate(const wxChar *wclass,
// Palm message handlers // Palm message handlers
// =========================================================================== // ===========================================================================
// ---------------------------------------------------------------------------
// end session messages
// ---------------------------------------------------------------------------
bool wxWindowPalm::HandleQueryEndSession(long logOff, bool *mayEnd)
{
return false;
}
bool wxWindowPalm::HandleEndSession(bool endSession, long logOff)
{
return false;
}
// ---------------------------------------------------------------------------
// window creation/destruction
// ---------------------------------------------------------------------------
bool wxWindowPalm::HandleCreate(WXLPCREATESTRUCT cs, bool *mayCreate)
{
return false;
}
bool wxWindowPalm::HandleDestroy()
{
return false;
}
// ---------------------------------------------------------------------------
// activation/focus
// ---------------------------------------------------------------------------
bool wxWindowPalm::HandleActivate(int state,
bool WXUNUSED(minimized),
WXHWND WXUNUSED(activate))
{
return false;
}
bool wxWindowPalm::HandleSetFocus(WXHWND hwnd)
{
return false;
}
bool wxWindowPalm::HandleKillFocus(WXHWND hwnd)
{
return false;
}
// ---------------------------------------------------------------------------
// miscellaneous
// ---------------------------------------------------------------------------
bool wxWindowPalm::HandleShow(bool show, int WXUNUSED(status))
{
return false;
}
bool wxWindowPalm::HandleInitDialog(WXHWND WXUNUSED(hWndFocus))
{
return false;
}
bool wxWindowPalm::HandleDropFiles(WXWPARAM wParam)
{
return false;
}
bool wxWindowPalm::HandleSetCursor(WXHWND WXUNUSED(hWnd),
short nHitTest,
int WXUNUSED(mouseMsg))
{
return false;
}
// ---------------------------------------------------------------------------
// owner drawn stuff
// ---------------------------------------------------------------------------
#if (wxUSE_OWNER_DRAWN && wxUSE_MENUS_NATIVE) || \
(wxUSE_CONTROLS && !defined(__WXUNIVERSAL__))
#define WXUNUSED_UNLESS_ODRAWN(param) param
#else
#define WXUNUSED_UNLESS_ODRAWN(param)
#endif
bool
wxWindowPalm::PalmOnDrawItem(int WXUNUSED_UNLESS_ODRAWN(id),
WXDRAWITEMSTRUCT * WXUNUSED_UNLESS_ODRAWN(itemStruct))
{
return false;
}
bool
wxWindowPalm::PalmOnMeasureItem(int WXUNUSED_UNLESS_ODRAWN(id),
WXMEASUREITEMSTRUCT *
WXUNUSED_UNLESS_ODRAWN(itemStruct))
{
return false;
}
// ---------------------------------------------------------------------------
// colours and palettes
// ---------------------------------------------------------------------------
bool wxWindowPalm::HandleSysColorChange()
{
return false;
}
bool wxWindowPalm::HandleDisplayChange()
{
return false;
}
bool wxWindowPalm::HandleCtlColor(WXHBRUSH *brush,
WXHDC pDC,
WXHWND pWnd,
WXUINT nCtlColor,
WXUINT message,
WXWPARAM wParam,
WXLPARAM lParam)
{
return false;
}
// Define for each class of dialog and control
WXHBRUSH wxWindowPalm::OnCtlColor(WXHDC WXUNUSED(hDC),
WXHWND WXUNUSED(hWnd),
WXUINT WXUNUSED(nCtlColor),
WXUINT WXUNUSED(message),
WXWPARAM WXUNUSED(wParam),
WXLPARAM WXUNUSED(lParam))
{
return (WXHBRUSH)0;
}
bool wxWindowPalm::HandlePaletteChanged(WXHWND hWndPalChange)
{
return false;
}
bool wxWindowPalm::HandleCaptureChanged(WXHWND hWndGainedCapture)
{
return false;
}
bool wxWindowPalm::HandleQueryNewPalette()
{
return false;
}
// Responds to colour changes: passes event on to children.
void wxWindowPalm::OnSysColourChanged(wxSysColourChangedEvent& WXUNUSED(event))
{
}
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// painting // painting
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
bool wxWindowPalm::HandlePaint()
{
return false;
}
// Can be called from an application's OnPaint handler // Can be called from an application's OnPaint handler
void wxWindowPalm::OnPaint(wxPaintEvent& event) void wxWindowPalm::OnPaint(wxPaintEvent& event)
{ {
} }
bool wxWindowPalm::HandleEraseBkgnd(WXHDC hdc)
{
return false;
}
void wxWindowPalm::OnEraseBackground(wxEraseEvent& event) void wxWindowPalm::OnEraseBackground(wxEraseEvent& event)
{ {
} }
@@ -884,16 +697,6 @@ void wxWindowPalm::OnEraseBackground(wxEraseEvent& event)
// moving and resizing // moving and resizing
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
bool wxWindowPalm::HandleMinimize()
{
return false;
}
bool wxWindowPalm::HandleMaximize()
{
return false;
}
bool wxWindowPalm::HandleMove(int x, int y) bool wxWindowPalm::HandleMove(int x, int y)
{ {
return false; return false;
@@ -904,106 +707,6 @@ bool wxWindowPalm::HandleMoving(wxRect& rect)
return false; return false;
} }
bool wxWindowPalm::HandleSize(int WXUNUSED(w), int WXUNUSED(h),
WXUINT WXUNUSED(flag))
{
return false;
}
bool wxWindowPalm::HandleSizing(wxRect& rect)
{
return false;
}
bool wxWindowPalm::HandleGetMinMaxInfo(void *mmInfo)
{
return false;
}
// ---------------------------------------------------------------------------
// command messages
// ---------------------------------------------------------------------------
bool wxWindowPalm::HandleCommand(WXWORD id, WXWORD cmd, WXHWND control)
{
return false;
}
// ---------------------------------------------------------------------------
// mouse events
// ---------------------------------------------------------------------------
void wxWindowPalm::InitMouseEvent(wxMouseEvent& event,
int x, int y,
WXUINT flags)
{
}
// Windows doesn't send the mouse events to the static controls (which are
// transparent in the sense that their WM_NCHITTEST handler returns
// HTTRANSPARENT) at all but we want all controls to receive the mouse events
// and so we manually check if we don't have a child window under mouse and if
// we do, send the event to it instead of the window Windows had sent WM_XXX
// to.
//
// Notice that this is not done for the mouse move events because this could
// (would?) be too slow, but only for clicks which means that the static texts
// still don't get move, enter nor leave events.
static wxWindowPalm *FindWindowForMouseEvent(wxWindowPalm *win, int *x, int *y) //TW:REQ:Univ
{
return NULL;
}
bool wxWindowPalm::HandleMouseEvent(WXUINT msg, int x, int y, WXUINT flags)
{
return false;
}
bool wxWindowPalm::HandleMouseMove(int x, int y, WXUINT flags)
{
return false;
}
bool wxWindowPalm::HandleMouseWheel(WXWPARAM wParam, WXLPARAM lParam)
{
return false;
}
// ---------------------------------------------------------------------------
// keyboard handling
// ---------------------------------------------------------------------------
// create the key event of the given type for the given key - used by
// HandleChar and HandleKeyDown/Up
wxKeyEvent wxWindowPalm::CreateKeyEvent(wxEventType evType,
int id,
WXLPARAM lParam,
WXWPARAM wParam) const
{
wxKeyEvent event(evType);
return event;
}
// isASCII is true only when we're called from WM_CHAR handler and not from
// WM_KEYDOWN one
bool wxWindowPalm::HandleChar(WXWPARAM wParam, WXLPARAM lParam, bool isASCII)
{
return false;
}
bool wxWindowPalm::HandleKeyDown(WXWPARAM wParam, WXLPARAM lParam)
{
return false;
}
bool wxWindowPalm::HandleKeyUp(WXWPARAM wParam, WXLPARAM lParam)
{
return false;
}
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// joystick // joystick
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
@@ -1018,8 +721,9 @@ bool wxWindowPalm::HandleJoystickEvent(WXUINT msg, int x, int y, WXUINT flags)
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
bool wxWindowPalm::PalmOnScroll(int orientation, WXWORD wParam, bool wxWindowPalm::PalmOnScroll(int orientation, WXWORD wParam,
WXWORD pos, WXHWND control) WXWORD pos, WXWINHANDLE control)
{ {
// TODO
return false; return false;
} }
@@ -1027,53 +731,9 @@ bool wxWindowPalm::PalmOnScroll(int orientation, WXWORD wParam,
// global functions // global functions
// =========================================================================== // ===========================================================================
void wxGetCharSize(WXHWND wnd, int *x, int *y, const wxFont *the_font) void wxGetCharSize(WXWINHANDLE wnd, int *x, int *y, const wxFont *the_font)
{ {
} // TODO
// Returns 0 if was a normal ASCII value, not a special key. This indicates that
// the key should be ignored by WM_KEYDOWN and processed by WM_CHAR instead.
int wxCharCodePalmToWX(int keySym, WXLPARAM lParam)
{
return 0;
}
int wxCharCodeWXToPalm(int id, bool *isVirtual)
{
return 0;
}
bool wxGetKeyState(wxKeyCode key)
{
return false;
}
wxWindow *wxGetActiveWindow()
{
return NULL;
}
extern wxWindow *wxGetWindowFromHWND(WXHWND hWnd)
{
return NULL;
}
// Find the wxWindow at the current mouse position, returning the mouse
// position.
wxWindow* wxFindWindowAtPointer(wxPoint& pt)
{
return NULL;
}
wxWindow* wxFindWindowAtPoint(const wxPoint& pt)
{
return NULL;
}
// Get the current mouse position.
wxPoint wxGetMousePosition()
{
return wxPoint(0, 0);
} }
#if wxUSE_HOTKEY #if wxUSE_HOTKEY
@@ -1088,15 +748,6 @@ bool wxWindowPalm::UnregisterHotKey(int hotkeyId)
return false; return false;
} }
#if wxUSE_ACCEL
bool wxWindowPalm::HandleHotKey(WXWPARAM wParam, WXLPARAM lParam)
{
return false;
}
#endif // wxUSE_ACCEL
#endif // wxUSE_HOTKEY #endif // wxUSE_HOTKEY