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:
@@ -1262,6 +1262,17 @@
|
||||
# endif
|
||||
#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_LISTBOX
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
|
@@ -74,7 +74,11 @@ public:
|
||||
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"
|
||||
|
||||
#define wxHAS_NATIVE_DATEPICKCTRL
|
||||
|
@@ -2346,7 +2346,37 @@ DECLARE_WXCOCOA_OBJC_CLASS(NSView);
|
||||
typedef WX_NSView WXWidget; /* wxWidgets BASE definition */
|
||||
#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 */
|
||||
#ifndef WXFAR
|
||||
|
@@ -84,8 +84,6 @@ public:
|
||||
// MSW only
|
||||
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
||||
WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
|
||||
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
protected:
|
||||
virtual void DoMoveWindow(int x, int y, int width, int height);
|
||||
|
@@ -108,9 +108,6 @@ public:
|
||||
bool MSWProcessEditMsg(WXUINT msg, 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;
|
||||
|
||||
protected:
|
||||
|
@@ -72,9 +72,6 @@ public:
|
||||
|
||||
void OnEraseBackground(wxEraseEvent& event);
|
||||
|
||||
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
|
||||
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
protected:
|
||||
// regardless how deeply we are in wxWidgets hierarchy always get correct form
|
||||
FormType* GetParentForm() const;
|
||||
@@ -101,6 +98,7 @@ protected:
|
||||
// getting and setting sizes
|
||||
virtual void DoGetPosition( int *x, int *y ) 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
|
||||
// from Create() method of the derived class passing its label, pos and
|
||||
@@ -143,6 +141,7 @@ private:
|
||||
void Init();
|
||||
|
||||
virtual void DoGetBounds( RectangleType &rect ) const;
|
||||
virtual void DoSetBounds( RectangleType &rect );
|
||||
|
||||
// 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
|
||||
|
62
include/wx/palmos/datectrl.h
Normal file
62
include/wx/palmos/datectrl.h
Normal 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_
|
@@ -63,7 +63,7 @@ public:
|
||||
// -------------------------------
|
||||
|
||||
// override some base class virtuals
|
||||
virtual bool Show(bool show = TRUE);
|
||||
virtual bool Show(bool show = true);
|
||||
|
||||
virtual void Raise();
|
||||
|
||||
@@ -76,28 +76,6 @@ public:
|
||||
void OnApply(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:
|
||||
// find the window to use as parent for this dialog if none has been
|
||||
// specified explicitly by the user
|
||||
|
@@ -52,7 +52,6 @@ public:
|
||||
// -------------------------------
|
||||
|
||||
// event handlers
|
||||
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
|
||||
// Toolbar
|
||||
@@ -65,8 +64,6 @@ public:
|
||||
#endif // wxUSE_TOOLBAR
|
||||
|
||||
// event handlers
|
||||
bool HandlePaint();
|
||||
bool HandleSize(int x, int y, WXUINT flag);
|
||||
bool HandleMenuLoop(const wxEventType& evtType, WXWORD isPopup);
|
||||
|
||||
virtual wxPoint GetClientAreaOrigin() const;
|
||||
|
@@ -213,9 +213,6 @@ public:
|
||||
// Add or remove a single window style
|
||||
void SetSingleStyle(long style, bool add = true) ;
|
||||
|
||||
// Set the whole window style
|
||||
void SetWindowStyleFlag(long style) ;
|
||||
|
||||
// Searches for an item, starting from 'item'.
|
||||
// item can be -1 to find the first item that matches the
|
||||
// specified flags.
|
||||
@@ -348,10 +345,6 @@ public:
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
|
||||
// obsolete stuff, for compatibility only -- don't use
|
||||
wxDEPRECATED( int GetItemSpacing(bool isSmall) const);
|
||||
|
||||
protected:
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
@@ -81,14 +81,8 @@ public:
|
||||
// handlers
|
||||
// --------
|
||||
|
||||
// Responds to colour changes
|
||||
void OnSysColourChanged(wxSysColourChangedEvent& 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
|
||||
virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
@@ -106,7 +100,7 @@ protected:
|
||||
wxMDIChildFrame * m_currentChild;
|
||||
wxMenu* m_windowMenu;
|
||||
|
||||
// TRUE if MDI Frame is intercepting commands, not child
|
||||
// true if MDI Frame is intercepting commands, not child
|
||||
bool m_parentFrameActive;
|
||||
|
||||
private:
|
||||
@@ -148,10 +142,10 @@ public:
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr);
|
||||
|
||||
virtual bool IsTopLevel() const { return FALSE; }
|
||||
virtual bool IsTopLevel() const { return false; }
|
||||
|
||||
// MDI operations
|
||||
virtual void Maximize(bool maximize = TRUE);
|
||||
virtual void Maximize(bool maximize = true);
|
||||
virtual void Restore();
|
||||
virtual void Activate();
|
||||
|
||||
@@ -161,8 +155,6 @@ public:
|
||||
// Handlers
|
||||
bool HandleMDIActivate(long bActivate, WXHWND, WXHWND);
|
||||
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 MSWDefWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
@@ -178,7 +170,7 @@ protected:
|
||||
virtual void DoGetPosition(int *x, int *y) const;
|
||||
virtual void DoSetClientSize(int width, int height);
|
||||
virtual void InternalSetMenuBar();
|
||||
virtual bool IsMDIChild() const { return TRUE; }
|
||||
virtual bool IsMDIChild() const { return true; }
|
||||
|
||||
virtual WXHICON GetDefaultIcon() const;
|
||||
|
||||
|
@@ -46,7 +46,7 @@ public:
|
||||
|
||||
virtual void SetThumbPosition(int viewStart);
|
||||
virtual void SetScrollbar(int position, int thumbSize, int range, int pageSize,
|
||||
bool refresh = TRUE);
|
||||
bool refresh = true);
|
||||
|
||||
// needed for RTTI
|
||||
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 Command(wxCommandEvent& event);
|
||||
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
|
||||
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
virtual bool MSWOnScroll(int orientation, WXWORD wParam,
|
||||
WXWORD pos, WXHWND control);
|
||||
|
||||
|
@@ -85,6 +85,9 @@ protected:
|
||||
private:
|
||||
|
||||
void Init();
|
||||
|
||||
int PalmInvertOrNot(int value) const;
|
||||
|
||||
int m_oldPos; // needed for tracing thumb position during scrolling
|
||||
int m_oldValue; // needed for comparing thumb position before and after scrolling
|
||||
int m_lineSize; // imitate line size
|
||||
|
@@ -117,9 +117,6 @@ class WXDLLEXPORT wxTabCtrl: public wxControl
|
||||
|
||||
virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
|
||||
|
||||
// Responds to colour changes
|
||||
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||
|
||||
protected:
|
||||
wxImageList* m_imageList;
|
||||
|
||||
|
@@ -136,12 +136,8 @@ public:
|
||||
// Implementation from now on
|
||||
// --------------------------
|
||||
|
||||
virtual void SetWindowStyleFlag(long style);
|
||||
|
||||
virtual void Command(wxCommandEvent& event);
|
||||
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
|
||||
virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
|
||||
@@ -155,8 +151,6 @@ public:
|
||||
virtual bool SetForegroundColour(const wxColour& colour);
|
||||
#endif // wxUSE_RICHEDIT
|
||||
|
||||
virtual void AdoptAttributesFromHWND();
|
||||
|
||||
virtual bool AcceptsFocus() const;
|
||||
|
||||
// callbacks
|
||||
|
@@ -60,10 +60,7 @@ public:
|
||||
// implementation only from now on
|
||||
// -------------------------------
|
||||
|
||||
virtual void SetWindowStyleFlag(long style);
|
||||
|
||||
void OnMouseEvent(wxMouseEvent& event);
|
||||
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||
|
||||
void SetFocus() {}
|
||||
|
||||
|
@@ -89,6 +89,8 @@ public:
|
||||
bool HandleControlRepeat(EventType* event);
|
||||
bool HandleSize(EventType* event);
|
||||
|
||||
virtual WXWINHANDLE GetWinHandle() const;
|
||||
|
||||
protected:
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
@@ -102,9 +104,6 @@ protected:
|
||||
// translate wxWidgets flags to Windows ones
|
||||
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?
|
||||
bool m_iconized;
|
||||
|
||||
|
@@ -74,12 +74,11 @@ public:
|
||||
virtual void WarpPointer(int x, int y);
|
||||
|
||||
virtual void Refresh( bool eraseBackground = true,
|
||||
const wxRect *rect = (const wxRect *) NULL );
|
||||
const wxRect *rect = NULL );
|
||||
virtual void Update();
|
||||
virtual void Freeze();
|
||||
virtual void Thaw();
|
||||
|
||||
virtual void SetWindowStyleFlag( long style );
|
||||
virtual bool SetCursor( const wxCursor &cursor );
|
||||
virtual bool SetFont( const wxFont &font );
|
||||
|
||||
@@ -136,9 +135,8 @@ public:
|
||||
// simple accessors
|
||||
// ----------------
|
||||
|
||||
WXHWND GetHWND() const { return m_hWnd; }
|
||||
void SetHWND(WXHWND hWnd) { m_hWnd = hWnd; }
|
||||
virtual WXWidget GetHandle() const { return GetHWND(); }
|
||||
virtual WXWINHANDLE GetWinHandle() const { return m_handle; }
|
||||
virtual WXWidget GetHandle() const { return GetWinHandle(); }
|
||||
|
||||
// event handlers
|
||||
// --------------
|
||||
@@ -147,23 +145,11 @@ public:
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
|
||||
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 *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
|
||||
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
|
||||
// and optional extended style for the corresponding native control
|
||||
@@ -188,9 +174,6 @@ public:
|
||||
int& x, int& y,
|
||||
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
|
||||
// style, title and geometry (default values
|
||||
//
|
||||
@@ -202,150 +185,25 @@ public:
|
||||
WXDWORD style = 0,
|
||||
WXDWORD exendedStyle = 0);
|
||||
|
||||
virtual bool PalmCommand(WXUINT param, WXWORD id);
|
||||
|
||||
#ifndef __WXUNIVERSAL__
|
||||
// Create an appropriate wxWindow from a HWND
|
||||
virtual wxWindow* CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd);
|
||||
// Create an appropriate wxWindow from a WinHandle
|
||||
virtual wxWindow* CreateWindowFromWinHandle(wxWindow* parent, WXWINHANDLE handle);
|
||||
|
||||
// Make sure the window style reflects the HWND style (roughly)
|
||||
virtual void AdoptAttributesFromHWND();
|
||||
// Make sure the window style reflects the WinHandle style (roughly)
|
||||
virtual void AdoptAttributesFromWinHandle();
|
||||
#endif // __WXUNIVERSAL__
|
||||
|
||||
// Setup background and foreground colours correctly
|
||||
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:
|
||||
// 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)
|
||||
virtual bool PalmOnScroll(int orientation, WXWORD nSBCode,
|
||||
WXWORD pos, WXHWND 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;
|
||||
WXWORD pos, WXWINHANDLE control);
|
||||
|
||||
// virtual function for implementing internal idle
|
||||
// behaviour
|
||||
@@ -353,15 +211,12 @@ public:
|
||||
|
||||
protected:
|
||||
// the window handle
|
||||
WXHWND m_hWnd;
|
||||
WinHandle m_handle;
|
||||
FormType *FrameForm;
|
||||
|
||||
FormType *GetFormPtr();
|
||||
void SetFormPtr(FormType *FormPtr);
|
||||
|
||||
// the old window proc (we subclass all windows)
|
||||
WXFARPROC m_oldWndProc;
|
||||
|
||||
// additional (Palm specific) flags
|
||||
bool m_mouseInWindow:1;
|
||||
bool m_lastKeydownProcessed:1;
|
||||
@@ -409,10 +264,6 @@ protected:
|
||||
const wxString& ttip);
|
||||
#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:
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
@@ -433,24 +284,6 @@ private:
|
||||
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
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -459,7 +292,7 @@ public:
|
||||
// needs to "see" its dtor and not just forward declaration
|
||||
#include "wx/hash.h"
|
||||
|
||||
// pseudo-template HWND <-> wxWindow hash table
|
||||
// pseudo-template WinHandle <-> wxWindow hash table
|
||||
WX_DECLARE_HASH(wxWindowPalm, wxWindowList, wxWinHashTable);
|
||||
|
||||
extern wxWinHashTable *wxWinHandleHash;
|
||||
|
Reference in New Issue
Block a user