Jump to content

Recommended Posts

Posted

Hello, I am trying align vertically the edit_box with the image_button but I cannot , What I doing wrong?

image.png.de7c952e980e58a4fd7854f2a7056509.png

layer_config:dialog{label="Title";
spacer;
: boxed_column{
   label = "Test";
    : row{ alignment = right; fixed_width = true;
       : edit_box { label = "test"; }
       : image_button {alignment = centered; height = 1.5;aspect_ratio = 1;fixed_width = true;fixed_height = true;color = 2;  }
    }
    : row{ alignment = right; fixed_width = true;
       : edit_box { label = "new"; }
       : image_button {alignment = centered; height = 1.5;aspect_ratio = 1;fixed_width = true;fixed_height = true;color = 1;  }
    }
    : row{ alignment = right; fixed_width = true;
       : edit_box { label = "new test"; }
       : image_button {alignment = centered; height = 1.5;aspect_ratio = 1;fixed_width = true;fixed_height = true;color = 5;  }
    }
    }
ok_cancel;
}

 

Posted

layer_cfg2 : dialog {label="Title";
spacer;
: boxed_row {
  : column {:text{label="test";}:text{label="new";}:text{label="new test";}}
  : column{
    : row {: edit_box {vertical_margin=none;key="eb1";}
           : image_button {height=1.5;aspect_ratio=1;fixed_width=true;fixed_height=true;color=2;key="ib1";}}
    : row {: edit_box {vertical_margin=none;key="eb2";}
           : image_button {height=1.5;aspect_ratio=1;fixed_width=true;fixed_height=true;color=1;key="ib2";}}
    : row {: edit_box {vertical_margin=none;key="eb3";}
           : image_button {height=1.5;aspect_ratio=1;fixed_width=true;fixed_height=true;color=5;key="ib3";}}
    }
  }
  ok_cancel;
}

  • Like 1
  • 5 years later...
Posted (edited)

hello
i have same problem but i think the solution is different !?
even i used your code to align but failed .
how to align texts with edit boxes ?
 

    : boxed_row {fixed_width=true;
      label = "ÇØáÇÚÇÊ ãÇá˜"; 
         children_fixed_width = true;
          children_alignment = right;
           : column {
      : row {
    
       : edit_box { key = "name"; width = 25; }
      }
      : row {
    : edit_box { key = "father_name"; width = 25; }
      }
      : row {
     
        : edit_box { key = "personal_code"; width = 25; edit_limit = 10; }
      }
      : row {
     
        : edit_box { key = "address"; width = 25; }
      }}
      
  : column { children_fixed_width = true;
  : text { label = "äÇã æ äÇã ÎÇäæÇÏí"; alignment = right; }
  : text { label = "äÇã ÏÑ"; alignment = right; }
  : text { label = "˜Ï ãáí"; alignment = right; }
  : text { label = "ÂÏÑÓ";  alignment = right; }}}

 

dialogue.png

Edited by mohammadreza
Posted

Sometimes with DCL you have to switch it around, the weekend here so can't check but you have:

 

Column;

Row, Row, Row

Column;

Row, Row, Row

 

Try flipping it:

 

Row

Column, Column

Row

Column, column

Row,

Column, Column

 

In Row you can also specify alignment, top, bottom or centered and in column left, centered or right - Centered and Left are the defaults.

Generally a combination of row / column and alignments do the trick

 

 

 

Posted (edited)

Try this arrangement

xxxx : dialog {
: boxed_column { fixed_width = true ;
      label = "ÇØáÇÚÇÊ ãÇá˜"; 
      : row {
       : edit_box { key = "name"; width = 25; }
	    : text { label = "äÇã æ äÇã ÎÇäæÇÏí"; alignment = right; }
      }
      : row {
    : edit_box { key = "father_name"; width = 25; }
	 : text { label = "äÇã ÏÑ"; alignment = right; }
      }
      : row {
        : edit_box { key = "personal_code"; width = 25; edit_limit = 10; }
		 : text { label = "˜Ï ãáí"; alignment = right; }
      }
      : row {
        : edit_box { key = "address"; width = 25; }
		  : text { label = "ÂÏÑÓ";  alignment = right; }
      }
spacer_1 ;
ok_cancel;
}
}

 A good way to go is to convert the dcl to lisp so the dcl code is inside the lsp code. 

 

