Dialog Tab Settings are being ignored?

Started by IJRobson, July 08, 2016, 02:28:04 AM

Previous topic - Next topic

IJRobson

Why can't I get the Tab settings to work?

Code (winbatch) Select
MyDialogFormat=`WWWDLGED,6.2`
MyDialogCaption='Card Details`
MyDialogX=1000
MyDialogY=1000
MyDialogWidth=275
MyDialogHeight=350
MyDialogNumControls=018
; MyDialogProcedure=`CDProc`
MyDialogProcedure=`DEFAULT`
MyDialogFont=`DEFAULT`
MyDialogTextColor=`DEFAULT`
MyDialogBackground=`DEFAULT,DEFAULT`
MyDialogConfig=0

MyDialog001=`010,030,250,045, MULTILINEBOX,"S1_Info", DEFAULT, "%S1Info%", DEFAULT,82,8,DEFAULT,DEFAULT,DEFAULT`
MyDialog002=`005,085,260,075, GROUPBOX,    "Slot_2", DEFAULT,   "Slot 2", DEFAULT,83,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog003=`010,095,050,012, STATICTEXT,  "S_TEXT_2", DEFAULT,  "Card Serial Number:",DEFAULT,84,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog004=`010,110,250,045, MULTILINEBOX,"S2_Info", DEFAULT, "%S2Info%", DEFAULT,85,8,DEFAULT,DEFAULT,DEFAULT`
MyDialog005=`005,165,260,075, GROUPBOX,    "Slot_3", DEFAULT,  "Slot 3", DEFAULT,86,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog006=`010,175,050,012, STATICTEXT,  "S_TEXT_3", DEFAULT,   Card Serial Number:",DEFAULT,87,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog007=`060,013,110,012, EDITBOX, "S1SerialNumber", S1SN, "", DEFAULT,10,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog008=`065,093,110,012, EDITBOX, "S2SerialNumber", S2SN, "", DEFAULT,20,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog009=`065,173,110,012, EDITBOX, "S3SerialNumber", S3SN, "", DEFAULT,30,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog010=`065,253,110,012, EDITBOX, "S4SerialNumber", S4SN, "", DEFAULT,40,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog011=`070,330,036,012, PUSHBUTTON,  "PB_Continue",DEFAULT, "Continue", 1,50,32,DEFAULT,DEFAULT,DEFAULT`
MyDialog012=`160,330,036,012, PUSHBUTTON,  "PB_Cancel", DEFAULT,      "Cancel", 2,60,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog013=`005,005,260,075, GROUPBOX,    "Slot_1", DEFAULT,       "Slot 1", DEFAULT,80,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog014=`010,020,050,012, STATICTEXT,  "S_TEXT_1", DEFAULT,       "Card Serial Number:", DEFAULT,81,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog015=`010,190,250,045, MULTILINEBOX,"S3_Info", DEFAULT, "%S3Info%", DEFAULT,88,8,DEFAULT,DEFAULT,DEFAULT`
MyDialog016=`005,245,260,075, GROUPBOX,    "Slot_4", DEFAULT,       "Slot 4", DEFAULT,89,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog017=`010,255,050,012, STATICTEXT,  "S_TEXT_4", DEFAULT,       "Card Serial Number:", DEFAULT,90,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog018=`010,270,250,045, MULTILINEBOX,"S4_Info", DEFAULT, "%S4Info%", DEFAULT,91,8,DEFAULT,DEFAULT,DEFAULT`

ButtonPushed=Dialog("MyDialog")


This Dialog should default to the First Serial Number, then jump to the next Serial Number (skipping the MULTILINEBOXs) etc. once all four Serial Numbers are entered then jump to the Continue Button.

But when I run this  it always defaults to the Continue Button, then Cancel Button, then starts at the top of the dialog and goes down each item in turn?

I have changed the Tab Settings (increments of 10 and random values), the dialog item order in the code, but nothing is changing this TAB order?

I have spent over an hour trying to work out what I have done wrong but nothing is working?

Thanks

IJRobson

I am running 2014B which is not the latest version of WinBatch so I guess there must be a bug in this release.

So I kept 2014B but switched back to WWWDLGED,6.1 format and that has the same problem?

Code (winbatch) Select
MyDialogFormat=`WWWDLGED,6.1`
MyDialogCaption=`Card Details`
MyDialogX=1000
MyDialogY=1000
MyDialogWidth=275
MyDialogHeight=350
MyDialogNumControls=018
MyDialogProcedure=`CDProc`
MyDialogFont=`DEFAULT`
MyDialogTextColor=`DEFAULT`
MyDialogBackground=`DEFAULT,DEFAULT`
MyDialogConfig=0


MyDialog002=`410,400,070,020,PUSHBUTTON,DEFAULT,"Start &From",2,2,32,DEFAULT,DEFAULT,DEFAULT`

MyDialog001=`060,013,110,012, EDITBOX, S1SN, "", DEFAULT,10,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog002=`065,093,110,012, EDITBOX, S2SN, "", DEFAULT,20,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog003=`065,173,110,012, EDITBOX, S3SN, "", DEFAULT,30,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog004=`065,253,110,012, EDITBOX, S4SN, "", DEFAULT,40,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog005=`070,330,036,012, PUSHBUTTON, DEFAULT, "Continue", 1,50,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog006=`160,330,036,012, PUSHBUTTON, DEFAULT,       "Cancel", 2,60,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog007=`005,005,260,075, GROUPBOX, DEFAULT,       "Slot 1", DEFAULT,80,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog008=`010,015,050,012, STATICTEXT, DEFAULT,       "Card Serial Number:", DEFAULT,81,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog009=`010,030,250,045, MULTILINEBOX, DEFAULT, "%S1Info%", DEFAULT,82,8,DEFAULT,DEFAULT,DEFAULT`
MyDialog010=`005,085,260,075, GROUPBOX, DEFAULT,       "Slot 2", DEFAULT,83,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog011=`010,095,050,012, STATICTEXT, DEFAULT,       "Card Serial Number:", DEFAULT,84,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog012=`010,110,250,045, MULTILINEBOX, DEFAULT, "%S2Info%", DEFAULT,85,8,DEFAULT,DEFAULT,DEFAULT`
MyDialog013=`005,165,260,075, GROUPBOX, DEFAULT,       "Slot 3", DEFAULT,86,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog014=`010,175,050,012, STATICTEXT, DEFAULT,       "Card Serial Number:", DEFAULT,87,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog015=`010,190,250,045, MULTILINEBOX, DEFAULT, "%S3Info%", DEFAULT,88,8,DEFAULT,DEFAULT,DEFAULT`
MyDialog016=`005,245,260,075, GROUPBOX, DEFAULT,       "Slot 4", DEFAULT,89,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog017=`010,255,050,012, STATICTEXT, DEFAULT,       "Card Serial Number:", DEFAULT,90,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog018=`010,270,250,045, MULTILINEBOX, DEFAULT, "%S4Info%", DEFAULT,91,8,DEFAULT,DEFAULT,DEFAULT`

ButtonPushed=Dialog("MyDialog")

JTaylor

It is your group boxes.  They affect tab order.   You have the first one set to 80 which is higher than 50 (Continue) so it goes to Continue.

Jim

IJRobson

OK, if the problem is caused by the GROUPBOX how do I get it to work?

I have tried different GROUPBOX TAB Values (larger, smaller, the same) and this does affect the TAB Settings order but nothing I have found will start at the First Serial Number field, skip to the next Serial Number Field when TAB key is pressed etc.

I guess I could remove the GROUPBOX but surely this should work?

IJRobson

With the GROUPBOX removed then the Tab Settings work correctly.

So does anyone know how to get Tab Settings to work with GROUPBOX.

If not then I will have to redesign the Dialog without GROUPBOX.  Unfortunate this means no way to divide up the Dialog into the four sections I require.

td

The dialog is doing exactly what you are telling it to do.  As the Consolidated WIL Help file states, "The Group Box control owns all the controls inside of it and it tends to use the tab order of the Group Box. Its best to first set the tab order on each Group Box and the controls that do not live in a Group Box. Then set the tab order within each Group Box." 

This is the behavior for group box user controls as implemented by Microsoft and why group boxes have their name.  They group controls together for navigation.  It is not just for some kind of visual effect.  It is one of the basic principles of UI design that appearance reflects behavior and behavior reflects appearance.

If you want the tab order to start at the first group box give it the smallest tab order number of any of the controls outside of a group box.  If you want the group boxes to tab in order down the dialog then give each one a higher tab order number than the one above it but give all group boxes a lower tab order number than other controls outside of group boxes.   However, you cannot skip tab key navigation of the controls within a group box unless you disable (@csDiabled) the control or use a control type that cannot get the input focus. 

"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

IJRobson

Understood, I now have the Tab Settings following the GROUPBOX groups.

I can get it to skip the MULTILINEBOX fields using @CSDisable but that greys out the Text so how do I use the other method you mentioned ("a control type that cannot get the input focus").  I don't see a DIALOG parameter to restrict the Input Focus.  I am already using Read Only Parameter (8) but that still supports Focus.

I don't want the User to edit or change the MULTILINEBOX Field because I use DialogControlSet to write history information into this field thus why I don't want it greyed out.

Thanks

td

You can intercept focus changes using a timer, update the text in a disabled control, or use a control like VARYTEXT which does not accept the input focus.  However, none of these approaches will allow a user to scroll the contents of the control, if that is the intent.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

JTaylor

Do you need GroupBoxes?  Simply use a different method for highlighting the different sections.  Seems like you are using them for visual purposes rather than functional.  Maybe something like the following.  Also, I sometimes use static text boxes with no text and different background colors to create sections.

Jim


Code (winbatch) Select

MyDialogFormat=`WWWDLGED,6.2`

MyDialogCaption=`Card Details`
MyDialogX=1000
MyDialogY=1000
MyDialogWidth=274
MyDialogHeight=350
MyDialogNumControls=018
MyDialogProcedure=`DEFAULT`
MyDialogFont=`DEFAULT`
MyDialogTextColor=`DEFAULT`
MyDialogBackground=`DEFAULT,DEFAULT`
MyDialogConfig=0

MyDialog001=`011,033,250,044,MULTILINEBOX,"S1_Info",DEFAULT,DEFAULT,DEFAULT,82,@csReadOnly,DEFAULT,DEFAULT,DEFAULT`
MyDialog002=`011,097,050,012,STATICTEXT,"S_TEXT_2",DEFAULT,"Card Serial Number:",DEFAULT,84,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog003=`011,113,250,044,MULTILINEBOX,"S2_Info",DEFAULT,DEFAULT,DEFAULT,85,@csReadOnly,DEFAULT,DEFAULT,DEFAULT`
MyDialog004=`011,181,052,016,STATICTEXT,"S_TEXT_3",DEFAULT,"Card Serial Number:,DEFAULT,87,DEFAULT,DEFAULT,DEFAULT,DEFAULT",DEFAULT,60,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog005=`061,019,110,012,EDITBOX,"S1SerialNumber",S1SN,DEFAULT,DEFAULT,10,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog006=`065,097,110,012,EDITBOX,"S2SerialNumber",S2SN,DEFAULT,DEFAULT,20,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog007=`065,181,110,012,EDITBOX,"S3SerialNumber",S3SN,DEFAULT,DEFAULT,30,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog008=`065,265,110,012,EDITBOX,"S4SerialNumber",S4SN,DEFAULT,DEFAULT,40,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog009=`071,333,036,012,PUSHBUTTON,"PB_Continue",DEFAULT,"Continue",1,50,@csDefButton,DEFAULT,DEFAULT,DEFAULT`
MyDialog010=`161,333,036,012,PUSHBUTTON,"PB_Cancel",DEFAULT,"Cancel",2,60,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog011=`011,019,050,012,STATICTEXT,"S_TEXT_1",DEFAULT,"Card Serial Number:",DEFAULT,81,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog012=`011,197,250,044,MULTILINEBOX,"S3_Info",DEFAULT,DEFAULT,DEFAULT,88,@csReadOnly,DEFAULT,DEFAULT,DEFAULT`
MyDialog013=`011,265,050,012,STATICTEXT,"S_TEXT_4",DEFAULT,"Card Serial Number:",DEFAULT,90,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog014=`011,281,250,044,MULTILINEBOX,"S4_Info",DEFAULT,DEFAULT,DEFAULT,91,@csReadOnly,DEFAULT,DEFAULT,DEFAULT`
MyDialog015=`011,003,256,012,STATICTEXT,"StaticText_1",DEFAULT,"Slot 1",DEFAULT,150,DEFAULT,"Microsoft Sans Serif|6656|70|34",DEFAULT,"192|192|192"`
MyDialog016=`011,081,248,012,STATICTEXT,"StaticText_2",DEFAULT,"Slot 2",DEFAULT,150,DEFAULT,"Microsoft Sans Serif|6656|70|34",DEFAULT,"192|192|192"`
MyDialog017=`011,165,252,012,STATICTEXT,"StaticText_3",DEFAULT,"Slot 3",DEFAULT,150,DEFAULT,"Microsoft Sans Serif|6656|70|34",DEFAULT,"192|192|192"`
MyDialog018=`011,249,248,012,STATICTEXT,"StaticText_4",DEFAULT,"Slot 4",DEFAULT,150,DEFAULT,"Microsoft Sans Serif|6656|70|34",DEFAULT,"192|192|192"`

ButtonPushed=Dialog("MyDialog")



JTaylor

Actually, I think you must have some text...I just make it the same color as the background.

Jim