]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/dirdlg.cpp
1. some more tests in console
[wxWidgets.git] / src / mac / dirdlg.cpp
index 344b8b32b93e6e9a1691f257393f263bd27213ae..02bbef6a204bad2100a085c8786858f9820e07b6 100644 (file)
 
 #include "wx/cmndata.h"
 
+#if !USE_SHARED_LIBRARY
 IMPLEMENT_CLASS(wxDirDialog, wxDialog)
-
-enum {
-       kSelectItem = 10,                       // select button item number
-       kSFGetFolderDlgID = 250,        // dialog resource number
-       kStrListID = 250,                       // our strings
-       kSelectStrNum = 1,                      // word 'Select: ' for button
-       kDesktopStrNum = 2,                     // word 'Desktop' for button
-       kSelectNoQuoteStrNum = 3,       // word 'Select: ' for button
-       
-       kUseQuotes = true,                      // parameter for SetButtonName
-       kDontUseQuotes = false
-};
+#endif
 
 // the data we need to pass to our standard file hook routine
 // includes a pointer to the dialog, a pointer to the standard
@@ -48,6 +38,21 @@ struct UserDataRec {
 typedef struct UserDataRec
        UserDataRec, *UserDataRecPtr;
 
+#if !TARGET_CARBON
+
+enum {
+       kSelectItem = 10,                       // select button item number
+       kSFGetFolderDlgID = 250,        // dialog resource number
+       kStrListID = 250,                       // our strings
+       kSelectStrNum = 1,                      // word 'Select: ' for button
+       kDesktopStrNum = 2,                     // word 'Desktop' for button
+       kSelectNoQuoteStrNum = 3,       // word 'Select: ' for button
+       
+       kUseQuotes = true,                      // parameter for SetButtonName
+       kDontUseQuotes = false
+};
+
+
 static void GetLabelString(StringPtr theStr, short stringNum)
 {
        GetIndString(theStr, kStrListID, stringNum);
@@ -302,6 +307,7 @@ static pascal short SFGetFolderDialogHook(short item, DialogPtr theDlgPtr, Ptr d
        
        return item;
 }
+#endif
 
 void StandardGetFolder( ConstStr255Param message , ConstStr255Param path , FileFilterYDUPP fileFilter, StandardFileReply *theSFR)
 {
@@ -321,7 +327,7 @@ void StandardGetFolder( ConstStr255Param message , ConstStr255Param path , FileF
        
        // set initial contents of Select button to a space
        
-       CopyPStr("\p ", theSFR->sfFile.name);
+       memcpy(theSFR->sfFile.name, "\p ", 2);
        
        // point the user data parameter at the reply record so we can get to it later
        
@@ -329,6 +335,8 @@ void StandardGetFolder( ConstStr255Param message , ConstStr255Param path , FileF
        
        // display the dialog
        
+       #if !TARGET_CARBON
+       
        dlgHookUPP = NewDlgHookYDProc(SFGetFolderDialogHook);
        myModalFilterUPP = NewModalFilterYDProc(SFGetFolderModalDialogFilter);
        
@@ -350,6 +358,8 @@ void StandardGetFolder( ConstStr255Param message , ConstStr255Param path , FileF
                                        
        DisposeRoutineDescriptor(dlgHookUPP);
        DisposeRoutineDescriptor(myModalFilterUPP);
+       #else
+       #endif
        
        // if cancel wasn't pressed and no fatal error occurred...
        
@@ -445,14 +455,18 @@ int wxDirDialog::ShowModal()
                strcpy((char *)path, m_path ) ;
                c2pstr((char *)path ) ;
 
-               FileFilterYDUPP         invisiblesExcludedCustomFilterUPP;
                StandardFileReply       reply ;
+               FileFilterYDUPP         invisiblesExcludedCustomFilterUPP = 0 ;
+               #if !TARGET_CARBON
                invisiblesExcludedCustomFilterUPP = 
                        NewFileFilterYDProc(OnlyVisibleFoldersCustomFileFilter);
+               #endif
 
                StandardGetFolder( prompt , path , invisiblesExcludedCustomFilterUPP, &reply);
        
+               #if !TARGET_CARBON
                DisposeRoutineDescriptor(invisiblesExcludedCustomFilterUPP);
+               #endif
                if ( reply.sfGood == false )
                {
                        m_path = "" ;