]> git.saurik.com Git - wxWidgets.git/commitdiff
adaptions for CW Pro 5.3 on mac
authorStefan Csomor <csomor@advancedconcepts.ch>
Thu, 13 Jan 2000 07:57:22 +0000 (07:57 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Thu, 13 Jan 2000 07:57:22 +0000 (07:57 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5365 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

13 files changed:
include/wx/mac/button.h
include/wx/mac/control.h
include/wx/mac/dc.h
include/wx/mac/listbox.h
include/wx/mac/notebook.h
include/wx/mac/setup.h
include/wx/mac/spinbutt.h
include/wx/mac/statbmp.h
include/wx/mac/toolbar.h
include/wx/mac/window.h
include/wx/notebook.h
include/wx/resource.h
src/make_cw.mcp

index d581f9a97bda809d6366f839f62ebef15bc4ef05..b016c98338de7ff57889a4d999ee674607093cea 100644 (file)
@@ -48,7 +48,7 @@ class WXDLLEXPORT wxButton: public wxControl
   virtual void SetDefault();
   virtual void Command(wxCommandEvent& event);
 protected:
-    virtual wxSize DoGetBestSize();
+    virtual wxSize DoGetBestSize() const ;
 };
 
 #endif
index 3770d647f29097d4b78bbfa4f91a6bfcac043261..713f91fd0930c391b6bb35fe712bac6ac1737502 100644 (file)
@@ -16,6 +16,8 @@
 #pragma interface "control.h"
 #endif
 
+WXDLLEXPORT_DATA(extern const wxChar*) wxControlNameStr;
+
 // General item class
 class WXDLLEXPORT wxControl : public wxControlBase
 {
@@ -25,6 +27,12 @@ public:
    wxControl();
    virtual ~wxControl();
 
+    bool Create(wxWindow *parent, wxWindowID id,
+            const wxPoint& pos = wxDefaultPosition,
+            const wxSize& size = wxDefaultSize, long style = 0,
+            const wxValidator& validator = wxDefaultValidator,
+            const wxString& name = wxControlNameStr);
+
    // Simulates an event
    virtual void Command(wxCommandEvent& event) { ProcessCommand(event); }
 
@@ -88,7 +96,7 @@ protected:
                int                                                     m_macVerticalBorder ;
    wxList m_subControls;
 
-   virtual wxSize DoGetBestSize();
+   virtual wxSize DoGetBestSize() const ;
 
 private:
    DECLARE_EVENT_TABLE()
index 3075bbf734e6070721c5c8358588e6317f983854..82c959b4c7b3e81c07269098dffd2462f094007d 100644 (file)
@@ -168,6 +168,17 @@ class WXDLLEXPORT wxDC: public wxObject
     virtual void GetTextExtent( const wxString &string, long *width, long *height,
                      long *descent = NULL, long *externalLeading = NULL,
                      wxFont *theFont = NULL, bool use16 = FALSE ) const ;
+    virtual void GetTextExtent( const wxString &string, int *width, int *height,
+                     int *descent = NULL, int *externalLeading = NULL,
+                     wxFont *theFont = NULL, bool use16 = FALSE ) const 
+    {
+       long lwidth,lheight,ldescent,lexternal ;
+       GetTextExtent( string, &lwidth,&lheight,&ldescent,&lexternal,theFont,use16 ) ;
+       *width = lwidth ;
+       *height = lheight ;
+       if (descent) *descent = ldescent ;
+       if (externalLeading) *externalLeading = lexternal ;
+    }
     virtual wxCoord GetCharWidth(void) const;
     virtual wxCoord GetCharHeight(void) const;
     
index 96be3d0f0ea2f7fe1ad98fcd9e7b160a7a9050aa..a312aec5933513fe03d4ff00a453f4cda68631d7 100644 (file)
@@ -138,7 +138,7 @@ protected:
     int m_noItems;
     int m_selected;
 
-    virtual wxSize DoGetBestSize();
+    virtual wxSize DoGetBestSize() const ;
 
 #if wxUSE_OWNER_DRAWN
     // control items
index 0e43da55d8ad4cc7c5a07c2d21b728274e844c12..aac5e6042e9140df7b9a8a9dbddbd726b77d8067 100644 (file)
@@ -34,27 +34,6 @@ class WXDLLEXPORT wxWindow;
 typedef wxWindow wxNotebookPage;  // so far, any window can be a page
 WX_DEFINE_ARRAY(wxNotebookPage *, wxArrayPages);
 
-// ----------------------------------------------------------------------------
-// notebook events
-// ----------------------------------------------------------------------------
-class WXDLLEXPORT wxNotebookEvent : public wxCommandEvent
-{
-public:
-  wxNotebookEvent(wxEventType commandType = wxEVT_NULL, int id = 0, 
-                  int nSel = -1, int nOldSel = -1)
-    : wxCommandEvent(commandType, id) { m_nSel = nSel; m_nOldSel = nOldSel; }
-
-  // accessors
-  int GetSelection() const { return m_nSel; }
-  int GetOldSelection() const { return m_nOldSel; }
-
-private:
-  int m_nSel,     // currently selected page
-      m_nOldSel;  // previously selected page
-
-  DECLARE_DYNAMIC_CLASS(wxNotebookEvent)
-};
-
 // ----------------------------------------------------------------------------
 // wxNotebook
 // ----------------------------------------------------------------------------
@@ -181,27 +160,5 @@ protected:
   DECLARE_EVENT_TABLE()
 };
 
-// ----------------------------------------------------------------------------
-// event macros
-// ----------------------------------------------------------------------------
-typedef void (wxEvtHandler::*wxNotebookEventFunction)(wxNotebookEvent&);
-
-#define EVT_NOTEBOOK_PAGE_CHANGED(id, fn)                                   \
-  {                                                                         \
-    wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED,                                    \
-    id,                                                                     \
-    -1,                                                                     \
-    (wxObjectEventFunction)(wxEventFunction)(wxNotebookEventFunction) &fn,  \
-    NULL                                                                    \
-  },
-
-#define EVT_NOTEBOOK_PAGE_CHANGING(id, fn)                                  \
-  {                                                                         \
-    wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, \                                 \
-    id,                                                                     \
-    -1,                                                                     \
-    (wxObjectEventFunction)(wxEventFunction)(wxNotebookEventFunction) &fn,  \
-    NULL                                                                    \
-  },
 
 #endif // _WX_NOTEBOOK_H_
index 0a1df37e9a419ad9c2116e9ceb45d6cc6ffb322e..bfb74aab4dc77b2ba3c737bc32781215469b2f2a 100644 (file)
 #ifndef _WX_SETUP_H_
 #define _WX_SETUP_H_
 
-/*
- * General features
- *
- */
+// ----------------------------------------------------------------------------
+// global settings
+// ----------------------------------------------------------------------------
+
+// define this to 0 when building wxBase library
+#define wxUSE_GUI            1
  
+// ----------------------------------------------------------------------------
+// compatibility settings
+// ----------------------------------------------------------------------------
+
+// This setting determines the compatibility with 1.68 API:
+// Level 0: no backward compatibility, all new features
+// Level 1: some extra methods are defined for compatibility.
+//
+// Default is 0.
+//
+// Recommended setting: 0 (in fact the compatibility code is now very minimal
+// so there is little advantage to setting it to 1.
+#define WXWIN_COMPATIBILITY  0
+
 #define WORDS_BIGENDIAN 1
 
+// ----------------------------------------------------------------------------
+// non GUI features selection
+// ----------------------------------------------------------------------------
+
+// Set wxUSE_LONGLONG to 1 to compile the wxLongLong class. This is a 64 bit
+// integer which is implemented in terms of native 64 bit integers if any or
+// uses emulation otherwise.
+//
+// This class is required by wxDateTime and so you should enable it if you want
+// to use wxDateTime. For most modern platforms, it will use the native 64 bit
+// integers in which case (almost) all of its functions are inline and it
+// almost does not take any space, so there should be no reason to switch it
+// off.
+//
+// Recommended setting: 1
+#define wxUSE_LONGLONG      1
+
+
+// Set wxUSE_TIMEDATE to 1 to compile the wxDateTime and related classes which
+// allow to manipulate dates, times and time intervals. wxDateTime replaces the
+// old wxTime and wxDate classes which are still provided for backwards
+// compatibility (and implemented in terms of wxDateTime).
+//
+// Note that this class is relatively new and is still officially in alpha
+// stage because some features are not yet (fully) implemented. It is already
+// quite useful though and should only be disabled if you are aiming at
+// absolutely minimal version of the library.
+//
+// Requires: wxUSE_LONGLONG
+//
+// Recommended setting: 1
+#define wxUSE_TIMEDATE      1
+
+// Setting wxUSE_CONFIG to 1 enables the use of wxConfig and related classes
+// which allow the application to store its settings in the persistent
+// storage. Setting this to 1 will also enable on-demand creation of the
+// global config object in wxApp.
+//
+// See also wxUSE_CONFIG_NATIVE below.
+//
+// Recommended setting: 1
 #define wxUSE_CONFIG           1
-                                // Use wxConfig, with CreateConfig in wxApp
 
-#define WXWIN_COMPATIBILITY  0
-                                // Compatibility with 1.66 API.
-                                // Level 0: no backward compatibility, all new features
-                                // Level 1: wxDC, OnSize (etc.) compatibility, but
-                                //          some new features such as event tables
+// ----------------------------------------------------------------------------
+// Optional controls
+// ----------------------------------------------------------------------------
+
+// wxToolBar related settings: if wxUSE_TOOLBAR is 0, don't compile any toolbar
+// classes at all. Otherwise, use the native toolbar class unless
+// wxUSE_TOOLBAR_NATIVE is 0. Additionally, the generic toolbar class which
+// supports some features which might not be supported by the native wxToolBar
+// class may be compiled in if wxUSE_TOOLBAR_SIMPLE is 1.
+//
+// Default is 1 for all settings.
+//
+// Recommended setting: 1 for wxUSE_TOOLBAR and wxUSE_TOOLBAR_NATIVE and 0 for
+// wxUSE_TOOLBAR_SIMPLE (the default is 1 mainly for backwards compatibility).
+#define wxUSE_TOOLBAR 1
+#define wxUSE_TOOLBAR_NATIVE 1
+#define wxUSE_TOOLBAR_SIMPLE 0
+
+// wxNotebook is a control with several "tabs" located on one of its sides. It
+// may be used ot logically organise the data presented to the user instead of
+// putting everything in one huge dialog. It replaces wxTabControl and related
+// classes of wxWin 1.6x.
+//
+// Default is 1.
+//
+// Recommended setting: 1
+#define wxUSE_NOTEBOOK 1
+
+
+// The corresponding controls will be compiled in if wxUSE_<CONTROL> is set to
+// 1 and not compiled into the library otherwise.
+//
+// Default is 1 for everything.
+//
+// Recommended setting: 1 (library might fail to compile for some combinations
+// of disabled controls) 
+#define wxUSE_COMBOBOX     1
+#define wxUSE_CHOICE       1
+#define wxUSE_RADIOBTN     1
+#define wxUSE_RADIOBOX     1
+#define wxUSE_SCROLLBAR    1
+#define wxUSE_CHECKBOX     1
+#define wxUSE_LISTBOX      1
+#define wxUSE_SPINBTN      1
+#define wxUSE_SPINCTRL     1
+#define wxUSE_STATLINE     1
+#define wxUSE_CHECKLISTBOX 1
+#define wxUSE_CHOICE       1
+#define wxUSE_CARET        1
+#define wxUSE_SLIDER       1
+
+// ----------------------------------------------------------------------------
+// Postscript support settings
+// ----------------------------------------------------------------------------
+
+
 #define wxUSE_POSTSCRIPT  0
                                // 0 for no PostScript device context
 #define wxUSE_AFM_FOR_POSTSCRIPT 0
index 3903eecb29426acf0a250ca8eea2e7f3177a6866..9909adfea9be25bac44ab99bc37920990b3ba00c 100644 (file)
@@ -65,7 +65,7 @@ public:
     virtual void MacHandleControlClick( ControlHandle control , SInt16 controlpart ) ;
 
 protected:
-   virtual wxSize DoGetBestSize();
+   virtual wxSize DoGetBestSize() const;
    int m_value ;
 
 private:
index f2162aeb10e6448d69cbca51858abff84c33f8af..48cad8933adce20c157c726502251c9079bdd37b 100644 (file)
@@ -54,6 +54,7 @@ class WXDLLEXPORT wxStaticBitmap: public wxControl
 
   // overriden base class virtuals
   virtual bool AcceptsFocus() const { return FALSE; }
+       wxSize DoGetBestSize() const ;
 
  protected:
   wxBitmap m_messageBitmap;
index 6fe126b788ba707766c3d95e3f28248c6ef16400..63c3d7f937da1931f252732993ff44c1dd6e00e6 100644 (file)
@@ -31,12 +31,14 @@ class WXDLLEXPORT wxToolBar: public wxToolBarBase
    * Public interface
    */
 
-  wxToolBar();
+   wxToolBar() { Init(); }
+
 
   inline wxToolBar(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
             long style = wxNO_BORDER|wxTB_HORIZONTAL,
             const wxString& name = wxToolBarNameStr)
   {
+    Init();
     Create(parent, id, pos, size, style, name);
   }
   ~wxToolBar();
@@ -45,36 +47,43 @@ class WXDLLEXPORT wxToolBar: public wxToolBarBase
             long style = wxNO_BORDER|wxTB_HORIZONTAL,
             const wxString& name = wxToolBarNameStr);
 
