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