forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


MAC --> Move Elements (Controls) Example .. Please repost

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code
View previous topic :: View next topic  
Author Message
marty
Professional Member
Professional Member


Joined: 10 May 2001
Posts: 789

PostPosted: Tue Jan 08, 2002 12:47 pm    Post subject: MAC --> Move Elements (Controls) Example .. Please repost Reply with quote

Hi Mac,

You made a Move Elements (Controls) Example that was in the old forum in the Source code section. But since we can't download any attachements with the old forum could you repost it on this one.

Thanks in advance Cool
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Tue Jan 08, 2002 10:09 pm    Post subject: Reply with quote

I was able to download it..seems you should be able to also.

Code:

rem -- Example of how to move dialog elements. Some can just
rem -- be clicked on, others require using the "Difficult
rem -- Elements" menu. The ENTER key must be used to release
rem -- the difficult elements.

rem -- Use the "Options" menu to set whether you're moving
rem -- or using the "easy" elements that you just click on.

rem -- NOTE: You could save a user's layout with an INI file
rem --       and use it to build the program each time.

OPTION SCALE, 96
Title "Mac's Move Elements"
DIALOG CREATE,"Mac's Move Elements",-1,0,350,300
  DIALOG ADD,MENU,&Options,&Move Element,&Use Element
  DIALOG ADD,MENU,&Difficult Elements,Move Edit Box,Move Combo,Move List,Move Radio,Move Group,Move Progress Bar
  DIALOG ADD,STYLE,Line_Style,,,,BLACK
  DIALOG ADD,TEXT,Line0,0,0,350,1,"",Line_Style

  rem -- Only used to create event with ENTER key --
  DIALOG ADD,BUTTON,Dummy,0,0,0,0,,DEFAULT

  rem -- Easy elements, just click on these to move them.
  rem -- Bitmaps could be used here also.
  DIALOG ADD,BUTTON,B1,5,5,60,20,"Button"
  DIALOG ADD,BITBTN,B2,30,5,60,20,,"Bitbtn","This is a hint..."
  DIALOG ADD,CHECK,C1,60,5,,,"Checkbox",,CLICK
  DIALOG ADD,TEXT,T1,90,5,,," A Line of text... ",CLICK
  DIALOG ADD,TRACKBAR,T2,230,5,180,24,,,,CLICK

  rem -- Difficult elements that do not generate events, require
  rem -- specific area clicks (radio, combo), or listbox (must
  rem -- contain items to generate event).
  DIALOG ADD,EDIT,E1,120,5,100,,EditBox
  DIALOG ADD,COMBO,C2,150,5,100,,"Combo List"
  DIALOG ADD,RADIO,R1,5,250,80,70,RADIO1,Value 1|Value 2|Value 3
  DIALOG ADD,GROUP,G1,90,152,180,40,Group
  DIALOG ADD,PROGRESS,P1,160,152,180,18,"50"
  DIALOG ADD,LIST,L1,200,250,80,50

  DIALOG ADD,STATUS,Stat1
DIALOG SHOW

LIST ADD, L1, "List"
%%move = 1

:EVLOOP
  if %%move
     DIALOG SET, Stat1, "Click & Release to move (or use 'Difficult Elements' options)..."
  else
     DIALOG SET, Stat1,"Set 'Options' for element use or movement"
  end
  WAIT EVENT
  %e = @event()
  goto %e

:DummyBUTTON
  goto EVLOOP

:Move ElementMENU
  %%move = 1
  goto EVLOOP

:Use ElementMENU
  %%move = ""
  goto EVLOOP

:Move Edit BoxMENU
  %e = E1
  goto Move_Element

:Move ComboMENU
  %e = C2
  goto Move_Element

:Move ListMENU
  %e = L1
  goto Move_Element

:Move RadioMENU
  %e = R1
  goto Move_Element

:Move GroupMENU
  %e = G1
  goto Move_Element

:Move Progress BarMENU
  %e = P1
  goto Move_Element

