Update of /cvsroot/mahogany/M/include/gui
In directory usw-pr-cvs1:/tmp/cvs-serv323/include/gui

Modified Files:
        wxDialogLayout.h 
Log Message:
extracted some CreateXXX() methods from wxEnhancedPanel to the global scope to make it 
possible to use them directly in the dialog creation code

Index: wxDialogLayout.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/gui/wxDialogLayout.h,v
retrieving revision 1.59
retrieving revision 1.60
diff -b -u -2 -r1.59 -r1.60
--- wxDialogLayout.h    4 Jul 2002 15:13:11 -0000       1.59
+++ wxDialogLayout.h    2 Sep 2002 18:39:03 -0000       1.60
@@ -47,4 +47,35 @@
 class WXDLLEXPORT wxComboBox;
 
+// ----------------------------------------------------------------------------
+// constants
+// ----------------------------------------------------------------------------
+
+/// flags for CreateFileEntry()
+enum
+{
+   FileEntry_Open = 0,
+   FileEntry_Save = 1,
+   FileEntry_ExistingOnly = 2       // makes sense with Open only
+};
+
+/// the kinds of browse buttons created by CreateEntryWithButton()
+enum BtnKind
+{
+   // the following 3 values must be consecutive, GetBtnType() relies on it
+   FileBtn,             // open an existing file
+   FileNewBtn,          // choose any file (might not exist)
+   FileSaveBtn,         // save to a file
+
+   // the following 3 values must be consecutive, GetBtnType() relies on it
+   FileOrDirBtn,        // open an existing file or directory
+   FileOrDirNewBtn,     // choose any file or directory
+   FileOrDirSaveBtn,    // save to a file or directory
+
+   DirBtn,              // choose a directory
+   ColorBtn,            // choose a colour
+   FontBtn,             // choose a font
+   FolderBtn            // choose a folder
+};
+
 // =============================================================================
 // GUI classes declared in this file
@@ -338,5 +369,5 @@
                                   long widthMax,
                                   wxControl *last,
-                                  size_t nRightMargin = 0);
+                                  wxCoord nRightMargin = 0);
 
       // a radiobox, the entries are taken from the label string which is
@@ -345,12 +376,12 @@
                               long widthMax,
                               wxControl *last,
-                              size_t nRightMargin = 0);
+                              wxCoord nRightMargin = 0);
 
       // nRightMargin is the distance to the right edge of the panel to leave
-      // (0 means deafult)
+      // (0 means default)
    wxTextCtrl *CreateTextWithLabel(const char *label,
                                    long widthMax,
                                    wxControl *last,
-                                   size_t nRightMargin = 0,
+                                   wxCoord nRightMargin = 0,
                                    int style = wxALIGN_RIGHT);
 
@@ -363,5 +394,5 @@
                               long widthMax,
                               wxControl *last,
-                              size_t nRightMargin = 0)
+                              wxCoord nRightMargin = 0)
    {
       return (wxComboBox *)CreateComboBoxOrChoice(TRUE, label, widthMax,
@@ -374,5 +405,5 @@
                           long widthMax,
                           wxControl *last,
-                          size_t nRightMargin = 0)
+                          wxCoord nRightMargin = 0)
    {
       return (wxChoice *)CreateComboBoxOrChoice(FALSE, label, widthMax,
@@ -493,5 +524,5 @@
    }
 
-   // forces a call to layout() to get everything nicely laid out
+   // forces a call to Layout() to get everything nicely laid out
    virtual bool Layout() { return DoLayout(GetClientSize()); }
 
@@ -508,23 +539,4 @@
                          size_t extraSpace = 0);
 
-   // create an entry with a browse button
-   enum BtnKind
-   {
-      // the following 3 values must be consecutive, GetBtnType() relies on it
-      FileBtn,             // open an existing file
-      FileNewBtn,          // choose any file (might not exist)
-      FileSaveBtn,         // save to a file
-
-      // the following 3 values must be consecutive, GetBtnType() relies on it
-      FileOrDirBtn,        // open an existing file or directory
-      FileOrDirNewBtn,     // choose any file or directory
-      FileOrDirSaveBtn,    // save to a file or directory
-
-      DirBtn,              // choose a directory
-      ColorBtn,            // choose a colour
-      FontBtn,             // choose a font
-      FolderBtn            // choose a folder
-   };
-
    // return the right btn type for the given "base" type and parameters
    static BtnKind GetBtnType(BtnKind base, bool open, bool existing)
@@ -554,5 +566,5 @@
                                      long widthMax,
                                      wxControl *last,
-                                     size_t nRightMargin = 0);
+                                     wxCoord nRightMargin = 0);
 
    // event handlers
@@ -611,5 +623,5 @@
 
 // =============================================================================
-// helper functions
+// helper functions to create/layout controls
 // =============================================================================
 
@@ -617,4 +629,36 @@
 // for font calculations)
 extern long GetMaxLabelWidth(const wxArrayString& labels, wxWindow *win);
+
+// all these functions correspond to the wxEnhancedPanel methods except that
+// they take an additional parent parameter
+extern wxTextCtrl *CreateTextWithLabel(wxWindow *parent,
+                                       const char *label,
+                                       long widthMax,
+                                       wxControl *last,
+                                       wxCoord nRightMargin = 0,
+                                       int style = wxALIGN_RIGHT);
+
+extern wxRadioBox *CreateRadioBox(wxWindow *parent,
+                                  const char *label,
+                                  long widthMax,
+                                  wxControl *last,
+                                  wxCoord nRightMargin = 0);
+
+extern wxTextCtrl *CreateEntryWithButton(wxWindow *parent,
+                                         const char *label,
+                                         long widthMax,
+                                         wxControl *last,
+                                         wxCoord nRightMargin = 0,
+                                         BtnKind kind = FileBtn,
+                                         wxTextBrowseButton **ppButton = NULL);
+
+extern wxTextCtrl *CreateFileEntry(wxWindow *parent,
+                                   const char *label,
+                                   long widthMax,
+                                   wxControl *last,
+                                   wxCoord nRightMargin = 0,
+                                   wxFileBrowseButton **ppButton = NULL,
+                                   int flags = FileEntry_Open |
+                                               FileEntry_ExistingOnly);
 
 #endif // _GUI_WXDIALOGLAYOUT_H



-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to