LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1751 Location: Space and Time
|
Posted: Wed Dec 16, 2009 7:50 pm Post subject: Flatten |
|
|
Here is a command that will "flatten" edit boxes, browser elements or any other element that has a sunken border.
Code: |
:flatten
if @not(%1)
error 2
end
dialog add,bitbtn,%1_t,@dlgpos(%1,T),@dlgpos(%1,L),@dlgpos(%1,W),2
dialog add,bitbtn,%1_l,@dlgpos(%1,T),@dlgpos(%1,L),2,@dlgpos(%1,H)
dialog add,bitbtn,%1_r,@dlgpos(%1,T),@diff(@sum(@dlgpos(%1,L),@dlgpos(%1,W)),2),2,@dlgpos(%1,H)
dialog add,bitbtn,%1_b,@diff(@sum(@dlgpos(%1,H),@dlgpos(%1,T)),2),@dlgpos(%1,L),@dlgpos(%1,W),2
dialog disable,%1_t
dialog disable,%1_l
dialog disable,%1_r
dialog disable,%1_b
exit
|
Example:
Code: |
External VDSBrw60.dll
#define command,browser,flatten
#define function,browser
DIALOG CREATE,New Dialog,-1,0,240,160
REM *** Modified by Dialog Designer on 12/16/2009 - 14:45 ***
DIALOG ADD,BROWSER,BROWSER1,33,34,40,40,http://www.google.com
DIALOG ADD,EDIT,EDIT1,91,36,180,19,EDIT1
flatten browser1
flatten edit1
DIALOG SHOW
:evloop
wait event
goto @event()
:close
stop
:flatten
if @not(%1)
error 2
end
dialog add,bitbtn,%1_t,@dlgpos(%1,T),@dlgpos(%1,L),@dlgpos(%1,W),2
dialog add,bitbtn,%1_l,@dlgpos(%1,T),@dlgpos(%1,L),2,@dlgpos(%1,H)
dialog add,bitbtn,%1_r,@dlgpos(%1,T),@diff(@sum(@dlgpos(%1,L),@dlgpos(%1,W)),2),2,@dlgpos(%1,H)
dialog add,bitbtn,%1_b,@diff(@sum(@dlgpos(%1,H),@dlgpos(%1,T)),2),@dlgpos(%1,L),@dlgpos(%1,W),2
dialog disable,%1_t
dialog disable,%1_l
dialog disable,%1_r
dialog disable,%1_b
exit
|
_________________ Chris
Http://theblindhouse.com |
|