]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/data.cpp
Removal of previous wxValidtor code for wxOS2
[wxWidgets.git] / src / msw / data.cpp
index a5df2d6ecc9b2bc956f1c847fb966eb3e0fe14ef..616d416e36571ee469343da2da1e4a4ef72fa71a 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     01/02/97
 // RCS-ID:      $Id$
 // Copyright:   (c) Julian Smart and Markus Holzem
-// Licence:    wxWindows licence
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 #ifdef __GNUG__
 #include "wx/wx.h"
 #endif
 
+#include "wx/prntbase.h"
+
 #define _MAXPATHLEN 500
 
 // Useful buffer, initialized in wxCommonInit
-char *wxBuffer = NULL;
+wxChar *wxBuffer = NULL;
 
 // Windows List
-wxList wxTopLevelWindows;
+wxWindowList wxTopLevelWindows;
 
 // List of windows pending deletion
-wxList wxPendingDelete;
+wxList WXDLLEXPORT wxPendingDelete;
 
 // Current cursor, in order to hang on to
 // cursor handle when setting the cursor globally
@@ -110,51 +112,49 @@ wxFont   wxNullFont;
 wxColour wxNullColour;
 
 // Default window names
-const char *wxButtonNameStr = "button";
-const char *wxCanvasNameStr = "canvas";
-const char *wxCheckBoxNameStr = "check";
-const char *wxChoiceNameStr = "choice";
-const char *wxComboBoxNameStr = "comboBox";
-const char *wxDialogNameStr = "dialog";
-const char *wxFrameNameStr = "frame";
-const char *wxGaugeNameStr = "gauge";
-const char *wxStaticBoxNameStr = "groupBox";
-const char *wxListBoxNameStr = "listBox";
-const char *wxStaticTextNameStr = "message";
-const char *wxStaticBitmapNameStr = "message";
-const char *wxMultiTextNameStr = "multitext";
-const char *wxPanelNameStr = "panel";
-const char *wxRadioBoxNameStr = "radioBox";
-const char *wxRadioButtonNameStr = "radioButton";
-const char *wxBitmapRadioButtonNameStr = "radioButton";
-const char *wxScrollBarNameStr = "scrollBar";
-const char *wxSliderNameStr = "slider";
-const char *wxStaticNameStr = "static";
-const char *wxTextCtrlWindowNameStr = "textWindow";
-const char *wxTextCtrlNameStr = "text";
-const char *wxVirtListBoxNameStr = "virtListBox";
-const char *wxButtonBarNameStr = "buttonbar";
-const char *wxEnhDialogNameStr = "Shell";
-const char *wxToolBarNameStr = "toolbar";
-const char *wxStatusLineNameStr = "status_line";
-const char *wxEmptyString = "";
-const char *wxGetTextFromUserPromptStr = "Input Text";
-const char *wxMessageBoxCaptionStr = "Message";
-const char *wxFileSelectorPromptStr = "Select a file";
-const char *wxFileSelectorDefaultWildcardStr = "*.*";
-const char *wxInternalErrorStr = "wxWindows Internal Error";
-const char *wxFatalErrorStr = "wxWindows Fatal Error";
+const wxChar *wxButtonNameStr = wxT("button");
+const wxChar *wxCanvasNameStr = wxT("canvas");
+const wxChar *wxCheckBoxNameStr = wxT("check");
+const wxChar *wxChoiceNameStr = wxT("choice");
+const wxChar *wxComboBoxNameStr = wxT("comboBox");
+const wxChar *wxDialogNameStr = wxT("dialog");
+const wxChar *wxFrameNameStr = wxT("frame");
+const wxChar *wxGaugeNameStr = wxT("gauge");
+const wxChar *wxStaticBoxNameStr = wxT("groupBox");
+const wxChar *wxListBoxNameStr = wxT("listBox");
+const wxChar *wxStaticTextNameStr = wxT("message");
+const wxChar *wxStaticBitmapNameStr = wxT("message");
+const wxChar *wxMultiTextNameStr = wxT("multitext");
+const wxChar *wxPanelNameStr = wxT("panel");
+const wxChar *wxRadioBoxNameStr = wxT("radioBox");
+const wxChar *wxRadioButtonNameStr = wxT("radioButton");
+const wxChar *wxBitmapRadioButtonNameStr = wxT("radioButton");
+const wxChar *wxScrollBarNameStr = wxT("scrollBar");
+const wxChar *wxSliderNameStr = wxT("slider");
+const wxChar *wxStaticNameStr = wxT("static");
+const wxChar *wxTextCtrlWindowNameStr = wxT("textWindow");
+const wxChar *wxTextCtrlNameStr = wxT("text");
+const wxChar *wxVirtListBoxNameStr = wxT("virtListBox");
+const wxChar *wxButtonBarNameStr = wxT("buttonbar");
+const wxChar *wxEnhDialogNameStr = wxT("Shell");
+const wxChar *wxToolBarNameStr = wxT("toolbar");
+const wxChar *wxStatusLineNameStr = wxT("status_line");
+const wxChar *wxGetTextFromUserPromptStr = wxT("Input Text");
+const wxChar *wxMessageBoxCaptionStr = wxT("Message");
+const wxChar *wxFileSelectorPromptStr = wxT("Select a file");
+const wxChar *wxFileSelectorDefaultWildcardStr = wxT("*.*");
+const wxChar *wxInternalErrorStr = wxT("wxWindows Internal Error");
+const wxChar *wxFatalErrorStr = wxT("wxWindows Fatal Error");
+const wxChar *wxTreeCtrlNameStr = wxT("treeCtrl");
+const wxChar *wxDirDialogNameStr = wxT("wxDirCtrl");
+const wxChar *wxDirDialogDefaultFolderStr = wxT("/");
 
 // See wx/utils.h
