1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/palmos/windows.cpp
4 // Author: William Osborne - minimal working wxPalmOS port
5 // Modified by: Wlodzimierz ABX Skiba - more than minimal functionality
8 // Copyright: (c) William Osborne, Wlodzimierz Skiba
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // ===========================================================================
14 // ===========================================================================
16 // ---------------------------------------------------------------------------
18 // ---------------------------------------------------------------------------
20 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
21 #pragma implementation "window.h"
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
32 #include "wx/window.h"
37 #include "wx/dcclient.h"
38 #include "wx/dcmemory.h"
41 #include "wx/layout.h"
42 #include "wx/dialog.h"
44 #include "wx/listbox.h"
45 #include "wx/button.h"
46 #include "wx/msgdlg.h"
47 #include "wx/settings.h"
48 #include "wx/statbox.h"
51 #if wxUSE_OWNER_DRAWN && !defined(__WXUNIVERSAL__)
52 #include "wx/ownerdrw.h"
55 #include "wx/module.h"
57 #if wxUSE_DRAG_AND_DROP
61 #if wxUSE_ACCESSIBILITY
62 #include "wx/access.h"
65 #include "wx/menuitem.h"
69 #include "wx/tooltip.h"
77 #include "wx/spinctrl.h"
78 #endif // wxUSE_SPINCTRL
83 #include "wx/textctrl.h"
84 #include "wx/notebook.h"
85 #include "wx/listctrl.h"
86 #include "wx/window.h"
88 // ---------------------------------------------------------------------------
90 // ---------------------------------------------------------------------------
92 #if wxUSE_MENUS_NATIVE
93 wxMenu
*wxCurrentPopupMenu
= NULL
;
94 #endif // wxUSE_MENUS_NATIVE
96 // true if we had already created the std colour map, used by
97 // wxGetStdColourMap() and wxWindow::OnSysColourChanged() (FIXME-MT)
98 static bool gs_hasStdCmap
= false;
100 // ---------------------------------------------------------------------------
102 // ---------------------------------------------------------------------------
104 // ---------------------------------------------------------------------------
106 // ---------------------------------------------------------------------------
108 // in wxUniv/Palm this class is abstract because it doesn't have DoPopupMenu()
110 #ifdef __WXUNIVERSAL__
111 IMPLEMENT_ABSTRACT_CLASS(wxWindowPalm
, wxWindowBase
)
113 #if wxUSE_EXTENDED_RTTI
115 // windows that are created from a parent window during its Create method, eg. spin controls in a calendar controls
116 // must never been streamed out separately otherwise chaos occurs. Right now easiest is to test for negative ids, as
117 // windows with negative ids never can be recreated anyway
119 bool wxWindowStreamingCallback( const wxObject
*object
, wxWriter
* , wxPersister
* , wxxVariantArray
& )
124 IMPLEMENT_DYNAMIC_CLASS_XTI_CALLBACK(wxWindow
, wxWindowBase
,"wx/window.h", wxWindowStreamingCallback
)
126 // make wxWindowList known before the property is used
128 wxCOLLECTION_TYPE_INFO( wxWindow
* , wxWindowList
) ;
130 template<> void wxCollectionToVariantArray( wxWindowList
const &theList
, wxxVariantArray
&value
)
132 wxListCollectionToVariantArray
<wxWindowList::compatibility_iterator
>( theList
, value
) ;
135 WX_DEFINE_FLAGS( wxWindowStyle
)
137 wxBEGIN_FLAGS( wxWindowStyle
)
138 // new style border flags, we put them first to
139 // use them for streaming out
141 wxFLAGS_MEMBER(wxBORDER_SIMPLE
)
142 wxFLAGS_MEMBER(wxBORDER_SUNKEN
)
143 wxFLAGS_MEMBER(wxBORDER_DOUBLE
)
144 wxFLAGS_MEMBER(wxBORDER_RAISED
)
145 wxFLAGS_MEMBER(wxBORDER_STATIC
)
146 wxFLAGS_MEMBER(wxBORDER_NONE
)
148 // old style border flags
149 wxFLAGS_MEMBER(wxSIMPLE_BORDER
)
150 wxFLAGS_MEMBER(wxSUNKEN_BORDER
)
151 wxFLAGS_MEMBER(wxDOUBLE_BORDER
)
152 wxFLAGS_MEMBER(wxRAISED_BORDER
)
153 wxFLAGS_MEMBER(wxSTATIC_BORDER
)
154 wxFLAGS_MEMBER(wxBORDER
)
156 // standard window styles
157 wxFLAGS_MEMBER(wxTAB_TRAVERSAL
)
158 wxFLAGS_MEMBER(wxCLIP_CHILDREN
)
159 wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW
)
160 wxFLAGS_MEMBER(wxWANTS_CHARS
)
161 wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE
)
162 wxFLAGS_MEMBER(wxALWAYS_SHOW_SB
)
163 wxFLAGS_MEMBER(wxVSCROLL
)
164 wxFLAGS_MEMBER(wxHSCROLL
)
166 wxEND_FLAGS( wxWindowStyle
)
168 wxBEGIN_PROPERTIES_TABLE(wxWindow
)
169 wxEVENT_PROPERTY( Close
, wxEVT_CLOSE_WINDOW
, wxCloseEvent
)
170 wxEVENT_PROPERTY( Create
, wxEVT_CREATE
, wxWindowCreateEvent
)
171 wxEVENT_PROPERTY( Destroy
, wxEVT_DESTROY
, wxWindowDestroyEvent
)
172 // Always constructor Properties first
174 wxREADONLY_PROPERTY( Parent
,wxWindow
*, GetParent
, EMPTY_MACROVALUE
, 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
175 wxPROPERTY( Id
,wxWindowID
, SetId
, GetId
, wxID_ANY
, 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
176 wxPROPERTY( Position
,wxPoint
, SetPosition
, GetPosition
, wxDefaultPosition
, 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // pos
177 wxPROPERTY( Size
,wxSize
, SetSize
, GetSize
, wxDefaultSize
, 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // size
178 wxPROPERTY( WindowStyle
, long , SetWindowStyleFlag
, GetWindowStyleFlag
, EMPTY_MACROVALUE
, 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
180 // Then all relations of the object graph
182 wxREADONLY_PROPERTY_COLLECTION( Children
, wxWindowList
, wxWindowBase
* , GetWindowChildren
, wxPROP_OBJECT_GRAPH
/*flags*/ , wxT("Helpstring") , wxT("group"))
184 // and finally all other properties
186 wxPROPERTY( ExtraStyle
, long , SetExtraStyle
, GetExtraStyle
, EMPTY_MACROVALUE
, 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // extstyle
187 wxPROPERTY( BackgroundColour
, wxColour
, SetBackgroundColour
, GetBackgroundColour
, EMPTY_MACROVALUE
, 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // bg
188 wxPROPERTY( ForegroundColour
, wxColour
, SetForegroundColour
, GetForegroundColour
, EMPTY_MACROVALUE
, 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // fg
189 wxPROPERTY( Enabled
, bool , Enable
, IsEnabled
, wxxVariant((bool)true) , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
190 wxPROPERTY( Shown
, bool , Show
, IsShown
, wxxVariant((bool)true) , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
192 // possible property candidates (not in xrc) or not valid in all subclasses
193 wxPROPERTY( Title
,wxString
, SetTitle
, GetTitle
, wxT("") )
194 wxPROPERTY( Font
, wxFont
, SetFont
, GetWindowFont
, )
195 wxPROPERTY( Label
,wxString
, SetLabel
, GetLabel
, wxT("") )
196 // MaxHeight, Width , MinHeight , Width
197 // TODO switch label to control and title to toplevels
199 wxPROPERTY( ThemeEnabled
, bool , SetThemeEnabled
, GetThemeEnabled
, )
200 //wxPROPERTY( Cursor , wxCursor , SetCursor , GetCursor , )
201 // wxPROPERTY( ToolTip , wxString , SetToolTip , GetToolTipText , )
202 wxPROPERTY( AutoLayout
, bool , SetAutoLayout
, GetAutoLayout
, )
207 wxEND_PROPERTIES_TABLE()
209 wxBEGIN_HANDLERS_TABLE(wxWindow
)
210 wxEND_HANDLERS_TABLE()
212 wxCONSTRUCTOR_DUMMY(wxWindow
)
215 IMPLEMENT_DYNAMIC_CLASS(wxWindow
, wxWindowBase
)
217 #endif // __WXUNIVERSAL__/__WXPalm__
219 BEGIN_EVENT_TABLE(wxWindowPalm
, wxWindowBase
)
220 EVT_ERASE_BACKGROUND(wxWindowPalm::OnEraseBackground
)
221 EVT_SYS_COLOUR_CHANGED(wxWindowPalm::OnSysColourChanged
)
222 EVT_INIT_DIALOG(wxWindowPalm::OnInitDialog
)
225 // ===========================================================================
227 // ===========================================================================
229 // ---------------------------------------------------------------------------
230 // wxWindow utility functions
231 // ---------------------------------------------------------------------------
233 // Find an item given the MS Windows id
234 wxWindow
*wxWindowPalm::FindItem(long id
) const
239 // Find an item given the MS Windows handle
240 wxWindow
*wxWindowPalm::FindItemByHWND(WXHWND hWnd
, bool controlOnly
) const
245 // Default command handler
246 bool wxWindowPalm::PalmCommand(WXUINT
WXUNUSED(param
), WXWORD
WXUNUSED(id
))
251 // ----------------------------------------------------------------------------
252 // constructors and such
253 // ----------------------------------------------------------------------------
255 void wxWindowPalm::Init()
260 wxWindowPalm::~wxWindowPalm()
264 // real construction (Init() must have been called before!)
265 bool wxWindowPalm::Create(wxWindow
*parent
,
270 const wxString
& name
)
272 wxCHECK_MSG( parent
, false, wxT("can't create wxWindow without parent") );
274 if ( !CreateBase(parent
, id
, pos
, size
, style
, wxDefaultValidator
, name
) )
277 parent
->AddChild(this);
284 FormType
*wxWindowPalm::GetFormPtr()
288 void wxWindowPalm::SetFormPtr(FormType
*FormPtr
)
293 // ---------------------------------------------------------------------------
295 // ---------------------------------------------------------------------------
297 void wxWindowPalm::SetFocus()
301 void wxWindowPalm::SetFocusFromKbd()
305 // Get the window with the focus
306 wxWindow
*wxWindowBase::DoFindFocus()
311 bool wxWindowPalm::Enable(bool enable
)
316 bool wxWindowPalm::Show(bool show
)
321 // Raise the window to the top of the Z order
322 void wxWindowPalm::Raise()
326 // Lower the window to the bottom of the Z order
327 void wxWindowPalm::Lower()
331 void wxWindowPalm::SetTitle( const wxString
& title
)
335 wxString
wxWindowPalm::GetTitle() const
337 return wxEmptyString
;
340 void wxWindowPalm::DoCaptureMouse()
344 void wxWindowPalm::DoReleaseMouse()
348 /* static */ wxWindow
*wxWindowBase::GetCapture()
353 bool wxWindowPalm::SetFont(const wxFont
& font
)
357 bool wxWindowPalm::SetCursor(const wxCursor
& cursor
)
362 void wxWindowPalm::WarpPointer (int x
, int y
)
366 // ---------------------------------------------------------------------------
368 // ---------------------------------------------------------------------------
370 // convert wxHORIZONTAL/wxVERTICAL to SB_HORZ/SB_VERT
371 static inline int wxDirToWinStyle(int orient
)
376 int wxWindowPalm::GetScrollPos(int orient
) const
381 // This now returns the whole range, not just the number
382 // of positions that we can scroll.
383 int wxWindowPalm::GetScrollRange(int orient
) const
388 int wxWindowPalm::GetScrollThumb(int orient
) const
393 void wxWindowPalm::SetScrollPos(int orient
, int pos
, bool refresh
)
397 // New function that will replace some of the above.
398 void wxWindowPalm::SetScrollbar(int orient
,
406 void wxWindowPalm::ScrollWindow(int dx
, int dy
, const wxRect
*prect
)
410 bool wxWindowPalm::ScrollLines(int lines
)
415 bool wxWindowPalm::ScrollPages(int pages
)
420 // ---------------------------------------------------------------------------
422 // ---------------------------------------------------------------------------
424 void wxWindowPalm::SubclassWin(WXHWND hWnd
)
428 void wxWindowPalm::UnsubclassWin()
432 bool wxCheckWindowWndProc(WXHWND hWnd
, WXFARPROC wndProc
)
437 // ----------------------------------------------------------------------------
439 // ----------------------------------------------------------------------------
441 void wxWindowPalm::SetWindowStyleFlag(long flags
)
445 WXDWORD
wxWindowPalm::PalmGetStyle(long flags
, WXDWORD
*exstyle
) const
450 // Setup background and foreground colours correctly
451 void wxWindowPalm::SetupColours()
455 bool wxWindowPalm::IsMouseInWindow() const
460 void wxWindowPalm::OnInternalIdle()
464 // Set this window to be the child of 'parent'.
465 bool wxWindowPalm::Reparent(wxWindowBase
*parent
)
470 void wxWindowPalm::Freeze()
474 void wxWindowPalm::Thaw()
478 void wxWindowPalm::Refresh(bool eraseBack
, const wxRect
*rect
)
482 void wxWindowPalm::Update()
486 // ---------------------------------------------------------------------------
488 // ---------------------------------------------------------------------------
491 #if wxUSE_DRAG_AND_DROP
492 void wxWindowPalm::SetDropTarget(wxDropTarget
*pDropTarget
)
495 #endif // wxUSE_DRAG_AND_DROP
497 // old style file-manager drag&drop support: we retain the old-style
498 // DragAcceptFiles in parallel with SetDropTarget.
499 void wxWindowPalm::DragAcceptFiles(bool accept
)
503 // ----------------------------------------------------------------------------
505 // ----------------------------------------------------------------------------
509 void wxWindowPalm::DoSetToolTip(wxToolTip
*tooltip
)
513 #endif // wxUSE_TOOLTIPS
515 // ---------------------------------------------------------------------------
516 // moving and resizing
517 // ---------------------------------------------------------------------------
520 void wxWindowPalm::DoGetSize(int *x
, int *y
) const
524 // Get size *available for subwindows* i.e. excluding menu bar etc.
525 void wxWindowPalm::DoGetClientSize(int *x
, int *y
) const
529 void wxWindowPalm::DoGetPosition(int *x
, int *y
) const
533 void wxWindowPalm::DoScreenToClient(int *x
, int *y
) const
537 void wxWindowPalm::DoClientToScreen(int *x
, int *y
) const
541 void wxWindowPalm::DoMoveWindow(int x
, int y
, int width
, int height
)
545 // set the size of the window: if the dimensions are positive, just use them,
546 // but if any of them is equal to -1, it means that we must find the value for
547 // it ourselves (unless sizeFlags contains wxSIZE_ALLOW_MINUS_ONE flag, in
548 // which case -1 is a valid value for x and y)
550 // If sizeFlags contains wxSIZE_AUTO_WIDTH/HEIGHT flags (default), we calculate
551 // the width/height to best suit our contents, otherwise we reuse the current
553 void wxWindowPalm::DoSetSize(int x
, int y
, int width
, int height
, int sizeFlags
)
557 void wxWindowPalm::DoSetClientSize(int width
, int height
)
561 // ---------------------------------------------------------------------------
563 // ---------------------------------------------------------------------------
565 int wxWindowPalm::GetCharHeight() const
570 int wxWindowPalm::GetCharWidth() const
575 void wxWindowPalm::GetTextExtent(const wxString
& string
,
577 int *descent
, int *externalLeading
,
578 const wxFont
*theFont
) const
582 // ---------------------------------------------------------------------------
584 // ---------------------------------------------------------------------------
586 #if wxUSE_MENUS_NATIVE
588 // yield for WM_COMMAND events only, i.e. process all WM_COMMANDs in the queue
589 // immediately, without waiting for the next event loop iteration
591 // NB: this function should probably be made public later as it can almost
592 // surely replace wxYield() elsewhere as well
593 static void wxYieldForCommandsOnly()
597 bool wxWindowPalm::DoPopupMenu(wxMenu
*menu
, int x
, int y
)
602 #endif // wxUSE_MENUS_NATIVE
604 // ===========================================================================
605 // pre/post message processing
606 // ===========================================================================
608 WXLRESULT
wxWindowPalm::PalmDefWindowProc(WXUINT nMsg
, WXWPARAM wParam
, WXLPARAM lParam
)
613 bool wxWindowPalm::PalmProcessMessage(WXMSG
* pMsg
)
618 bool wxWindowPalm::PalmTranslateMessage(WXMSG
* pMsg
)
623 bool wxWindowPalm::PalmShouldPreProcessMessage(WXMSG
* WXUNUSED(pMsg
))
628 // ---------------------------------------------------------------------------
629 // Main wxWidgets window proc and the window proc for wxWindow
630 // ---------------------------------------------------------------------------
632 // Hook for new window just as it's being created, when the window isn't yet
633 // associated with the handle
635 // implementation of wxWindowCreationHook class: it just sets gs_winBeingCreated to the
636 // window being created and insures that it's always unset back later
637 wxWindowCreationHook::wxWindowCreationHook(wxWindowPalm
*winBeingCreated
)
641 wxWindowCreationHook::~wxWindowCreationHook()
645 WXLRESULT
wxWindowPalm::PalmWindowProc(WXUINT message
, WXWPARAM wParam
, WXLPARAM lParam
)
650 // ----------------------------------------------------------------------------
651 // wxWindow <-> HWND map
652 // ----------------------------------------------------------------------------
654 wxWinHashTable
*wxWinHandleHash
= NULL
;
656 wxWindow
*wxFindWinFromHandle(WXHWND hWnd
)
661 void wxRemoveHandleAssociation(wxWindowPalm
*win
)
665 // ----------------------------------------------------------------------------
666 // various Palm speciic class dependent functions
667 // ----------------------------------------------------------------------------
669 // Default destroyer - override if you destroy it in some other way
670 // (e.g. with MDI child windows)
671 void wxWindowPalm::PalmDestroyWindow()
675 bool wxWindowPalm::PalmGetCreateWindowCoords(const wxPoint
& pos
,
678 int& w
, int& h
) const
683 WXHWND
wxWindowPalm::PalmGetParent() const
688 bool wxWindowPalm::PalmCreate(const wxChar
*wclass
,
693 WXDWORD extendedStyle
)
698 // ===========================================================================
699 // Palm message handlers
700 // ===========================================================================
702 // ---------------------------------------------------------------------------
703 // end session messages
704 // ---------------------------------------------------------------------------
706 bool wxWindowPalm::HandleQueryEndSession(long logOff
, bool *mayEnd
)
711 bool wxWindowPalm::HandleEndSession(bool endSession
, long logOff
)
716 // ---------------------------------------------------------------------------
717 // window creation/destruction
718 // ---------------------------------------------------------------------------
720 bool wxWindowPalm::HandleCreate(WXLPCREATESTRUCT cs
, bool *mayCreate
)
725 bool wxWindowPalm::HandleDestroy()
730 // ---------------------------------------------------------------------------
732 // ---------------------------------------------------------------------------
734 bool wxWindowPalm::HandleActivate(int state
,
735 bool WXUNUSED(minimized
),
736 WXHWND
WXUNUSED(activate
))
741 bool wxWindowPalm::HandleSetFocus(WXHWND hwnd
)
746 bool wxWindowPalm::HandleKillFocus(WXHWND hwnd
)
751 // ---------------------------------------------------------------------------
753 // ---------------------------------------------------------------------------
755 bool wxWindowPalm::HandleShow(bool show
, int WXUNUSED(status
))
760 bool wxWindowPalm::HandleInitDialog(WXHWND
WXUNUSED(hWndFocus
))
765 bool wxWindowPalm::HandleDropFiles(WXWPARAM wParam
)
771 bool wxWindowPalm::HandleSetCursor(WXHWND
WXUNUSED(hWnd
),
773 int WXUNUSED(mouseMsg
))
778 // ---------------------------------------------------------------------------
780 // ---------------------------------------------------------------------------
782 #if (wxUSE_OWNER_DRAWN && wxUSE_MENUS_NATIVE) || \
783 (wxUSE_CONTROLS && !defined(__WXUNIVERSAL__))
784 #define WXUNUSED_UNLESS_ODRAWN(param) param
786 #define WXUNUSED_UNLESS_ODRAWN(param)
790 wxWindowPalm::PalmOnDrawItem(int WXUNUSED_UNLESS_ODRAWN(id
),
791 WXDRAWITEMSTRUCT
* WXUNUSED_UNLESS_ODRAWN(itemStruct
))
797 wxWindowPalm::PalmOnMeasureItem(int WXUNUSED_UNLESS_ODRAWN(id
),
798 WXMEASUREITEMSTRUCT
*
799 WXUNUSED_UNLESS_ODRAWN(itemStruct
))
804 // ---------------------------------------------------------------------------
805 // colours and palettes
806 // ---------------------------------------------------------------------------
808 bool wxWindowPalm::HandleSysColorChange()
813 bool wxWindowPalm::HandleDisplayChange()
818 bool wxWindowPalm::HandleCtlColor(WXHBRUSH
*brush
,
829 // Define for each class of dialog and control
830 WXHBRUSH
wxWindowPalm::OnCtlColor(WXHDC
WXUNUSED(hDC
),
831 WXHWND
WXUNUSED(hWnd
),
832 WXUINT
WXUNUSED(nCtlColor
),
833 WXUINT
WXUNUSED(message
),
834 WXWPARAM
WXUNUSED(wParam
),
835 WXLPARAM
WXUNUSED(lParam
))
840 bool wxWindowPalm::HandlePaletteChanged(WXHWND hWndPalChange
)
845 bool wxWindowPalm::HandleCaptureChanged(WXHWND hWndGainedCapture
)
850 bool wxWindowPalm::HandleQueryNewPalette()
855 // Responds to colour changes: passes event on to children.
856 void wxWindowPalm::OnSysColourChanged(wxSysColourChangedEvent
& WXUNUSED(event
))
860 // ---------------------------------------------------------------------------
862 // ---------------------------------------------------------------------------
864 bool wxWindowPalm::HandlePaint()
869 // Can be called from an application's OnPaint handler
870 void wxWindowPalm::OnPaint(wxPaintEvent
& event
)
874 bool wxWindowPalm::HandleEraseBkgnd(WXHDC hdc
)
879 void wxWindowPalm::OnEraseBackground(wxEraseEvent
& event
)
883 // ---------------------------------------------------------------------------
884 // moving and resizing
885 // ---------------------------------------------------------------------------
887 bool wxWindowPalm::HandleMinimize()
892 bool wxWindowPalm::HandleMaximize()
897 bool wxWindowPalm::HandleMove(int x
, int y
)
902 bool wxWindowPalm::HandleMoving(wxRect
& rect
)
907 bool wxWindowPalm::HandleSize(int WXUNUSED(w
), int WXUNUSED(h
),
908 WXUINT
WXUNUSED(flag
))
913 bool wxWindowPalm::HandleSizing(wxRect
& rect
)
918 bool wxWindowPalm::HandleGetMinMaxInfo(void *mmInfo
)
923 // ---------------------------------------------------------------------------
925 // ---------------------------------------------------------------------------
927 bool wxWindowPalm::HandleCommand(WXWORD id
, WXWORD cmd
, WXHWND control
)
932 // ---------------------------------------------------------------------------
934 // ---------------------------------------------------------------------------
936 void wxWindowPalm::InitMouseEvent(wxMouseEvent
& event
,
942 // Windows doesn't send the mouse events to the static controls (which are
943 // transparent in the sense that their WM_NCHITTEST handler returns
944 // HTTRANSPARENT) at all but we want all controls to receive the mouse events
945 // and so we manually check if we don't have a child window under mouse and if
946 // we do, send the event to it instead of the window Windows had sent WM_XXX
949 // Notice that this is not done for the mouse move events because this could
950 // (would?) be too slow, but only for clicks which means that the static texts
951 // still don't get move, enter nor leave events.
952 static wxWindowPalm
*FindWindowForMouseEvent(wxWindowPalm
*win
, int *x
, int *y
) //TW:REQ:Univ
957 bool wxWindowPalm::HandleMouseEvent(WXUINT msg
, int x
, int y
, WXUINT flags
)
962 bool wxWindowPalm::HandleMouseMove(int x
, int y
, WXUINT flags
)
968 bool wxWindowPalm::HandleMouseWheel(WXWPARAM wParam
, WXLPARAM lParam
)
974 // ---------------------------------------------------------------------------
976 // ---------------------------------------------------------------------------
978 // create the key event of the given type for the given key - used by
979 // HandleChar and HandleKeyDown/Up
980 wxKeyEvent
wxWindowPalm::CreateKeyEvent(wxEventType evType
,
983 WXWPARAM wParam
) const
985 wxKeyEvent
event(evType
);
990 // isASCII is true only when we're called from WM_CHAR handler and not from
992 bool wxWindowPalm::HandleChar(WXWPARAM wParam
, WXLPARAM lParam
, bool isASCII
)
997 bool wxWindowPalm::HandleKeyDown(WXWPARAM wParam
, WXLPARAM lParam
)
1002 bool wxWindowPalm::HandleKeyUp(WXWPARAM wParam
, WXLPARAM lParam
)
1007 // ---------------------------------------------------------------------------
1009 // ---------------------------------------------------------------------------
1011 bool wxWindowPalm::HandleJoystickEvent(WXUINT msg
, int x
, int y
, WXUINT flags
)
1016 // ---------------------------------------------------------------------------
1018 // ---------------------------------------------------------------------------
1020 bool wxWindowPalm::PalmOnScroll(int orientation
, WXWORD wParam
,
1021 WXWORD pos
, WXHWND control
)
1026 // ===========================================================================
1028 // ===========================================================================
1030 void wxGetCharSize(WXHWND wnd
, int *x
, int *y
, const wxFont
*the_font
)
1034 // Returns 0 if was a normal ASCII value, not a special key. This indicates that
1035 // the key should be ignored by WM_KEYDOWN and processed by WM_CHAR instead.
1036 int wxCharCodePalmToWX(int keySym
, WXLPARAM lParam
)
1041 int wxCharCodeWXToPalm(int id
, bool *isVirtual
)
1046 bool wxGetKeyState(wxKeyCode key
)
1051 wxWindow
*wxGetActiveWindow()
1056 extern wxWindow
*wxGetWindowFromHWND(WXHWND hWnd
)
1061 // Find the wxWindow at the current mouse position, returning the mouse
1063 wxWindow
* wxFindWindowAtPointer(wxPoint
& pt
)
1068 wxWindow
* wxFindWindowAtPoint(const wxPoint
& pt
)
1073 // Get the current mouse position.
1074 wxPoint
wxGetMousePosition()
1076 return wxPoint(0, 0);
1081 bool wxWindowPalm::RegisterHotKey(int hotkeyId
, int modifiers
, int keycode
)
1086 bool wxWindowPalm::UnregisterHotKey(int hotkeyId
)
1093 bool wxWindowPalm::HandleHotKey(WXWPARAM wParam
, WXLPARAM lParam
)
1098 #endif // wxUSE_ACCEL
1100 #endif // wxUSE_HOTKEY