Kowal Posted February 11, 2018 Share Posted February 11, 2018 I am trying to format the DCL window. : text { label = "Test DCL."; alignment = centered; } : row { : boxed_column { width = 10; alignment = left; fixed_width = true; : text { label = "1."; alignment = centered; } : text { label = "2."; alignment = left; } } : boxed_column { alignment = centered; width = 20; fixed_width = true; : text { label = "3."; alignment = right; } : text { label = "4."; alignment = left; } } } : row { : edit_box { label = "Test:"; key = "Edit4";//Edit1$ from lsp file edit_width = 150.0; alignment = left; fixed_width = true; } } The window looks like this: How to move the column to the left does not change its width. As in the picture below. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted February 11, 2018 Share Posted February 11, 2018 Apply fixed_width = true to the row tile: test : dialog { : text { label = "Test DCL."; alignment = centered; } : row { [color=red]fixed_width = true;[/color] : boxed_column { width = 10; alignment = left; fixed_width = true; : text { label = "1."; alignment = centered; } : text { label = "2."; alignment = left; } } : boxed_column { alignment = centered; width = 20; fixed_width = true; : text { label = "3."; alignment = right; } : text { label = "4."; alignment = left; } } } : row { : edit_box { label = "Test:"; key = "Edit4"; //Edit1$ from lsp file edit_width = 150.0; alignment = left; fixed_width = true; } } ok_cancel; } Quote Link to comment Share on other sites More sharing options...
Kowal Posted February 12, 2018 Author Share Posted February 12, 2018 Thank you for your help. I have one more question. How to make such formatting edit_box with label. //--------------------------------------------------------------------------------------------------------- // MyEditText //--------------------------------------------------------------------------------------------------------- MyEditText : dialog { key = "Title"; label = "";//Title$ from lsp file : text { label = "DCL test."; alignment = centered; } initial_focus = "Edit1"; spacer; //: row { : column { width = 5.09; fixed_width = true; spacer; } : edit_box { label = "BLK:"; key = "Edit1";//Edit1$ from lsp file edit_width = 30.0; alignment = left; fixed_width = true; } initial_focus = "Edit2"; spacer; //: row { : column { width = 5.09; fixed_width = true; spacer; // : text { // key = "Prompt1"; // label = "";//Prompt from lsp file // } } : edit_box { label = "Attrib:"; key = "Edit2";//Edit1$ from lsp file edit_width = 30.0; alignment = left; fixed_width = true; } //} initial_focus = "Edit3"; spacer; //: row { : column { width = 5.09; fixed_width = true; spacer; // : text { // key = "Prompt2"; // label = "";//Prompt from lsp file // } } : edit_box { key = "Edit3";//Edit1$ from lsp file edit_width = 100.0; label = "Name:"; alignment = left; fixed_width = true; } //} spacer; : row { fixed_width = true; alignment = centered; : ok_button { width = 10; } : cancel_button { width = 10; } } }//MyEditText The code makes a window like in the picture below. How to align the edit_box to the left side like in the picture below. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted February 12, 2018 Share Posted February 12, 2018 How to make such formatting edit_box with label. How to align the edit_box to the left side like in the picture below. Hi, Divide edit_box tile into two tiles like this: : row { : text { label = "BLK:"; } : edit_box { key = "Edit1";}} Then add a space tile with specific width value to suit them in the alignment way you want it. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted February 12, 2018 Share Posted February 12, 2018 There is no need for rows of separate text/edit_box tiles, simply adjust the width attribute to account for the largest label: test : dialog { spacer; : edit_box { key = "edit1"; label = "Block:"; width = 42.0; edit_width = 30.0; fixed_width = true; alignment = left; } : edit_box { key = "edit2"; label = "Attrib:"; width = 42.0; edit_width = 30.0; fixed_width = true; alignment = left; } : edit_box { key = "edit3"; label = "Name:"; width = 112.0; edit_width = 100.0; fixed_width = true; alignment = left; } ok_cancel; } The above yields: Quote Link to comment Share on other sites More sharing options...
Grrr Posted February 12, 2018 Share Posted February 12, 2018 I've followed Tharwat's advice and ended up with some nice results: test1 : dialog { label = "EB Alignment test"; spacer_1; : column { alignment = centered; fixed_width = true; children_alignment = centered; : row { children_alignment = right; : text { label = "BLK:"; fixed_width = true; } : edit_box { key = "eb1"; fixed_width = true; }} : row { children_alignment = right; : text { label = "Attrib:"; fixed_width = true; } : edit_box { key = "eb2"; fixed_width = true; }} : row { children_alignment = right; : text { label = "Name:"; fixed_width = true; } : edit_box { key = "eb3"; fixed_width = true; }} } spacer_1; ok_only; spacer_1; } test2 : dialog { label = "EB Alignment test"; spacer_1; : column { alignment = centered; fixed_width = true; children_alignment = centered; : row { children_alignment = right; : text { label = "Name (First and Second):"; fixed_width = true; } : edit_box { key = "eb1"; fixed_width = true; }} : row { children_alignment = right; : text { label = "Age:"; fixed_width = true; } : edit_box { key = "eb2"; fixed_width = true; }} : row { children_alignment = right; : text { label = "Address:"; fixed_width = true; } : edit_box { key = "eb3"; fixed_width = true; }} : row { children_alignment = right; : text { label = "Email:"; fixed_width = true; } : edit_box { key = "eb4"; fixed_width = true; }} } spacer_1; ok_only; spacer_1; } They reminded me about his nice dialogs in his HVAC/Piping programs. However Lee's suggestion seems more suitable for the OP's dialog problem. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted February 13, 2018 Share Posted February 13, 2018 Good job Grrr and thanks for the nice words. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.