-const char *wxFloatToStringStr = "%.2f";
-const char *wxDoubleToStringStr = "%.2f";
+const wxChar *wxFloatToStringStr = wxT("%.2f");
+const wxChar *wxDoubleToStringStr = wxT("%.2f");
 
 #ifdef __WXMSW__
-const char *wxUserResourceStr = "TEXT";
-#endif
-
-#if wxUSE_POSTSCRIPT
-wxPrintPaperDatabase* wxThePrintPaperDatabase = NULL;
+const wxChar *wxUserResourceStr = wxT("TEXT");
 #endif
 
 #if wxUSE_SHARED_LIBRARY
@@ -197,11 +197,11 @@ IMPLEMENT_DYNAMIC_CLASS(wxComboBox, wxControl)
 #include "wx/dcclient.h"
 #include "wx/dcscreen.h"
 IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject)
-IMPLEMENT_DYNAMIC_CLASS(wxClientDC, wxDC)
 IMPLEMENT_DYNAMIC_CLASS(wxWindowDC, wxDC)
-IMPLEMENT_DYNAMIC_CLASS(wxPaintDC, wxDC)
-IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC, wxDC)
+IMPLEMENT_DYNAMIC_CLASS(wxPaintDC, wxWindowDC)
+IMPLEMENT_DYNAMIC_CLASS(wxClientDC, wxWindowDC)
 IMPLEMENT_DYNAMIC_CLASS(wxScreenDC, wxWindowDC)
+IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC, wxDC)
 
 #if defined(__WXMSW__)
 #include "wx/dcprint.h"
@@ -313,13 +313,14 @@ IMPLEMENT_CLASS(wxGenericPrintSetupDialog, wxDialog)
 #endif
 
 #if wxUSE_POSTSCRIPT
-#include "wx/postscrp.h"
+#include "wx/dcps.h"
 IMPLEMENT_DYNAMIC_CLASS(wxPostScriptDC, wxDC)
 IMPLEMENT_DYNAMIC_CLASS(wxPrintSetupData, wxObject)
 IMPLEMENT_DYNAMIC_CLASS(wxPageSetupData, wxObject)
+#endif
+
 IMPLEMENT_DYNAMIC_CLASS(wxPrintPaperType, wxObject)
 IMPLEMENT_DYNAMIC_CLASS(wxPrintPaperDatabase, wxList)
-#endif
 
 #if wxUSE_WX_RESOURCES
 #include "wx/resource.h"
@@ -331,6 +332,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxResourceTable, wxHashTable)
 IMPLEMENT_DYNAMIC_CLASS(wxEvtHandler, wxObject)
 IMPLEMENT_ABSTRACT_CLASS(wxEvent, wxObject)
 IMPLEMENT_DYNAMIC_CLASS(wxCommandEvent, wxEvent)
+IMPLEMENT_DYNAMIC_CLASS(wxNotifyEvent, wxCommandEvent)
 IMPLEMENT_DYNAMIC_CLASS(wxScrollEvent, wxCommandEvent)
 IMPLEMENT_DYNAMIC_CLASS(wxMouseEvent, wxEvent)
 IMPLEMENT_DYNAMIC_CLASS(wxKeyEvent, wxEvent)
