]> git.saurik.com Git - wxWidgets.git/blob - src/palmos/window.cpp
fixed bug in Set() on DST days (patch 1097811)
[wxWidgets.git] / src / palmos / window.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/palmos/windows.cpp
3 // Purpose: wxWindow
4 // Author: William Osborne - minimal working wxPalmOS port
5 // Modified by: Wlodzimierz ABX Skiba - more than minimal functionality
6 // Created: 10/13/04
7 // RCS-ID: $Id$
8 // Copyright: (c) William Osborne, Wlodzimierz Skiba
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 // ===========================================================================
13 // declarations
14 // ===========================================================================
15
16 // ---------------------------------------------------------------------------
17 // headers
18 // ---------------------------------------------------------------------------
19
20 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
21 #pragma implementation "window.h"
22 #endif
23
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
26
27 #ifdef __BORLANDC__
28 #pragma hdrstop
29 #endif
30
31 #ifndef WX_PRECOMP
32 #include "wx/window.h"
33 #include "wx/accel.h"
34 #include "wx/setup.h"
35 #include "wx/menu.h"
36 #include "wx/dc.h"
37 #include "wx/dcclient.h"
38 #include "wx/dcmemory.h"
39 #include "wx/utils.h"
40 #include "wx/app.h"
41 #include "wx/layout.h"
42 #include "wx/dialog.h"
43 #include "wx/frame.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"
49 #endif
50
51 #if wxUSE_OWNER_DRAWN && !defined(__WXUNIVERSAL__)
52 #include "wx/ownerdrw.h"
53 #endif
54
55 #include "wx/module.h"
56
57 #if wxUSE_DRAG_AND_DROP
58 #include "wx/dnd.h"
59 #endif
60
61 #if wxUSE_ACCESSIBILITY
62 #include "wx/access.h"
63 #endif
64
65 #include "wx/menuitem.h"
66 #include "wx/log.h"
67
68 #if wxUSE_TOOLTIPS
69 #include "wx/tooltip.h"
70 #endif
71
72 #if wxUSE_CARET
73 #include "wx/caret.h"
74 #endif // wxUSE_CARET
75
76 #if wxUSE_SPINCTRL
77 #include "wx/spinctrl.h"
78 #endif // wxUSE_SPINCTRL
79
80 #include "wx/intl.h"
81 #include "wx/log.h"
82
83 #include "wx/textctrl.h"
84 #include "wx/notebook.h"
85 #include "wx/listctrl.h"
86 #include "wx/window.h"
87
88 // ---------------------------------------------------------------------------
89 // global variables
90 // ---------------------------------------------------------------------------
91
92 #if wxUSE_MENUS_NATIVE
93 wxMenu *wxCurrentPopupMenu = NULL;
94 #endif // wxUSE_MENUS_NATIVE
95
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;
99
100 // ---------------------------------------------------------------------------
101 // private functions
102 // ---------------------------------------------------------------------------
103
104 // ---------------------------------------------------------------------------
105 // event tables
106 // ---------------------------------------------------------------------------
107
108 // in wxUniv/Palm this class is abstract because it doesn't have DoPopupMenu()
109 // method
110 #ifdef __WXUNIVERSAL__
111 IMPLEMENT_ABSTRACT_CLASS(wxWindowPalm, wxWindowBase)
112 #else // __WXPalm__
113 #if wxUSE_EXTENDED_RTTI
114
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
118
119 bool wxWindowStreamingCallback( const wxObject *object, wxWriter * , wxPersister * , wxxVariantArray & )
120 {
121 return false;
122 }
123
124 IMPLEMENT_DYNAMIC_CLASS_XTI_CALLBACK(wxWindow, wxWindowBase,"wx/window.h", wxWindowStreamingCallback)
125
126 // make wxWindowList known before the property is used
127
128 wxCOLLECTION_TYPE_INFO( wxWindow* , wxWindowList ) ;
129
130 template<> void wxCollectionToVariantArray( wxWindowList const &theList, wxxVariantArray &value)
131 {
132 wxListCollectionToVariantArray<wxWindowList::compatibility_iterator>( theList , value ) ;
133 }
134
135 WX_DEFINE_FLAGS( wxWindowStyle )
136
137 wxBEGIN_FLAGS( wxWindowStyle )
138 // new style border flags, we put them first to
139 // use them for streaming out
140
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)
147
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)
155
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)
165
166 wxEND_FLAGS( wxWindowStyle )
167
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
173
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
179
180 // Then all relations of the object graph
181
182 wxREADONLY_PROPERTY_COLLECTION( Children , wxWindowList , wxWindowBase* , GetWindowChildren , wxPROP_OBJECT_GRAPH /*flags*/ , wxT("Helpstring") , wxT("group"))
183
184 // and finally all other properties
185
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"))
191 #if 0
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
198
199 wxPROPERTY( ThemeEnabled , bool , SetThemeEnabled , GetThemeEnabled , )
200 //wxPROPERTY( Cursor , wxCursor , SetCursor , GetCursor , )
201 // wxPROPERTY( ToolTip , wxString , SetToolTip , GetToolTipText , )
202 wxPROPERTY( AutoLayout , bool , SetAutoLayout , GetAutoLayout , )
203
204
205
206 #endif
207 wxEND_PROPERTIES_TABLE()
208
209 wxBEGIN_HANDLERS_TABLE(wxWindow)
210 wxEND_HANDLERS_TABLE()
211
212 wxCONSTRUCTOR_DUMMY(wxWindow)
213
214 #else
215 IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowBase)
216 #endif
217 #endif // __WXUNIVERSAL__/__WXPalm__
218
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)
223 END_EVENT_TABLE()
224
225 // ===========================================================================
226 // implementation
227 // ===========================================================================
228
229 // ---------------------------------------------------------------------------
230 // wxWindow utility functions
231 // ---------------------------------------------------------------------------
232
233 // Find an item given the MS Windows id
234 wxWindow *wxWindowPalm::FindItem(long id) const
235 {
236 return NULL;
237 }
238
239 // Find an item given the MS Windows handle
240 wxWindow *wxWindowPalm::FindItemByHWND(WXHWND hWnd, bool controlOnly) const
241 {
242 return NULL;
243 }
244
245 // Default command handler
246 bool wxWindowPalm::PalmCommand(WXUINT WXUNUSED(param), WXWORD WXUNUSED(id))
247 {
248 return false;
249 }
250
251 // ----------------------------------------------------------------------------
252 // constructors and such
253 // ----------------------------------------------------------------------------
254
255 void wxWindowPalm::Init()
256 {
257 }
258
259 // Destructor
260 wxWindowPalm::~wxWindowPalm()
261 {
262 }
263
264 // real construction (Init() must have been called before!)
265 bool wxWindowPalm::Create(wxWindow *parent,
266 wxWindowID id,
267 const wxPoint& pos,
268 const wxSize& size,
269 long style,
270 const wxString& name)
271 {
272 return false;
273 }
274
275 FormType *wxWindowPalm::GetFormPtr()
276 {
277 return FrameForm;
278 }
279 void wxWindowPalm::SetFormPtr(FormType *FormPtr)
280 {
281 FrameForm=FormPtr;
282 }
283
284 // ---------------------------------------------------------------------------
285 // basic operations
286 // ---------------------------------------------------------------------------
287
288 void wxWindowPalm::SetFocus()
289 {
290 }
291
292 void wxWindowPalm::SetFocusFromKbd()
293 {
294 }
295
296 // Get the window with the focus
297 wxWindow *wxWindowBase::DoFindFocus()
298 {
299 return NULL;
300 }
301
302 bool wxWindowPalm::Enable(bool enable)
303 {
304 return false;
305 }
306
307 bool wxWindowPalm::Show(bool show)
308 {
309 return false;
310 }
311
312 // Raise the window to the top of the Z order
313 void wxWindowPalm::Raise()
314 {
315 }
316
317 // Lower the window to the bottom of the Z order
318 void wxWindowPalm::Lower()
319 {
320 }
321
322 void wxWindowPalm::SetTitle( const wxString& title)
323 {
324 }
325
326 wxString wxWindowPalm::GetTitle() const
327 {
328 return wxEmptyString;
329 }
330
331 void wxWindowPalm::DoCaptureMouse()
332 {
333 }
334
335 void wxWindowPalm::DoReleaseMouse()
336 {
337 }
338
339 /* static */ wxWindow *wxWindowBase::GetCapture()
340 {
341 return NULL;
342 }
343
344 bool wxWindowPalm::SetFont(const wxFont& font)
345 {
346 return false;
347 }
348 bool wxWindowPalm::SetCursor(const wxCursor& cursor)
349 {
350 return false;
351 }
352
353 void wxWindowPalm::WarpPointer (int x, int y)
354 {
355 }
356
357 // ---------------------------------------------------------------------------
358 // scrolling stuff
359 // ---------------------------------------------------------------------------
360
361 // convert wxHORIZONTAL/wxVERTICAL to SB_HORZ/SB_VERT
362 static inline int wxDirToWinStyle(int orient)
363 {
364 return 0;
365 }
366
367 int wxWindowPalm::GetScrollPos(int orient) const
368 {
369 return 0;
370 }
371
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
375 {
376 return 0;
377 }
378
379 int wxWindowPalm::GetScrollThumb(int orient) const
380 {
381 return 0;
382 }
383
384 void wxWindowPalm::SetScrollPos(int orient, int pos, bool refresh)
385 {
386 }
387
388 // New function that will replace some of the above.
389 void wxWindowPalm::SetScrollbar(int orient,
390 int pos,
391 int pageSize,
392 int range,
393 bool refresh)
394 {
395 }
396
397 void wxWindowPalm::ScrollWindow(int dx, int dy, const wxRect *prect)
398 {
399 }
400
401 bool wxWindowPalm::ScrollLines(int lines)
402 {
403 return false;
404 }
405
406 bool wxWindowPalm::ScrollPages(int pages)
407 {
408 return false;
409 }
410
411 // ---------------------------------------------------------------------------
412 // subclassing
413 // ---------------------------------------------------------------------------
414
415 void wxWindowPalm::SubclassWin(WXHWND hWnd)
416 {
417 }
418
419 void wxWindowPalm::UnsubclassWin()
420 {
421 }
422
423 bool wxCheckWindowWndProc(WXHWND hWnd, WXFARPROC wndProc)
424 {
425 return false;
426 }
427
428 // ----------------------------------------------------------------------------
429 // Style handling
430 // ----------------------------------------------------------------------------
431
432 void wxWindowPalm::SetWindowStyleFlag(long flags)
433 {
434 }
435
436 WXDWORD wxWindowPalm::PalmGetStyle(long flags, WXDWORD *exstyle) const
437 {
438 return 0;
439 }
440
441 // Setup background and foreground colours correctly
442 void wxWindowPalm::SetupColours()
443 {
444 }
445
446 bool wxWindowPalm::IsMouseInWindow() const
447 {
448 return false;
449 }
450
451 void wxWindowPalm::OnInternalIdle()
452 {
453 }
454
455 // Set this window to be the child of 'parent'.
456 bool wxWindowPalm::Reparent(wxWindowBase *parent)
457 {
458 return false;
459 }
460
461 void wxWindowPalm::Freeze()
462 {
463 }
464
465 void wxWindowPalm::Thaw()
466 {
467 }
468
469 void wxWindowPalm::Refresh(bool eraseBack, const wxRect *rect)
470 {
471 }
472
473 void wxWindowPalm::Update()
474 {
475 }
476
477 // ---------------------------------------------------------------------------
478 // drag and drop
479 // ---------------------------------------------------------------------------
480
481
482 #if wxUSE_DRAG_AND_DROP
483 void wxWindowPalm::SetDropTarget(wxDropTarget *pDropTarget)
484 {
485 }
486 #endif // wxUSE_DRAG_AND_DROP
487
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)
491 {
492 }
493
494 // ----------------------------------------------------------------------------
495 // tooltips
496 // ----------------------------------------------------------------------------
497
498 #if wxUSE_TOOLTIPS
499
500 void wxWindowPalm::DoSetToolTip(wxToolTip *tooltip)
501 {
502 }
503
504 #endif // wxUSE_TOOLTIPS
505
506 // ---------------------------------------------------------------------------
507 // moving and resizing
508 // ---------------------------------------------------------------------------
509
510 // Get total size
511 void wxWindowPalm::DoGetSize(int *x, int *y) const
512 {
513 }
514
515 // Get size *available for subwindows* i.e. excluding menu bar etc.
516 void wxWindowPalm::DoGetClientSize(int *x, int *y) const
517 {
518 }
519
520 void wxWindowPalm::DoGetPosition(int *x, int *y) const
521 {
522 }
523
524 void wxWindowPalm::DoScreenToClient(int *x, int *y) const
525 {
526 }
527
528 void wxWindowPalm::DoClientToScreen(int *x, int *y) const
529 {
530 }
531
532 void wxWindowPalm::DoMoveWindow(int x, int y, int width, int height)
533 {
534 }
535
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)
540 //
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
543 // width/height
544 void wxWindowPalm::DoSetSize(int x, int y, int width, int height, int sizeFlags)
545 {
546 }
547
548 void wxWindowPalm::DoSetClientSize(int width, int height)
549 {
550 }
551
552 // For implementation purposes - sometimes decorations make the client area
553 // smaller
554 wxPoint wxWindowPalm::GetClientAreaOrigin() const
555 {
556 return wxPoint(0, 0);
557 }
558
559 // ---------------------------------------------------------------------------
560 // text metrics
561 // ---------------------------------------------------------------------------
562
563 int wxWindowPalm::GetCharHeight() const
564 {
565 return 0;
566 }
567
568 int wxWindowPalm::GetCharWidth() const
569 {
570 return 0;
571 }
572
573 void wxWindowPalm::GetTextExtent(const wxString& string,
574 int *x, int *y,
575 int *descent, int *externalLeading,
576 const wxFont *theFont) const
577 {
578 }
579
580 // ---------------------------------------------------------------------------
581 // popup menu
582 // ---------------------------------------------------------------------------
583
584 #if wxUSE_MENUS_NATIVE
585
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
588 //
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()
592 {
593 }
594
595 bool wxWindowPalm::DoPopupMenu(wxMenu *menu, int x, int y)
596 {
597 return false;
598 }
599
600 #endif // wxUSE_MENUS_NATIVE
601
602 // ===========================================================================
603 // pre/post message processing
604 // ===========================================================================
605
606 WXLRESULT wxWindowPalm::PalmDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
607 {
608 return false;
609 }
610
611 bool wxWindowPalm::PalmProcessMessage(WXMSG* pMsg)
612 {
613 return false;
614 }
615
616 bool wxWindowPalm::PalmTranslateMessage(WXMSG* pMsg)
617 {
618 return false;
619 }
620
621 bool wxWindowPalm::PalmShouldPreProcessMessage(WXMSG* WXUNUSED(pMsg))
622 {
623 return false;
624 }
625
626 // ---------------------------------------------------------------------------
627 // Main wxWidgets window proc and the window proc for wxWindow
628 // ---------------------------------------------------------------------------
629
630 // Hook for new window just as it's being created, when the window isn't yet
631 // associated with the handle
632
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)
636 {
637 }
638
639 wxWindowCreationHook::~wxWindowCreationHook()
640 {
641 }
642
643 WXLRESULT wxWindowPalm::PalmWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
644 {
645 return false;
646 }
647
648 // ----------------------------------------------------------------------------
649 // wxWindow <-> HWND map
650 // ----------------------------------------------------------------------------
651
652 wxWinHashTable *wxWinHandleHash = NULL;
653
654 wxWindow *wxFindWinFromHandle(WXHWND hWnd)
655 {
656 return NULL;
657 }
658
659 void wxRemoveHandleAssociation(wxWindowPalm *win)
660 {
661 }
662
663 // ----------------------------------------------------------------------------
664 // various Palm speciic class dependent functions
665 // ----------------------------------------------------------------------------
666
667 // Default destroyer - override if you destroy it in some other way
668 // (e.g. with MDI child windows)
669 void wxWindowPalm::PalmDestroyWindow()
670 {
671 }
672
673 bool wxWindowPalm::PalmGetCreateWindowCoords(const wxPoint& pos,
674 const wxSize& size,
675 int& x, int& y,
676 int& w, int& h) const
677 {
678 return false;
679 }
680
681 WXHWND wxWindowPalm::PalmGetParent() const
682 {
683 return NULL;
684 }
685
686 bool wxWindowPalm::PalmCreate(const wxChar *wclass,
687 const wxChar *title,
688 const wxPoint& pos,
689 const wxSize& size,
690 WXDWORD style,
691 WXDWORD extendedStyle)
692 {
693 return false;
694 }
695
696 // ===========================================================================
697 // Palm message handlers
698 // ===========================================================================
699
700 // ---------------------------------------------------------------------------
701 // end session messages
702 // ---------------------------------------------------------------------------
703
704 bool wxWindowPalm::HandleQueryEndSession(long logOff, bool *mayEnd)
705 {
706 return false;
707 }
708
709 bool wxWindowPalm::HandleEndSession(bool endSession, long logOff)
710 {
711 return false;
712 }
713
714 // ---------------------------------------------------------------------------
715 // window creation/destruction
716 // ---------------------------------------------------------------------------
717
718 bool wxWindowPalm::HandleCreate(WXLPCREATESTRUCT cs, bool *mayCreate)
719 {
720 return false;
721 }
722
723 bool wxWindowPalm::HandleDestroy()
724 {
725 return false;
726 }
727
728 // ---------------------------------------------------------------------------
729 // activation/focus
730 // ---------------------------------------------------------------------------
731
732 bool wxWindowPalm::HandleActivate(int state,
733 bool WXUNUSED(minimized),
734 WXHWND WXUNUSED(activate))
735 {
736 return false;
737 }
738
739 bool wxWindowPalm::HandleSetFocus(WXHWND hwnd)
740 {
741 return false;
742 }
743
744 bool wxWindowPalm::HandleKillFocus(WXHWND hwnd)
745 {
746 return false;
747 }
748
749 // ---------------------------------------------------------------------------
750 // miscellaneous
751 // ---------------------------------------------------------------------------
752
753 bool wxWindowPalm::HandleShow(bool show, int WXUNUSED(status))
754 {
755 return false;
756 }
757
758 bool wxWindowPalm::HandleInitDialog(WXHWND WXUNUSED(hWndFocus))
759 {
760 return false;
761 }
762
763 bool wxWindowPalm::HandleDropFiles(WXWPARAM wParam)
764 {
765 return false;
766 }
767
768
769 bool wxWindowPalm::HandleSetCursor(WXHWND WXUNUSED(hWnd),
770 short nHitTest,
771 int WXUNUSED(mouseMsg))
772 {
773 return false;
774 }
775
776 // ---------------------------------------------------------------------------
777 // owner drawn stuff
778 // ---------------------------------------------------------------------------
779
780 #if (wxUSE_OWNER_DRAWN && wxUSE_MENUS_NATIVE) || \
781 (wxUSE_CONTROLS && !defined(__WXUNIVERSAL__))
782 #define WXUNUSED_UNLESS_ODRAWN(param) param
783 #else
784 #define WXUNUSED_UNLESS_ODRAWN(param)
785 #endif
786
787 bool
788 wxWindowPalm::PalmOnDrawItem(int WXUNUSED_UNLESS_ODRAWN(id),
789 WXDRAWITEMSTRUCT * WXUNUSED_UNLESS_ODRAWN(itemStruct))
790 {
791 return false;
792 }
793
794 bool
795 wxWindowPalm::PalmOnMeasureItem(int WXUNUSED_UNLESS_ODRAWN(id),
796 WXMEASUREITEMSTRUCT *
797 WXUNUSED_UNLESS_ODRAWN(itemStruct))
798 {
799 return false;
800 }
801
802 // ---------------------------------------------------------------------------
803 // colours and palettes
804 // ---------------------------------------------------------------------------
805
806 bool wxWindowPalm::HandleSysColorChange()
807 {
808 return false;
809 }
810
811 bool wxWindowPalm::HandleDisplayChange()
812 {
813 return false;
814 }
815
816 bool wxWindowPalm::HandleCtlColor(WXHBRUSH *brush,
817 WXHDC pDC,
818 WXHWND pWnd,
819 WXUINT nCtlColor,
820 WXUINT message,
821 WXWPARAM wParam,
822 WXLPARAM lParam)
823 {
824 return false;
825 }
826
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))
834 {
835 return (WXHBRUSH)0;
836 }
837
838 bool wxWindowPalm::HandlePaletteChanged(WXHWND hWndPalChange)
839 {
840 return false;
841 }
842
843 bool wxWindowPalm::HandleCaptureChanged(WXHWND hWndGainedCapture)
844 {
845 return false;
846 }
847
848 bool wxWindowPalm::HandleQueryNewPalette()
849 {
850 return false;
851 }
852
853 // Responds to colour changes: passes event on to children.
854 void wxWindowPalm::OnSysColourChanged(wxSysColourChangedEvent& WXUNUSED(event))
855 {
856 }
857
858 // ---------------------------------------------------------------------------
859 // painting
860 // ---------------------------------------------------------------------------
861
862 bool wxWindowPalm::HandlePaint()
863 {
864 return false;
865 }
866
867 // Can be called from an application's OnPaint handler
868 void wxWindowPalm::OnPaint(wxPaintEvent& event)
869 {
870 }
871
872 bool wxWindowPalm::HandleEraseBkgnd(WXHDC hdc)
873 {
874 return false;
875 }
876
877 void wxWindowPalm::OnEraseBackground(wxEraseEvent& event)
878 {
879 }
880
881 // ---------------------------------------------------------------------------
882 // moving and resizing
883 // ---------------------------------------------------------------------------
884
885 bool wxWindowPalm::HandleMinimize()
886 {
887 return false;
888 }
889
890 bool wxWindowPalm::HandleMaximize()
891 {
892 return false;
893 }
894
895 bool wxWindowPalm::HandleMove(int x, int y)
896 {
897 return false;
898 }
899
900 bool wxWindowPalm::HandleMoving(wxRect& rect)
901 {
902 return false;
903 }
904
905 bool wxWindowPalm::HandleSize(int WXUNUSED(w), int WXUNUSED(h),
906 WXUINT WXUNUSED(flag))
907 {
908 return false;
909 }
910
911 bool wxWindowPalm::HandleSizing(wxRect& rect)
912 {
913 return false;
914 }
915
916 bool wxWindowPalm::HandleGetMinMaxInfo(void *mmInfo)
917 {
918 return false;
919 }
920
921 // ---------------------------------------------------------------------------
922 // command messages
923 // ---------------------------------------------------------------------------
924
925 bool wxWindowPalm::HandleCommand(WXWORD id, WXWORD cmd, WXHWND control)
926 {
927 return false;
928 }
929
930 // ---------------------------------------------------------------------------
931 // mouse events
932 // ---------------------------------------------------------------------------
933
934 void wxWindowPalm::InitMouseEvent(wxMouseEvent& event,
935 int x, int y,
936 WXUINT flags)
937 {
938 }
939
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
945 // to.
946 //
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
951 {
952 return NULL;
953 }
954
955 bool wxWindowPalm::HandleMouseEvent(WXUINT msg, int x, int y, WXUINT flags)
956 {
957 return false;
958 }
959
960 bool wxWindowPalm::HandleMouseMove(int x, int y, WXUINT flags)
961 {
962 return false;
963 }
964
965
966 bool wxWindowPalm::HandleMouseWheel(WXWPARAM wParam, WXLPARAM lParam)
967 {
968 return false;
969 }
970
971
972 // ---------------------------------------------------------------------------
973 // keyboard handling
974 // ---------------------------------------------------------------------------
975
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,
979 int id,
980 WXLPARAM lParam,
981 WXWPARAM wParam) const
982 {
983 wxKeyEvent event(evType);
984
985 return event;
986 }
987
988 // isASCII is true only when we're called from WM_CHAR handler and not from
989 // WM_KEYDOWN one
990 bool wxWindowPalm::HandleChar(WXWPARAM wParam, WXLPARAM lParam, bool isASCII)
991 {
992 return false;
993 }
994
995 bool wxWindowPalm::HandleKeyDown(WXWPARAM wParam, WXLPARAM lParam)
996 {
997 return false;
998 }
999
1000 bool wxWindowPalm::HandleKeyUp(WXWPARAM wParam, WXLPARAM lParam)
1001 {
1002 return false;
1003 }
1004
1005 // ---------------------------------------------------------------------------
1006 // joystick
1007 // ---------------------------------------------------------------------------
1008
1009 bool wxWindowPalm::HandleJoystickEvent(WXUINT msg, int x, int y, WXUINT flags)
1010 {
1011 return false;
1012 }
1013
1014 // ---------------------------------------------------------------------------
1015 // scrolling
1016 // ---------------------------------------------------------------------------
1017
1018 bool wxWindowPalm::PalmOnScroll(int orientation, WXWORD wParam,
1019 WXWORD pos, WXHWND control)
1020 {
1021 return false;
1022 }
1023
1024 // ===========================================================================
1025 // global functions
1026 // ===========================================================================
1027
1028 void wxGetCharSize(WXHWND wnd, int *x, int *y, const wxFont *the_font)
1029 {
1030 }
1031
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)
1035 {
1036 return 0;
1037 }
1038
1039 int wxCharCodeWXToPalm(int id, bool *isVirtual)
1040 {
1041 return 0;
1042 }
1043
1044 bool wxGetKeyState(wxKeyCode key)
1045 {
1046 return false;
1047 }
1048
1049 wxWindow *wxGetActiveWindow()
1050 {
1051 return NULL;
1052 }
1053
1054 extern wxWindow *wxGetWindowFromHWND(WXHWND hWnd)
1055 {
1056 return NULL;
1057 }
1058
1059 // Find the wxWindow at the current mouse position, returning the mouse
1060 // position.
1061 wxWindow* wxFindWindowAtPointer(wxPoint& pt)
1062 {
1063 return NULL;
1064 }
1065
1066 wxWindow* wxFindWindowAtPoint(const wxPoint& pt)
1067 {
1068 return NULL;
1069 }
1070
1071 // Get the current mouse position.
1072 wxPoint wxGetMousePosition()
1073 {
1074 return wxPoint(0, 0);
1075 }
1076
1077 #if wxUSE_HOTKEY
1078
1079 bool wxWindowPalm::RegisterHotKey(int hotkeyId, int modifiers, int keycode)
1080 {
1081 return false;
1082 }
1083
1084 bool wxWindowPalm::UnregisterHotKey(int hotkeyId)
1085 {
1086 return false;
1087 }
1088
1089 #if wxUSE_ACCEL
1090
1091 bool wxWindowPalm::HandleHotKey(WXWPARAM wParam, WXLPARAM lParam)
1092 {
1093 return false;
1094 }
1095
1096 #endif // wxUSE_ACCEL
1097
1098 #endif // wxUSE_HOTKEY
1099
1100