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 


Flat Controls

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


Joined: 11 Sep 2002
Posts: 766
Location: Eastman, GA

PostPosted: Sun Dec 15, 2002 12:43 am    Post subject: Flat Controls Reply with quote

For flat controls just place 4 bitbtns around the control 2 pixels in hieght for top and bottom 2 in width for sides...be sure to disable them.
Code:

DIALOG CREATE,New Dialog,-1,0,240,160
  DIALOG ADD,EDIT,EDIT1,10,12,180,19,Flat Edit Control
  DIALOG ADD,BITBTN,BITBTN1,10,12,180,2,,,Focus
  DIALOG ADD,BITBTN,BITBTN2,10,12,2,19,,,Focus
  DIALOG ADD,BITBTN,BITBTN3,27,12,180,2,,,Focus
  DIALOG ADD,BITBTN,BITBTN4,12,190,2,19,,,Focus
  dialog disable,bitbtn1
  dialog disable,bitbtn2
  dialog disable,bitbtn3
  dialog disable,bitbtn4
  DIALOG SHOW
WAIT EVENT


NodNarb
Back to top
View user's profile Send private message AIM Address
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Sun Dec 15, 2002 2:44 am    Post subject: Reply with quote

Very cool. Never thought of doing that. Great idea! Worship
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Sun Dec 15, 2002 2:58 am    Post subject: Reply with quote

Works for buttons too(easier to use sendmessage I guess):
Code:

DIALOG CREATE,New Dialog,-1,0,240,160
  DIALOG ADD,BUTTON,Hidden,0,0,0,0,Hidden
  DIALOG ADD,BUTTON,Button1,10,12,180,19,Flat Button Control
  DIALOG ADD,BITBTN,BITBTN1,10,12,180,2,,,Focus
  DIALOG ADD,BITBTN,BITBTN2,10,12,2,19,,,Focus
  DIALOG ADD,BITBTN,BITBTN3,27,12,180,2,,,Focus
  DIALOG ADD,BITBTN,BITBTN4,12,190,2,19,,,Focus
  dialog disable,bitbtn1
  dialog disable,bitbtn2
  dialog disable,bitbtn3
  dialog disable,bitbtn4
  DIALOG SHOW
:Button1BUTTON
  DIALOG FOCUS,HIDDEN
:evloop
  wait event
  goto @event()
:Close
  exit

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


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Sun Dec 15, 2002 2:33 pm    Post subject: Reply with quote

It's easier to us this, so you don't have to recode it all the time... Wink

__________________________________________________________________________________________________________________________________________________________________________________________________________________
Code:

  DIALOG CREATE,Make flat elements,-1,0,191,241
  DIALOG ADD,EDIT,EDIT1,8,4,180,19,EDIT1
  DIALOG ADD,BUTTON,BUTTON1,32,4,64,24,BUTTON1
  DIALOG ADD,PROGRESS,PROGRESS1,62,4,150,24,50
  DIALOG ADD,LIST,LIST1,92,4,180,144
  DIALOG SHOW

%%Elementname = EDIT1
gosub Makeflat
%%Elementname = BUTTON1
gosub Makeflat
%%Elementname = PROGRESS1
gosub Makeflat
%%Elementname = LIST1
gosub Makeflat

:Evloop 
wait event
goto @event()

:Close
exit
 
rem You must include the code unbeneath in all code in which you are going to use it...

:Makeflat
  DIALOG ADD,BITBTN,"BITBTN"%%elementname"1",@dlgpos(%%elementname,t),@dlgpos(%%elementname,l),2,@dlgpos(%%elementname,h)
  DIALOG ADD,BITBTN,"BITBTN"%%elementname"2",@dlgpos(%%elementname,t),@diff(@fadd(@dlgpos(%%elementname,l),@dlgpos(%%elementname,w)),2),2,@dlgpos(%%elementname,h)
  DIALOG ADD,BITBTN,"BITBTN"%%elementname"3",@dlgpos(%%elementname,t),@dlgpos(%%elementname,l),@dlgpos(%%elementname,w),2
  DIALOG ADD,BITBTN,"BITBTN"%%elementname"4",@diff(@fadd(@dlgpos(%%elementname,t),@dlgpos(%%elementname,h)),2),@dlgpos(%%elementname,l),@dlgpos(%%elementname,w),2
  %%elementnamenumber = 1
  repeat
  DIALOG DISABLE,"BITBTN"%%elementname%%elementnamenumber
  %%elementnamenumber = @succ(%%elementnamenumber)
  until @equal(%%elementnamenumber,5)
exit


Ps. Tommy, this code was wrapping again...
Back to top
View user's profile Send private message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sun Dec 15, 2002 4:04 pm    Post subject: Reply with quote

To avoid the wrapping, style code lines could probably in the template
file /templates/subSilver/viewtopic_body.tpl

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
cnodnarb
Professional Member
Professional Member


Joined: 11 Sep 2002
Posts: 766
Location: Eastman, GA

PostPosted: Sun Dec 15, 2002 5:01 pm    Post subject: Reply with quote

Well I was going to post this tool for flattening controls...but I lke skits sub-routine much better!!

Good job Skit!! Very Happy

NodNarb
Back to top
View user's profile Send private message AIM Address
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Sun Dec 15, 2002 5:06 pm    Post subject: Reply with quote

Most of the time I use subroutines, because it's easy to use for other people too... Too see more examples you can take a look at my website: http://www.skit3000.tk/
Back to top
View user's profile Send private message
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