@@ -409,6 +411,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxToolBar95, wxToolBarBase)
 
 #endif
 
+#if wxUSE_SOCKETS
+
 #include "wx/sckaddr.h"
 
 IMPLEMENT_DYNAMIC_CLASS(wxIPV4address, wxSockAddress)
@@ -453,12 +457,14 @@ IMPLEMENT_DYNAMIC_CLASS(wxTCPServer, wxServerBase)
 IMPLEMENT_DYNAMIC_CLASS(wxTCPClient, wxClientBase)
 IMPLEMENT_DYNAMIC_CLASS(wxTCPConnection, wxConnectionBase)
 
+#endif
+
 #include "wx/statusbr.h"
 
 IMPLEMENT_DYNAMIC_CLASS(wxStatusBar, wxWindow)
 
 BEGIN_EVENT_TABLE(wxStatusBar, wxWindow)
-       EVT_PAINT(wxStatusBar::OnPaint)
+    EVT_PAINT(wxStatusBar::OnPaint)
     EVT_SYS_COLOUR_CHANGED(wxStatusBar::OnSysColourChanged)
 END_EVENT_TABLE()
 
@@ -614,14 +620,14 @@ IMPLEMENT_DYNAMIC_CLASS(wxGenericGrid, wxPanel)
 const wxEventTable *wxEvtHandler::GetEventTable() const { return &wxEvtHandler::sm_eventTable; }
 
 const wxEventTable wxEvtHandler::sm_eventTable =
-       { NULL, &wxEvtHandler::sm_eventTableEntries[0] };
+    { NULL, &wxEvtHandler::sm_eventTableEntries[0] };
 
 const wxEventTableEntry wxEvtHandler::sm_eventTableEntries[] = { { 0, 0, 0, NULL } };
 
 BEGIN_EVENT_TABLE(wxFrame, wxWindow)
-       EVT_ACTIVATE(wxFrame::OnActivate)
-       EVT_SIZE(wxFrame::OnSize)
-       EVT_MENU_HIGHLIGHT_ALL(wxFrame::OnMenuHighlight)
+    EVT_ACTIVATE(wxFrame::OnActivate)
+    EVT_SIZE(wxFrame::OnSize)
+    EVT_MENU_HIGHLIGHT_ALL(wxFrame::OnMenuHighlight)
     EVT_SYS_COLOUR_CHANGED(wxFrame::OnSysColourChanged)
     EVT_IDLE(wxFrame::OnIdle)
     EVT_CLOSE(wxFrame::OnCloseWindow)
@@ -656,9 +662,8 @@ BEGIN_EVENT_TABLE(wxPanel, wxWindow)
 END_EVENT_TABLE()
 
 BEGIN_EVENT_TABLE(wxTextCtrl, wxControl)
-       EVT_CHAR(wxTextCtrl::OnChar)
-       EVT_DROP_FILES(wxTextCtrl::OnDropFiles)
-       EVT_ERASE_BACKGROUND(wxTextCtrl::OnEraseBackground)
+    EVT_CHAR(wxTextCtrl::OnChar)
+    EVT_DROP_FILES(wxTextCtrl::OnDropFiles)
 END_EVENT_TABLE()
 
 #ifdef __WXMSW__
@@ -680,32 +685,32 @@ BEGIN_EVENT_TABLE(wxToolBarBase, wxControl)
 END_EVENT_TABLE()
 
 BEGIN_EVENT_TABLE(wxToolBarSimple, wxToolBarBase)
-       EVT_SIZE(wxToolBarSimple::OnSize)
-       EVT_PAINT(wxToolBarSimple::OnPaint)
-       EVT_KILL_FOCUS(wxToolBarSimple::OnKillFocus)
-       EVT_MOUSE_EVENTS(wxToolBarSimple::OnMouseEvent)
+    EVT_SIZE(wxToolBarSimple::OnSize)
+    EVT_PAINT(wxToolBarSimple::OnPaint)
+    EVT_KILL_FOCUS(wxToolBarSimple::OnKillFocus)
+    EVT_MOUSE_EVENTS(wxToolBarSimple::OnMouseEvent)
 END_EVENT_TABLE()
 
 #ifdef __WXMSW__
 BEGIN_EVENT_TABLE(wxToolBarMSW, wxToolBarBase)
