Jump to content

Recommended Posts

Posted

Hello guys.

 

Is it possible to adjust the appearance of a dialog box to become equal in all sides ?

 

The following dialog box needs to adjust the text "X" to be in the middle and the buttons Ok and Cancel to be within the same size . :)

 

strings: dialog {
   label = "Window Selection ";            
   :column {
   :boxed_row {label = "Strings ...";
           :column {
            :row { : text { value = "Width"; }
                   : text { value = "X"; }
                   : text { value = "Height"; }
                }
            :row {
                  : popup_list { key = "l1"; width = 10; }
                  : popup_list { key = "l2"; width = 10; }
                  } 
           }
           }
           :row {
           : button { key = "accept"; label = "OK"; fixed_width = false; is_default = true; is_cancel = true; allow_accept =true; }
           : button { key = "cancel"; label = " Cancel "; fixed_width = false; is_default = false; is_cancel = true;}
           }
    }
           } 

dialog.jpg

Posted

You can control the size of a dialog by width and height attributes; width works also for buttons and labels.

May use spacer tile to adjust the location of other tiles.

strings: dialog {
   label = "Window Selection ";
[color=magenta] [color=red]   width = 30;
   height = 12;[/color][/color]
   :column {
   :boxed_row {label = "Strings ...";
           :column {
            :row {
                   [color=red]: spacer { width = 2; }[/color]
                   : text { value = "Width";  [color=magenta][color=red]width = 7;[/color] [/color]}
                   : text { value = "X";  [color=red]width = 3;[/color] }
                   : text { value = "Height"; [color=red]width = 5;[/color] }
                   [color=red]: spacer { width = 2; }[/color]
                }
            :row {
                  : popup_list { key = "l1"; width = 10; }
                  : popup_list { key = "l2"; width = 10; }
                  } 
           }
           }
           :row {
           : button { key = "accept"; label = "OK"; [color=red]width = 12;[/color] is_default = true; }
           : button { key = "cancel"; label = " Cancel "; [color=red]width = 12;[/color] is_cancel = true;}
           }
    }
           }

The is_default and is_cancel attributes are controlling the behavior of buttons when press , respectively ; both are set to false by default. Those attributes must be unique per dialog definition. Also is a nonsense to add allow_accept to an OK button - you ask it to trigger by himself.

Posted

I would use something like this:

 

mytext : text   { fixed_width = true; alignment = centered; }
mybutt : button { fixed_width = true; alignment = centered; width = 12; }

strings: dialog
{
   label = "Window Selection";
   : boxed_column
   {
       label = "Strings";
       : row
       {
           : column
           {
               : mytext { label = "Width"; }
               : popup_list { key = "l1"; width = 15; fixed_width = true; }
           }
           : column
           {
               : mytext { label = "X"; }
           }
           : column
           {
               : mytext { label = "Height"; }
               : popup_list { key = "l2"; width = 15; fixed_width = true; }
           }
       }
       spacer;
   }
   : row
   {
       fixed_width = true;
       alignment = centered;
       : mybutt { key = "accept"; label = "OK";      is_default = true; }
       : mybutt { key = "cancel"; label = "Cancel";  is_cancel = true;  }
   }
}

Posted

Waww ... both are GREAT :thumbsup:

 

Thank you so much gentlemen .

Posted

Hello guys .

 

How do you use edit format window for Dcl codes ?

 

Thanks

Posted

I'm afraid that feature works only with AutoLISP code. Excerpt from help:

If you select text to be formatted, the selection must contain valid AutoLISP expressions or the formatter will issue an error message.
Posted

Hello .

 

I am working on another dialog and I feel the widths ' values are not logic at all , so how do they work ?

 

Thanks

Posted
I am working on another dialog and I feel the widths ' values are not logic at all , so how do they work ?

 

What about them do you feel is not logical? A larger width value will result in a wider tile - seems logical enough to me :?

Posted

Hi Lee .

 

Actually when I change the width value of any button or popup list or edit boxes , I see nothing changed on the dialog , here is an example .

 

example: dialog {
width  = 25;
height = 10;
   label = "Lists " ;
   :boxed_column { label = "Rows"; 
   :row {
         :edit_box   { label = "Number of Rows :" ;     key = "rows" ;    value = "" ;   edit_width = 7 ; }
         :popup_list { label = "Supply" ;     key = "L1" ;      width = 5;}
         }
        }
   :boxed_column { label = "Columns"; width = 5; 
   :row {
                :edit_box   { label = "Number of Columns :" ;  key = "columns" ; value = "" ;   edit_width = 7 ; }
                :popup_list { label = "Return " ;    key = "L2" ;      width = 5;}
        }
       }
   :boxed_row
               {
      : button { key = "rect" ; label = "Rectangle selction" ; width = 5 ; is_default = true ; is_cancel = true ; }
      : button { key = "cancel" ; label = "Cancel" ;     width = 5 ; is_cancel = true ; }
               }
    }

 

Thanks a lot

Posted

The width value must be large enough to accommodate the size of the label for the button, and furthermore, the fixed_width attribute must be set to true, else the tile will expand to fill the available area.

 

Perhaps have a read through some of the DCL tutorials on AfraLISP, and the DCL guide in the Visual LISP IDE Help Documentation; both offer valuable insights surrounding dialog design and tile behaviour.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...