From acd4a8caeee6e40469b879c892abb26780a5f8e5 Mon Sep 17 00:00:00 2001 From: akshay-c Date: Tue, 7 May 2019 12:05:55 +0530 Subject: Set initial focus controls for dialogboxes --- ldmicro/coildialog.cpp | 1 + ldmicro/commentdialog.cpp | 1 + ldmicro/contactsdialog.cpp | 1 + ldmicro/lutdialog.cpp | 1 + ldmicro/resetdialog.cpp | 1 + ldmicro/simpledialog.cpp | 1 + 6 files changed, 6 insertions(+) diff --git a/ldmicro/coildialog.cpp b/ldmicro/coildialog.cpp index f6677b9..eae0a3f 100644 --- a/ldmicro/coildialog.cpp +++ b/ldmicro/coildialog.cpp @@ -128,6 +128,7 @@ void ShowCoilDialog(BOOL *negated, BOOL *setOnly, BOOL *resetOnly, char *name) } else { NormalRadio->setChecked(TRUE); } + NameTextbox->setFocus(); int ret = CoilDialog->exec(); switch(ret) { diff --git a/ldmicro/commentdialog.cpp b/ldmicro/commentdialog.cpp index 1b7bffe..8e29528 100644 --- a/ldmicro/commentdialog.cpp +++ b/ldmicro/commentdialog.cpp @@ -67,6 +67,7 @@ void ShowCommentDialog(char *comment) CommentGrid = new QGridLayout(CommentDialog); MakeControls(); CommentTextbox->setText(comment); + CommentTextbox->setFocus(); int ret = CommentDialog->exec(); switch(ret) { diff --git a/ldmicro/contactsdialog.cpp b/ldmicro/contactsdialog.cpp index 40d8055..be04b15 100644 --- a/ldmicro/contactsdialog.cpp +++ b/ldmicro/contactsdialog.cpp @@ -108,6 +108,7 @@ void ShowContactsDialog(BOOL *negated, char *name) NameTextbox->setValidator( new QRegExpValidator( QRegExp("[a-zA-Z0-9_]+"))); + NameTextbox->setFocus(); if(name[0] == 'R') { SourceInternalRelayRadio->setChecked(TRUE); diff --git a/ldmicro/lutdialog.cpp b/ldmicro/lutdialog.cpp index b6e3433..bd13fc8 100644 --- a/ldmicro/lutdialog.cpp +++ b/ldmicro/lutdialog.cpp @@ -354,6 +354,7 @@ void ShowLookUpTableDialog(ElemLeaf *l) sprintf(buf, "%d", t->count); CountTextbox->setText(buf); AsStringCheckbox->setChecked(asString); + DestTextbox->setFocus(); PrevTableAsString[0] = NULL; int ret = LutDialog->exec(); switch(ret) diff --git a/ldmicro/resetdialog.cpp b/ldmicro/resetdialog.cpp index 0d155b8..ba79def 100644 --- a/ldmicro/resetdialog.cpp +++ b/ldmicro/resetdialog.cpp @@ -99,6 +99,7 @@ void ShowResetDialog(char *name) TypeCounterRadio->setChecked(TRUE); } NameTextbox->setText(name + 1); + NameTextbox->setFocus(); int ret = ResetDialog->exec(); switch(ret) diff --git a/ldmicro/simpledialog.cpp b/ldmicro/simpledialog.cpp index c9a9e77..a22ae99 100644 --- a/ldmicro/simpledialog.cpp +++ b/ldmicro/simpledialog.cpp @@ -150,6 +150,7 @@ BOOL ShowSimpleDialog(char *title, int boxes, char **labels, DWORD numOnlyMask, QRegExp("[a-zA-Z0-9_'-]+"))); } } + Textboxes[0]->setFocus(); int ret = SimpleDialog->exec(); switch(ret) { -- cgit