OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: velasquez on May 04, 2009, 12:25:54 PM

Title: Problem with dcl_Control_SetPos
Post by: velasquez on May 04, 2009, 12:25:54 PM
Hi 
dcl_Control_SetPos in Opendcl 4.1.2.2 doesn't work when it is called below in the format.
Code (autolisp) Select
(dcl_Control_SetPos "DuctilCAD" "DuctilCAD_MainForm" "PictureBox1" 246 83 244 180)
I tested with PictureBox and SlideView. 
Did anybody already test with a newer version? 
Unhappily I could not still make this work.
Title: Re: Problem with dcl_Control_SetPos
Post by: scottcd on May 04, 2009, 09:24:09 PM
It looks as if it is expecting a list ?
Title: Re: Problem with dcl_Control_SetPos
Post by: Kerry on May 05, 2009, 01:37:51 AM
I think you may be applying the Position to the incorrect control.

Is the PictureBox in question the one on the rab Pane ??

If so  the X & Y should be relative to the Contailner, not the Parent ... 


Title: Re: Problem with dcl_Control_SetPos
Post by: velasquez on May 07, 2009, 10:07:42 AM
Hi Kerry,   
   
I didn't understand.   
Do you want to say that dcl_Control_SetPos works when it is called with strings?   
Thanks.
Title: Re: Problem with dcl_Control_SetPos
Post by: Fred Tomke on May 07, 2009, 11:10:13 AM
Hi,

give the following a try, I have a assumption in mind.

Code (autolisp) Select
(dcl_Control_SetPos "DuctilCAD" "MainForm" "PictureBox1" 246 83 244 180)

Fred
Title: Re: Problem with dcl_Control_SetPos
Post by: velasquez on May 07, 2009, 01:52:02 PM
Hello Fred, 
Thank you for the help but dcl_Control_SetPos forms he/she doesn't also work. 
I need to use inside of Foreach.
Title: Re: Problem with dcl_Control_SetPos
Post by: Kerry on May 07, 2009, 02:51:35 PM

How about posting your odcl and some testing code. ?

I'm using 5.1.0.4 so can't remember anything special different about 4.1.2.2

Is the Picturebox on the Tab Control. ?
For interest, why are you setting the position of the PictureBox ?




Title: Re: Problem with dcl_Control_SetPos
Post by: velasquez on May 07, 2009, 03:52:15 PM
I am not fastening PictureBox.   
The problem with dcl_Control_SetPos is that he doesn't work in any place when it is called with strings.   
I need to move and to change the size of many PictureBox in RunTime
Title: Re: Problem with dcl_Control_SetPos
Post by: Fred Tomke on May 07, 2009, 11:57:04 PM
Quote from: velasquez on May 07, 2009, 01:52:02 PM
Hello Fred, 
Thank you for the help but dcl_Control_SetPos forms he/she doesn't also work. 
I need to use inside of Foreach.

The thing I had in mind was that your example was

Code (autolisp) Select
(dcl_Control_SetPos <projectname> <projectname>_<formname> <controlname> 246 83 244 180)

I thought that the syntax could have been a mistype because it must be

Code (autolisp) Select
(dcl_Control_SetPos <projectname> <formname> <controlname> 246 83 244 180)

instead. If you want I invite you to a remote desktop connection using the free TeamViewer (http://www.teamviewer.com/index.aspx). Then we can work on your desktop to find the problem.

Fred
Title: Re: Problem with dcl_Control_SetPos
Post by: velasquez on May 08, 2009, 04:55:59 AM
Hello Fred, 
 
I don't know TeamViewer but the code that I posted display that the problem this in the property dcl_Control_SetPos why the another work well.

Code (autolisp) Select

(defun JoyCleanMenu ()
    (foreach JoyItem '("PictureBox1"    "PictureBox2"
       "PictureBox3"    "PictureBox4"
       "PictureBox5"    "PictureBox6"
       "PictureBox7"    "PictureBox8"
       "PictureBox9"    "PictureBox10"
       "PictureBox11"    "PictureBox12"
      ) ;_ fim de list
;;;Limpa o PictureBox
      (dcl_PictureBox_Clear
"DuctilCAD"
"DuctilCAD_MainForm"
JoyItem
NIL
      ) ;_ fim de dcl_Control_SetVisible
;;;Oculta o PictureBox
      (dcl_Control_SetVisible
"DuctilCAD"
"DuctilCAD_MainForm"
JoyItem
NIL
      ) ;_ fim de dcl_Control_SetVisible
    ) ;_ fim de foreach
  )


