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
)
275 FormType
*wxWindowPalm::GetFormPtr()
279 void wxWindowPalm::SetFormPtr(FormType
*FormPtr
)
284 // ---------------------------------------------------------------------------
286 // ---------------------------------------------------------------------------
288 void wxWindowPalm::SetFocus()
292 void wxWindowPalm::SetFocusFromKbd()
296 // Get the window with the focus
297 wxWindow
*wxWindowBase::DoFindFocus()
302 bool wxWindowPalm::Enable(bool enable
)
307 bool wxWindowPalm::Show(bool show
)
312 // Raise the window to the top of the Z order
313 void wxWindowPalm::Raise()
317 // Lower the window to the bottom of the Z order
318 void wxWindowPalm::Lower()
322 void wxWindowPalm::SetTitle( const wxString
& title
)
326 wxString
wxWindowPalm::GetTitle() const
328 return wxEmptyString
;
331 void wxWindowPalm::DoCaptureMouse()
335 void wxWindowPalm::DoReleaseMouse()
339 /* static */ wxWindow
*wxWindowBase::GetCapture()
344 bool wxWindowPalm::SetFont(const wxFont
& font
)
348 bool wxWindowPalm::SetCursor(const wxCursor
& cursor
)
353 void wxWindowPalm::WarpPointer (int x
, int y
)
357 // ---------------------------------------------------------------------------
359 // ---------------------------------------------------------------------------
361 // convert wxHORIZONTAL/wxVERTICAL to SB_HORZ/SB_VERT
362 static inline int wxDirToWinStyle(int orient
)
367 int wxWindowPalm::GetScrollPos(int orient
) const
372 // This now returns the whole range, not just the number
373 // of positions that we can scroll.
374 int wxWindowPalm::GetScrollRange(int orient
) const
379 int wxWindowPalm::GetScrollThumb(int orient
) const
384 void wxWindowPalm::SetScrollPos(int orient
, int pos
, bool refresh
)
388 // New function that will replace some of the above.
389 void wxWindowPalm::SetScrollbar(int orient
,
397 void wxWindowPalm::ScrollWindow(int dx
, int dy
, const wxRect
*prect
)
401 bool wxWindowPalm::ScrollLines(int lines
)
406 bool wxWindowPalm::ScrollPages(int pages
)
411 // ---------------------------------------------------------------------------
413 // ---------------------------------------------------------------------------
415 void wxWindowPalm::SubclassWin(WXHWND hWnd
)
419 void wxWindowPalm::UnsubclassWin()
423 bool wxCheckWindowWndProc(WXHWND hWnd
, WXFARPROC wndProc
)
428 // ----------------------------------------------------------------------------
430 // ----------------------------------------------------------------------------
432 void wxWindowPalm::SetWindowStyleFlag(long flags
)
436 WXDWORD
wxWindowPalm::PalmGetStyle(long flags
, WXDWORD
*exstyle
) const
441 // Setup background and foreground colours correctly
442 void wxWindowPalm::SetupColours()
446 bool wxWindowPalm::IsMouseInWindow() const
451 void wxWindowPalm::OnInternalIdle()
455 // Set this window to be the child of 'parent'.
456 bool wxWindowPalm::Reparent(wxWindowBase
*parent
)
461 void wxWindowPalm::Freeze()
465 void wxWindowPalm::Thaw()
469 void wxWindowPalm::Refresh(bool eraseBack
, const wxRect
*rect
)
473 void wxWindowPalm::Update()
477 // ---------------------------------------------------------------------------
479 // ---------------------------------------------------------------------------
482 #if wxUSE_DRAG_AND_DROP
483 void wxWindowPalm::SetDropTarget(wxDropTarget
*pDropTarget
)
486 #endif // wxUSE_DRAG_AND_DROP
488 // old style file-manager drag&drop support: we retain the old-style
489 // DragAcceptFiles in parallel with SetDropTarget.
490 void wxWindowPalm::DragAcceptFiles(bool accept
)
494 // ----------------------------------------------------------------------------
496 // ----------------------------------------------------------------------------
500 void wxWindowPalm::DoSetToolTip(wxToolTip
*tooltip
)
504 #endif // wxUSE_TOOLTIPS
506 // ---------------------------------------------------------------------------
507 // moving and resizing
508 // ---------------------------------------------------------------------------
511 void wxWindowPalm::DoGetSize(int *x
, int *y
) const
515 // Get size *available for subwindows* i.e. excluding menu bar etc.
516 void wxWindowPalm::DoGetClientSize(int *x
, int *y
) const
520 void wxWindowPalm::DoGetPosition(int *x
, int *y
) const
524 void wxWindowPalm::DoScreenToClient(int *x
, int *y
) const
528 void wxWindowPalm::DoClientToScreen(int *x
, int *y
) const
532 void wxWindowPalm::DoMoveWindow(int x
, int y
, int width
, int height
)
536 // set the size of the window: if the dimensions are positive, just use them,
537 // but if any of them is equal to -1, it means that we must find the value for
538 // it ourselves (unless sizeFlags contains wxSIZE_ALLOW_MINUS_ONE flag, in
539 // which case -1 is a valid value for x and y)
541 // If sizeFlags contains wxSIZE_AUTO_WIDTH/HEIGHT flags (default), we calculate
542 // the width/height to best suit our contents, otherwise we reuse the current
544 void wxWindowPalm::DoSetSize(int x
, int y
, int width
, int height
, int sizeFlags
)
548 void wxWindowPalm::DoSetClientSize(int width
, int height
)
552 // For implementation purposes - sometimes decorations make the client area
554 wxPoint
wxWindowPalm::GetClientAreaOrigin() const
556 return wxPoint(0, 0);
559 // ---------------------------------------------------------------------------
561 // ---------------------------------------------------------------------------
563 int wxWindowPalm::GetCharHeight() const
568 int wxWindowPalm::GetCharWidth() const
573 void wxWindowPalm::GetTextExtent(const wxString
& string
,
575 int *descent
, int *externalLeading
,
576 const wxFont
*theFont
) const
580 // ---------------------------------------------------------------------------
582 // ---------------------------------------------------------------------------
584 #if wxUSE_MENUS_NATIVE
586 // yield for WM_COMMAND events only, i.e. process all WM_COMMANDs in the queue
587 // immediately, without waiting for the next event loop iteration
589 // NB: this function should probably be made public later as it can almost
590 // surely replace wxYield() elsewhere as well
591 static void wxYieldForCommandsOnly()
595 bool wxWindowPalm::DoPopupMenu(wxMenu
*menu
, int x
, int y
)
600 #endif // wxUSE_MENUS_NATIVE
602 // ===========================================================================
603 // pre/post message processing
604 // ===========================================================================
606 WXLRESULT
wxWindowPalm::PalmDefWindowProc(WXUINT nMsg
, WXWPARAM wParam
, WXLPARAM lParam
)
611 bool wxWindowPalm::PalmProcessMessage(WXMSG
* pMsg
)
616 bool wxWindowPalm::PalmTranslateMessage(WXMSG
* pMsg
)
621 bool wxWindowPalm::PalmShouldPreProcessMessage(WXMSG
* WXUNUSED(pMsg
))
626 // ---------------------------------------------------------------------------
627 // Main wxWidgets window proc and the window proc for wxWindow
628 // ---------------------------------------------------------------------------
630 // Hook for new window just as it's being created, when the window isn't yet
631 // associated with the handle
633 // implementation of wxWindowCreationHook class: it just sets gs_winBeingCreated to the
634 // window being created and insures that it's always unset back later
635 wxWindowCreationHook::wxWindowCreationHook(wxWindowPalm
*winBeingCreated
)
639 wxWindowCreationHook::~wxWindowCreationHook()
643 WXLRESULT
wxWindowPalm::PalmWindowProc(WXUINT message
, WXWPARAM wParam
, WXLPARAM lParam
)
648 // ----------------------------------------------------------------------------
649 // wxWindow <-> HWND map
650 // ----------------------------------------------------------------------------
652 wxWinHashTable
*wxWinHandleHash
= NULL
;
654 wxWindow
*wxFindWinFromHandle(WXHWND hWnd
)
659 void wxRemoveHandleAssociation(wxWindowPalm
*win
)
663 // ----------------------------------------------------------------------------
664 // various Palm speciic class dependent functions
665 // ----------------------------------------------------------------------------
667 // Default destroyer - override if you destroy it in some other way
668 // (e.g. with MDI child windows)
669 void wxWindowPalm::PalmDestroyWindow()
673 bool wxWindowPalm::PalmGetCreateWindowCoords(const wxPoint
& pos
,
676 int& w
, int& h
) const
681 WXHWND
wxWindowPalm::PalmGetParent() const
686 bool wxWindowPalm::PalmCreate(const wxChar
*wclass
,
691 WXDWORD extendedStyle
)
696 // ===========================================================================
697 // Palm message handlers
698 // ===========================================================================
700 // ---------------------------------------------------------------------------
701 // end session messages
702 // ---------------------------------------------------------------------------
704 bool wxWindowPalm::HandleQueryEndSession(long logOff
, bool *mayEnd
)
709 bool wxWindowPalm::HandleEndSession(bool endSession
, long logOff
)
714 // ---------------------------------------------------------------------------
715 // window creation/destruction
716 // ---------------------------------------------------------------------------
718 bool wxWindowPalm::HandleCreate(WXLPCREATESTRUCT cs
, bool *mayCreate
)
723 bool wxWindowPalm::HandleDestroy()
728 // ---------------------------------------------------------------------------
730 // ---------------------------------------------------------------------------
732 bool wxWindowPalm::HandleActivate(int state
,
733 bool WXUNUSED(minimized
),
734 WXHWND
WXUNUSED(activate
))
739 bool wxWindowPalm::HandleSetFocus(WXHWND hwnd
)
744 bool wxWindowPalm::HandleKillFocus(WXHWND hwnd
)
749 // ---------------------------------------------------------------------------
751 // ---------------------------------------------------------------------------
753 bool wxWindowPalm::HandleShow(bool show
, int WXUNUSED(status
))
758 bool wxWindowPalm::HandleInitDialog(WXHWND
WXUNUSED(hWndFocus
))
763 bool wxWindowPalm::HandleDropFiles(WXWPARAM wParam
)
769 bool wxWindowPalm::HandleSetCursor(WXHWND
WXUNUSED(hWnd
),
771 int WXUNUSED(mouseMsg
))
776 // ---------------------------------------------------------------------------
778 // ---------------------------------------------------------------------------
780 #if (wxUSE_OWNER_DRAWN && wxUSE_MENUS_NATIVE) || \
781 (wxUSE_CONTROLS && !defined(__WXUNIVERSAL__))
782 #define WXUNUSED_UNLESS_ODRAWN(param) param
784 #define WXUNUSED_UNLESS_ODRAWN(param)
788 wxWindowPalm::PalmOnDrawItem(int WXUNUSED_UNLESS_ODRAWN(id
),
789 WXDRAWITEMSTRUCT
* WXUNUSED_UNLESS_ODRAWN(itemStruct
))
795 wxWindowPalm::PalmOnMeasureItem(int WXUNUSED_UNLESS_ODRAWN(id
),
796 WXMEASUREITEMSTRUCT
*
797 WXUNUSED_UNLESS_ODRAWN(itemStruct
))
802 // ---------------------------------------------------------------------------
803 // colours and palettes
804 // ---------------------------------------------------------------------------
806 bool wxWindowPalm::HandleSysColorChange()
811 bool wxWindowPalm::HandleDisplayChange()
816 bool wxWindowPalm::HandleCtlColor(WXHBRUSH
*brush
,
827 // Define for each class of dialog and control
828 WXHBRUSH
wxWindowPalm::OnCtlColor(WXHDC
WXUNUSED(hDC
),
829 WXHWND
WXUNUSED(hWnd
),
830 WXUINT
WXUNUSED(nCtlColor
),
831 WXUINT
WXUNUSED(message
),
832 WXWPARAM
WXUNUSED(wParam
),
833 WXLPARAM
WXUNUSED(lParam
))
838 bool wxWindowPalm::HandlePaletteChanged(WXHWND hWndPalChange
)
843 bool wxWindowPalm::HandleCaptureChanged(WXHWND hWndGainedCapture
)
848 bool wxWindowPalm::HandleQueryNewPalette()
853 // Responds to colour changes: passes event on to children.
854 void wxWindowPalm::OnSysColourChanged(wxSysColourChangedEvent
& WXUNUSED(event
))
858 // ---------------------------------------------------------------------------
860 // ---------------------------------------------------------------------------
862 bool wxWindowPalm::HandlePaint()
867 // Can be called from an application's OnPaint handler
868 void wxWindowPalm::OnPaint(wxPaintEvent
& event
)
872 bool wxWindowPalm::HandleEraseBkgnd(WXHDC hdc
)
877 void wxWindowPalm::OnEraseBackground(wxEraseEvent
& event
)
881 // ---------------------------------------------------------------------------
882 // moving and resizing
883 // ---------------------------------------------------------------------------
885 bool wxWindowPalm::HandleMinimize()
890 bool wxWindowPalm::HandleMaximize()
895 bool wxWindowPalm::HandleMove(int x
, int y
)
900 bool wxWindowPalm::HandleMoving(wxRect
& rect
)
905 bool wxWindowPalm::HandleSize(int WXUNUSED(w
), int WXUNUSED(h
),
906 WXUINT
WXUNUSED(flag
))
911 bool wxWindowPalm::HandleSizing(wxRect
& rect
)
916 bool wxWindowPalm::HandleGetMinMaxInfo(void *mmInfo
)
921 // ---------------------------------------------------------------------------
923 // ---------------------------------------------------------------------------
925 bool wxWindowPalm::HandleCommand(WXWORD id
, WXWORD cmd
, WXHWND control
)
930 // ---------------------------------------------------------------------------
932 // ---------------------------------------------------------------------------
934 void wxWindowPalm::InitMouseEvent(wxMouseEvent
& event
,
940 // Windows doesn't send the mouse events to the static controls (which are
941 // transparent in the sense that their WM_NCHITTEST handler returns
942 // HTTRANSPARENT) at all but we want all controls to receive the mouse events
943 // and so we manually check if we don't have a child window under mouse and if
944 // we do, send the event to it instead of the window Windows had sent WM_XXX
947 // Notice that this is not done for the mouse move events because this could
948 // (would?) be too slow, but only for clicks which means that the static texts
949 // still don't get move, enter nor leave events.
950 static wxWindowPalm
*FindWindowForMouseEvent(wxWindowPalm
*win
, int *x
, int *y
) //TW:REQ:Univ
955 bool wxWindowPalm::HandleMouseEvent(WXUINT msg
, int x
, int y
, WXUINT flags
)
960 bool wxWindowPalm::HandleMouseMove(int x
, int y
, WXUINT flags
)
966 bool wxWindowPalm::HandleMouseWheel(WXWPARAM wParam
, WXLPARAM lParam
)
972 // ---------------------------------------------------------------------------
974 // ---------------------------------------------------------------------------
976 // create the key event of the given type for the given key - used by
977 // HandleChar and HandleKeyDown/Up
978 wxKeyEvent
wxWindowPalm::CreateKeyEvent(wxEventType evType
,
981 WXWPARAM wParam
) const
983 wxKeyEvent
event(evType
);
988 // isASCII is true only when we're called from WM_CHAR handler and not from
990 bool wxWindowPalm::HandleChar(WXWPARAM wParam
, WXLPARAM lParam
, bool isASCII
)
995 bool wxWindowPalm::HandleKeyDown(WXWPARAM wParam
, WXLPARAM lParam
)
1000 bool wxWindowPalm::HandleKeyUp(WXWPARAM wParam
, WXLPARAM lParam
)
1005 // ---------------------------------------------------------------------------
1007 // ---------------------------------------------------------------------------
1009 bool wxWindowPalm::HandleJoystickEvent(WXUINT msg
, int x
, int y
, WXUINT flags
)
1014 // ---------------------------------------------------------------------------
1016 // ---------------------------------------------------------------------------
1018 bool wxWindowPalm::PalmOnScroll(int orientation
, WXWORD wParam
,
1019 WXWORD pos
, WXHWND control
)
1024 // ===========================================================================
1026 // ===========================================================================
1028 void wxGetCharSize(WXHWND wnd
, int *x
, int *y
, const wxFont
*the_font
)
1032 // Returns 0 if was a normal ASCII value, not a special key. This indicates that
1033 // the key should be ignored by WM_KEYDOWN and processed by WM_CHAR instead.
1034 int wxCharCodePalmToWX(int keySym
, WXLPARAM lParam
)
1039 int wxCharCodeWXToPalm(int id
, bool *isVirtual
)
1044 bool wxGetKeyState(wxKeyCode key
)
1049 wxWindow
*wxGetActiveWindow()
1054 extern wxWindow
*wxGetWindowFromHWND(WXHWND hWnd
)
1059 // Find the wxWindow at the current mouse position, returning the mouse
1061 wxWindow
* wxFindWindowAtPointer(wxPoint
& pt
)
1066 wxWindow
* wxFindWindowAtPoint(const wxPoint
& pt
)
1071 // Get the current mouse position.
1072 wxPoint
wxGetMousePosition()
1074 return wxPoint(0, 0);
1079 bool wxWindowPalm::RegisterHotKey(int hotkeyId
, int modifiers
, int keycode
)
1084 bool wxWindowPalm::UnregisterHotKey(int hotkeyId
)
1091 bool wxWindowPalm::HandleHotKey(WXWPARAM wParam
, WXLPARAM lParam
)
1096 #endif // wxUSE_ACCEL
1098 #endif // wxUSE_HOTKEY