:B1BUTTON
:B2BUTTON
:C1CLICK
:T1CLICK
:T2CLICK
  if %%move
     goto Move_Element
  else
     INFO "Now we're using the element"@tab()
  end
  goto EVLOOP

:Move_Element
  DIALOG SET, Stat1, "Click again to release  (ENTER key on difficult elements)..."

  rem -- Find which element to move --
  %s = @substr(%e, 1, 2)

  REPEAT
    rem -- Attach element to mouse (allow for Window Position, etc.) --
    %x = @diff(@mousepos(X), @sum(@winpos("Mac's Move Elements",L),10))
    %y = @diff(@mousepos(Y), @sum(@winpos("Mac's Move Elements",T),50))

    rem -- Keep element at least partially on screen --
    if @greater(0, %x)
       %x = 0
    end
    if @greater(0, %y)
       %y = 0
    end
    if @greater(%x, 340)
       %x = 340
    end
    if @greater(%y, 270)
       %y = 270
    end

    rem -- Move the element --
    DIALOG SETPOS,%s,%y,%x

  UNTIL @event()
  goto EVLOOP

:CLOSE
  EXIT
  STOP

_________________
-Sheep
My pockets hurt...
Back to top
View user's profile Send private message Send e-mail
Tommy
Admin Team


Joined: 16 Nov 2002
Posts: 746
Location: The Netherlands

PostPosted: Tue Jan 08, 2002 10:12 pm    Post subject: Reply with quote

Uploads should be downloadable now on the old board:

http://www.sools.nl/Ultraboard/Public/Uploads/Post-3-46-move_elements.dsc

Tommy
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Tue Jan 08, 2002 10:13 pm    Post subject: Reply with quote

OK, here's two of them. The first one is the original one
I posted, the second uses the undocumented "DESIGN"
style that LiquidCode told me about.
________________________________________________________________________________________________________________________________________________________
Code:

rem -- Example of how to move dialog elements. Some can just
rem -- be clicked on, others require using the "Difficult
rem -- Elements" menu. The ENTER key must be used to release
rem -- the difficult elements.

rem -- Use the "Options" menu to set whether you're moving
rem -- or using the "easy" elements that you just click on.

rem -- NOTE: You could save a user's layout with an INI file
rem --       and use it to build the program each time.

OPTION SCALE, 96
Title "Mac's Move Elements"
DIALOG CREATE,"Mac's Move Elements",-1,0,350,300
  DIALOG ADD,MENU,&Options,&Move Element,&Use Element
  DIALOG ADD,MENU,&Difficult Elements,Move Edit Box,Move Combo,Move List,Move Radio,Move Group,Move Progress Bar
  DIALOG ADD,STYLE,Line_Style,,,,BLACK
  DIALOG ADD,TEXT,Line0,0,0,350,1,"",Line_Style

  rem -- Only used to create event with ENTER key --
  DIALOG ADD,BUTTON,Dummy,0,0,0,0,,DEFAULT

  rem -- Easy elements, just click on these to move them.
  rem -- Bitmaps could be used here also.
  DIALOG ADD,BUTTON,B1,5,5,60,20,"Button"
  DIALOG ADD,BITBTN,B2,30,5,60,20,,"Bitbtn","This is a hint..."
  DIALOG ADD,CHECK,C1,60,5,,,"Checkbox",,CLICK
  DIALOG ADD,TEXT,T1,90,5,,," A Line of text... ",CLICK
  DIALOG ADD,TRACKBAR,T2,230,5,180,24,,,,CLICK

  rem -- Difficult elements that do not generate events, require
  rem -- specific area clicks (radio, combo), or listbox (must
  rem -- contain items to generate event).
  DIALOG ADD,EDIT,E1,120,5,100,,EditBox
  DIALOG ADD,COMBO,C2,150,5,100,,"Combo List"
  DIALOG ADD,RADIO,R1,5,250,80,70,RADIO1,Value 1|Value 2|Value 3
  DIALOG ADD,GROUP,G1,90,152,180,40,Group
  DIALOG ADD,PROGRESS,P1,160,152,180,18,"50"
  DIALOG ADD,LIST,L1,200,250,80,50

  DIALOG ADD,STATUS,Stat1