-  // If pushedBitmap is NULL, a reversed version of bitmap is
-  // created and used as the pushed/toggled image.
-  // If toggle is TRUE, the button toggles between the two states.
-  wxToolBarTool *AddTool(int toolIndex, const wxBitmap& bitmap, const wxBitmap& pushedBitmap = wxNullBitmap,
-               bool toggle = FALSE, long xPos = -1, long yPos = -1, wxObject *clientData = NULL,
-               const wxString& helpString1 = "", const wxString& helpString2 = "");
+    // override/implement base class virtuals
+    virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const;
 
-  // Set default bitmap size
-  void SetToolBitmapSize(const wxSize& size);
-  void EnableTool(int toolIndex, bool enable); // additional drawing on enabling
-  void ToggleTool(int toolIndex, bool toggle); // toggle is TRUE if toggled on
-  void ClearTools();
+    virtual bool Realize();
 
-  // The button size is bigger than the bitmap size
-  wxSize GetToolSize() const;
+    virtual void SetToolBitmapSize(const wxSize& size);
+    virtual wxSize GetToolSize() const;
 
-  wxSize GetMaxSize() const;
+    virtual void SetRows(int nRows);
 
   // Add all the buttons
-  virtual bool CreateTools();
-       virtual void LayoutButtons() {}
 
