Visual Style Buttons

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
rdonnay
Site Admin
Posts: 4733
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Visual Style Buttons

#1 Post by rdonnay »

DCPUSHBUTTONXP will now paint the background of the button in the Windows visual style if the ::bgColor is GRA_CLR_BACKGROUND and a manifest file is used. This was added in build 261.

Unzip the attached file into your ..\samples\buttonxp folder.
Then run Pbuild VisualStyle.xpj to build VisualStyle.exe.
visualstyle.jpg
visualstyle.jpg (36.97 KiB) Viewed 7379 times

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
Attachments
visualstyle.zip
(7.2 KiB) Downloaded 622 times
The eXpress train is coming - and it has more cars.

User avatar
Auge_Ohr
Posts: 1407
Joined: Wed Feb 24, 2010 3:44 pm

Re: Visual Style Buttons

#2 Post by Auge_Ohr »

hi,

i saw in your Manifest File

Code: Select all

</dependency>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
	<security>
	  <requestedPrivileges>
        <requestedExecutionLevel
          level="asInvoker"
          uiAccess="false"/>
      </requestedPrivileges>
	</security>
</trustInfo>
did you have a link to get more Information what that Code is for ?
greetings by OHR
Jimmy

User avatar
jdsoft
Posts: 113
Joined: Thu Jan 28, 2010 1:13 pm
Location: Overberg
Contact:

Re: Visual Style Buttons

#3 Post by jdsoft »

Hello,

The link below explains exactly the manifest file.

https://msdn.microsoft.com/en-us/librar ... s.85).aspx

Regards,
Jack Duijf

User avatar
Auge_Ohr
Posts: 1407
Joined: Wed Feb 24, 2010 3:44 pm

Re: Visual Style Buttons

#4 Post by Auge_Ohr »

hi,
jdsoft wrote:The link below explains exactly the manifest file.
https://msdn.microsoft.com/en-us/librar ... s.85).aspx
thx for the link.
i do knew Manifest but my Question was about that Code-Snip when using "false" :shock:

"requestedExecutionLevel" have Level :

1.) asInvoker
2.) highestAvailable
3.) requireAdministrator

but it make no Sence to me to use "false" for a Level ?
greetings by OHR
Jimmy

Post Reply