| View previous topic :: View next topic |
| Author |
Message |
cnodnarb Professional Member


Joined: 11 Sep 2002 Posts: 766 Location: Eastman, GA
|
Posted: Sun Dec 15, 2002 12:43 am Post subject: Flat Controls |
|
|
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 |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
Posted: Sun Dec 15, 2002 2:44 am Post subject: |
|
|
Very cool. Never thought of doing that. Great idea!  _________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Sun Dec 15, 2002 2:58 am Post subject: |
|
|
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 |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Sun Dec 15, 2002 2:33 pm Post subject: |
|
|
It's easier to us this, so you don't have to recode it all the time...
__________________________________________________________________________________________________________________________________________________________________________________________________________________
| 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 |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Sun Dec 15, 2002 4:04 pm Post subject: |
|
|
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 |
|
 |
cnodnarb Professional Member


Joined: 11 Sep 2002 Posts: 766 Location: Eastman, GA
|
Posted: Sun Dec 15, 2002 5:01 pm Post subject: |
|
|
Well I was going to post this tool for flattening controls...but I lke skits sub-routine much better!!
Good job Skit!!
NodNarb |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Sun Dec 15, 2002 5:06 pm Post subject: |
|
|
| 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 |
|
 |
|
|
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
|
|