]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/dirdlg.cpp
set more event object fields for lbox dbl click events
[wxWidgets.git] / src / mac / dirdlg.cpp
index edfc211caa05465c25cd36acde69e55c778c1d88..02bbef6a204bad2100a085c8786858f9820e07b6 100644 (file)
 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 = "" ;