How to position a form without opening it ?

Started by krunch, February 14, 2011, 06:34:22 AM

Previous topic - Next topic

krunch

Hi

I'd want a Modeless form to appear near the cursor, so I set the position (left height) of the form with SetPos method (lisp below).
But this method doesn't work if the form is not displayed, so it makes a "flash" on the previous position of the form when (dcl_Form_Show proj dia) is called.

Is there a way to set position before the dcl_Form_Show ?
Thanks

Code (autolisp) Select

    (dcl_Form_Show proj dia)
;;;    (dcl_Form_Hide proj dia T) ; doesn't change anything
    (MoveForm dia 216 232) ; width height of the form
;;;    (dcl_Form_Hide proj dia nil)

(defun MoveForm (dia x y / tmp lft hgt)
  (setq tmp (dcl_GetMouseCoords)
    lft (if (< (- (car(dcl_GetScreenSize)) (car tmp) 30) x) (- (car tmp) x 30) (+ (car tmp) 30))
    hgt (if (< (- (last tmp) 30) y) (+ (last tmp) 30) (- (last tmp) y 30)))
  (dcl_Control_SetPos proj dia lft hgt)
)

Fred Tomke

Hello, why don't you use (dcl_form_show proj_dia intX intY) ?

Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

krunch

I had't seen these arguments for show method.. Thanks !

Fred Tomke

Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]