Hi
dcl_Control_SetPos in Opendcl 4.1.2.2 doesn't work when it is called below in the format.
(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.
It looks as if it is expecting a list ?
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 ...
Hi Kerry,
I didn't understand.
Do you want to say that dcl_Control_SetPos works when it is called with strings?
Thanks.
Hi,
give the following a try, I have a assumption in mind.
(dcl_Control_SetPos "DuctilCAD" "MainForm" "PictureBox1" 246 83 244 180)
Fred
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.
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 ?
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
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
(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
(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
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.
(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
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.
(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
Hm, this works in my code with 5.1.0.4:
(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.
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.
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:
(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)
....
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.
(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)
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.
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
Hello Chad, my problem was solved my doubt it was cleared.
Thanks
Excuse me Fred, the answer was for you.
Thanks
Doesn't matter. I believe that Chad won't read these topics anymore ;)
Fred