mirror of
https://github.com/autc04/Retro68.git
synced 2025-01-20 19:30:37 +00:00
LaunchAPPLServer: some tweaks/fixes to standarf file dialogs
This commit is contained in:
parent
ada9b67a75
commit
e8f346cc9f
@ -131,8 +131,17 @@ static pascal short DlgHookProc(short item, DialogRef theDialog)
|
|||||||
return 1;
|
return 1;
|
||||||
if(item == 11)
|
if(item == 11)
|
||||||
{
|
{
|
||||||
|
short type;
|
||||||
|
Rect r;
|
||||||
|
ControlHandle button;
|
||||||
|
|
||||||
|
GetDialogItem(theDialog, 1, &type, (Handle*)&button, &r);
|
||||||
|
|
||||||
choosePressed = true;
|
choosePressed = true;
|
||||||
|
if((*button)->contrlHilite == 0)
|
||||||
return sfHookOpenFolder;
|
return sfHookOpenFolder;
|
||||||
|
else
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return item;
|
return item;
|
||||||
@ -149,7 +158,11 @@ static bool ChooseSharedDirectory6(FSSpec& spec)
|
|||||||
auto dlgHookProc = NewDlgHookUPP(&DlgHookProc);
|
auto dlgHookProc = NewDlgHookUPP(&DlgHookProc);
|
||||||
auto fileFilterProc = NewFileFilterUPP(&FileFilterProc);
|
auto fileFilterProc = NewFileFilterUPP(&FileFilterProc);
|
||||||
choosePressed = false;
|
choosePressed = false;
|
||||||
SFPGetFile(Point{-1,-1}, "\p", fileFilterProc, 0, nullptr, dlgHookProc, &reply, 128, nullptr);
|
|
||||||
|
Point position = { short((qd.screenBits.bounds.bottom - 225) / 2),
|
||||||
|
short((qd.screenBits.bounds.right - 348) / 2) };
|
||||||
|
|
||||||
|
SFPGetFile(position, "\p", fileFilterProc, 0, nullptr, dlgHookProc, &reply, 128, nullptr);
|
||||||
DisposeDlgHookUPP(dlgHookProc);
|
DisposeDlgHookUPP(dlgHookProc);
|
||||||
DisposeFileFilterUPP(fileFilterProc);
|
DisposeFileFilterUPP(fileFilterProc);
|
||||||
|
|
||||||
@ -164,6 +177,9 @@ static bool ChooseSharedDirectory6(FSSpec& spec)
|
|||||||
}
|
}
|
||||||
static pascal short DlgHookYDProc(short item, DialogRef theDialog, void *yourDataPtr)
|
static pascal short DlgHookYDProc(short item, DialogRef theDialog, void *yourDataPtr)
|
||||||
{
|
{
|
||||||
|
if(GetWRefCon(theDialog) != sfMainDialogRefCon)
|
||||||
|
return item;
|
||||||
|
|
||||||
if(choosePressed)
|
if(choosePressed)
|
||||||
return 1;
|
return 1;
|
||||||
if(item == 10)
|
if(item == 10)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user