-       EVT_SIZE(wxToolBarMSW::OnSize)
-       EVT_PAINT(wxToolBarMSW::OnPaint)
-       EVT_MOUSE_EVENTS(wxToolBarMSW::OnMouseEvent)
+    EVT_SIZE(wxToolBarMSW::OnSize)
+    EVT_PAINT(wxToolBarMSW::OnPaint)
+    EVT_MOUSE_EVENTS(wxToolBarMSW::OnMouseEvent)
 END_EVENT_TABLE()
 
 BEGIN_EVENT_TABLE(wxToolBar95, wxToolBarBase)
-       EVT_SIZE(wxToolBar95::OnSize)
-       EVT_PAINT(wxToolBar95::OnPaint)
-       EVT_KILL_FOCUS(wxToolBar95::OnKillFocus)
-       EVT_MOUSE_EVENTS(wxToolBar95::OnMouseEvent)
+    EVT_SIZE(wxToolBar95::OnSize)
+    EVT_PAINT(wxToolBar95::OnPaint)
+    EVT_KILL_FOCUS(wxToolBar95::OnKillFocus)
+    EVT_MOUSE_EVENTS(wxToolBar95::OnMouseEvent)
     EVT_SYS_COLOUR_CHANGED(wxToolBar95::OnSysColourChanged)
 END_EVENT_TABLE()
 #endif
 
 BEGIN_EVENT_TABLE(wxGenericGrid, wxPanel)
-       EVT_SIZE(wxGenericGrid::OnSize)
-       EVT_PAINT(wxGenericGrid::OnPaint)
-       EVT_MOUSE_EVENTS(wxGenericGrid::OnMouseEvent)
+    EVT_SIZE(wxGenericGrid::OnSize)
+    EVT_PAINT(wxGenericGrid::OnPaint)
+    EVT_MOUSE_EVENTS(wxGenericGrid::OnMouseEvent)
     EVT_TEXT(wxGRID_TEXT_CTRL, wxGenericGrid::OnText)
     EVT_COMMAND_SCROLL(wxGRID_HSCROLL, wxGenericGrid::OnGridScroll)
     EVT_COMMAND_SCROLL(wxGRID_VSCROLL, wxGenericGrid::OnGridScroll)
@@ -717,28 +722,28 @@ END_EVENT_TABLE()
 
 #if !defined(__WXMSW__) || wxUSE_GENERIC_DIALOGS_IN_MSW
 BEGIN_EVENT_TABLE(wxGenericMessageDialog, wxDialog)
-       EVT_BUTTON(wxID_YES, wxGenericMessageDialog::OnYes)
-       EVT_BUTTON(wxID_NO, wxGenericMessageDialog::OnNo)
-       EVT_BUTTON(wxID_CANCEL, wxGenericMessageDialog::OnCancel)
+    EVT_BUTTON(wxID_YES, wxGenericMessageDialog::OnYes)
+    EVT_BUTTON(wxID_NO, wxGenericMessageDialog::OnNo)
+    EVT_BUTTON(wxID_CANCEL, wxGenericMessageDialog::OnCancel)
 END_EVENT_TABLE()
 
 BEGIN_EVENT_TABLE(wxGenericColourDialog, wxDialog)
-       EVT_BUTTON(wxID_ADD_CUSTOM, wxGenericColourDialog::OnAddCustom)
-       EVT_SLIDER(wxID_RED_SLIDER, wxGenericColourDialog::OnRedSlider)
-       EVT_SLIDER(wxID_GREEN_SLIDER, wxGenericColourDialog::OnGreenSlider)
-       EVT_SLIDER(wxID_BLUE_SLIDER, wxGenericColourDialog::OnBlueSlider)
-       EVT_PAINT(wxGenericColourDialog::OnPaint)
-       EVT_MOUSE_EVENTS(wxGenericColourDialog::OnMouseEvent)
+    EVT_BUTTON(wxID_ADD_CUSTOM, wxGenericColourDialog::OnAddCustom)
+    EVT_SLIDER(wxID_RED_SLIDER, wxGenericColourDialog::OnRedSlider)
+    EVT_SLIDER(wxID_GREEN_SLIDER, wxGenericColourDialog::OnGreenSlider)
+    EVT_SLIDER(wxID_BLUE_SLIDER, wxGenericColourDialog::OnBlueSlider)
+    EVT_PAINT(wxGenericColourDialog::OnPaint)
+    EVT_MOUSE_EVENTS(wxGenericColourDialog::OnMouseEvent)
 END_EVENT_TABLE()
 
 BEGIN_EVENT_TABLE(wxGenericFontDialog, wxDialog)
