X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ad81651f00edc6f489d9b6a0839d316a964fd521..cd212ee42521a28c8947cf287940121cde7cde8f:/src/mac/dirdlg.cpp diff --git a/src/mac/dirdlg.cpp b/src/mac/dirdlg.cpp index 344b8b32b9..02bbef6a20 100644 --- a/src/mac/dirdlg.cpp +++ b/src/mac/dirdlg.cpp @@ -20,19 +20,9 @@ #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 = "" ;