]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/generic/choicdgg.h
Quick hack to rid the code of wxDIALOG_MODAL
[wxWidgets.git] / include / wx / generic / choicdgg.h
index ff12c18d9233fd127ba9997dd65dbdee499e8253..3038a2dff58e85a249c828e4fb425fa16317769c 100644 (file)
@@ -12,7 +12,7 @@
 #ifndef __CHOICEDLGH_G__
 #define __CHOICEDLGH_G__
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma interface "choicdgg.h"
 #endif
 
@@ -28,7 +28,8 @@ class WXDLLEXPORT wxListBox;
 #define wxCHOICE_HEIGHT 150
 #define wxCHOICE_WIDTH 200
 
-#define wxCHOICEDLG_STYLE (wxDEFAULT_DIALOG_STYLE|wxOK | wxCANCEL | wxCENTRE)
+#define wxCHOICEDLG_STYLE \
+    (wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxOK | wxCANCEL | wxCENTRE)
 
 // ----------------------------------------------------------------------------
 // wxAnyChoiceDialog: a base class for dialogs containing a listbox
@@ -50,6 +51,17 @@ public:
         (void)Create(parent, message, caption, n, choices,
                      styleDlg, pos, styleLbox);
     }
+    wxAnyChoiceDialog(wxWindow *parent,
+                      const wxString& message,
+                      const wxString& caption,
+                      const wxArrayString& choices,
+                      long styleDlg = wxCHOICEDLG_STYLE,
+                      const wxPoint& pos = wxDefaultPosition,
+                      long styleLbox = wxLB_ALWAYS_SB)
+    {
+        (void)Create(parent, message, caption, choices,
+                     styleDlg, pos, styleLbox);
+    }
 
     bool Create(wxWindow *parent,
                 const wxString& message,
@@ -58,9 +70,18 @@ public:
                 long styleDlg = wxCHOICEDLG_STYLE,
                 const wxPoint& pos = wxDefaultPosition,
                 long styleLbox = wxLB_ALWAYS_SB);
+    bool Create(wxWindow *parent,
+                const wxString& message,
+                const wxString& caption,
+                const wxArrayString& choices,
+                long styleDlg = wxCHOICEDLG_STYLE,
+                const wxPoint& pos = wxDefaultPosition,
+                long styleLbox = wxLB_ALWAYS_SB);
 
 protected:
     wxListBox  *m_listbox;
+
+    DECLARE_NO_COPY_CLASS(wxAnyChoiceDialog)
 };
 
 // ----------------------------------------------------------------------------
@@ -83,6 +104,13 @@ public:
                          char **clientData = (char **)NULL,
                          long style = wxCHOICEDLG_STYLE,
                          const wxPoint& pos = wxDefaultPosition);
+    wxSingleChoiceDialog(wxWindow *parent,
+                         const wxString& message,
+                         const wxString& caption,
+                         const wxArrayString& choices,
+                         char **clientData = (char **)NULL,
+                         long style = wxCHOICEDLG_STYLE,
+                         const wxPoint& pos = wxDefaultPosition);
 
     bool Create(wxWindow *parent,
                 const wxString& message,
@@ -92,6 +120,13 @@ public:
                 char **clientData = (char **)NULL,
                 long style = wxCHOICEDLG_STYLE,
                 const wxPoint& pos = wxDefaultPosition);
+    bool Create(wxWindow *parent,
+                const wxString& message,
+                const wxString& caption,
+                const wxArrayString& choices,
+                char **clientData = (char **)NULL,
+                long style = wxCHOICEDLG_STYLE,
+                const wxPoint& pos = wxDefaultPosition);
 
     void SetSelection(int sel);
     int GetSelection() const { return m_selection; }
@@ -104,31 +139,12 @@ public:
     void OnOK(wxCommandEvent& event);
     void OnListBoxDClick(wxCommandEvent& event);
 
