View previous topic :: View next topic |
Author |
Message |
laurent_H Contributor
Joined: 30 Jun 2001 Posts: 60
|
Posted: Thu Jan 17, 2002 1:03 am Post subject: Dynamic element |
|
|
Hi,
I have dynamics elements (groups) that place in my dialog
How can I add ascrollbar to my dialog for view outer added elements ?
Also, somme one knows How can forbid a dialog change position ?
Why because I want to put a dialog with dynamic created into a main dialog _________________ Thanks |
|
Back to top |
|
|
Mac Professional Member
Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Thu Jan 17, 2002 3:11 am Post subject: |
|
|
Here's one way to scroll elements, but there's a problem...
Although you can use DIALOG CREATE with negative numbers,
DIALOG SETPOS will not allow you to move elements below zero
coordinates, so I'm not sure this is going to help much. You might
try hiding the visible elements, then scrolling others into view.
__________________________________________________________________________________________________________________________
Code: |
rem -- VDS3 & VDS4 compatible --
OPTION SCALE, 96
Title By Mac
%%dialogX = 5
DIALOG CREATE,"Test Prog",-1,0,300,220
DIALOG ADD,STYLE,Style1,,,,BLACK
DIALOG ADD,BUTTON,B1,5,%%dialogX,60,20
DIALOG ADD,TEXT,T1,8,@sum(%%dialogX,65),,," Text Element "
DIALOG ADD,EDIT,E1,30,%%dialogX,290,20
DIALOG ADD,COMBO,C1,55,%%dialogX,290,20
DIALOG ADD,LIST,L1,80,%%dialogX,290,90
DIALOG ADD,TRACKBAR,TBar,175,0,300,24,,,,CLICK
DIALOG ADD,STATUS,Stat
DIALOG SHOW
:EVLOOP
WAIT EVENT
goto @event()
:TbarCLICK
%%dialogX = @prod(@dlgtext(Tbar),5)
DIALOG SET, Stat, X position = %%dialogX
GOSUB MoveElements
goto EVLOOP
:B1BUTTON
goto EVLOOP
:CLOSE
EXIT
rem ---- GOSUB ROUTINES ----
:MoveElements
DIALOG SETPOS,B1,,%%dialogX
DIALOG SETPOS,T1,,@sum(%%dialogX,65)
DIALOG SETPOS,E1,,%%dialogX
DIALOG SETPOS,C1,,%%dialogX
DIALOG SETPOS,L1,,%%dialogX
exit
|
_________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
|
|
Back to top |
|
|
laurent_H Contributor
Joined: 30 Jun 2001 Posts: 60
|
Posted: Thu Jan 17, 2002 8:34 am Post subject: |
|
|
Thanks Mac your example is very useful
Is there a way to design a real scrollbar like in a list to not disturb the user ? _________________ Thanks |
|
Back to top |
|
|
Mac Professional Member
Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Thu Jan 17, 2002 9:31 am Post subject: |
|
|
Well, this is kinda close...
__________________________________________________________________________________________________________________________
Code: |
rem -- VDS3 & VDS4 compatible --
OPTION SCALE, 96
Title By Mac
%%dialogX = 5
DIALOG CREATE,"Test Prog",-1,0,300,200
DIALOG ADD,STYLE,Style1,Wingdings,8,B,$E0E0E0
DIALOG ADD,BUTTON,B1,5,%%dialogX,60,20
DIALOG ADD,TEXT,T1,8,@sum(%%dialogX,65),,," Text Element "
DIALOG ADD,EDIT,E1,30,%%dialogX,290,20
DIALOG ADD,COMBO,C1,55,%%dialogX,290,20
DIALOG ADD,LIST,L1,80,%%dialogX,290,95
rem -- Scroll buttons --
DIALOG ADD,TEXT,Bkgrnd,184,0,300,15,,,Style1
DIALOG ADD,BUTTON,Left,184,0,15,15,@chr(215),,Style1
DIALOG ADD,BUTTON,Right,184,285,15,15,@chr(216),,Style1
DIALOG SHOW
:EVLOOP
DIALOG FOCUS, E1
WAIT EVENT
goto @event()
:B1BUTTON
goto EVLOOP
:LeftBUTTON
if @greater(%%dialogX, 0)
%%dialogX = @diff(%%dialogX,5)
else
%%dialogX = 0
end
GOSUB MoveElements
goto EVLOOP
:RightBUTTON
%%dialogX = @sum(%%dialogX,5)
GOSUB MoveElements
goto EVLOOP
:CLOSE
EXIT
rem ---- GOSUB ROUTINES ----
:MoveElements
DIALOG SETPOS,B1,,%%dialogX
DIALOG SETPOS,T1,,@sum(%%dialogX,65)
DIALOG SETPOS,E1,,%%dialogX
DIALOG SETPOS,C1,,%%dialogX
DIALOG SETPOS,L1,,%%dialogX
exit
|
_________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Last edited by Mac on Thu Jan 17, 2002 9:41 am; edited 2 times in total |
|
Back to top |
|
|
laurent_H Contributor
Joined: 30 Jun 2001 Posts: 60
|
Posted: Thu Jan 17, 2002 9:39 am Post subject: |
|
|
I love you Mac ;-*
I don't want to abuse of your time but is there a way to have between
the arrows a drag bar like in a window, You know the user drag the bar
and the screen advance in real time dragging event...
I'm very glad for your help Mac !
Laurent, Paris _________________ Thanks
Last edited by laurent_H on Thu Jan 17, 2002 9:41 am; edited 1 time in total |
|
Back to top |
|
|
Mac Professional Member
Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Thu Jan 17, 2002 9:40 am Post subject: |
|
|
If you have VDS4, you can probably use @mousedown() and put a
moveable button in the middle of the scroll bar (I'm still using VDS3). _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
|
|
Back to top |
|
|
laurent_H Contributor
Joined: 30 Jun 2001 Posts: 60
|
Posted: Thu Jan 17, 2002 9:48 am Post subject: |
|
|
I also use vds 3.51 version,
Should I use special event with a timeto detect the mouse Y position
and drag my bar in function of it...
Also, Is there a way to forbid the user to move a main dialog
in the screen ? _________________ Thanks |
|
Back to top |
|
|
Mac Professional Member
Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Thu Jan 17, 2002 10:07 am Post subject: |
|
|
I'll see what I can do about the slide, but it's going to move
anytime the mouse is over it in VDS3.
To keep the main window in position, I think you'll need a loop that
constantly checks the window position and automatically repositions it. _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
|
|
Back to top |
|
|
Mac Professional Member
Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Thu Jan 17, 2002 12:17 pm Post subject: |
|
|
Hey Laurent,
I posted one in the VDS3 Source code section.
Cheers, Mac _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
|
|
Back to top |
|
|
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Fri Jan 18, 2002 12:58 am Post subject: |
|
|
One of Tommy's dll's should have a similar function to the @mousedown()
that VDS 4 has. I use to use this function from his dll on regular basis all
the time while it was part of the VDSDLL.DLL, so check out his dll's and
see if he still has it.. I think it was @keyboard() or something like that.
I think there's a few examples listed on VDS World using these kinds of
routines that you need for the dragging of the scrollbar. _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
Back to top |
|
|
laurent_H Contributor
Joined: 30 Jun 2001 Posts: 60
|
Posted: Fri Jan 18, 2002 2:40 pm Post subject: |
|
|
I will see, but I think I'll upgrade my version of Vds go to 4 because the french version is coming soon so...
Anyway if you know how can I insert an icon in a menu item it will great _________________ Thanks |
|
Back to top |
|
|
SnarlingSheep Professional Member
Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Fri Jan 18, 2002 8:48 pm Post subject: |
|
|
Did you try our examples in the VDS3 Source Code section for creating your own menus?
At this time, using a dialog as a menu is the only way to have icons in the menu. _________________ -Sheep
My pockets hurt... |
|
Back to top |
|
|
laurent_H Contributor
Joined: 30 Jun 2001 Posts: 60
|
Posted: Sat Jan 19, 2002 6:09 pm Post subject: |
|
|
The icon of my item become from exe file so the example of don't walk
Do you if VD4 can put icon near a item ?
Do you if a popup sub menu could be create with VDS 4 because I saw a dll that called memo.dll a old vds extension that could create a popup
submenu but this one is 16 bit dll and I can't find the author to update the version to a vds 32 bit compatible with VDS3 or 4 ? _________________ Thanks |
|
Back to top |
|
|
Mac Professional Member
Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sat Jan 19, 2002 9:49 pm Post subject: |
|
|
You can show an EXE icon with the BITMAP element, just use the
EXE filename and it loads the icon.
__________________________________________________________________________________________________________________________
Code: |
DIALOG ADD,BITMAP,Menu0icon,5,5,25,20,vds.exe,,CLICK
|
Unfortunately, the STRETCH style doesn't work on icons, so
you must either clip it with the width/height parameters, or
use the full sized icon... _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|