]> git.saurik.com Git - wxWidgets.git/blame - src/gtk1/data.cpp
memdc and bitmap fixes
[wxWidgets.git] / src / gtk1 / data.cpp
CommitLineData
c801d85f
KB
1/////////////////////////////////////////////////////////////////////////////
2// Name: data.cpp
3// Purpose:
4// Author: Robert Roebling
5// Created: 01/02/97
6// Id:
7// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
8// Licence: wxWindows licence
9/////////////////////////////////////////////////////////////////////////////
10
11
12#ifdef __GNUG__
13// #pragma implementation
14#endif
15
16#include "wx/wx.h"
17
18#define _MAXPATHLEN 500
19
20// Used for X resources
21
22#include <X11/Xlib.h>
23#include <X11/Xutil.h>
24#include <X11/Xresource.h>
25
26wxList wxResourceCache(wxKEY_STRING);
27XrmDatabase wxResourceDatabase;
28
29// Useful buffer, initialized in wxCommonInit
30char *wxBuffer = NULL;
31
32// Windows List
33wxList wxTopLevelWindows;
34
35// List of windows pending deletion
36wxList wxPendingDelete;
37
38// Current cursor, in order to hang on to
39// cursor handle when setting the cursor globally
40wxCursor *g_globalCursor = NULL;
41
42// Don't allow event propagation during drag
43bool g_blockEventsOnDrag = FALSE;
44
45// Message Strings for Internationalization
46char **wx_msg_str = (char**)NULL;
47
48// Custom OS version, as optionally placed in wx.ini/.wxrc
49// Currently this can be Win95, Windows, Win32s, WinNT.
50// For some systems, you can't tell until run-time what services you
51// have. See wxGetOsVersion, which uses this string if present.
52char *wxOsVersion = NULL;
53
54// For printing several pages
55int wxPageNumber;
56wxPrintPaperDatabase* wxThePrintPaperDatabase = NULL;
57
58// GDI Object Lists
59wxBrushList *wxTheBrushList = NULL;
60wxPenList *wxThePenList = NULL;
61wxFontList *wxTheFontList = NULL;
62wxColourDatabase *wxTheColourDatabase = NULL;
63wxBitmapList *wxTheBitmapList = NULL;
64
65
66// X only font names
67wxFontNameDirectory wxTheFontNameDirectory;
68
69// Stock objects
70wxFont *wxNORMAL_FONT;
71wxFont *wxSMALL_FONT;
72wxFont *wxITALIC_FONT;
73wxFont *wxSWISS_FONT;
74
75wxPen *wxRED_PEN;
76wxPen *wxCYAN_PEN;
77wxPen *wxGREEN_PEN;
78wxPen *wxBLACK_PEN;
79wxPen *wxWHITE_PEN;
80wxPen *wxTRANSPARENT_PEN;
81wxPen *wxBLACK_DASHED_PEN;
82wxPen *wxGREY_PEN;
83wxPen *wxMEDIUM_GREY_PEN;
84wxPen *wxLIGHT_GREY_PEN;
85
86wxBrush *wxBLUE_BRUSH;
87wxBrush *wxGREEN_BRUSH;
88wxBrush *wxWHITE_BRUSH;
89wxBrush *wxBLACK_BRUSH;
90wxBrush *wxTRANSPARENT_BRUSH;
91wxBrush *wxCYAN_BRUSH;
92wxBrush *wxRED_BRUSH;
93wxBrush *wxGREY_BRUSH;
94wxBrush *wxMEDIUM_GREY_BRUSH;
95wxBrush *wxLIGHT_GREY_BRUSH;
96
97wxColour *wxBLACK;
98wxColour *wxWHITE;
99wxColour *wxGREY; // Robert Roebling
100wxColour *wxRED;
101wxColour *wxBLUE;
102wxColour *wxGREEN;
103wxColour *wxCYAN;
104wxColour *wxLIGHT_GREY;
105
106wxCursor *wxSTANDARD_CURSOR = NULL;
107wxCursor *wxHOURGLASS_CURSOR = NULL;
108wxCursor *wxCROSS_CURSOR = NULL;
109
110// 'Null' objects
111wxBitmap wxNullBitmap;
112wxIcon wxNullIcon;
113wxCursor wxNullCursor;
114wxPen wxNullPen;
115wxBrush wxNullBrush;
116wxFont wxNullFont;
117wxColour wxNullColour;
118wxPalette wxNullPalette;
119
120// Default window names
121const char *wxButtonNameStr = "button";
122const char *wxCanvasNameStr = "canvas";
123const char *wxCheckBoxNameStr = "check";
124const char *wxChoiceNameStr = "choice";
125const char *wxComboBoxNameStr = "comboBox";
126const char *wxDialogNameStr = "dialog";
127const char *wxFrameNameStr = "frame";
128const char *wxGaugeNameStr = "gauge";
129const char *wxStaticBoxNameStr = "groupBox";
130const char *wxListBoxNameStr = "listBox";
131const char *wxStaticTextNameStr = "message";
132const char *wxStaticBitmapNameStr = "message";
133const char *wxMultiTextNameStr = "multitext";
134const char *wxPanelNameStr = "panel";
135const char *wxRadioBoxNameStr = "radioBox";
136const char *wxRadioButtonNameStr = "radioButton";
137const char *wxBitmapRadioButtonNameStr = "radioButton";
138const char *wxScrollBarNameStr = "scrollBar";
139const char *wxSliderNameStr = "slider";
140const char *wxStaticNameStr = "static";
141const char *wxTextCtrlWindowNameStr = "textWindow";
142const char *wxTextCtrlNameStr = "text";
143const char *wxVirtListBoxNameStr = "virtListBox";
144const char *wxButtonBarNameStr = "buttonbar";
145const char *wxEnhDialogNameStr = "Shell";
146const char *wxToolBarNameStr = "toolbar";
147const char *wxStatusLineNameStr = "status_line";
148const char *wxEmptyString = "";
149const char *wxGetTextFromUserPromptStr = "Input Text";
150const char *wxMessageBoxCaptionStr = "Message";
151const char *wxFileSelectorPromptStr = "Select a file";
152const char *wxFileSelectorDefaultWildcardStr = "*.*";
153const char *wxInternalErrorStr = "wxWindows Internal Error";
154const char *wxFatalErrorStr = "wxWindows Fatal Error";
155
156// See wx/utils.h
157const char *wxFloatToStringStr = "%.2f";
158const char *wxDoubleToStringStr = "%.2f";
159
160#ifdef wx_msw
161const char *wxUserResourceStr = "TEXT";
162#endif
163
164
165#if USE_SHARED_LIBRARY
166/*
167 * For wxWindows to be made into a dynamic library (e.g. Sun),
168 * all IMPLEMENT_... macros must be in one place.
169 * But normally, the definitions are in the appropriate places.
170 */
171
172// Hand-coded IMPLEMENT... macro for wxObject (define static data)
173wxClassInfo wxObject::classwxObject("wxObject", NULL, NULL, sizeof(wxObject), NULL);
174wxClassInfo *wxClassInfo::first = NULL;
175
176#include "wx/button.h"
177#include "wx/bmpbuttn.h"
178IMPLEMENT_DYNAMIC_CLASS(wxButton, wxControl)
179IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton, wxButton)
180
181#include "wx/checkbox.h"
182IMPLEMENT_DYNAMIC_CLASS(wxCheckBox, wxControl)
183IMPLEMENT_DYNAMIC_CLASS(wxBitmapCheckBox, wxCheckBox)
184
185#include "wx/choice.h"
186IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl)
187
188#if USE_CLIPBOARD
189#include "wx/clipbrd.h"
190IMPLEMENT_DYNAMIC_CLASS(wxClipboard, wxObject)
191IMPLEMENT_ABSTRACT_CLASS(wxClipboardClient, wxObject)
192#endif
193
194#if USE_COMBOBOX
195#include "wx/combobox.h"
196IMPLEMENT_DYNAMIC_CLASS(wxComboBox, wxControl)
197#endif
198
199#include "wx/dc.h"
200#include "wx/dcmemory.h"
201#include "wx/dcclient.h"
202#include "wx/dcscreen.h"
203IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject)
204IMPLEMENT_DYNAMIC_CLASS(wxClientDC, wxDC)
205IMPLEMENT_DYNAMIC_CLASS(wxWindowDC, wxDC)
206IMPLEMENT_DYNAMIC_CLASS(wxPaintDC, wxDC)
207IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC, wxDC)
208IMPLEMENT_DYNAMIC_CLASS(wxScreenDC, wxWindowDC)
209
210#if defined(wx_msw)
211#include "wx/dcprint.h"
212IMPLEMENT_CLASS(wxPrinterDC, wxDC)
213#endif
214
215#include "wx/dialog.h"
216IMPLEMENT_DYNAMIC_CLASS(wxDialog, wxWindow)
217
218#include "wx/frame.h"
219IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow)
220
221#include "wx/mdi.h"
222IMPLEMENT_DYNAMIC_CLASS(wxMDIParentFrame, wxFrame)
223IMPLEMENT_DYNAMIC_CLASS(wxMDIChildFrame, wxFrame)
224IMPLEMENT_DYNAMIC_CLASS(wxMDIClientWindow, wxWindow)
225
226#include "wx/cmndata.h"
227IMPLEMENT_DYNAMIC_CLASS(wxColourData, wxObject)
228IMPLEMENT_DYNAMIC_CLASS(wxFontData, wxObject)
229IMPLEMENT_DYNAMIC_CLASS(wxPrintData, wxObject)
230
231#include "wx/colordlg.h"
232#include "wx/fontdlg.h"
233
234#if !defined(wx_msw) || USE_GENERIC_DIALOGS_IN_MSW
235#include "wx/generic/colordlg.h"
236#include "wx/generic/fontdlg.h"
237IMPLEMENT_DYNAMIC_CLASS(wxGenericColourDialog, wxDialog)
238IMPLEMENT_DYNAMIC_CLASS(wxGenericFontDialog, wxDialog)
239#endif
240
241// X defines wxColourDialog to be wxGenericColourDialog
242#ifndef wx_x
243IMPLEMENT_DYNAMIC_CLASS(wxColourDialog, wxDialog)
244IMPLEMENT_DYNAMIC_CLASS(wxFontDialog, wxDialog)
245#endif
246
247#include "wx/gdicmn.h"
248#include "wx/pen.h"
249#include "wx/brush.h"
250#include "wx/font.h"
251#include "wx/palette.h"
252#include "wx/icon.h"
253#include "wx/cursor.h"
254
255IMPLEMENT_DYNAMIC_CLASS(wxColour, wxObject)
256IMPLEMENT_CLASS(wxColourDatabase, wxList)
257IMPLEMENT_DYNAMIC_CLASS(wxFontList, wxList)
258IMPLEMENT_DYNAMIC_CLASS(wxPenList, wxList)
259IMPLEMENT_DYNAMIC_CLASS(wxBrushList, wxList)
260IMPLEMENT_DYNAMIC_CLASS(wxBitmapList, wxList)
261
6a6c0a8b 262/*
c801d85f
KB
263#if (!USE_TYPEDEFS)
264IMPLEMENT_DYNAMIC_CLASS(wxPoint, wxObject)
265IMPLEMENT_DYNAMIC_CLASS(wxIntPoint, wxObject)
266#endif
6a6c0a8b 267*/
c801d85f
KB
268
269#if defined(wx_x) || (defined(wx_msw) && USE_PORTABLE_FONTS_IN_MSW)
270IMPLEMENT_DYNAMIC_CLASS(wxFontNameDirectory, wxObject)
271#endif
272
273#include "wx/hash.h"
274IMPLEMENT_DYNAMIC_CLASS(wxHashTable, wxObject)
275
276#include "wx/help.h"
277IMPLEMENT_DYNAMIC_CLASS(wxHelpInstance, wxClient)
278IMPLEMENT_CLASS(wxHelpConnection, wxConnection)
279
280#include "wx/list.h"
281IMPLEMENT_DYNAMIC_CLASS(wxNode, wxObject)
282IMPLEMENT_DYNAMIC_CLASS(wxList, wxObject)
283IMPLEMENT_DYNAMIC_CLASS(wxStringList, wxList)
284
285#if USE_PRINTING_ARCHITECTURE
286#include "wx/print.h"
287IMPLEMENT_DYNAMIC_CLASS(wxPrintDialog, wxDialog)
288IMPLEMENT_DYNAMIC_CLASS(wxPrinterBase, wxObject)
289IMPLEMENT_DYNAMIC_CLASS(wxPostScriptPrinter, wxPrinterBase)
290IMPLEMENT_DYNAMIC_CLASS(wxWindowsPrinter, wxPrinterBase)
291IMPLEMENT_ABSTRACT_CLASS(wxPrintout, wxObject)
292IMPLEMENT_CLASS(wxPreviewCanvas, wxWindow)
293IMPLEMENT_CLASS(wxPreviewControlBar, wxWindow)
294IMPLEMENT_CLASS(wxPreviewFrame, wxFrame)
295IMPLEMENT_CLASS(wxPrintPreviewBase, wxObject)
296IMPLEMENT_CLASS(wxPostScriptPrintPreview, wxPrintPreviewBase)
297IMPLEMENT_CLASS(wxWindowsPrintPreview, wxPrintPreviewBase)
298IMPLEMENT_CLASS(wxGenericPrintDialog, wxDialog)
299IMPLEMENT_CLASS(wxGenericPrintSetupDialog, wxDialog)
300#endif
301
302#if USE_POSTSCRIPT
303#include "wx/postscrp.h"
304IMPLEMENT_DYNAMIC_CLASS(wxPostScriptDC, wxDC)
305IMPLEMENT_DYNAMIC_CLASS(wxPrintSetupData, wxObject)
306IMPLEMENT_DYNAMIC_CLASS(wxPageSetupData, wxObject)
307IMPLEMENT_DYNAMIC_CLASS(wxPrintPaperType, wxObject)
308IMPLEMENT_DYNAMIC_CLASS(wxPrintPaperDatabase, wxList)
309#endif
310
311#if USE_WX_RESOURCES
312#include "wx/resource.h"
313IMPLEMENT_DYNAMIC_CLASS(wxItemResource, wxObject)
314IMPLEMENT_DYNAMIC_CLASS(wxResourceTable, wxHashTable)
315#endif
316
317#include "wx/event.h"
318IMPLEMENT_DYNAMIC_CLASS(wxEvtHandler, wxObject)
319IMPLEMENT_ABSTRACT_CLASS(wxEvent, wxObject)
320IMPLEMENT_DYNAMIC_CLASS(wxCommandEvent, wxEvent)
321IMPLEMENT_DYNAMIC_CLASS(wxScrollEvent, wxCommandEvent)
322IMPLEMENT_DYNAMIC_CLASS(wxMouseEvent, wxEvent)
323IMPLEMENT_DYNAMIC_CLASS(wxKeyEvent, wxEvent)
324IMPLEMENT_DYNAMIC_CLASS(wxSizeEvent, wxEvent)
325IMPLEMENT_DYNAMIC_CLASS(wxPaintEvent, wxEvent)
326IMPLEMENT_DYNAMIC_CLASS(wxEraseEvent, wxEvent)
327IMPLEMENT_DYNAMIC_CLASS(wxMoveEvent, wxEvent)
328IMPLEMENT_DYNAMIC_CLASS(wxFocusEvent, wxEvent)
329IMPLEMENT_DYNAMIC_CLASS(wxCloseEvent, wxEvent)
330IMPLEMENT_DYNAMIC_CLASS(wxMenuEvent, wxEvent)
331IMPLEMENT_DYNAMIC_CLASS(wxJoystickEvent, wxEvent)
332IMPLEMENT_DYNAMIC_CLASS(wxDropFilesEvent, wxEvent)
333IMPLEMENT_DYNAMIC_CLASS(wxActivateEvent, wxEvent)
334IMPLEMENT_DYNAMIC_CLASS(wxInitDialogEvent, wxEvent)
335IMPLEMENT_DYNAMIC_CLASS(wxSysColourChangedEvent, wxEvent)
336IMPLEMENT_DYNAMIC_CLASS(wxIdleEvent, wxEvent)
337IMPLEMENT_DYNAMIC_CLASS(wxUpdateUIEvent, wxEvent)
cf447356 338IMPLEMENT_DYNAMIC_CLASS(wxProcessEvent, wxEvent)
c801d85f
KB
339
340#include "wx/utils.h"
341IMPLEMENT_DYNAMIC_CLASS(wxPathList, wxList)
342
6a6c0a8b 343// IMPLEMENT_DYNAMIC_CLASS(wxRect, wxObject)
c801d85f 344
cf447356
GL
345#include "wx/process.h"
346IMPLEMENT_DYNAMIC_CLASS(wxProcess, wxEvtHandler)
347
3cacae09
GL
348#include "wx/stream.h"
349#include "wx/fstream.h"
350#include "wx/mstream.h"
351#include "wx/datstrm.h"
352IMPLEMENT_ABSTRACT_CLASS(wxInputStream, wxObject)
353IMPLEMENT_ABSTRACT_CLASS(wxOutputStream, wxObject)
354IMPLEMENT_ABSTRACT_CLASS2(wxStream, wxInputStream, wxOutputStream)
355IMPLEMENT_CLASS(wxFilterInputStream, wxInputStream)
356IMPLEMENT_CLASS(wxFilterOutputStream, wxOutputStream)
357
358IMPLEMENT_CLASS(wxFileStreamBase, wxStream)
359IMPLEMENT_CLASS(wxFileInputStream, wxFileStreamBase)
360IMPLEMENT_CLASS(wxFileOutputStream, wxFileStreamBase)
361
362IMPLEMENT_CLASS(wxMemoryStreamBase, wxStream)
363IMPLEMENT_CLASS(wxMemoryInputStream, wxMemoryStreamBase)
364IMPLEMENT_DYNAMIC_CLASS(wxMemoryOutputStream, wxMemoryStreamBase)
365IMPLEMENT_DYNAMIC_CLASS(wxMemoryStream, wxMemoryStreamBase)
366
367IMPLEMENT_CLASS(wxDataInputStream, wxFilterInputStream)
368IMPLEMENT_CLASS(wxDataOutputStream, wxFilterInputStream)
369
c801d85f
KB
370#if USE_TIMEDATE
371#include "wx/date.h"
372IMPLEMENT_DYNAMIC_CLASS(wxDate, wxObject)
373#endif
374
375#if USE_DOC_VIEW_ARCHITECTURE
376#include "wx/docview.h"
377//IMPLEMENT_ABSTRACT_CLASS(wxDocItem, wxObject)
378IMPLEMENT_ABSTRACT_CLASS(wxDocument, wxEvtHandler)
379IMPLEMENT_ABSTRACT_CLASS(wxView, wxEvtHandler)
380IMPLEMENT_ABSTRACT_CLASS(wxDocTemplate, wxObject)
381IMPLEMENT_DYNAMIC_CLASS(wxDocManager, wxEvtHandler)
382IMPLEMENT_CLASS(wxDocChildFrame, wxFrame)
383IMPLEMENT_CLASS(wxDocParentFrame, wxFrame)
384#if USE_PRINTING_ARCHITECTURE
385IMPLEMENT_DYNAMIC_CLASS(wxDocPrintout, wxPrintout)
386#endif
387IMPLEMENT_CLASS(wxCommand, wxObject)
388IMPLEMENT_DYNAMIC_CLASS(wxCommandProcessor, wxObject)
389IMPLEMENT_DYNAMIC_CLASS(wxFileHistory, wxObject)
390#endif
391
392#if USE_CONSTRAINTS
393#include "wx/layout.h"
394IMPLEMENT_DYNAMIC_CLASS(wxIndividualLayoutConstraint, wxObject)
395IMPLEMENT_DYNAMIC_CLASS(wxLayoutConstraints, wxObject)
396IMPLEMENT_DYNAMIC_CLASS(wxSizer, wxObject)
397IMPLEMENT_DYNAMIC_CLASS(wxRowColSizer, wxSizer)
398#endif
399
400#if USE_TOOLBAR
401#include "wx/tbarbase.h"
402IMPLEMENT_DYNAMIC_CLASS(wxToolBarTool, wxObject)
403IMPLEMENT_DYNAMIC_CLASS(wxToolBarBase, wxControl)
404
405#include "wx/tbarsmpl.h"
406IMPLEMENT_DYNAMIC_CLASS(wxToolBarSimple, wxToolBarBase)
407
408#ifdef wx_msw
409#include "wx/tbarmsw.h"
410IMPLEMENT_DYNAMIC_CLASS(wxToolBarMSW, wxToolBarBase)
411
412#include "wx/tbar95.h"
413IMPLEMENT_DYNAMIC_CLASS(wxToolBar95, wxToolBarBase)
414#endif
415
416#endif
417
418#include "wx/statusbr.h"
419
420IMPLEMENT_DYNAMIC_CLASS(wxStatusBar, wxWindow)
421
422BEGIN_EVENT_TABLE(wxStatusBar, wxWindow)
423 EVT_PAINT(wxStatusBar::OnPaint)
424 EVT_SYS_COLOUR_CHANGED(wxStatusBar::OnSysColourChanged)
425END_EVENT_TABLE()
426
427#if USE_TIMEDATE
428#include "wx/time.h"
429IMPLEMENT_DYNAMIC_CLASS(wxTime, wxObject)
430#endif
431
432#if !USE_GNU_WXSTRING
433#include "wx/string.h"
434IMPLEMENT_DYNAMIC_CLASS(wxString, wxObject)
435#endif
436
437#ifdef wx_motif
438IMPLEMENT_DYNAMIC_CLASS(wxXColormap, wxObject)
439IMPLEMENT_DYNAMIC_CLASS(wxXFont, wxObject)
440IMPLEMENT_DYNAMIC_CLASS(wxXCursor, wxObject)
441#endif
442IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject)
443IMPLEMENT_DYNAMIC_CLASS(wxPalette, wxGDIObject)
444IMPLEMENT_DYNAMIC_CLASS(wxPen, wxGDIObject)
445IMPLEMENT_DYNAMIC_CLASS(wxBrush, wxGDIObject)
446IMPLEMENT_DYNAMIC_CLASS(wxIcon, wxBitmap)
447IMPLEMENT_DYNAMIC_CLASS(wxCursor, wxBitmap)
448IMPLEMENT_DYNAMIC_CLASS(wxBitmap, wxGDIObject)
449IMPLEMENT_DYNAMIC_CLASS(wxMask, wxObject)
450
451// This will presumably be implemented on other platforms too
452#ifdef wx_msw
453IMPLEMENT_DYNAMIC_CLASS(wxBitmapHandler, wxObject)
454IMPLEMENT_DYNAMIC_CLASS(wxBMPResourceHandler, wxBitmapHandler)
455IMPLEMENT_DYNAMIC_CLASS(wxBMPFileHandler, wxBitmapHandler)
456IMPLEMENT_DYNAMIC_CLASS(wxXPMFileHandler, wxBitmapHandler)
457IMPLEMENT_DYNAMIC_CLASS(wxXPMDataHandler, wxBitmapHandler)
458IMPLEMENT_DYNAMIC_CLASS(wxICOFileHandler, wxBitmapHandler)
459IMPLEMENT_DYNAMIC_CLASS(wxICOResourceHandler, wxBitmapHandler)
460#endif
461
462#include "wx/statbox.h"
463IMPLEMENT_DYNAMIC_CLASS(wxStaticBox, wxControl)
464
465#if USE_IPC
466#include "wx/dde.h"
467IMPLEMENT_ABSTRACT_CLASS(wxDDEObject, wxObject)
468IMPLEMENT_DYNAMIC_CLASS(wxDDEServer, wxDDEObject)
469IMPLEMENT_DYNAMIC_CLASS(wxDDEClient, wxDDEObject)
470IMPLEMENT_CLASS(wxDDEConnection, wxObject)
471#endif
472
473IMPLEMENT_ABSTRACT_CLASS(wxControl, wxWindow)
474
475#include "wx/listbox.h"
476IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl)
477
478IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler)
479
480#include "wx/menu.h"
481IMPLEMENT_DYNAMIC_CLASS(wxMenu, wxWindow)
482IMPLEMENT_DYNAMIC_CLASS(wxMenuItem, wxObject)
483IMPLEMENT_DYNAMIC_CLASS(wxMenuBar, wxWindow)
484
485#include "wx/stattext.h"
486#include "wx/statbmp.h"
487IMPLEMENT_DYNAMIC_CLASS(wxStaticText, wxControl)
488IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap, wxControl)
489
490#if USE_METAFILE
491#include "wx/metafile.h"
492IMPLEMENT_DYNAMIC_CLASS(wxMetaFile, wxObject)
493IMPLEMENT_ABSTRACT_CLASS(wxMetaFileDC, wxDC)
494#endif
495
496#include "wx/radiobox.h"
497#include "wx/radiobut.h"
498IMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl)
499
500IMPLEMENT_DYNAMIC_CLASS(wxRadioButton, wxControl)
501// IMPLEMENT_DYNAMIC_CLASS(wxBitmapRadioButton, wxRadioButton)
502
503#include "wx/scrolbar.h"
504IMPLEMENT_DYNAMIC_CLASS(wxScrollBar, wxControl)
505
506#if WXWIN_COMPATIBILITY
507BEGIN_EVENT_TABLE(wxScrollBar, wxControl)
508 EVT_SCROLL(wxScrollBar::OnScroll)
509END_EVENT_TABLE()
510#endif
511
512#include "wx/slider.h"
513IMPLEMENT_DYNAMIC_CLASS(wxSlider, wxControl)
514
515#if WXWIN_COMPATIBILITY
516BEGIN_EVENT_TABLE(wxSlider, wxControl)
517 EVT_SCROLL(wxSlider::OnScroll)
518END_EVENT_TABLE()
519#endif
520
521#include "wx/timer.h"
522IMPLEMENT_ABSTRACT_CLASS(wxTimer, wxObject)
523
524#include "wx/textctrl.h"
525IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl, wxControl)
526
527#include "wx/window.h"
528IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxEvtHandler)
529
530#include "wx/scrolwin.h"
531IMPLEMENT_DYNAMIC_CLASS(wxScrolledWindow, wxWindow)
532
533#include "wx/panel.h"
534IMPLEMENT_DYNAMIC_CLASS(wxPanel, wxWindow)
535
536#include "wx/msgbxdlg.h"
537#include "wx/textdlg.h"
538#include "wx/filedlg.h"
539#include "wx/dirdlg.h"
540#include "wx/choicdlg.h"
541
542#if !defined(wx_msw) || USE_GENERIC_DIALOGS_IN_MSW
543#include "wx/generic/msgdlgg.h"
544IMPLEMENT_CLASS(wxGenericMessageDialog, wxDialog)
545#endif
546
547IMPLEMENT_CLASS(wxTextEntryDialog, wxDialog)
548IMPLEMENT_CLASS(wxSingleChoiceDialog, wxDialog)
549IMPLEMENT_CLASS(wxFileDialog, wxDialog)
550IMPLEMENT_CLASS(wxDirDialog, wxDialog)
551
552#ifdef wx_msw
553IMPLEMENT_CLASS(wxMessageDialog)
554#endif
555
556#if USE_GAUGE
557#ifdef wx_motif
558#include "../../contrib/xmgauge/gauge.h"
559#endif
560#include "wx_gauge.h"
561IMPLEMENT_DYNAMIC_CLASS(wxGauge, wxControl)
562#endif
563
564#include "wx/grid.h"
565IMPLEMENT_DYNAMIC_CLASS(wxGenericGrid, wxPanel)
566
567///// Event tables (also must be in one, statically-linked file for shared libraries)
568
569// This is the base, wxEvtHandler 'bootstrap' code which is expanded manually here
570const wxEventTable *wxEvtHandler::GetEventTable() const { return &wxEvtHandler::sm_eventTable; }
571
572const wxEventTable wxEvtHandler::sm_eventTable =
573 { NULL, &wxEvtHandler::sm_eventTableEntries[0] };
574
575const wxEventTableEntry wxEvtHandler::sm_eventTableEntries[] = { { 0, 0, 0, NULL } };
576
577BEGIN_EVENT_TABLE(wxFrame, wxWindow)
578 EVT_ACTIVATE(wxFrame::OnActivate)
579 EVT_SIZE(wxFrame::OnSize)
580 EVT_MENU_HIGHLIGHT_ALL(wxFrame::OnMenuHighlight)
581 EVT_SYS_COLOUR_CHANGED(wxFrame::OnSysColourChanged)
582 EVT_IDLE(wxFrame::OnIdle)
583 EVT_CLOSE(wxFrame::OnCloseWindow)
584END_EVENT_TABLE()
585
586BEGIN_EVENT_TABLE(wxDialog, wxPanel)
587 EVT_BUTTON(wxID_OK, wxDialog::OnOK)
588 EVT_BUTTON(wxID_APPLY, wxDialog::OnApply)
589 EVT_BUTTON(wxID_CANCEL, wxDialog::OnCancel)
590 EVT_CHAR_HOOK(wxDialog::OnCharHook)
591 EVT_SYS_COLOUR_CHANGED(wxDialog::OnSysColourChanged)
592 EVT_CLOSE(wxDialog::OnCloseWindow)
593END_EVENT_TABLE()
594
595BEGIN_EVENT_TABLE(wxWindow, wxEvtHandler)
596 EVT_CHAR(wxWindow::OnChar)
597 EVT_SIZE(wxWindow::Size)
598 EVT_ERASE_BACKGROUND(wxWindow::OnEraseBackground)
599 EVT_SYS_COLOUR_CHANGED(wxWindow::OnSysColourChanged)
600 EVT_INIT_DIALOG(wxWindow::OnInitDialog)
601 EVT_IDLE(wxWindow::OnIdle)
602END_EVENT_TABLE()
603
604BEGIN_EVENT_TABLE(wxScrolledWindow, wxWindow)
605 EVT_SCROLL(wxScrolledWindow::OnScroll)
606 EVT_SIZE(wxScrolledWindow::OnSize)
607END_EVENT_TABLE()
608
609BEGIN_EVENT_TABLE(wxPanel, wxWindow)
610 EVT_SYS_COLOUR_CHANGED(wxPanel::OnSysColourChanged)
611END_EVENT_TABLE()
612
613BEGIN_EVENT_TABLE(wxTextCtrl, wxControl)
614 EVT_CHAR(wxTextCtrl::OnChar)
615 EVT_DROP_FILES(wxTextCtrl::OnDropFiles)
616 EVT_ERASE_BACKGROUND(wxTextCtrl::OnEraseBackground)
617END_EVENT_TABLE()
618
619#ifdef wx_msw
620BEGIN_EVENT_TABLE(wxMDIParentWindow, wxFrame)
621 EVT_SIZE(wxMDIParentWindow::OnSize)
622 EVT_ACTIVATE(wxMDIParentWindow::OnActivate)
623 EVT_SYS_COLOUR_CHANGED(wxMDIParentWindow::OnSysColourChanged)
624END_EVENT_TABLE()
625
626BEGIN_EVENT_TABLE(wxMDIClientWindow, wxWindow)
627 EVT_SCROLL(wxMDIClientWindow::OnScroll)
628END_EVENT_TABLE()
629#endif
630
631BEGIN_EVENT_TABLE(wxToolBarBase, wxControl)
632 EVT_SCROLL(wxToolBarBase::OnScroll)
633 EVT_SIZE(wxToolBarBase::OnSize)
634 EVT_IDLE(wxToolBarBase::OnIdle)
635END_EVENT_TABLE()
636
637BEGIN_EVENT_TABLE(wxToolBarSimple, wxToolBarBase)
638 EVT_SIZE(wxToolBarSimple::OnSize)
639 EVT_PAINT(wxToolBarSimple::OnPaint)
640 EVT_KILL_FOCUS(wxToolBarSimple::OnKillFocus)
641 EVT_MOUSE_EVENTS(wxToolBarSimple::OnMouseEvent)
642END_EVENT_TABLE()
643
644#ifdef wx_msw
645BEGIN_EVENT_TABLE(wxToolBarMSW, wxToolBarBase)
646 EVT_SIZE(wxToolBarMSW::OnSize)
647 EVT_PAINT(wxToolBarMSW::OnPaint)
648 EVT_MOUSE_EVENTS(wxToolBarMSW::OnMouseEvent)
649END_EVENT_TABLE()
650
651BEGIN_EVENT_TABLE(wxToolBar95, wxToolBarBase)
652 EVT_SIZE(wxToolBar95::OnSize)
653 EVT_PAINT(wxToolBar95::OnPaint)
654 EVT_KILL_FOCUS(wxToolBar95::OnKillFocus)
655 EVT_MOUSE_EVENTS(wxToolBar95::OnMouseEvent)
656 EVT_SYS_COLOUR_CHANGED(wxToolBar95::OnSysColourChanged)
657END_EVENT_TABLE()
658#endif
659
660BEGIN_EVENT_TABLE(wxGenericGrid, wxPanel)
661 EVT_SIZE(wxGenericGrid::OnSize)
662 EVT_PAINT(wxGenericGrid::OnPaint)
663 EVT_MOUSE_EVENTS(wxGenericGrid::OnMouseEvent)
664 EVT_TEXT(wxGRID_TEXT_CTRL, wxGenericGrid::OnText)
665 EVT_COMMAND_SCROLL(wxGRID_HSCROLL, wxGenericGrid::OnGridScroll)
666 EVT_COMMAND_SCROLL(wxGRID_VSCROLL, wxGenericGrid::OnGridScroll)
667END_EVENT_TABLE()
668
669BEGIN_EVENT_TABLE(wxControl, wxWindow)
670 EVT_ERASE_BACKGROUND(wxControl::OnEraseBackground)
671END_EVENT_TABLE()
672
673#if !defined(wx_msw) || USE_GENERIC_DIALOGS_IN_MSW
674BEGIN_EVENT_TABLE(wxGenericMessageDialog, wxDialog)
675 EVT_BUTTON(wxID_YES, wxGenericMessageDialog::OnYes)
676 EVT_BUTTON(wxID_NO, wxGenericMessageDialog::OnNo)
677 EVT_BUTTON(wxID_CANCEL, wxGenericMessageDialog::OnCancel)
678END_EVENT_TABLE()
679
680BEGIN_EVENT_TABLE(wxGenericColourDialog, wxDialog)
681 EVT_BUTTON(wxID_ADD_CUSTOM, wxGenericColourDialog::OnAddCustom)
682 EVT_SLIDER(wxID_RED_SLIDER, wxGenericColourDialog::OnRedSlider)
683 EVT_SLIDER(wxID_GREEN_SLIDER, wxGenericColourDialog::OnGreenSlider)
684 EVT_SLIDER(wxID_BLUE_SLIDER, wxGenericColourDialog::OnBlueSlider)
685 EVT_PAINT(wxGenericColourDialog::OnPaint)
686 EVT_MOUSE_EVENTS(wxGenericColourDialog::OnMouseEvent)
687END_EVENT_TABLE()
688
689BEGIN_EVENT_TABLE(wxGenericFontDialog, wxDialog)
690 EVT_CHECKBOX(wxID_FONT_UNDERLINE, wxGenericFontDialog::OnChangeFont)
691 EVT_CHOICE(wxID_FONT_STYLE, wxGenericFontDialog::OnChangeFont)
692 EVT_CHOICE(wxID_FONT_WEIGHT, wxGenericFontDialog::OnChangeFont)
693 EVT_CHOICE(wxID_FONT_FAMILY, wxGenericFontDialog::OnChangeFont)
694 EVT_CHOICE(wxID_FONT_COLOUR, wxGenericFontDialog::OnChangeFont)
695 EVT_CHOICE(wxID_FONT_SIZE, wxGenericFontDialog::OnChangeFont)
696 EVT_PAINT(wxGenericFontDialog::OnPaint)
697END_EVENT_TABLE()
698
699BEGIN_EVENT_TABLE(wxGenericPrintDialog, wxDialog)
700 EVT_BUTTON(wxID_OK, wxGenericPrintDialog::OnOK)
701 EVT_BUTTON(wxPRINTID_SETUP, wxGenericPrintDialog::OnSetup)
702 EVT_RADIOBOX(wxPRINTID_RANGE, wxGenericPrintDialog::OnRange)
703END_EVENT_TABLE()
704
705#endif
706
707BEGIN_EVENT_TABLE(wxTextEntryDialog, wxDialog)
708 EVT_BUTTON(wxID_OK, wxTextEntryDialog::OnOK)
709END_EVENT_TABLE()
710
711BEGIN_EVENT_TABLE(wxSingleChoiceDialog, wxDialog)
712 EVT_BUTTON(wxID_OK, wxSingleChoiceDialog::OnOK)
713END_EVENT_TABLE()
714
715#include "wx/prntbase.h"
716
717BEGIN_EVENT_TABLE(wxPrintAbortDialog, wxDialog)
718 EVT_BUTTON(wxID_CANCEL, wxPrintAbortDialog::OnCancel)
719END_EVENT_TABLE()
720
721BEGIN_EVENT_TABLE(wxPreviewControlBar, wxWindow)
722 EVT_BUTTON(wxID_PREVIEW_CLOSE, wxPreviewControlBar::OnClose)
723 EVT_BUTTON(wxID_PREVIEW_PRINT, wxPreviewControlBar::OnPrint)
724 EVT_BUTTON(wxID_PREVIEW_PREVIOUS, wxPreviewControlBar::OnPrevious)
725 EVT_BUTTON(wxID_PREVIEW_NEXT, wxPreviewControlBar::OnNext)
726 EVT_CHOICE(wxID_PREVIEW_ZOOM, wxPreviewControlBar::OnZoom)
727END_EVENT_TABLE()
728
729#endif
730
731
732const wxSize wxDefaultSize(-1, -1);
733const wxPoint wxDefaultPosition(-1, -1);