-  // The post-tool-addition call. TODO: do here whatever's
-  // necessary for completing the toolbar construction.
-  bool Realize() { return CreateTools(); };
        virtual void MacHandleControlClick( ControlHandle control , SInt16 controlpart ) ;
 protected:
+    // common part of all ctors
+    void Init();
+
+    // implement base class pure virtuals
+    virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool);
+    virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool);
+
+    virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable);
+    virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle);
+    virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle);
+
+    virtual wxToolBarToolBase *CreateTool(int id,
+                                          const wxBitmap& bitmap1,
+                                          const wxBitmap& bitmap2,
+                                          bool toggle,
+                                          wxObject *clientData,
+                                          const wxString& shortHelpString,
+                                          const wxString& longHelpString);
+    virtual wxToolBarToolBase *CreateTool(wxControl *control);
+
        wxArrayPtrVoid  m_macToolHandles ;
 
-DECLARE_EVENT_TABLE()
+       DECLARE_EVENT_TABLE()
 };
 
 #endif // wxUSE_TOOLBAR
index 3eac7270ce0774da4c916d133643780565a4908e..c7c6bd43b06f2c309fd6a006e3a52045fa5ea876 100644 (file)
@@ -86,7 +86,6 @@ public:
 
     virtual void SetFocus();
 
