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