Make clicking the radio buttons switch focus back to the search line.

This means that pressing return will do a new search with the new settings.
This commit is contained in:
Stephen Heumann 2019-04-18 23:50:57 -05:00
parent ea2f3794ca
commit dcb6aa4d6b
3 changed files with 15 additions and 4 deletions

View File

@ -27,6 +27,9 @@
/* Task record used for TaskMasterDA */
static WmTaskRec taskRec;
/* Search line control */
static CtlRecHndl searchLineHandle;
static void HandleEvent(int eventCode, WmTaskRec *taskRec);
static boolean DoLEEdit (int editAction);
@ -91,6 +94,13 @@ static void HandleEvent(int eventCode, WmTaskRec *taskRec) {
DoMount();
break;
case forIIGSRadio:
case forAnyAppleIIRadio:
if (FindTargetCtl() != searchLineHandle) {
MakeThisCtlTarget(searchLineHandle);
}
break;
case disksList:
if (taskRec->what == mouseDownEvt) {
if (taskRec->wmClickCount == 2) {
@ -160,5 +170,6 @@ static boolean DoLEEdit (int editAction) {
void InitEventState(void) {
memset(&taskRec, sizeof(taskRec), 0);
searchLineHandle = GetCtlHandleFromID(window, searchLine);
}

View File

@ -104,6 +104,8 @@ void ShowBrowserWindow(void) {
sysWindRecord.memoryID = myUserID;
auxWindInfo->NDASysWindPtr = (Ptr)&sysWindRecord;
InitEventState();
disksListHandle = GetCtlHandleFromID(window, disksList);
mountButtonHandle = GetCtlHandleFromID(window, mountDiskButton);
searchButtonHandle = GetCtlHandleFromID(window, searchButton);
@ -118,8 +120,6 @@ void ShowBrowserWindow(void) {
moreResultsSelected = false;
InitEventState();
diskList = malloc(DISK_LIST_MAX_LENGTH * sizeof(*diskList));
if (diskList == NULL) {
CloseWindow(window);

View File

@ -41,7 +41,7 @@ enum NetDiskError {
NOT_MULTIPLE_OF_BLOCK_SIZE,
NOT_SPECIFIED_IMAGE_TYPE,
/* Errors related to proccessing JSON result in the disk browser */
/* Errors related to processing JSON result in the disk browser */
JSON_PARSING_ERROR = 900,
NOT_EXPECTED_CONTENTS,
};