Forms not positioning correctly on one computer, but o.k. on the other...

Started by Hypersonic, August 22, 2012, 08:12:21 AM

Previous topic - Next topic

Hypersonic


I have the following code to display a form in the upper right corner of the screen, it seems to work on a couple computers, but one it always puts the form in the middle of the screen.
It works on my computer with screen size of 2560 x 1920, it works on a computer with screen size of 1920 x 1080, but the one that is in between
with a screen size of 1920 x 1200 it puts the form in the middle of the screen.
Any thoughts ?  UGH this is driving me nuts!



(defun c:synthesis_root_form ()
(entering "synthesis_root_form")

(vl-cmdf "_OPENDCL")

(get_all_setup_values_from_db);otherwise the active_job variable below might not be set when going into a fresh drawing...


(setq form_is_active (dcl_Form_IsActive Parametrics_Root_form))
(if form_is_active (dcl_Form_Close Parametrics_Root_form))

(setq project (strcat lsp_dir "parametrics/parametrics"))
   (dcl_project_load project T)                ;adding the T forces reload, i.e. for while makeing changes.....



;**** find corner to place it properly *****


(setq xsize (nth 0 (dcl_GetScreenSize)))
(setq ysize (nth 1 (dcl_GetScreenSize)))

(princ "\n in synthesis root form and screen xsize is: ")
(princ xsize)

(princ "\n in synthesis root form and screen ysize is: ")
(princ ysize)



(setq form_width (dcl_Control_GetWidth Parametrics_Root_Form));136 currently
(princ "\n in synthesis root form and form width is: ")
(princ form_width)

;just for testing, not used currently
(setq form_height (dcl_Control_GetHeight Parametrics_Root_Form));864 currently

(setq ulc_pos (- xsize form_width 10));this makes it pushed into the upper right corner of the main "center" screen.

;(setq ulc_pos (+ xsize 10));this pushes it to the left edge of the right screen...


(princ "\n in synthesis root form and the x value of the ulc_pos is: ")
(princ ulc_pos)



(dcl_Form_Show Parametrics_Root_Form ulc_pos 0)


(dcl_Control_SetCaption Parametrics_Root_Form_Label1 (strcat "Active Job: " active_job))


);end defun

Hypersonic

We reinstalled the video drivers just for fun, and Wala! that fixed it... Hmm maybe this will help someone down the road....