]> git.saurik.com Git - wxWidgets.git/commitdiff
making cocoa build again
authorStefan Csomor <csomor@advancedconcepts.ch>
Wed, 5 Jul 2006 13:10:46 +0000 (13:10 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Wed, 5 Jul 2006 13:10:46 +0000 (13:10 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40007 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/cocoa/colour.h
src/cocoa/dirdlg.mm
src/cocoa/filedlg.mm
src/mac/corefoundation/stdpaths_cf.cpp

index db7a4e9444053caeb9a0757657d0e77686d0b997..f0e3829a73ddfc03f8008ae074c191ca13dc756c 100644 (file)
@@ -61,7 +61,21 @@ public:
 
     // Set() functions
     void Set( WX_NSColor aColor );
-
+    
+    // reroute the inherited ones
+    void Set(unsigned char red, unsigned char green, unsigned char blue)
+    { wxColourBase::Set(red,green,blue); }
+    
+    // implemented in colourcmn.cpp
+    bool Set(const wxChar *str)
+    { return wxColourBase::Set(str); }
+    
+    bool Set(const wxString &str)
+    { return wxColourBase::Set(str); }
+    
+    void Set(unsigned long colRGB)
+    { wxColourBase::Set(colRGB); }
+    
 protected:
     // puts the object in an invalid, uninitialized state
     void Init();
index 69112c5bc8c170f41c4167de4987467b5cbbcd0b..1c3c95d8a5c5502a89b161c44cdb55ad8c235def 100644 (file)
@@ -56,7 +56,8 @@ wxDirDialog::wxDirDialog(wxWindow *parent, const wxString& message,
     wxTopLevelWindows.Append(this);
 
     m_message = message;
-    m_dialogStyle = style;
+
+    SetWindowStyle(style);
     m_parent = parent;
     m_path = defaultPath;
 
@@ -70,7 +71,7 @@ wxDirDialog::wxDirDialog(wxWindow *parent, const wxString& message,
 
     //If the user requests to save - use a NSSavePanel
     //else use a NSOpenPanel
-    if (m_dialogStyle & wxFD_SAVE)
+    if (HasFlag(wxFD_SAVE))
     {
         SetNSPanel([NSSavePanel savePanel]);
 
@@ -91,7 +92,7 @@ wxDirDialog::wxDirDialog(wxWindow *parent, const wxString& message,
         [GetNSSavePanel() setPrompt:@"Open"];
     }
 
-    if (m_dialogStyle & wxDD_NEW_DIR_BUTTON) //m_dialogStyle & wxDD_NEW_DIR_BUTTON
+    if (HasFlag(wxDD_NEW_DIR_BUTTON)) //m_dialogStyle & wxDD_NEW_DIR_BUTTON
     {
         [(NSOpenPanel*)m_cocoaNSWindow setCanCreateDirectories:YES];
     }
@@ -109,7 +110,7 @@ int wxDirDialog::ShowModal()
 
     int nResult;
 
-    if (m_dialogStyle & wxFD_SAVE)
+    if (HasFlag(wxFD_SAVE))
     {
         nResult = [GetNSSavePanel()
                     runModalForDirectory:wxNSStringWithWxString(m_dir)
index 0070821f25602d7ae8fbd74c0aaa90e9fa450c73..57a8a2fbaf90153760f3593cfdd21f5b873155a0 100644 (file)
@@ -48,11 +48,17 @@ IMPLEMENT_CLASS(wxCocoaFileDialog, wxFileDialogBase)
 // wxFileDialog
 // ----------------------------------------------------------------------------
 
-wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
-        const wxString& defaultDir, const wxString& defaultFileName,
-        const wxString& wildCard, long style, const wxPoint& pos)
-:   wxFileDialogBase(parent, message, defaultDir, defaultFileName,
-        wildCard, style, pos)
+wxFileDialog::wxFileDialog(wxWindow *parent,
+                           const wxString& message,
+                           const wxString& defaultDir,
+                           const wxString& defaultFileName,
+                           const wxString& wildCard,
+                           long style,
+                           const wxPoint& pos,
+                           const wxSize& sz,
+                           const wxString& name)
+            : wxFileDialogBase(parent, message, defaultDir, defaultFileName,
+                               wildCard, style, pos, sz, name)
 {
     wxTopLevelWindows.Append(this);
 
@@ -69,7 +75,7 @@ wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
 
     //If the user requests to save - use a NSSavePanel
     //else use a NSOpenPanel
-    if (m_dialogStyle & wxFD_SAVE)
+    if (HasFlag(wxFD_SAVE))
     {
         SetNSPanel([NSSavePanel savePanel]);
 
@@ -93,7 +99,7 @@ wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
         SetNSPanel([NSOpenPanel openPanel]);
         [m_cocoaNSWindow setTitle:wxNSStringWithWxString(message)];
 
-        [(NSOpenPanel*)m_cocoaNSWindow setAllowsMultipleSelection:(m_dialogStyle & wxFD_MULTIPLE)];
+        [(NSOpenPanel*)m_cocoaNSWindow setAllowsMultipleSelection:(HasFlag(wxFD_MULTIPLE))];
         [(NSOpenPanel*)m_cocoaNSWindow setResolvesAliases:YES];
         [(NSOpenPanel*)m_cocoaNSWindow setCanChooseFiles:YES];
         [(NSOpenPanel*)m_cocoaNSWindow setCanChooseDirectories:NO];
@@ -196,7 +202,7 @@ int wxFileDialog::ShowModal()
 
     int nResult;
 
-    if (m_dialogStyle & wxFD_SAVE)
+    if (HasFlag(wxFD_SAVE))
     {
         nResult = [GetNSSavePanel()
                     runModalForDirectory:wxNSStringWithWxString(m_dir)
index 2b2cf9cba0061427f41435224d0a63663e71d045..d4068cc2fa448431fbb7329822eae81f1d84c18a 100644 (file)
@@ -109,6 +109,7 @@ wxString wxStandardPathsCF::GetFromFunc(wxCFURLRef (*func)(wxCFBundleRef)) const
 
 wxString wxStandardPathsCF::GetDocumentsDir() const
 {
+#ifdef __WXMAC__
     return wxMacFindFolderNoSeparator
         (
 #if TARGET_API_MAC_OSX
@@ -119,6 +120,9 @@ wxString wxStandardPathsCF::GetDocumentsDir() const
         kDocumentsFolderType,
         kCreateFolder
         );
+#else
+    return wxFileName::GetHomeDir() + wxT("/Documents");
+#endif
 }
 
 // ----------------------------------------------------------------------------