Only allow disks list to be target when it's active.

This commit is contained in:
Stephen Heumann 2019-04-11 18:28:05 -05:00
parent 44d02d36e1
commit b3b9eea27e
2 changed files with 25 additions and 1 deletions

View File

@ -152,6 +152,8 @@ boolean DoLEEdit (int editAction) {
/* Do a search */
void DoSearch(void) {
CtlRecHndl disksListHandle;
for (int i = 0; i < DISK_LIST_LENGTH; i++) {
diskList[i].memPtr = "This is the title of some disk you could mount";
diskList[i].memFlag = 0;
@ -159,6 +161,19 @@ void DoSearch(void) {
NewList2(NULL, 1, (Ref) diskList, refIsPointer,
DISK_LIST_LENGTH, (Handle) GetCtlHandleFromID(window, disksList));
disksListHandle = GetCtlHandleFromID(window, disksList);
SetCtlMoreFlags(
GetCtlMoreFlags(disksListHandle) | fCtlCanBeTarget | fCtlWantEvents,
disksListHandle);
HiliteControl(noHilite, disksListHandle);
HiliteControl(noHilite, GetCtlHandleFromID(window, mountDiskButton));
ShowControl(GetCtlHandleFromID(window, previousPageButton));
ShowControl(GetCtlHandleFromID(window, pageText));
ShowControl(GetCtlHandleFromID(window, pageNumberLine));
ShowControl(GetCtlHandleFromID(window, ofPagesText));
ShowControl(GetCtlHandleFromID(window, nextPageButton));
}
/* Handle an event after TaskMasterDA processing */
@ -294,6 +309,15 @@ void ShowBrowserWindow(void) {
sysWindRecord.eventMask = 0xFFFF; //0x03FF;
sysWindRecord.memoryID = myUserID;
auxWindInfo->NDASysWindPtr = (Ptr)&sysWindRecord;
HiliteControl(inactiveHilite, GetCtlHandleFromID(window, disksList));
HiliteControl(inactiveHilite, GetCtlHandleFromID(window, mountDiskButton));
HideControl(GetCtlHandleFromID(window, previousPageButton));
HideControl(GetCtlHandleFromID(window, pageText));
HideControl(GetCtlHandleFromID(window, pageNumberLine));
HideControl(GetCtlHandleFromID(window, ofPagesText));
HideControl(GetCtlHandleFromID(window, nextPageButton));
cleanup:
if (resourceFileOpened && !windowOpened) {

View File

@ -126,7 +126,7 @@ resource rControlTemplate (disksList) {
{45, 10, 147, 410}, /* control rect */
ListControl {{
$0007, /* flags */
$7400, /* more flags */
$1400, /* more flags */
0, /* refcon */
0, /* list size */
10, /* List View */