Problem with dcl_Control_SetPos

Started by velasquez, May 04, 2009, 12:25:54 PM

Previous topic - Next topic

velasquez

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.

scottcd

It looks as if it is expecting a list ?

Kerry

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


Perfection is not optional.
My other home is TheSwamp

velasquez

Hi Kerry,   
   
I didn't understand.   
Do you want to say that dcl_Control_SetPos works when it is called with strings?   
Thanks.

Fred Tomke

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
Fred Tomke
Dipl.-Ing. (FH) Landespflege

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

velasquez

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.

Kerry


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 ?




Perfection is not optional.
My other home is TheSwamp

velasquez

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

Fred Tomke

#8
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. Then we can work on your desktop to find the problem.

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

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

velasquez

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

velasquez

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

Fred Tomke

#11
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.
Fred Tomke
Dipl.-Ing. (FH) Landespflege

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

Fred Tomke

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.
Fred Tomke
Dipl.-Ing. (FH) Landespflege

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

velasquez

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

Fred Tomke

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)

Fred Tomke
Dipl.-Ing. (FH) Landespflege

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