Unzip the attached file into your ..\samples\buttonxp folder.
Then run Pbuild VisualStyle.xpj to build VisualStyle.exe.
Code: Select all
#INCLUDE "dcdialog.CH"
#include "gra.ch"
#define COLOR_LTORANGE GraMakeRGBColor( { 250, 205, 0 } )
FUNCTION Main()
LOCAL GetList[0], aCaptions, bMenuAction, oMenu, oBigButton
DC_BitMapTransparentColor(GraMakeRGBColor({192,192,192}))
bMenuAction := {|a,b,o|oMenu:PopUp( o:setParent(), o:currentPos(), 2 , ;
XBPMENU_PU_DEFAULT + XBPMENU_PU_MOUSE_RBDOWN ) }
DCSUBMENU oMenu PROMPT 'Menu' OWNERDRAW
DCMENUITEM 'Disable the Really Big Bug' PARENT oMenu ;
ACTION {||oBigButton:disable()} WHEN {||oBigButton:isEnabled()}
DCMENUITEM 'Enable the Really Big Bug' PARENT oMenu ;
ACTION {||oBigButton:enable()} WHEN {||!oBigButton:isEnabled()}
@ 0,0 DCPUSHBUTTON CAPTION 'Last Record' SIZE 20,3 ;
BITMAP 'GotoLast_Enable.ico' OFFSET 10 ;
COLOR GRA_CLR_BLACK,GRA_CLR_BACKGROUND
@ 4,0 DCPUSHBUTTONXP ;
CAPTION 'This is a Button;with a lot of text.;It will word-wrap;very nicely;thank you!' ;
SIZE 35,7 ;
COLOR GRA_CLR_BLACK,GRA_CLR_BACKGROUND ;
BITMAP '..\..\bitmaps\bugicon.bmp' OFFSET 15 ;
FONT '12.Arial Bold' ;
SOUND {DC_CurPath() + '\IR_END.WAV'}
aCaptions := { ;
{ DC_GetBitMap('..\..\bitmaps\bugicon.bmp'),, 20,10,120,100,,,}, ;
{ 'This is a', GRA_CLR_BLACK, 50, 120,,,,'24.Lucida Console',,}, ;
{ 'Really Big', GRA_CLR_RED, 140, 120,,,,'32.Arial Bold',,}, ;
{ 'Bug', COLOR_LTORANGE, 230, 120,,,,'32.Helv Bold',,} }
@ 12, 0 DCPUSHBUTTONXP ;
SIZE 50,7 ;
CAPTIONARRAY aCaptions ;
MENUACTION bMenuAction ;
ACTION {||DC_MsgBox({'I am Really Big!!','Click my down arrow for my menu'})} ;
OBJECT oBigButton ;
COLOR GRA_CLR_DARKGREEN, GRA_CLR_BACKGROUND ;
SOUND { DC_CurPath()+'\ding.wav' } ;
DCREAD GUI FIT TITLE 'Visual Style Buttons'
RETURN nil
PROC appsys ; RETURN