DCL tab sorting

DCL tab sorting

J-Rocks
Collaborator Collaborator
1,363 Views
17 Replies
Message 1 of 18

DCL tab sorting

J-Rocks
Collaborator
Collaborator

Hello guys,

I have a dialog with four edit_box and when I press TAB from the keyboard the cursor moves from one to another automatically.

How can I rearrange the tab sorting between these attributes to the order I want ?

Thanks in advance.

0 Likes
1,364 Views
17 Replies
Replies (17)
Message 2 of 18

Moshe-A
Mentor
Mentor

@J-Rocks hi,

 

i do not know if you can control tab stop order but a disabled tile is not tab stop even  is_tab_stop = true;

 or you can set is_tab_stop = false; [but not at run time (in autolisp)] or recreate the dcl at run time.

 

Moshe

 

 

 

 

0 Likes
Message 3 of 18

paullimapa
Mentor
Mentor

tab stop order typically is from top down (row) and left to right (column)

shift+tab stop order typically is reverse of the above


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 4 of 18

J-Rocks
Collaborator
Collaborator

Yeah I know that, but I want to set my own tab order although that I read about all dcl tab functions from help document and could not find a working one which suit my needs.

0 Likes
Message 5 of 18

paullimapa
Mentor
Mentor

unfortunately, DCL programming does not offer an attribute to adjust the tab stop order


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 6 of 18

Sea-Haven
Mentor
Mentor

Not sure, not tested but I have when you select a radio button it saves a value and exits the dcl. So maybe can do same by click on a tile and set the one you want as next.

 

(action_tile rb1  (strcat "(setq but "  (rtos x 2 0) ")" "(set_tile rb2 "1")"))

 

0 Likes
Message 7 of 18

komondormrex
Mentor
Mentor

if you need the tab going your way to move focus, why you do not place your edit_boxes that way in dialog code? unless you want various ways depending on some data got. 

0 Likes
Message 8 of 18

J-Rocks
Collaborator
Collaborator

Hi,

Because I have lots of edit_boxes involved and I wanted to fill out the info in different order, though everything works well.

Thanks.

0 Likes
Message 9 of 18

komondormrex
Mentor
Mentor

well, in that case you may look at a possibility to fill out the info in other generated on the fly subdialogs which will follow your certain order for each request.

Message 10 of 18

J-Rocks
Collaborator
Collaborator

I am not sure that I got your idea but I think it seems promising, can you shade some light on the procedure or post testing codes for me to get it right ?

0 Likes
Message 11 of 18

komondormrex
Mentor
Mentor

komondormrex_0-1688554977072.png

 

this is a rough outline of what i meant

0 Likes
Message 12 of 18

scot-65
Advisor
Advisor

J-Rocks,

This is a late response to your reply - hope you will investigate my idea.

 

Create a dialog with 2 columns.

The first column populate with radio buttons listing all the tab variations you require.

Inside the second column create a row [container] with text_part and an edit_box inside.

Repeat 3 additional times to finish the second column.

Assign a key="Rad0" to the radio_column (a key to a radio_button is mandatory as well).

Assign a key to each row, to each text_part, and to each edit_box.

Assign fix_width=true to each row (or fixed_width to this second column).

Assign a width to the text_part and to the edit_box.

 

Action_tile each radio_button to change the text_part value (set_tile "Tex1" "Label #1")...

Where a edit box is not needed for a particular variation, (mode_tile "Row4" 1).

The radio button action can also automatically tab to the first edit box (mode_tile "Edi1" 2).

 

OK button gather together "Rad0", "Edi1", "Edi2", "Edi3", and "Edi4" as a LIST.

Done_dialog and process the input.

 

Use the first position (nth 0) of the LIST to direct which order for which value (cond...

 

Scot-65

 


Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.

Message 13 of 18

john.uhden
Mentor
Mentor

@J-Rocks ,

I think that most of the responses are true, BUT

You can put most any code in an action_tile line, including mode_tiling the peferred next tile.

Just remember that tile action must be input as strings, so that any string within the quoted action must be escape-quoted, as in...

(action_tile "A1" "(mode_tile \"A2\" 2)") ; focus on tile

Of course you can also do things before changing tiles, as in...

(action_tile "A1" "(do_this)(do_that $key)(mode_tile \"A2\" 2)") ; focus on tile

There re lots of ways to orchestrate more complex lyrics.

 

John F. Uhden

0 Likes
Message 14 of 18

scot-65
Advisor
Advisor
John,
Edit boxes are a different animal.
action tile works when entering the tile, but not while inside or when leaving.

Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.

0 Likes
Message 15 of 18

john.uhden
Mentor
Mentor

@scot-65 

Hi, Scot!

I was pretty sure that with edit_boxes, the action is taken when you press 'Enter.'

So if you include focusing on a different tile as the last part of the action, then the focus will change (as long as it's not the same tile 😁).

But what do I know?

John F. Uhden

0 Likes
Message 16 of 18

john.uhden
Mentor
Mentor

@Sea-Haven ,

Don't forget to escape those quotes (except for the two outer ones).

John F. Uhden

0 Likes
Message 17 of 18

komondormrex
Mentor
Mentor

actually it does, on the exiting. 

callback reason Code 2—Edit Boxes. 

The user has exited the edit box—by pressing the TAB key or by choosing a different tile—but has not made a final selection. If this is the reason for an edit box callback, your application should not update the value of the associated variable, but should check the validity of the value in the edit box.

@john.uhden and code 1 when hitting <enter>. 

0 Likes
Message 18 of 18

J-Rocks
Collaborator
Collaborator

Thank you for your clear narrative solution, will try it as soon as possible.

0 Likes