-    virtual bool Reparent( wxWindow *newParent );
 
     virtual void WarpPointer(int x, int y);
     virtual void CaptureMouse();
@@ -181,6 +180,8 @@ public:
     void OnEraseBackground(wxEraseEvent& event);
     void OnIdle(wxIdleEvent& event);
     void MacOnScroll(wxScrollEvent&event ) ;
+    
+    bool AcceptsFocus() const ;
 
 public:
     // For implementation purposes - sometimes decorations make the client area
@@ -297,10 +298,6 @@ protected:
                            int sizeFlags = wxSIZE_AUTO);
     virtual void DoSetClientSize(int width, int height);
 
-    // get the size which best suits the window: e.g., for a static text it
-    // will be the width and height of the text
-    virtual wxSize DoGetBestSize();
-
     // move the window to the specified location and resize it: this is called
     // from both DoSetSize() and DoSetClientSize() and would usually just call
     // ::MoveWindow() except for composite controls which will want to arrange
index 4dea9653ef0504708afd78563549ef0c4405faca..63bbee89ead8109b379af773f81db424b2a71db3 100644 (file)
@@ -102,7 +102,7 @@ typedef void (wxEvtHandler::*wxNotebookEventFunction)(wxNotebookEvent&);
 #elif defined(__WXQT__)
   #include  "wx/qt/notebook.h"
 #elif defined(__WXMAC__)
-  #include  "wx/generic/notebook.h"
+  #include  "wx/mac/notebook.h"
 #elif defined(__WXPM__)
   #include  "wx/os2/notebook.h"
 #elif defined(__WXSTUBS__)
index bbd5aa1f75274059264eab8805d85c79cfb39c03..937bc47b7f05b7a63035c6f7ab51269c9ee8760d 100644 (file)
@@ -147,6 +147,7 @@ class WXDLLEXPORT wxResourceTable: public wxHashTable
     virtual bool DeleteResource(const wxString& name);
 
     virtual bool ParseResourceFile(const wxString& filename);
+       virtual bool ParseResourceFile( wxInputStream *is ) ;
     virtual bool ParseResourceData(const wxString& data);
     virtual bool SaveResource(const wxString& filename);
 
index 4dedadf9b20a2454ed212c06f2519e98056a4132..79abe23b376ce92c65d010e982ec014395755f93 100644 (file)
Binary files a/src/make_cw.mcp and b/src/make_cw.mcp differ