-    // old, deprecated methods
-#ifdef WXWIN_COMPATIBILITY_2
-    wxSingleChoiceDialog(wxWindow *parent,
-                         const wxString& message,
-                         const wxString& caption,
-                         const wxStringList& choices,
-                         char **clientData = (char **)NULL,
-                         long style = wxCHOICEDLG_STYLE,
-                         const wxPoint& pos = wxDefaultPosition);
-
-    bool Create(wxWindow *parent,
-                const wxString& message,
-                const wxString& caption,
-                const wxStringList& choices,
-                char **clientData = (char **)NULL,
-                long style = wxCHOICEDLG_STYLE,
-                const wxPoint& pos = wxDefaultPosition);
-#endif // WXWIN_COMPATIBILITY_2
-
 protected:
     int         m_selection;
     wxString    m_stringSelection;
 
 private:
-    DECLARE_DYNAMIC_CLASS(wxSingleChoiceDialog)
+    DECLARE_DYNAMIC_CLASS_NO_COPY(wxSingleChoiceDialog)
     DECLARE_EVENT_TABLE()
 };
 
@@ -151,6 +167,15 @@ public:
     {
         (void)Create(parent, message, caption, n, choices, style, pos);
     }
+    wxMultiChoiceDialog(wxWindow *parent,
+                        const wxString& message,
+                        const wxString& caption,
+                        const wxArrayString& choices,
+                        long style = wxCHOICEDLG_STYLE,
+                        const wxPoint& pos = wxDefaultPosition)
+    {
+        (void)Create(parent, message, caption, choices, style, pos);
+    }
 
     bool Create(wxWindow *parent,
                 const wxString& message,
@@ -159,19 +184,24 @@ public:
                 const wxString *choices,
                 long style = wxCHOICEDLG_STYLE,
                 const wxPoint& pos = wxDefaultPosition);
+    bool Create(wxWindow *parent,
+                const wxString& message,
+                const wxString& caption,
+                const wxArrayString& choices,
+                long style = wxCHOICEDLG_STYLE,
+                const wxPoint& pos = wxDefaultPosition);
 
     void SetSelections(const wxArrayInt& selections);
     wxArrayInt GetSelections() const { return m_selections; }
 
     // implementation from now on
-    void OnOK(wxCommandEvent& event);
+    virtual bool TransferDataFromWindow();
 
 protected:
     wxArrayInt m_selections;
 
 private:
-    DECLARE_DYNAMIC_CLASS(wxMultiChoiceDialog)
-    DECLARE_EVENT_TABLE()
+    DECLARE_DYNAMIC_CLASS_NO_COPY(wxMultiChoiceDialog)
 };
 
 // ----------------------------------------------------------------------------
@@ -267,41 +297,5 @@ WXDLLEXPORT size_t wxGetMultipleChoices(wxArrayInt& selections,
                                         int width = wxCHOICE_WIDTH,
                                         int height = wxCHOICE_HEIGHT);
 
-// ----------------------------------------------------------------------------
-// these methods are for backwards compatibility only, not documented and
-// deprecated
-// ----------------------------------------------------------------------------
-
-WXDLLEXPORT wxString wxGetSingleChoice(const wxString& message,
-                                       const wxString& caption,
-                                       int n, wxChar *choices[],
-                                       wxWindow *parent = (wxWindow *) NULL,
-                                       int x = -1,
-                                       int y = -1,
-                                       bool centre = TRUE,
-                                       int width = wxCHOICE_WIDTH,
-                                       int height = wxCHOICE_HEIGHT);
-
-WXDLLEXPORT int wxGetSingleChoiceIndex(const wxString& message,
-                                       const wxString& caption,
-                                       int n, wxChar *choices[],
-                                       wxWindow *parent = (wxWindow *) NULL,
-                                       int x = -1,
-                                       int y = -1,
-                                       bool centre = TRUE,
-                                       int width = wxCHOICE_WIDTH,
-                                       int height = wxCHOICE_HEIGHT);
-
-WXDLLEXPORT void* wxGetSingleChoiceData(const wxString& message,
-                                        const wxString& caption,
-                                        int n, wxChar **choices,
-                                        void **client_data,
-                                        wxWindow *parent = (wxWindow *) NULL,
-                                        int x = -1, int y = -1,
-                                        bool centre = TRUE,
-                                        int width = wxCHOICE_WIDTH,
-                                        int height = wxCHOICE_HEIGHT);
-
-
 #endif // __CHOICEDLGH_G__