-#if !TARGET_CARBON
-
-static void wxMacSetupStandardFile(short newVRefNum, long newDirID)
-{
- enum
- { SFSaveDisk = 0x214, CurDirStore = 0x398 };
- *(short *) SFSaveDisk = -1 * newVRefNum;
- *(long *) CurDirStore = newDirID;
-}
-
-static void wxMacSetupStandardFileFromPath( const char* s )
-{
- Str255 volume ;
- Str255 path ;
- short vRefNum ;
- long dirRef ;
- short i,j ;
- Boolean isDirectory ;
-
- for (i=0 ; (s[i]!=0) && (s[i]!=':') ;i++)
- {
- volume[i]=s[i] ;
- }
- volume[i]=':' ;
- volume[i+1]=0 ;
-
- // then copy the rest of the filename
-
- for (j=0;(s[i]!=0);i++,j++)
- {
- path[j]=s[i] ;
- }
- path[j]=0 ;
-
- c2pstr((Ptr) volume) ;
- c2pstr((Ptr) path) ;
-
- SetVol(volume, 0) ;
- GetVol( NULL, &vRefNum ) ;
-
- GetDirectoryID( vRefNum , fsRtDirID , path , &dirRef , &isDirectory ) ;
- wxMacSetupStandardFile(vRefNum, dirRef) ;
-}
-
-enum {
- kSelectItem = 10, // select button item number
- kSFGetFileDlgID = 251, // dialog resource number
- kStrListID = 251, // 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);
-}
-
-static void CopyPStr(StringPtr src, StringPtr dest)
-{
- BlockMoveData(src, dest, 1 + src[0]);
-}
-
-static char GetSelectKey(void)
-{
- // this is the key used to trigger the select button
-
- // NOT INTERNATIONAL SAVVY; should at least grab it from resources
-
- return 's';
-}
-
-// FlashButton briefly highlights the dialog button
-// as feedback for key equivalents
-
-static void FlashButton(DialogPtr theDlgPtr, short buttonID)
-{
- short buttonType;
- Handle buttonHandle;
- Rect buttonRect;
- unsigned long finalTicks;
-
- GetDialogItem(theDlgPtr, buttonID, &buttonType, &buttonHandle, &buttonRect);
- HiliteControl((ControlHandle) buttonHandle, kControlButtonPart);
- Delay(10, &finalTicks);
- HiliteControl((ControlHandle) buttonHandle, 0);
-}
-
-static Boolean SameFSSpec(FSSpecPtr spec1, FSSpecPtr spec2)
-{
- return (spec1->vRefNum == spec2->vRefNum
- && spec1->parID == spec2->parID
- && EqualString(spec1->name, spec2->name, false, false));
-}
-// MyModalDialogFilter maps a key to the Select button, and handles
-// flashing of the button when the key is hit
-
-static pascal Boolean SFGetFolderModalDialogFilter(DialogPtr theDlgPtr, EventRecord *eventRec,
- short *item, void *dataPtr)
-{
-#pragma unused (dataPtr)
-
- // make certain the proper dialog is showing, 'cause standard file
- // can nest dialogs but calls the same filter for each
-
- if (((WindowPeek) theDlgPtr)->refCon == sfMainDialogRefCon)
- {
- // check if the select button was hit
- /*
- if ((eventRec->what == keyDown)
- && (eventRec->modifiers & cmdKey)
- && ((eventRec->message & charCodeMask) == GetSelectKey()))
- {
- *item = kSelectItem;
- FlashButton(theDlgPtr, kSelectItem);
- return true;
- }
- */
- }
-
- return false;
-}
-#endif !TARGET_CARBON