DIALOG SHOW

LIST ADD, L1, "List"
%%move = 1

:EVLOOP
  if %%move
     DIALOG SET, Stat1, "Click & Release to move (or use 'Difficult Elements' options)..."
  else
     DIALOG SET, Stat1,"Set 'Options' for element use or movement"
  end
  WAIT EVENT
  %e = @event()
  goto %e

:DummyBUTTON
  goto EVLOOP

:Move ElementMENU
  %%move = 1
  goto EVLOOP

:Use ElementMENU
  %%move = ""
  goto EVLOOP

:Move Edit BoxMENU
  %e = E1
  goto Move_Element

:Move ComboMENU
  %e = C2
  goto Move_Element

:Move ListMENU
  %e = L1
  goto Move_Element

:Move RadioMENU
  %e = R1
  goto Move_Element

:Move GroupMENU
  %e = G1
  goto Move_Element

:Move Progress BarMENU
  %e = P1
  goto Move_Element

:B1BUTTON
:B2BUTTON
:C1CLICK
:T1CLICK
:T2CLICK
  if %%move
     goto Move_Element
  else
     INFO "Now we're using the element"@tab()
  end
  goto EVLOOP

:Move_Element
  DIALOG SET, Stat1, "Click again to release  (ENTER key on difficult elements)..."

  rem -- Find which element to move --
  %s = @substr(%e, 1, 2)

  REPEAT
    rem -- Attach element to mouse (allow for Window Position, etc.) --
    %x = @diff(@mousepos(X), @sum(@winpos("Mac's Move Elements",L),10))
    %y = @diff(@mousepos(Y), @sum(@winpos("Mac's Move Elements",T),50))

    rem -- Keep element at least partially on screen --
    if @greater(0, %x)
       %x = 0
    end
    if @greater(0, %y)
       %y = 0
    end
    if @greater(%x, 340)
       %x = 340
    end
    if @greater(%y, 270)
       %y = 270
    end

    rem -- Move the element --
    DIALOG SETPOS,%s,%y,%x

  UNTIL @event()
  goto EVLOOP

:CLOSE
  EXIT
  STOP

Code:

rem -- VDS3 & VDS4 compatible --
rem -- Move elements using the undocumented DESIGN style --
OPTION SCALE, 96
Title By Mac
DIALOG CREATE,Design Style,-1,0,300,200,DESIGN,CLICK
  DIALOG ADD,BUTTON,B1,5,5,60,20,"Button"
DIALOG SHOW

:CLICK
:EVLOOP
  WAIT EVENT
  goto @event()

:B1CLICK
  DIALOG ATTACH, B1
:B1CHANGE
  goto EVLOOP
 
:CLOSE
  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 Sun Jan 13, 2002 11:17 am; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Tue Jan 08, 2002 10:15 pm    Post subject: Reply with quote

Wow, looks like everyone beat me to the post... Smile
_________________
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
View user's profile Send private message Send e-mail
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Tue Jan 08, 2002 10:15 pm    Post subject: Reply with quote

Sorry Mac..next time I'll check and see if someone is here before intruding on their post.
_________________
-Sheep
My pockets hurt...
Back to top
View user's profile Send private message Send e-mail
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Tue Jan 08, 2002 10:16 pm    Post subject: Reply with quote

It's absolutely NOT a problem Sheep. Smile

I didn't know we could access the old board anyway... Embarassed

_________________
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
View user's profile Send private message Send e-mail
marty
Professional Member
Professional Member


Joined: 10 May 2001
Posts: 789

PostPosted: Wed Jan 09, 2002 12:39 pm    Post subject: Reply with quote

Laughing

Great thanks guys.... 2 great examples espacially the DIALOG ATTACH feature!

Is there other non document features like that?

Again this is what exacly I was looking for....

Marty
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code All times are GMT
Page 1 of 1

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group