+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Full Member Kowal's Avatar
    Using
    Civil 3D 2014
    Join Date
    Apr 2013
    Posts
    84

    Default DCL alignment column

    Registered forum members do not see this ad.

    I am trying to format the DCL window.
    Code:
      : 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:

    DCL 1.jpg

    How to move the column to the left does not change its width.
    As in the picture below.

    DCL 2.jpg

  2. #2
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Win 7 Pro / Win 10 Pro / Linux Mint
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2018
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    19,539

    Default

    Apply fixed_width = true to the row tile:
    Code:
    test : dialog
    {
        : text
        {
            label = "Test DCL.";
            alignment = centered;
        }
        : row
        {
            fixed_width = true;
            : 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;
    }
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

  3. #3
    Full Member Kowal's Avatar
    Using
    Civil 3D 2014
    Join Date
    Apr 2013
    Posts
    84

    Default

    Thank you for your help.

    I have one more question.

    How to make such formatting edit_box with label.

    Code:
    //---------------------------------------------------------------------------------------------------------
    // 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.

    DCL 3.jpg

    How to align the edit_box to the left side like in the picture below.

    DCL 4.jpg

  4. #4
    Luminous Being Tharwat's Avatar
    Discipline
    Mechanical
    Tharwat's Discipline Details
    Occupation
    MEP AutoCAD Draughtsman
    Discipline
    Mechanical
    Details
    HVAC, Drainage, Water Supply, Fire Fighting and a little about Electricity.
    Using
    AutoCAD 2015
    Join Date
    Oct 2009
    Location
    Great Syria , Living in Abu Dhabi
    Posts
    6,179

    Default

    Quote Originally Posted by Kowal View Post
    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:

    Code:
    : 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.

  5. #5
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Win 7 Pro / Win 10 Pro / Linux Mint
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2018
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    19,539

    Default

    There is no need for rows of separate text/edit_box tiles, simply adjust the width attribute to account for the largest label:
    Code:
    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:

    editboxalignment.png
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

  6. #6
    Super Member
    Discipline
    Multi-disciplinary
    Using
    AutoCAD 2015
    Join Date
    Nov 2013
    Posts
    1,449

    Default

    I've followed Tharwat's advice and ended up with some nice results:

    Code:
    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;
    }
    Code:
    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.

    EB Alignment Test1.jpgEB Alignment Test2.jpg

  7. #7
    Luminous Being Tharwat's Avatar
    Discipline
    Mechanical
    Tharwat's Discipline Details
    Occupation
    MEP AutoCAD Draughtsman
    Discipline
    Mechanical
    Details
    HVAC, Drainage, Water Supply, Fire Fighting and a little about Electricity.
    Using
    AutoCAD 2015
    Join Date
    Oct 2009
    Location
    Great Syria , Living in Abu Dhabi
    Posts
    6,179

    Default

    Registered forum members do not see this ad.

    Good job Grrr and thanks for the nice words.

Similar Threads

  1. add comment/remark column to alignment table
    By sandiegophil in forum Civil 3D & LDD
    Replies: 0
    Last Post: 3rd Mar 2016, 08:16 pm
  2. Replies: 0
    Last Post: 15th Jan 2014, 01:43 pm
  3. Replies: 2
    Last Post: 26th Feb 2013, 05:35 pm
  4. Replies: 6
    Last Post: 11th Sep 2012, 08:20 pm
  5. column Alignment -Pls Help
    By muthu123 in forum AutoLISP, Visual LISP & DCL
    Replies: 2
    Last Post: 17th May 2010, 10:16 am

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts