software/MFrame/commonFunctions/commonFunctions.cpp
// SetButtonName sets the name of the Select button in the dialog
//
// To do this, we need to call the Script Manager to truncate the
// label in the middle to fit the button and to merge the button
// name with the word Select (possibly followed by quotes).  Using
// the Script Manager avoids all sorts of problems internationally.
//
// buttonName is the name to appear following the word Select
// quoteFlag should be true if the name is to appear in quotes
SetButtonName sets the name of the Select button in the dialog
To do this, we need to call the Script Manager to truncate the
label in the middle to fit the button and to merge the button
name with the word Select (possibly followed by quotes).  Using
the Script Manager avoids all sorts of problems internationally.

buttonName is the name to appear following the word Select
quoteFlag should be true if the name is to appear in quotes
SetButtonName sets the name of the Select button in the dialog To do this we need to call the Script Manager to truncate the label in the middle to fit the button and to merge the button name with the word Select ( possibly followed by quotes ) . Using the Script Manager avoids all sorts of problems internationally . buttonName is the name to appear following the word Select quoteFlag should be true if the name is to appear in quotes
static void SetButtonName(DialogPtr theDlgPtr, short buttonID, Str255 buttonName)
{
	ControlHandle button;
	Rect			buttonRect;
	Str255		buttonText;
	GetDialogItemAsControl(theDlgPtr, buttonID, &button);
	if (!EqualString(buttonName, "\pDesktop", true, true))
	{
		GetIndString(buttonText, rSelectObjectStrings, sSelect);
		SubstituteString(buttonText, "\p<file name>", buttonName);
	}
	else
	{
		GetIndString(buttonText, rSelectObjectStrings, sSelectDesktop);
	}
#if OPAQUE_TOOLBOX_STRUCTS
	GetControlBounds(button, &buttonRect);
#else
	buttonRect = (**button).contrlRect;
#endif
	TruncString(buttonRect.right - buttonRect.left - 20, buttonText, truncMiddle);
	SetControlTitle(button, buttonText);
}
static void SetButtonName ( DialogPtr theDlgPtr , short buttonID , Str255 buttonName ) { ControlHandle button ; Rect buttonRect ; Str255 buttonText ; GetDialogItemAsControl ( theDlgPtr , buttonID , & button ) ; if ( ! EqualString ( buttonName , " \p " , true , true ) ) { GetIndString ( buttonText , rSelectObjectStrings , sSelect ) ; SubstituteString ( buttonText , " \p " , buttonName ) ; } else { GetIndString ( buttonText , rSelectObjectStrings , sSelectDesktop ) ; } #if OPAQUE_TOOLBOX_STRUCTS GetControlBounds ( button , & buttonRect ) ; #else buttonRect = ( * * button ) . contrlRect ; #endif TruncString ( buttonRect . right - buttonRect . left - 20 , buttonText , truncMiddle ) ; SetControlTitle ( button , buttonText ) ; }
SetButtonName sets the name of the Select button in the dialog
To do this, we need to call the Script Manager to truncate the
label in the middle to fit the button and to merge the button
name with the word Select (possibly followed by quotes).
SetButtonName sets the name of the Select button in the dialog To do this we need to call the Script Manager to truncate the label in the middle to fit the button and to merge the button name with the word Select ( possibly followed by quotes ) .