Thanks
Title: Re: Problem with dcl_Control_SetPos
Post by: velasquez on May 08, 2009, 06:21:45 AM
Hello Fred, 
dcl_Control_SetPos worked below in the code in OpenDCL 4.1.2.2 
 
If this problem is happening in the current version I think is a bug.

Code (autolisp) Select
(dcl_Control_SetPos
       (eval
(read
   (strcat "DuctilCAD_DuctilCAD_MainForm_" (nth 0 Joyitem))
) ;_ fim de read
       ) ;_ fim de eval
       (nth 0 (cadr joyitem))
       (nth 1 (cadr joyitem))
       (nth 2 (cadr joyitem))
       (nth 3 (cadr joyitem))
     ) ;_ fim de dcl_Control_SetPos
Title: Re: Problem with dcl_Control_SetPos
Post by: Fred Tomke on May 08, 2009, 12:23:57 PM
Hm, this works in my code with 5.1.0.4:

Code (autolisp) Select
(dcl_Control_SetPos signothek_sc_signothek_dwg_1 intStartX intStartY nBreitePrevSing nHöhePrevSing)

Fred

P.S. The video is very bad. But it shows that the dwg previews are resizing as desired.
Title: Re: Problem with dcl_Control_SetPos
Post by: Fred Tomke on May 08, 2009, 12:27:02 PM
velasquez, please upload the odcl and tell me which control to resize.

Fred

P.S. TeamViewer is a very good tool for internet based online support. We use it with our customers.
Title: Re: Problem with dcl_Control_SetPos
Post by: velasquez on May 08, 2009, 02:22:28 PM
Hi Fred,   
I will separate my file odcl to send for you.   
Did you work with SetPos in each control or in all at once?   
Or:
Code (autolisp) Select

(dcl_Control_SetPos signothek_sc_signothek_dwg_1 intStartX intStartY nBreitePrevSing nHöhePrevSing)
(dcl_Control_SetPos signothek_sc_signothek_dwg_2 intStartX intStartY nBreitePrevSing nHöhePrevSing)
(dcl_Control_SetPos signothek_sc_signothek_dwg_3 intStartX intStartY nBreitePrevSing nHöhePrevSing)
(dcl_Control_SetPos signothek_sc_signothek_dwg_4 intStartX intStartY nBreitePrevSing nHöhePrevSing)
....
Title: Re: Problem with dcl_Control_SetPos
Post by: Fred Tomke on May 09, 2009, 12:47:52 PM
Hi, velasquez, don't do to much work with your odcl-file. I will only work with one control to demonstrate.

QuoteDid you work with SetPos in each control

Yes, I invoke SetPos to every preview. I upload the project file and the event OnSize for testing.

Code (autolisp) Select


