X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/519cb848a8f4c91c73421bb75314754284e593a4..cd212ee42521a28c8947cf287940121cde7cde8f:/src/mac/dirdlg.cpp diff --git a/src/mac/dirdlg.cpp b/src/mac/dirdlg.cpp index edfc211caa..02bbef6a20 100644 --- a/src/mac/dirdlg.cpp +++ b/src/mac/dirdlg.cpp @@ -24,18 +24,6 @@ IMPLEMENT_CLASS(wxDirDialog, wxDialog) #endif -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 -}; - // the data we need to pass to our standard file hook routine // includes a pointer to the dialog, a pointer to the standard // file reply record (so we can inspect the current selection) @@ -50,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); @@ -304,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) { @@ -323,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 @@ -331,6 +335,8 @@ void StandardGetFolder( ConstStr255Param message , ConstStr255Param path , FileF // display the dialog + #if !TARGET_CARBON + dlgHookUPP = NewDlgHookYDProc(SFGetFolderDialogHook); myModalFilterUPP = NewModalFilterYDProc(SFGetFolderModalDialogFilter); @@ -352,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... @@ -447,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 = "" ;