(defun wow ( / )

(setq dcl (vl-filename-mktemp nil nil ".dcl") )
(setq des (open dcl "w") )
(foreach x 
'(
"xxxx : dialog {"
": boxed_column { fixed_width = true ;"
"      label = \"ÇØáÇÚÇÊ ãÇá˜\"; "
"      : row {"
"       : edit_box { key = \"name\"; width = 25; }"
"	    : text { label = \"äÇã æ äÇã ÎÇäæÇÏí\"; alignment = right; }"
"      }"
"      : row {"
"    : edit_box { key = \"father_name\"; width = 25; }"
"	 : text { label = \"äÇã ÏÑ\"; alignment = right; }"
"      }"
"      : row {"
"        : edit_box { key = \"personal_code\"; width = 25; edit_limit = 10; }"
"		 : text { label = \"˜Ï ãáí\"; alignment = right; }"
"      }"
"      : row {"
"        : edit_box { key = \"address\"; width = 25; }"
"		  : text { label = \"ÂÏÑÓ\";  alignment = right; }"
"      }"
"spacer_1 ;"
"ok_cancel;"
"}"
"}"
"      "
)
(write-line x des )
)
(close des)

(setq dcl_id (load_dialog dcl))
  (if (not (new_dialog "xxxx" dcl_id))
    (exit)
  )
(action_tile "name" "(setq val1 (get_tile \"name\"))")
(action_tile "father_name" "(setq val2 (get_tile \"father_name\"))")
(action_tile "personal_code" "(setq val3 (get_tile \"personal_code\"))")
(action_tile "address" "(setq val4 (get_tile \"address\"))")
(action_tile "accept" "(done_dialog)")
(action_tile "cancel" "(done_dialog)")
(start_dialog)
(unload_dialog dcl_id)
(vl-file-delete dcl)  

(princ)
)
(wow)

 

Thanks to @rlx for his convert dcl to lsp.

Edited by BIGAL
  • Like 1
Posted

thanx Bigal , glad to hear it's still useful 👍

 

(defun c:mohammadreza ( / fn fp dcl drv)
  (create_dialog)
  (if (not (and (setq dcl (load_dialog fn)) (new_dialog "mohammadreza" dcl)))
    (princ "\nUnable to start dialog")
    (progn
      ;;; init tiles...
      ;;; action tiles
      (action_tile "cancel" "(done_dialog 0)")
      (action_tile "accept" "(done_dialog 1)")
      (if (and fn (findfile fn)) (vl-file-delete (findfile fn)))
      (setq drv (start_dialog))
      (cond
        ((= drv 0) (princ "\nCancel"))
        ((= drv 1) (princ "\nAccept"))
      )
    )
  )
  (princ)
)

(defun create_dialog ()
  (if (and (setq fn (vl-filename-mktemp "mohammedreze.dcl")) (setq fp (open fn "w")))
    (mapcar '(lambda (x)(write-line x fp))
             (list
               "mohammadreza : dialog {label=\"Mohammadreza 5/'25\";"
               "  :boxed_row {label=\"ÇØáÇÚÇÊ ãÇá˜\";"
               "    :column {:eb {key=\"name\";}:eb {key=\"father_name\";}:eb {key=\"personal_code\";edit_limit=10;}:eb {key=\"address\";}}"
               "    :column {vertical_margin=none;children_fixed_width=true;children_alignment=right;"
               "      :tr {label=\"äÇã æ äÇã ÎÇäæÇÏí\";}:tr {label=\"äÇã ÏÑ\";}:tr {label=\"˜Ï ãáí\";}:tr {label=\"ÂÏÑÓ\";}}}"
               "  ok_cancel;"
               "}"
               "eb :edit_box {fixed_width=true;width=25;vertical_margin=none;edit_width=25;}"
               "tr :text     {alignment=right;fixed_width=true;width=25;}"
             )
    )
  )
  (if fp (close fp))
  (gc)
)

 

🐉

  • Like 1

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