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