-       EVT_CHECKBOX(wxID_FONT_UNDERLINE, wxGenericFontDialog::OnChangeFont)
-       EVT_CHOICE(wxID_FONT_STYLE, wxGenericFontDialog::OnChangeFont)
-       EVT_CHOICE(wxID_FONT_WEIGHT, wxGenericFontDialog::OnChangeFont)
-       EVT_CHOICE(wxID_FONT_FAMILY, wxGenericFontDialog::OnChangeFont)
-       EVT_CHOICE(wxID_FONT_COLOUR, wxGenericFontDialog::OnChangeFont)
-       EVT_CHOICE(wxID_FONT_SIZE, wxGenericFontDialog::OnChangeFont)
-       EVT_PAINT(wxGenericFontDialog::OnPaint)
+    EVT_CHECKBOX(wxID_FONT_UNDERLINE, wxGenericFontDialog::OnChangeFont)
+    EVT_CHOICE(wxID_FONT_STYLE, wxGenericFontDialog::OnChangeFont)
+    EVT_CHOICE(wxID_FONT_WEIGHT, wxGenericFontDialog::OnChangeFont)
+    EVT_CHOICE(wxID_FONT_FAMILY, wxGenericFontDialog::OnChangeFont)
+    EVT_CHOICE(wxID_FONT_COLOUR, wxGenericFontDialog::OnChangeFont)
+    EVT_CHOICE(wxID_FONT_SIZE, wxGenericFontDialog::OnChangeFont)
+    EVT_PAINT(wxGenericFontDialog::OnPaint)
 END_EVENT_TABLE()
 
 BEGIN_EVENT_TABLE(wxGenericPrintDialog, wxDialog)
@@ -750,25 +755,25 @@ END_EVENT_TABLE()
 #endif
 
 BEGIN_EVENT_TABLE(wxTextEntryDialog, wxDialog)
-       EVT_BUTTON(wxID_OK, wxTextEntryDialog::OnOK)
+    EVT_BUTTON(wxID_OK, wxTextEntryDialog::OnOK)
 END_EVENT_TABLE()
 
 BEGIN_EVENT_TABLE(wxSingleChoiceDialog, wxDialog)
-       EVT_BUTTON(wxID_OK, wxSingleChoiceDialog::OnOK)
+    EVT_BUTTON(wxID_OK, wxSingleChoiceDialog::OnOK)
 END_EVENT_TABLE()
 
 #include "wx/prntbase.h"
 
 BEGIN_EVENT_TABLE(wxPrintAbortDialog, wxDialog)
-       EVT_BUTTON(wxID_CANCEL, wxPrintAbortDialog::OnCancel)
+    EVT_BUTTON(wxID_CANCEL, wxPrintAbortDialog::OnCancel)
 END_EVENT_TABLE()
 
 BEGIN_EVENT_TABLE(wxPreviewControlBar, wxWindow)
-       EVT_BUTTON(wxID_PREVIEW_CLOSE,          wxPreviewControlBar::OnClose)
-       EVT_BUTTON(wxID_PREVIEW_PRINT,          wxPreviewControlBar::OnPrint)
-       EVT_BUTTON(wxID_PREVIEW_PREVIOUS,       wxPreviewControlBar::OnPrevious)
-       EVT_BUTTON(wxID_PREVIEW_NEXT,           wxPreviewControlBar::OnNext)
-       EVT_CHOICE(wxID_PREVIEW_ZOOM,           wxPreviewControlBar::OnZoom)
+    EVT_BUTTON(wxID_PREVIEW_CLOSE,         wxPreviewControlBar::OnClose)
+    EVT_BUTTON(wxID_PREVIEW_PRINT,         wxPreviewControlBar::OnPrint)
+    EVT_BUTTON(wxID_PREVIEW_PREVIOUS,     wxPreviewControlBar::OnPrevious)
+    EVT_BUTTON(wxID_PREVIEW_NEXT,         wxPreviewControlBar::OnNext)
+    EVT_CHOICE(wxID_PREVIEW_ZOOM,         wxPreviewControlBar::OnZoom)
 END_EVENT_TABLE()
 
 #endif