]> git.saurik.com Git - wxWidgets.git/blame - src/palmos/window.cpp
implement date events here if wxDatePickerCtrl is not used (as we need them too)
[wxWidgets.git] / src / palmos / window.cpp
CommitLineData
ffecfa5a
JS
1/////////////////////////////////////////////////////////////////////////////
2// Name: src/palmos/windows.cpp
3// Purpose: wxWindow
4// Author: William Osborne
5// Modified by:
6// Created: 10/13/04
4055ed82 7// RCS-ID: $Id:
ffecfa5a
JS
8// Copyright: (c) William Osborne
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
87#include <string.h>
88
89#include "wx/palmos/window.h"
90
91// ---------------------------------------------------------------------------
92// global variables
93// ---------------------------------------------------------------------------
94
95#if wxUSE_MENUS_NATIVE
96wxMenu *wxCurrentPopupMenu = NULL;
97#endif // wxUSE_MENUS_NATIVE
98
99#ifdef __WXWINCE__
100extern wxChar *wxCanvasClassName;
101#else
102extern const wxChar *wxCanvasClassName;
103#endif
104
105// true if we had already created the std colour map, used by
106// wxGetStdColourMap() and wxWindow::OnSysColourChanged() (FIXME-MT)
107static bool gs_hasStdCmap = false;
108
109// ---------------------------------------------------------------------------
110// private functions
111// ---------------------------------------------------------------------------
112
113// ---------------------------------------------------------------------------
114// event tables
115// ---------------------------------------------------------------------------
116
117// in wxUniv/Palm this class is abstract because it doesn't have DoPopupMenu()
118// method
119#ifdef __WXUNIVERSAL__
120 IMPLEMENT_ABSTRACT_CLASS(wxWindowPalm, wxWindowBase)
121#else // __WXPalm__
122#if wxUSE_EXTENDED_RTTI
123
124// windows that are created from a parent window during its Create method, eg. spin controls in a calendar controls
125// must never been streamed out separately otherwise chaos occurs. Right now easiest is to test for negative ids, as
126// windows with negative ids never can be recreated anyway
127
128bool wxWindowStreamingCallback( const wxObject *object, wxWriter * , wxPersister * , wxxVariantArray & )
129{
130 return false;
131}
132
133IMPLEMENT_DYNAMIC_CLASS_XTI_CALLBACK(wxWindow, wxWindowBase,"wx/window.h", wxWindowStreamingCallback)
134
135// make wxWindowList known before the property is used
136
137wxCOLLECTION_TYPE_INFO( wxWindow* , wxWindowList ) ;
138
139template<> void wxCollectionToVariantArray( wxWindowList const &theList, wxxVariantArray &value)
140{
141 wxListCollectionToVariantArray<wxWindowList::compatibility_iterator>( theList , value ) ;
142}
143
144WX_DEFINE_FLAGS( wxWindowStyle )
145
146wxBEGIN_FLAGS( wxWindowStyle )
147 // new style border flags, we put them first to
148 // use them for streaming out
149
150 wxFLAGS_MEMBER(wxBORDER_SIMPLE)
151 wxFLAGS_MEMBER(wxBORDER_SUNKEN)
152 wxFLAGS_MEMBER(wxBORDER_DOUBLE)
153 wxFLAGS_MEMBER(wxBORDER_RAISED)
154 wxFLAGS_MEMBER(wxBORDER_STATIC)
155 wxFLAGS_MEMBER(wxBORDER_NONE)
4055ed82 156
ffecfa5a
JS
157 // old style border flags
158 wxFLAGS_MEMBER(wxSIMPLE_BORDER)
159 wxFLAGS_MEMBER(wxSUNKEN_BORDER)
160 wxFLAGS_MEMBER(wxDOUBLE_BORDER)
161 wxFLAGS_MEMBER(wxRAISED_BORDER)
162 wxFLAGS_MEMBER(wxSTATIC_BORDER)
163 wxFLAGS_MEMBER(wxBORDER)
164
165 // standard window styles
166 wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
167 wxFLAGS_MEMBER(wxCLIP_CHILDREN)
168 wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)
169 wxFLAGS_MEMBER(wxWANTS_CHARS)
170 wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)
171 wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )
172 wxFLAGS_MEMBER(wxVSCROLL)
173 wxFLAGS_MEMBER(wxHSCROLL)
174
175wxEND_FLAGS( wxWindowStyle )
176
177wxBEGIN_PROPERTIES_TABLE(wxWindow)
178 wxEVENT_PROPERTY( Close , wxEVT_CLOSE_WINDOW , wxCloseEvent)
179 wxEVENT_PROPERTY( Create , wxEVT_CREATE , wxWindowCreateEvent )
180 wxEVENT_PROPERTY( Destroy , wxEVT_DESTROY , wxWindowDestroyEvent )
181 // Always constructor Properties first
182
183 wxREADONLY_PROPERTY( Parent,wxWindow*, GetParent, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
184 wxPROPERTY( Id,wxWindowID, SetId, GetId, wxID_ANY, 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
185 wxPROPERTY( Position,wxPoint, SetPosition , GetPosition, wxDefaultPosition , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // pos
186 wxPROPERTY( Size,wxSize, SetSize, GetSize, wxDefaultSize , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // size
187 wxPROPERTY( WindowStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
188
189 // Then all relations of the object graph
190
191 wxREADONLY_PROPERTY_COLLECTION( Children , wxWindowList , wxWindowBase* , GetWindowChildren , wxPROP_OBJECT_GRAPH /*flags*/ , wxT("Helpstring") , wxT("group"))
192
193 // and finally all other properties
194
195 wxPROPERTY( ExtraStyle , long , SetExtraStyle , GetExtraStyle , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // extstyle
196 wxPROPERTY( BackgroundColour , wxColour , SetBackgroundColour , GetBackgroundColour , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // bg
197 wxPROPERTY( ForegroundColour , wxColour , SetForegroundColour , GetForegroundColour , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // fg
198 wxPROPERTY( Enabled , bool , Enable , IsEnabled , wxxVariant((bool)true) , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
199 wxPROPERTY( Shown , bool , Show , IsShown , wxxVariant((bool)true) , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
200#if 0
201 // possible property candidates (not in xrc) or not valid in all subclasses
202 wxPROPERTY( Title,wxString, SetTitle, GetTitle, wxT("") )
203 wxPROPERTY( Font , wxFont , SetFont , GetWindowFont , )
204 wxPROPERTY( Label,wxString, SetLabel, GetLabel, wxT("") )
205 // MaxHeight, Width , MinHeight , Width
206 // TODO switch label to control and title to toplevels
207
208 wxPROPERTY( ThemeEnabled , bool , SetThemeEnabled , GetThemeEnabled , )
209 //wxPROPERTY( Cursor , wxCursor , SetCursor , GetCursor , )
210 // wxPROPERTY( ToolTip , wxString , SetToolTip , GetToolTipText , )
211 wxPROPERTY( AutoLayout , bool , SetAutoLayout , GetAutoLayout , )
212
213
214
215#endif
216wxEND_PROPERTIES_TABLE()
217
218wxBEGIN_HANDLERS_TABLE(wxWindow)
219wxEND_HANDLERS_TABLE()
220
221wxCONSTRUCTOR_DUMMY(wxWindow)
222
223#else
224 IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowBase)
225#endif
226#endif // __WXUNIVERSAL__/__WXPalm__
227
228BEGIN_EVENT_TABLE(wxWindowPalm, wxWindowBase)
229 EVT_ERASE_BACKGROUND(wxWindowPalm::OnEraseBackground)
230 EVT_SYS_COLOUR_CHANGED(wxWindowPalm::OnSysColourChanged)
231 EVT_INIT_DIALOG(wxWindowPalm::OnInitDialog)
232END_EVENT_TABLE()
233
234// ===========================================================================
235// implementation
236// ===========================================================================
237
238// ---------------------------------------------------------------------------
239// wxWindow utility functions
240// ---------------------------------------------------------------------------
241
242// Find an item given the MS Windows id
243wxWindow *wxWindowPalm::FindItem(long id) const
244{
245 return NULL;
246}
247
248// Find an item given the MS Windows handle
249wxWindow *wxWindowPalm::FindItemByHWND(WXHWND hWnd, bool controlOnly) const
250{
251 return NULL;
252}
253
254// Default command handler
255bool wxWindowPalm::PalmCommand(WXUINT WXUNUSED(param), WXWORD WXUNUSED(id))
256{
257 return false;
258}
259
260// ----------------------------------------------------------------------------
261// constructors and such
262// ----------------------------------------------------------------------------
263
264void wxWindowPalm::Init()
265{
266}
267
268// Destructor
269wxWindowPalm::~wxWindowPalm()
270{
271}
272
273// real construction (Init() must have been called before!)
274bool wxWindowPalm::Create(wxWindow *parent,
275 wxWindowID id,
276 const wxPoint& pos,
277 const wxSize& size,
278 long style,
279 const wxString& name)
280{
281 return false;
282}
283
284FormType *wxWindowPalm::GetFormPtr()
285{
286 return FrameForm;
287}
288void wxWindowPalm::SetFormPtr(FormType *FormPtr)
289{
290 FrameForm=FormPtr;
291}
292
293// ---------------------------------------------------------------------------
294// basic operations
295// ---------------------------------------------------------------------------
296
297void wxWindowPalm::SetFocus()
298{
299}
300
301void wxWindowPalm::SetFocusFromKbd()
302{
303}
304
305// Get the window with the focus
306wxWindow *wxWindowBase::DoFindFocus()
307{
308 return NULL;
309}
310
311bool wxWindowPalm::Enable(bool enable)
312{
313 return false;
314}
315
316bool wxWindowPalm::Show(bool show)
317{
318 return false;
319}
320
321// Raise the window to the top of the Z order
322void wxWindowPalm::Raise()
323{
324}
325
326// Lower the window to the bottom of the Z order
327void wxWindowPalm::Lower()
328{
329}
330
331void wxWindowPalm::SetTitle( const wxString& title)
332{
333}
334
335wxString wxWindowPalm::GetTitle() const
336{
337 return wxString("");
338}
339
340void wxWindowPalm::DoCaptureMouse()
341{
342}
343
344void wxWindowPalm::DoReleaseMouse()
345{
346}
347
348/* static */ wxWindow *wxWindowBase::GetCapture()
349{
350 return NULL;
351}
352
353bool wxWindowPalm::SetFont(const wxFont& font)
354{
355 return false;
356}
357bool wxWindowPalm::SetCursor(const wxCursor& cursor)
358{
359 return false;
360}
361
362void wxWindowPalm::WarpPointer (int x, int y)
363{
364}
365
366// ---------------------------------------------------------------------------
367// scrolling stuff
368// ---------------------------------------------------------------------------
369
370// convert wxHORIZONTAL/wxVERTICAL to SB_HORZ/SB_VERT
371static inline int wxDirToWinStyle(int orient)
372{
373 return 0;
374}
375
376int wxWindowPalm::GetScrollPos(int orient) const
377{
378 return 0;
379}
380
381// This now returns the whole range, not just the number
382// of positions that we can scroll.
383int wxWindowPalm::GetScrollRange(int orient) const
384{
385 return 0;
386}
387
388int wxWindowPalm::GetScrollThumb(int orient) const
389{
390 return 0;
391}
392
393void wxWindowPalm::SetScrollPos(int orient, int pos, bool refresh)
394{
395}
396
397// New function that will replace some of the above.
398void wxWindowPalm::SetScrollbar(int orient,
399 int pos,
400 int pageSize,
401 int range,
402 bool refresh)
403{
404}
405
406void wxWindowPalm::ScrollWindow(int dx, int dy, const wxRect *prect)
407{
408}
409
410bool wxWindowPalm::ScrollLines(int lines)
411{
412 return false;
413}
414
415bool wxWindowPalm::ScrollPages(int pages)
416{
417 return false;
418}
419
420// ---------------------------------------------------------------------------
421// subclassing
422// ---------------------------------------------------------------------------
423
424void wxWindowPalm::SubclassWin(WXHWND hWnd)
425{
426}
427
428void wxWindowPalm::UnsubclassWin()
429{
430}
431
432bool wxCheckWindowWndProc(WXHWND hWnd, WXFARPROC wndProc)
433{
434 return false;
435}
436
437// ----------------------------------------------------------------------------
438// Style handling
439// ----------------------------------------------------------------------------
440
441void wxWindowPalm::SetWindowStyleFlag(long flags)
442{
443}
444
445WXDWORD wxWindowPalm::PalmGetStyle(long flags, WXDWORD *exstyle) const
446{
447 return 0;
448}
449
450// Setup background and foreground colours correctly
451void wxWindowPalm::SetupColours()
452{
453}
454
455bool wxWindowPalm::IsMouseInWindow() const
456{
457 return false;
458}
459
460void wxWindowPalm::OnInternalIdle()
461{
462}
463
464// Set this window to be the child of 'parent'.
465bool wxWindowPalm::Reparent(wxWindowBase *parent)
466{
467 return false;
468}
469
470void wxWindowPalm::Freeze()
471{
472}
473
474void wxWindowPalm::Thaw()
475{
476}
477
478void wxWindowPalm::Refresh(bool eraseBack, const wxRect *rect)
479{
480}
481
482void wxWindowPalm::Update()
483{
484}
485
486// ---------------------------------------------------------------------------
487// drag and drop
488// ---------------------------------------------------------------------------
489
490
491#if wxUSE_DRAG_AND_DROP
492void wxWindowPalm::SetDropTarget(wxDropTarget *pDropTarget)
493{
494}
495#endif // wxUSE_DRAG_AND_DROP
496
497// old style file-manager drag&drop support: we retain the old-style
498// DragAcceptFiles in parallel with SetDropTarget.
499void wxWindowPalm::DragAcceptFiles(bool accept)
500{
501}
502
503// ----------------------------------------------------------------------------
504// tooltips
505// ----------------------------------------------------------------------------
506
507#if wxUSE_TOOLTIPS
508
509void wxWindowPalm::DoSetToolTip(wxToolTip *tooltip)
510{
511}
512
513#endif // wxUSE_TOOLTIPS
514
515// ---------------------------------------------------------------------------
516// moving and resizing
517// ---------------------------------------------------------------------------
518
519// Get total size
520void wxWindowPalm::DoGetSize(int *x, int *y) const
521{
522}
523
524// Get size *available for subwindows* i.e. excluding menu bar etc.
525void wxWindowPalm::DoGetClientSize(int *x, int *y) const
526{
527}
528
529void wxWindowPalm::DoGetPosition(int *x, int *y) const
530{
531}
532
533void wxWindowPalm::DoScreenToClient(int *x, int *y) const
534{
535}
536
537void wxWindowPalm::DoClientToScreen(int *x, int *y) const
538{
539}
540
541void wxWindowPalm::DoMoveWindow(int x, int y, int width, int height)
542{
543}
544
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)
549//
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
552// width/height
553void wxWindowPalm::DoSetSize(int x, int y, int width, int height, int sizeFlags)
554{
555}
556
557void wxWindowPalm::DoSetClientSize(int width, int height)
558{
559}
560
561// For implementation purposes - sometimes decorations make the client area
562// smaller
563wxPoint wxWindowPalm::GetClientAreaOrigin() const
564{
565 return wxPoint(0, 0);
566}
567
568// ---------------------------------------------------------------------------
569// text metrics
570// ---------------------------------------------------------------------------
571
572int wxWindowPalm::GetCharHeight() const
573{
574 return 0;
575}
576
577int wxWindowPalm::GetCharWidth() const
578{
579 return 0;
580}
581
582void wxWindowPalm::GetTextExtent(const wxString& string,
583 int *x, int *y,
584 int *descent, int *externalLeading,
585 const wxFont *theFont) const
586{
587}
588
589// ---------------------------------------------------------------------------
590// popup menu
591// ---------------------------------------------------------------------------
592
593#if wxUSE_MENUS_NATIVE
594
595// yield for WM_COMMAND events only, i.e. process all WM_COMMANDs in the queue
596// immediately, without waiting for the next event loop iteration
597//
598// NB: this function should probably be made public later as it can almost
599// surely replace wxYield() elsewhere as well
600static void wxYieldForCommandsOnly()
601{
602}
603
604bool wxWindowPalm::DoPopupMenu(wxMenu *menu, int x, int y)
605{
606 return false;
607}
608
609#endif // wxUSE_MENUS_NATIVE
610
611// ===========================================================================
612// pre/post message processing
613// ===========================================================================
614
615WXLRESULT wxWindowPalm::PalmDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
616{
617 return false;
618}
619
620bool wxWindowPalm::PalmProcessMessage(WXMSG* pMsg)
621{
622 return false;
623}
624
625bool wxWindowPalm::PalmTranslateMessage(WXMSG* pMsg)
626{
627 return false;
628}
629
630bool wxWindowPalm::PalmShouldPreProcessMessage(WXMSG* WXUNUSED(pMsg))
631{
632 return false;
633}
634
635// ---------------------------------------------------------------------------
636// Main wxWidgets window proc and the window proc for wxWindow
637// ---------------------------------------------------------------------------
638
639// Hook for new window just as it's being created, when the window isn't yet
640// associated with the handle
641
642// implementation of wxWindowCreationHook class: it just sets gs_winBeingCreated to the
643// window being created and insures that it's always unset back later
644wxWindowCreationHook::wxWindowCreationHook(wxWindowPalm *winBeingCreated)
645{
646}
647
648wxWindowCreationHook::~wxWindowCreationHook()
649{
650}
651
652WXLRESULT wxWindowPalm::PalmWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
653{
654 return false;
655}
656
657// ----------------------------------------------------------------------------
658// wxWindow <-> HWND map
659// ----------------------------------------------------------------------------
660
661wxWinHashTable *wxWinHandleHash = NULL;
662
663wxWindow *wxFindWinFromHandle(WXHWND hWnd)
664{
665 return NULL;
666}
667
668void wxRemoveHandleAssociation(wxWindowPalm *win)
669{
670}
671
672// ----------------------------------------------------------------------------
673// various Palm speciic class dependent functions
674// ----------------------------------------------------------------------------
675
676// Default destroyer - override if you destroy it in some other way
677// (e.g. with MDI child windows)
678void wxWindowPalm::PalmDestroyWindow()
679{
680}
681
682bool wxWindowPalm::PalmGetCreateWindowCoords(const wxPoint& pos,
683 const wxSize& size,
684 int& x, int& y,
685 int& w, int& h) const
686{
687 return false;
688}
689
690WXHWND wxWindowPalm::PalmGetParent() const
691{
692 return NULL;
693}
694
695bool wxWindowPalm::PalmCreate(const wxChar *wclass,
696 const wxChar *title,
697 const wxPoint& pos,
698 const wxSize& size,
699 WXDWORD style,
700 WXDWORD extendedStyle)
701{
702 return false;
703}
704
705// ===========================================================================
706// Palm message handlers
707// ===========================================================================
708
709// ---------------------------------------------------------------------------
710// WM_NOTIFY
711// ---------------------------------------------------------------------------
712
713#ifdef __WIN95__
714
715bool wxWindowPalm::HandleNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
716{
717 return false;
718}
719
720#if wxUSE_TOOLTIPS
721
722bool wxWindowPalm::HandleTooltipNotify(WXUINT code,
723 WXLPARAM lParam,
724 const wxString& ttip)
725{
726 return false;
727}
728
729#endif // wxUSE_TOOLTIPS
730
731bool wxWindowPalm::PalmOnNotify(int WXUNUSED(idCtrl),
732 WXLPARAM lParam,
733 WXLPARAM* WXUNUSED(result))
734{
735 return false;
736}
737
738#endif // __WIN95__
739
740// ---------------------------------------------------------------------------
741// end session messages
742// ---------------------------------------------------------------------------
743
744bool wxWindowPalm::HandleQueryEndSession(long logOff, bool *mayEnd)
745{
746 return false;
747}
748
749bool wxWindowPalm::HandleEndSession(bool endSession, long logOff)
750{
751 return false;
752}
753
754// ---------------------------------------------------------------------------
755// window creation/destruction
756// ---------------------------------------------------------------------------
757
758bool wxWindowPalm::HandleCreate(WXLPCREATESTRUCT cs, bool *mayCreate)
759{
760 return false;
761}
762
763bool wxWindowPalm::HandleDestroy()
764{
765 return false;
766}
767
768// ---------------------------------------------------------------------------
769// activation/focus
770// ---------------------------------------------------------------------------
771
772bool wxWindowPalm::HandleActivate(int state,
773 bool WXUNUSED(minimized),
774 WXHWND WXUNUSED(activate))
775{
776 return false;
777}
778
779bool wxWindowPalm::HandleSetFocus(WXHWND hwnd)
780{
781 return false;
782}
783
784bool wxWindowPalm::HandleKillFocus(WXHWND hwnd)
785{
786 return false;
787}
788
789// ---------------------------------------------------------------------------
790// miscellaneous
791// ---------------------------------------------------------------------------
792
793bool wxWindowPalm::HandleShow(bool show, int WXUNUSED(status))
794{
795 return false;
796}
797
798bool wxWindowPalm::HandleInitDialog(WXHWND WXUNUSED(hWndFocus))
799{
800 return false;
801}
802
803bool wxWindowPalm::HandleDropFiles(WXWPARAM wParam)
804{
805 return false;
806}
807
808
809bool wxWindowPalm::HandleSetCursor(WXHWND WXUNUSED(hWnd),
810 short nHitTest,
811 int WXUNUSED(mouseMsg))
812{
813 return false;
814}
815
816// ---------------------------------------------------------------------------
817// owner drawn stuff
818// ---------------------------------------------------------------------------
819
820#if (wxUSE_OWNER_DRAWN && wxUSE_MENUS_NATIVE) || \
821 (wxUSE_CONTROLS && !defined(__WXUNIVERSAL__))
822 #define WXUNUSED_UNLESS_ODRAWN(param) param
823#else
824 #define WXUNUSED_UNLESS_ODRAWN(param)
825#endif
826
827bool
828wxWindowPalm::PalmOnDrawItem(int WXUNUSED_UNLESS_ODRAWN(id),
829 WXDRAWITEMSTRUCT * WXUNUSED_UNLESS_ODRAWN(itemStruct))
830{
831 return false;
832}
833
834bool
835wxWindowPalm::PalmOnMeasureItem(int WXUNUSED_UNLESS_ODRAWN(id),
836 WXMEASUREITEMSTRUCT *
837 WXUNUSED_UNLESS_ODRAWN(itemStruct))
838{
839 return false;
840}
841
842// ---------------------------------------------------------------------------
843// colours and palettes
844// ---------------------------------------------------------------------------
845
846bool wxWindowPalm::HandleSysColorChange()
847{
848 return false;
849}
850
851bool wxWindowPalm::HandleDisplayChange()
852{
853 return false;
854}
855
856bool wxWindowPalm::HandleCtlColor(WXHBRUSH *brush,
857 WXHDC pDC,
858 WXHWND pWnd,
859 WXUINT nCtlColor,
860 WXUINT message,
861 WXWPARAM wParam,
862 WXLPARAM lParam)
863{
864 return false;
865}
866
867// Define for each class of dialog and control
868WXHBRUSH wxWindowPalm::OnCtlColor(WXHDC WXUNUSED(hDC),
869 WXHWND WXUNUSED(hWnd),
870 WXUINT WXUNUSED(nCtlColor),
871 WXUINT WXUNUSED(message),
872 WXWPARAM WXUNUSED(wParam),
873 WXLPARAM WXUNUSED(lParam))
874{
875 return (WXHBRUSH)0;
876}
877
878bool wxWindowPalm::HandlePaletteChanged(WXHWND hWndPalChange)
879{
880 return false;
881}
882
883bool wxWindowPalm::HandleCaptureChanged(WXHWND hWndGainedCapture)
884{
885 return false;
886}
887
888bool wxWindowPalm::HandleQueryNewPalette()
889{
890 return false;
891}
892
893// Responds to colour changes: passes event on to children.
894void wxWindowPalm::OnSysColourChanged(wxSysColourChangedEvent& WXUNUSED(event))
895{
896}
897
898// ---------------------------------------------------------------------------
899// painting
900// ---------------------------------------------------------------------------
901
902bool wxWindowPalm::HandlePaint()
903{
904 return false;
905}
906
907// Can be called from an application's OnPaint handler
908void wxWindowPalm::OnPaint(wxPaintEvent& event)
909{
910}
911
912bool wxWindowPalm::HandleEraseBkgnd(WXHDC hdc)
913{
914 return false;
915}
916
917void wxWindowPalm::OnEraseBackground(wxEraseEvent& event)
918{
919}
920
921// ---------------------------------------------------------------------------
922// moving and resizing
923// ---------------------------------------------------------------------------
924
925bool wxWindowPalm::HandleMinimize()
926{
927 return false;
928}
929
930bool wxWindowPalm::HandleMaximize()
931{
932 return false;
933}
934
935bool wxWindowPalm::HandleMove(int x, int y)
936{
937 return false;
938}
939
940bool wxWindowPalm::HandleMoving(wxRect& rect)
941{
942 return false;
943}
944
945bool wxWindowPalm::HandleSize(int WXUNUSED(w), int WXUNUSED(h),
946 WXUINT WXUNUSED(flag))
947{
948 return false;
949}
950
951bool wxWindowPalm::HandleSizing(wxRect& rect)
952{
953 return false;
954}
955
956bool wxWindowPalm::HandleGetMinMaxInfo(void *mmInfo)
957{
958 return false;
959}
960
961// ---------------------------------------------------------------------------
962// command messages
963// ---------------------------------------------------------------------------
964
965bool wxWindowPalm::HandleCommand(WXWORD id, WXWORD cmd, WXHWND control)
966{
967 return false;
968}
969
970// ---------------------------------------------------------------------------
971// mouse events
972// ---------------------------------------------------------------------------
973
974void wxWindowPalm::InitMouseEvent(wxMouseEvent& event,
975 int x, int y,
976 WXUINT flags)
977{
978}
979
980// Windows doesn't send the mouse events to the static controls (which are
981// transparent in the sense that their WM_NCHITTEST handler returns
982// HTTRANSPARENT) at all but we want all controls to receive the mouse events
983// and so we manually check if we don't have a child window under mouse and if
984// we do, send the event to it instead of the window Windows had sent WM_XXX
985// to.
986//
987// Notice that this is not done for the mouse move events because this could
988// (would?) be too slow, but only for clicks which means that the static texts
989// still don't get move, enter nor leave events.
990static wxWindowPalm *FindWindowForMouseEvent(wxWindowPalm *win, int *x, int *y) //TW:REQ:Univ
991{
992 return NULL;
993}
994
995bool wxWindowPalm::HandleMouseEvent(WXUINT msg, int x, int y, WXUINT flags)
996{
997 return false;
998}
999
1000bool wxWindowPalm::HandleMouseMove(int x, int y, WXUINT flags)
1001{
1002 return false;
1003}
1004
1005
1006bool wxWindowPalm::HandleMouseWheel(WXWPARAM wParam, WXLPARAM lParam)
1007{
1008 return false;
1009}
1010
1011
1012// ---------------------------------------------------------------------------
1013// keyboard handling
1014// ---------------------------------------------------------------------------
1015
1016// create the key event of the given type for the given key - used by
1017// HandleChar and HandleKeyDown/Up
1018wxKeyEvent wxWindowPalm::CreateKeyEvent(wxEventType evType,
1019 int id,
1020 WXLPARAM lParam,
1021 WXWPARAM wParam) const
1022{
1023 wxKeyEvent event(evType);
1024
1025 return event;
1026}
1027
1028// isASCII is true only when we're called from WM_CHAR handler and not from
1029// WM_KEYDOWN one
1030bool wxWindowPalm::HandleChar(WXWPARAM wParam, WXLPARAM lParam, bool isASCII)
1031{
1032 return false;
1033}
1034
1035bool wxWindowPalm::HandleKeyDown(WXWPARAM wParam, WXLPARAM lParam)
1036{
1037 return false;
1038}
1039
1040bool wxWindowPalm::HandleKeyUp(WXWPARAM wParam, WXLPARAM lParam)
1041{
1042 return false;
1043}
1044
ffecfa5a
JS
1045// ---------------------------------------------------------------------------
1046// joystick
1047// ---------------------------------------------------------------------------
1048
1049bool wxWindowPalm::HandleJoystickEvent(WXUINT msg, int x, int y, WXUINT flags)
1050{
1051 return false;
1052}
1053
1054// ---------------------------------------------------------------------------
1055// scrolling
1056// ---------------------------------------------------------------------------
1057
1058bool wxWindowPalm::PalmOnScroll(int orientation, WXWORD wParam,
1059 WXWORD pos, WXHWND control)
4055ed82 1060{
ffecfa5a
JS
1061 return false;
1062}
1063
1064// ===========================================================================
1065// global functions
1066// ===========================================================================
1067
1068void wxGetCharSize(WXHWND wnd, int *x, int *y, const wxFont *the_font)
1069{
1070}
1071
1072// Returns 0 if was a normal ASCII value, not a special key. This indicates that
1073// the key should be ignored by WM_KEYDOWN and processed by WM_CHAR instead.
1074int wxCharCodePalmToWX(int keySym, WXLPARAM lParam)
1075{
1076 return 0;
1077}
1078
1079int wxCharCodeWXToPalm(int id, bool *isVirtual)
1080{
1081 return 0;
1082}
1083
1084bool wxGetKeyState(wxKeyCode key)
1085{
1086 return false;
1087}
1088
1089wxWindow *wxGetActiveWindow()
1090{
1091 return NULL;
1092}
1093
1094extern wxWindow *wxGetWindowFromHWND(WXHWND hWnd)
1095{
1096 return NULL;
1097}
1098
1099#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
1100
1101void wxSetKeyboardHook(bool doIt)
1102{
1103}
1104
1105#endif // !__WXMICROWIN__
1106
1107#ifdef __WXDEBUG__
1108const char *wxGetMessageName(int message)
1109{
1110 return "";
1111}
1112#endif //__WXDEBUG__
1113
1114// Find the wxWindow at the current mouse position, returning the mouse
1115// position.
1116wxWindow* wxFindWindowAtPointer(wxPoint& pt)
1117{
1118 return NULL;
1119}
1120
1121wxWindow* wxFindWindowAtPoint(const wxPoint& pt)
1122{
1123 return NULL;
1124}
1125
1126// Get the current mouse position.
1127wxPoint wxGetMousePosition()
1128{
1129 return wxPoint(0, 0);
1130}
1131
1132#if wxUSE_HOTKEY
1133
1134bool wxWindowPalm::RegisterHotKey(int hotkeyId, int modifiers, int keycode)
1135{
1136 return false;
1137}
1138
1139bool wxWindowPalm::UnregisterHotKey(int hotkeyId)
1140{
1141 return false;
1142}
1143
1144#if wxUSE_ACCEL
1145
1146bool wxWindowPalm::HandleHotKey(WXWPARAM wParam, WXLPARAM lParam)
1147{
1148 return false;
1149}
1150
1151#endif // wxUSE_ACCEL
1152
1153#endif // wxUSE_HOTKEY
1154
1155