(defun c:signothek_sc_signothek_OnSize (nWidth nHeight / lstRec nWidthPrevAll nWidthPrevSing
  nWidthPrevDistAll nWidthPrevDistSing
  nHeightPrevAll nHeightPrevSing nHeightPrevDistAll
  nHeightPrevDistSing intLS2 intLS3 intTR2 intTR3
  intStartX intStartY)
  (setq lstRec (dcl_Control_GetCurPos signothek_sc_signothek_frm_preview))
;;;  (princ (strcat "\nWidth: " (itoa (caddr lstRec)) " Height: " (itoa (last lstRec)) " Left: " (itoa (car lstRec)) " Top: " (itoa (cadr lstRec)) "\r"))

  (setq nWidthPrevAll (- (caddr lstRec) 40))
  (setq nWidthPrevSing (fix (/ (- nWidthPrevAll 8) 3.0)))
  (setq nWidthPrevDistAll (- nWidthPrevAll (* 3 nWidthPrevSing)))
  (setq nWidthPrevDistSing (fix (/ nWidthPrevDistAll 2.0)))
;;;  (princ (strcat "\nWidth: " (itoa nWidthPrevAll) " Each: " (itoa nWidthPrevSing)
;;; " DistAll: " (itoa nWidthPrevDistAll) " DistEach: " (itoa nWidthPrevDistSing) "\r"))

  (setq nHeightPrevAll (- (last lstRec) 20))
  (setq nHeightPrevSing (fix (/ (- nHeightPrevAll 8) 3.0)))
  (setq nHeightPrevDistAll (- nHeightPrevAll (* 3 nHeightPrevSing)))
  (setq nHeightPrevDistSing (fix (/ nHeightPrevDistAll 2.0)))
;;;  (princ (strcat "\nHeight: " (itoa nHeightPrevAll) " Each: " (itoa nHeightPrevSing)
;;; " DistAll: " (itoa nHeightPrevDistAll) " DistEach: " (itoa nHeightPrevDistSing) "\r"))

  (setq intStartX (+ (car lstRec) 8))
  (setq intStartY 20)
  (setq intLS2 (+ intStartX nWidthPrevSing nWidthPrevDistSing))
  (setq intLS3 (+ intStartX (* 2 nWidthPrevSing) (* 2 nWidthPrevDistSing)))
  (setq intTR2 (+ intStartY nHeightPrevSing nHeightPrevDistSing))
  (setq intTR3 (+ intStartY (* 2 nHeightPrevSing) (* 2 nHeightPrevDistSing)))

  (dcl_Control_SetPos signothek_sc_signothek_dwg_1 intStartX intStartY nWidthPrevSing nHeightPrevSing)
  (dcl_Control_SetPos signothek_sc_signothek_dwg_2 intLS2 intStartY nWidthPrevSing nHeightPrevSing)
  (dcl_Control_SetPos signothek_sc_signothek_dwg_3 intLS3 intStartY nWidthPrevSing nHeightPrevSing)
  (dcl_Control_SetPos signothek_sc_signothek_dwg_4 intStartX intTR2 nWidthPrevSing nHeightPrevSing)
  (dcl_Control_SetPos signothek_sc_signothek_dwg_5 intLS2 intTR2 nWidthPrevSing nHeightPrevSing)
  (dcl_Control_SetPos signothek_sc_signothek_dwg_6 intLS3 intTR2 nWidthPrevSing nHeightPrevSing)
  (dcl_Control_SetPos signothek_sc_signothek_dwg_7 intStartX intTR3 nWidthPrevSing nHeightPrevSing)
  (dcl_Control_SetPos signothek_sc_signothek_dwg_8 intLS2 intTR3 nWidthPrevSing nHeightPrevSing)
  (dcl_Control_SetPos signothek_sc_signothek_dwg_9 intLS3 intTR3 nWidthPrevSing nHeightPrevSing)
); c:signothek_sc_signothek_OnSize

(dcl_Form_Show signothek_sc_signothek)

Title: Re: Problem with dcl_Control_SetPos
Post by: velasquez on May 11, 2009, 05:28:28 AM
Hello Fred, 
 
Thank you for the files. 
I could test the chada below and he worked well with OpenDCL 5.0.2.4 
 
The problem that I found this in the version 4.1.2.2

Thank you for your help.
Title: Re: Problem with dcl_Control_SetPos
Post by: Fred Tomke on May 11, 2009, 08:28:03 AM
Hello velasquez, I must say that I'ver never worked with OpenDCL 4. I started with OpenDCL 5 alpha again.
I'm not sure - even quite a bit confused: is your problem solved now?

Fred
Title: Re: Problem with dcl_Control_SetPos
Post by: velasquez on May 11, 2009, 10:56:06 AM
Hello Chad, my problem was solved my doubt it was cleared. 
Thanks
Title: Re: Problem with dcl_Control_SetPos
Post by: velasquez on May 11, 2009, 11:56:28 AM
Excuse me Fred, the answer was for you. 
Thanks
Title: Re: Problem with dcl_Control_SetPos
Post by: Fred Tomke on May 11, 2009, 03:31:22 PM
Doesn't matter. I believe that Chad won't read these topics anymore  ;)

Fred