ButtongGadget with Text + Icon ?

Just starting out? Need help? Post your questions and find answers here.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

A couple of years ago, I saw someone render an icon onto a button. Don't know fo the code is still around though
This won't be what you saw, but sparkie's code massaged slightly to render a standard 32*32 icon looks like:

You'll need this (or you can use your own): http://www.networkmaestro.com/icons.zip

Code: Select all

;; Make sure movie.ico is in the program folder
;;
hIcon=LoadImage_(GetModuleHandle_(0),"movie.ico",#IMAGE_ICON,32,32,#LR_LOADFROMFILE) 

Procedure ButtonIconGadget(num, hIcon, x, y, w, h, text$) 
  buttonBack = GetSysColor_(#COLOR_BTNFACE) 
  thisImg = CreateImage(#PB_Any, w, h) 
  hDC=StartDrawing(ImageOutput(thisImg)) 
  Box(0, 0, w, h, buttonBack) 
  DrawIconEx_(hDC, 5,5, hIcon, 0, 0, 0, #Null, #DI_NORMAL | #DI_COMPAT )  
  DrawingFont(GetStockObject_(#DEFAULT_GUI_FONT)) 
  DrawText(50, (h - TextHeight(text$))/2, text$, #Black, buttonBack) 
  StopDrawing() 
  gadId = ButtonImageGadget(num, x, y, w, h, ImageID(thisImg)) 
  ProcedureReturn gadId 
EndProcedure 

OpenWindow(0,0,0,400,300,"",#PB_Window_SystemMenu|#PB_Window_ScreenCentered) 
CreateGadgetList(WindowID(0)) 
ButtonIconGadget(0,hIcon,120,130,160,44,"Some Text Too") 
Repeat    
  ev=WaitWindowEvent() 
  If EventWindow()=0 
    If ev=#PB_Event_Gadget 
      If EventGadget()=0 
         ;do something useful 
      EndIf 
    EndIf 
  EndIf 
Until ev=#PB_Event_CloseWindow  

And here is how to include the icon as a resource in your program (from the PORC resource compiler help in PellesC:
ICON resource statement

Purpose:
Defines an icon.

Syntax:
resource-ID ICON filename.ICO

resource-ID ICON

BEGIN

' XX XX ... '

END

The argument resource-ID is a numeric value, or a string, that identifies the icon. More than one icon can be present in the script file. The ID must be unique within the resource type.

The argument filename specifies the name of the ICO file. The name can be given with or without quotes. If the file cannot be found in the current directory, the standard places will be searched. See also compiler option /I.

The argument 'XX XX ...' specifies a sequence of hexadecimal bytes, surrounded by single quotes, equivalent of the ICO file content.

BEGIN and END may be replaced by { and }.

Example:
1 ICON app.ico

9 ICON “icons\\myapp.ico“

5 ICON

{

'00 00 02 00 01 00 20 20 00 00 00 00 00 00 30 01'
'00 00 16 00 00 00 28 00 00 00 20 00 00 00 40 00'

}
If you are going to include the icon as a resource, change the ico.s = " " line to reflect the ID you gave the icon in the resource file rather than the filename and change the last parameter in the LoadImage_() command from #LR_LOADFROMFILE to 0.
Last edited by netmaestro on Fri Mar 17, 2006 5:47 am, edited 6 times in total.
BERESHEIT
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post by va!n »

@netmaestro:
thanks for the source, but when enable the XP skin, t doesnt looks like an original buttongadget (the border seems to be ok but not the filled area!?)

Code: Select all

ico.s="d:\movie.ico"
hIcon=LoadImage_(GetModuleHandle_(0),@ico,#IMAGE_ICON,0,0,#LR_LOADFROMFILE)

Procedure ButtonIconGadget(num, hIcon, x, y, w, h, text$)
  buttonBack = GetSysColor_(#COLOR_BTNFACE)
  thisImg = CreateImage(#PB_Any, w, h)
  hDC=StartDrawing(ImageOutput(thisImg))
  Box(0, 0, w, h, buttonBack)
  DrawIconEx_(hDC, 5,5, hIcon, 0, 0, 0, #Null, #DI_NORMAL | #DI_COMPAT ) 
  DrawingFont(GetStockObject_(#DEFAULT_GUI_FONT))
  DrawText(50, (h - TextHeight(text$))/2, text$, #Black, buttonBack)
  StopDrawing()
  gadId = ButtonImageGadget(num, x, y, w, h, ImageID(thisImg))
  ProcedureReturn gadId
EndProcedure

OpenWindow(0,0,0,400,300,"",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
CreateGadgetList(WindowID(0))
ButtonIconGadget(0,hIcon,120,130,160,44,"Some Text Too")
ButtonGadget(1,120,70,160,44,"   Some Text Too")
Repeat   
  ev=WaitWindowEvent()
  If EventWindow()=0
    If ev=#PB_Event_Gadget
      If EventGadget()=0
         ;do something useful
      EndIf
    EndIf
  EndIf
Until ev=#PB_Event_CloseWindow 

va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

Skinned Windows it is then. How does this look:

You need this (or use your own): http://www.networkmaestro.com/icons.zip

Code: Select all

;; Make sure XP Skins Support is checked in your compiler options 
;; and that setup.ico is in the program folder 
;; 
Global ButtonUpImage 
Global ButtonDownImage 
Global ButtonHoverImage 
Global hIcon=LoadImage_(GetModuleHandle_(0),"setup.ico",#IMAGE_ICON,32,32,#LR_LOADFROMFILE) 

Procedure ButtonCallback(hWnd, Message, wParam, lParam) 
  If IsImage(ButtonUpImage) And IsImage(ButtonDownImage) 
    If ChildWindowFromPoint_(WindowID(0),WindowMouseX(0),WindowMouseY(0))<>GadgetID(0) 
      If GetGadgetState(0)<>ImageID(ButtonUpImage) 
        SetGadgetState(0,ImageID(ButtonUpImage)) 
      EndIf 
    EndIf 
    Select message 
      Case #WM_SETCURSOR 
        If ChildWindowFromPoint_(WindowID(0),WindowMouseX(0),WindowMouseY(0))=GadgetID(0) 
          If GetAsyncKeyState_(#VK_LBUTTON)=0 
            If GetGadgetState(0)<>ImageID(ButtonHoverImage) 
              SetGadgetState(0,ImageID(ButtonHoverImage)) 
            EndIf 
          EndIf 
        EndIf          
      Case #WM_COMMAND 
        If ChildWindowFromPoint_(WindowID(0),WindowMouseX(0),WindowMouseY(0))=GadgetID(0) 
          SetGadgetState(0,ImageID(ButtonUpImage)) 
        EndIf 
      Case #WM_MOUSEACTIVATE 
        If ChildWindowFromPoint_(WindowID(0),WindowMouseX(0),WindowMouseY(0))=GadgetID(0) 
          SetGadgetState(0,ImageID(ButtonDownImage)) 
        EndIf 
    EndSelect 
  EndIf 
  Result = #PB_ProcessPureBasicEvents 
  ProcedureReturn Result 
EndProcedure 

Procedure DrawTImage(DC, ImageID, x, y, TransparentColor) ;Draw Transparent Image 
  Protected ImageList, BM.BITMAP 
  GetObject_(ImageID,SizeOf(BITMAP),BM.BITMAP) 
  ImageID = CopyImage_(ImageID,#IMAGE_BITMAP,BM\bmWidth,BM\bmHeight,0) 
  ImageList = ImageList_Create_(BM\bmWidth,BM\bmHeight,#ILC_COLORDDB|#ILC_MASK,1,0) 
  ImageList_AddMasked_(ImageList,ImageID,TransparentColor) 
  ImageList_Draw_(ImageList,0,DC,x,y,#ILD_TRANSPARENT) 
  ImageList_Destroy_(ImageList) 
  DeleteObject_(ImageID) 
EndProcedure 

ProcedureDLL SkinnedButtonIconGadget(num, hIcon, x, y, w, h, text$) 
  ButtonUpImage = CreateImage(#PB_Any, w, h) 
  ButtonDownImage = CreateImage(#PB_Any, w, h) 
  ButtonHoverImage = CreateImage(#PB_Any, w, h) 
  TextImage=CreateImage(#PB_Any,600,200) 
  StartDrawing(ImageOutput(TextImage)) 
    DrawingFont(GetStockObject_(#DEFAULT_GUI_FONT)) 
    tw=TextWidth(text$) 
    th=TextHeight(text$) 
  StopDrawing() 
  ResizeImage(TextImage,tw,th) 
  StartDrawing(ImageOutput(TextImage)) 
    DrawingFont(GetStockObject_(#DEFAULT_GUI_FONT)) 
    DrawText(0,0, text$, #Black,RGB(255,255,255)) 
  StopDrawing()  
  hDC=StartDrawing(ImageOutput(ButtonUpImage)) 
    Box(0,0,w,h,RGB(255,255,255)) 
    c=250:d=255 
    For i=2 To h-1 Step 3 
      Box(0,i,w-1,3,RGB(c,c,d)) 
      Select i 
        Case 0 To h*1/3 
         c-2 :d-1 
        Case h*1/3 To h*3/4 
         c-4 :d-3 
        Case h*3/4 To h 
         c-5 :d-5 
      EndSelect 
    Next 
    DrawIconEx_(hDC, 5,5, hIcon, h-10, h-10, 0, #Null, #DI_NORMAL | #DI_COMPAT ) 
    DrawTImage(hDC, ImageID(TextImage), h+5, h/2-th/2, RGB(255,255,255)) 
    StopDrawing() 
    hDC=StartDrawing(ImageOutput(ButtonDownImage)) 
    c=250:d=255 
    For i=h To 0 Step -2 
      Box(0,i,w-1,2,RGB(c,c,d)) 
      Select i 
        Case 0 To h*1/2 
         c-7 :d-5 
        Case h*1/2 To h 
         c-2 :d-2 
      EndSelect 
    Next 
    DrawIconEx_(hDC, 5,5, hIcon, h-10, h-10, 0, #Null, #DI_NORMAL | #DI_COMPAT ) 
    DrawTImage(hDC, ImageID(TextImage), h+5, h/2-th/2, RGB(255,255,255)) 
    StopDrawing() 
    hDC=StartDrawing(ImageOutput(ButtonHoverImage)) 
    Box(0,0,w,h,RGB(255,255,255)) 
    c=250:d=255 
    For i=2 To h-1 Step 3 
      Box(0,i,w-1,3,RGB(c,c,d)) 
      Select i 
        Case h*1/3 To h*3/4 
         c-4 :d-4 
        Case h*3/4 To h 
         c-7 :d-7 
      EndSelect 
    Next 
    DrawIconEx_(hDC, 5,5, hIcon, h-10, h-10, 0, #Null, #DI_NORMAL | #DI_COMPAT ) 
    DrawTImage(hDC, ImageID(TextImage), h+5, h/2-th/2, RGB(255,255,255)) 
  StopDrawing() 
  gadId = ButtonImageGadget(num, x, y, w, h, ImageID(ButtonUpImage)) 
  ProcedureReturn gadId 
EndProcedure 

OpenWindow(0,0,0,400,300,"",#PB_Window_SystemMenu|#PB_Window_ScreenCentered) 
CreateGadgetList(WindowID(0)) 
SkinnedButtonIconGadget(0,hIcon,120,130,160,46,"Ico-Text Skinned") 
ButtonGadget(1,120,80,160,46,"Normal Skinned Button") 
SetWindowCallback(@ButtonCallback()) 
Repeat    
  ev=WaitWindowEvent() 
   If ev=#PB_Event_Gadget 
      If EventGadget()=0 
        ; Do something useful 
      EndIf 
  EndIf 
Until ev=#PB_Event_CloseWindow  
End 
The icon image will resize with the button, but it will look best if you size the button about 10 or so pixels higher than the original icon. So for a 32*32 icon, that would be say 42 to 46 px high. For a 16*16, that's 26-30 or so.
BERESHEIT
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

Ok, here's something else I came up with. It accomodates .BMP files with or without a mask color. I tested with 32 x 32 BMP.s with a Magenta mask in this example. I was only able to test this on XP so let me know what happens on Win 98/ Win 2K. I'm still tuning it up a bit so feel free to dig in and optimize at will. :)

Code: Select all

;/============================================================= 
;/ Code       : ButtonGadgets with BMP Icons
;/ Author     : Sparkie 
;/ Date       : 03/16/06 
;/ PB Version : PB 4.00 Beta7 
;/ OS Support : Windows 98/NT/2000/XP/Server 2003
;/ Ref        : /http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwxp/html/winxpintro.asp
;/============================================================= 

;/=============================================== 
;/ Constants / Enumerations 
;/=============================================== 
#BCM_FIRST = $1600
#BCM_SETIMAGELIST = #BCM_FIRST + 2
#BUTTON_IMAGELIST_ALIGN_LEFT = 0

#MyWindow1 = 1 
#Dummy = 0
#MyButton1 = 1 
#MyButton2 = 2

;/=============================================== 
;/ Structure used for Button ImageList
;/=============================================== 
Structure _BUTTON_IMAGELIST
  himl.l
  margin.RECT
  uAlign.l
EndStructure
Global buttonImgList._BUTTON_IMAGELIST

;/=============================================== 
;/ Procedure - Create icon/text ButtonImageGadget 
;/ (Only used when XP theme not active)
;/=============================================== 
Procedure ButtonIconGadget(num, gadgetX, gadgetY, gadgetW, gadgetH, text$, imageNum, icoW, icoH, maskColor) 
  buttonBack = GetSysColor_(#COLOR_BTNFACE) 
  StartDrawing(ImageOutput(imageNum))
  ;...Replce mask color with Button color
  For x = 0 To icoW - 1
    For y = 0 To icoH - 1
      If Point(x, y) = maskColor
        Plot(x, y, buttonBack)
      EndIf
    Next y
  Next x
  StopDrawing()
  ;...Create image for ButtonImageGadget
  thisImg = CreateImage(#PB_Any, gadgetW, gadgetH) 
  StartDrawing(ImageOutput(thisImg)) 
  ;...Fill with Button Color
  Box(0, 0, gadgetW, gadgetH, buttonBack) 
  ;...Draw our Graphic image
  DrawImage(ImageID(imageNum), 5, (gadgetH - icoH)/2, icoW, icoH) 
  DrawingFont(getstockobject_(#DEFAULT_GUI_FONT)) 
  ;...Add our text
  DrawText(icoW + 10, (gadgetH - TextHeight(text$))/2, text$, #Black, buttonBack) 
  StopDrawing() 
  ;...Create ButtonImageGadget
  gadId = ButtonImageGadget(num, gadgetX, gadgetY, gadgetW, gadgetH, ImageID(thisImg)) 
  ProcedureReturn gadId 
EndProcedure 

;/=============================================== 
;/ Procedure - Create icon/text ButtonImageGadget 
;/ (Only used when XP theme is active)
;/=============================================== 
Procedure ButtonImageList(imgW, imgH, imageId, maskColor)
  ;...Add our image with mask
  hButtonImgList = ImageList_Create_(imgW, imgH, #ILC_COLOR24 | #ILC_MASK, 0, 2)
  ImageList_AddMasked_(hButtonImgList, imageId, maskColor)
  ;...Fill our Button ImageList strcuture
  With buttonImgList
    \uAlign = #BUTTON_IMAGELIST_ALIGN_LEFT
    \margin\top = 3
    \margin\bottom = 3
    \margin\left = 3
    \margin\right = 3 
  EndWith
  ProcedureReturn hButtonImgList
EndProcedure

;/=============================================== 
;/ Main Window
;/=============================================== 
If OpenWindow(#MyWindow1, 100, 100, 250, 200, "Buttons With Icons", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(#MyWindow1)) 
  
  ;...For now this is the best I could do to check for XP themes
  ButtonGadget(#Dummy, 0, 0, 0, 0, "Dummy Gadget to test for XP theme") 
  
  ;...If XP skins is enabled use Plan A
  If GetWindowTheme_(GadgetID(#Dummy))
    FreeGadget(#Dummy)
    ;...Create ButtonGadget 1
    ButtonGadget(#MyButton1, 75, 50, 100, 42, "Clock", #PB_Button_Left) 
    
    ;...Get our image for Button 1
    img1 = CatchImage(#PB_Any, ?ButtonIcon1)
    
    ;...Set ImageList for #MyButton1
    hImgList1 = ButtonImageList(32, 32, ImageID(img1), RGB(255, 0, 255))
    buttonImgList\himl = hImgList1
    SendMessage_(GadgetID(#MyButton1), #BCM_SETIMAGELIST, 0, @buttonImgList)
    
    ;...Create ButtonGadget 2
    ButtonGadget(#MyButton2, 75, 100, 100, 42, "Calculator", #PB_Button_Left) 
    
    ;...Get our image for Button 2
    img2 = CatchImage(#PB_Any, ?ButtonIcon2)
    
    ;...Set ImageList for #MyButton2
    hImgList2 = ButtonImageList(32, 32, ImageID(img2), RGB(255, 0, 255))
    buttonImgList\himl = hImgList2
    SendMessage_(GadgetID(#MyButton2), #BCM_SETIMAGELIST, 0, @buttonImgList)
  Else
    ;...Not running with XP skins so go to plan B
    FreeGadget(#Dummy)
    img1 = CatchImage(#PB_Any, ?ButtonIcon1)
    img2 = CatchImage(#PB_Any, ?ButtonIcon2)
    ButtonIconGadget(#MyButton1, 75, 50, 100, 42, "Clock", img1, 32, 32, RGB(255, 0, 255)) 
    ButtonIconGadget(#MyButton2, 75, 100, 100, 42, "Calculator", img2, 32, 32, RGB(255, 0, 255)) 
  EndIf
  ;/=============================================== 
  ;/ Main Event Loop
  ;/=============================================== 
  Repeat 
    event = WaitWindowEvent() 
  Until event = #PB_Event_CloseWindow 
  
  ;...Destroy image lists
  If hImgList1
    ImageList_Destroy_(hImgList1)
  EndIf
  If hImgList2
    ImageList_Destroy_(hImgList2)
  EndIf
EndIf 

End 

DataSection 
ButtonIcon1: 
Data.b $42,$4D,$72,$04,$00,$00,$00,$00,$00,$00,$72,$00,$00,$00,$28,$00
Data.b $00,$00,$20,$00,$00,$00,$20,$00,$00,$00,$01,$00,$08,$00,$00,$00
Data.b $00,$00,$00,$04,$00,$00,$C3,$0E,$00,$00,$C3,$0E,$00,$00,$0F,$00
Data.b $00,$00,$00,$00,$00,$00,$FF,$FF,$FF,$00,$EF,$FF,$FF,$00,$F7,$F7
Data.b $E6,$00,$B5,$F7,$F7,$00,$AD,$B5,$9C,$00,$6B,$6B,$EF,$00,$84,$84
Data.b $73,$00,$FF,$00,$FF,$00,$42,$5A,$6B,$00,$42,$42,$31,$00,$08,$08
Data.b $9C,$00,$00,$08,$21,$00,$10,$08,$00,$00,$00,$08,$00,$00,$00,$00
Data.b $00,$00,$07,$07,$07,$06,$06,$04,$09,$09,$09,$06,$04,$03,$07,$07
Data.b $07,$07,$07,$03,$04,$04,$09,$06,$03,$06,$09,$07,$07,$07,$07,$07
Data.b $07,$07,$07,$07,$07,$07,$0E,$04,$00,$00,$00,$06,$04,$04,$09,$07
Data.b $0E,$07,$04,$04,$09,$06,$00,$00,$06,$0E,$07,$07,$07,$07,$07,$07
Data.b $07,$07,$07,$07,$07,$07,$07,$0E,$03,$00,$00,$04,$09,$0E,$0E,$0E
Data.b $0B,$0E,$0E,$0C,$04,$00,$00,$00,$0E,$07,$07,$07,$07,$07,$07,$07
Data.b $07,$07,$07,$07,$07,$07,$07,$07,$0E,$0C,$0E,$0B,$0A,$05,$05,$0A
Data.b $0B,$0B,$0E,$0E,$0E,$0B,$0E,$0E,$09,$07,$07,$07,$07,$07,$07,$07
Data.b $07,$07,$07,$07,$07,$07,$07,$09,$0B,$05,$05,$0B,$0B,$09,$06,$06
Data.b $09,$06,$06,$0B,$0E,$0E,$0B,$0B,$0E,$09,$07,$07,$07,$07,$07,$07
Data.b $07,$07,$07,$07,$07,$07,$0E,$0A,$05,$0E,$09,$01,$01,$01,$01,$01
Data.b $0D,$01,$01,$01,$01,$01,$0B,$0E,$0A,$0B,$0E,$07,$07,$07,$07,$07
Data.b $07,$07,$07,$07,$07,$0E,$0A,$0A,$0E,$01,$01,$08,$01,$01,$01,$09
Data.b $0E,$01,$01,$01,$06,$09,$01,$03,$0E,$0A,$0A,$0A,$07,$07,$07,$07
Data.b $07,$07,$07,$07,$0E,$0E,$0A,$0A,$01,$01,$01,$0E,$0E,$01,$01,$01
Data.b $06,$01,$01,$01,$0E,$09,$01,$01,$01,$0A,$0A,$0A,$05,$07,$07,$07
Data.b $07,$07,$07,$09,$0E,$05,$0E,$01,$01,$01,$01,$01,$01,$01,$01,$01
Data.b $01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$0E,$0B,$0A,$09,$07,$07
Data.b $07,$07,$07,$0E,$0E,$0B,$08,$04,$0C,$0E,$01,$01,$01,$01,$01,$01
Data.b $01,$01,$01,$01,$01,$01,$01,$09,$0E,$01,$01,$0E,$08,$0E,$07,$07
Data.b $07,$07,$04,$0E,$08,$0A,$04,$01,$06,$06,$01,$01,$01,$01,$01,$01
Data.b $01,$01,$01,$01,$01,$01,$01,$01,$09,$01,$01,$0B,$0B,$0E,$06,$07
Data.b $07,$07,$09,$0E,$05,$0B,$03,$01,$01,$01,$01,$01,$01,$01,$01,$01
Data.b $01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$04,$0E,$0B,$0E,$07
Data.b $07,$07,$0C,$0E,$05,$0E,$06,$09,$03,$01,$01,$01,$01,$01,$01,$04
Data.b $0C,$01,$01,$01,$01,$01,$01,$01,$08,$0E,$01,$04,$0A,$0A,$0E,$07
Data.b $07,$07,$0E,$0E,$08,$0E,$0E,$06,$08,$01,$01,$01,$01,$01,$01,$06
Data.b $0E,$01,$01,$01,$01,$01,$01,$01,$0B,$0E,$01,$04,$0A,$0B,$0E,$07
Data.b $07,$07,$0E,$08,$05,$0E,$0E,$01,$01,$01,$01,$01,$01,$01,$01,$0B
Data.b $0E,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$0C,$0A,$0E,$0E,$07
Data.b $07,$07,$06,$0A,$05,$0E,$0E,$09,$01,$04,$01,$01,$01,$01,$01,$0A
Data.b $0B,$09,$01,$01,$01,$01,$01,$06,$04,$01,$01,$0E,$0A,$0B,$06,$07
Data.b $07,$07,$07,$0E,$05,$05,$0E,$0E,$0C,$09,$09,$01,$01,$01,$01,$0B
Data.b $0A,$04,$01,$01,$01,$01,$01,$09,$08,$01,$06,$0A,$05,$0E,$07,$07
Data.b $07,$07,$07,$0A,$0A,$05,$0A,$0B,$0E,$01,$01,$01,$01,$01,$01,$09
Data.b $09,$01,$01,$01,$01,$01,$01,$04,$01,$04,$0E,$0A,$0E,$07,$07,$07
Data.b $07,$07,$07,$07,$0A,$0A,$05,$05,$0E,$0E,$01,$03,$0C,$01,$08,$00
Data.b $08,$01,$01,$01,$09,$01,$01,$01,$01,$0E,$0A,$0E,$0E,$07,$07,$07
Data.b $07,$07,$07,$07,$04,$0E,$05,$05,$0A,$0E,$0E,$0E,$09,$01,$06,$04
Data.b $0C,$04,$01,$01,$09,$01,$01,$01,$0E,$0E,$0E,$0E,$07,$07,$07,$07
Data.b $07,$07,$07,$07,$07,$07,$0E,$0A,$05,$0A,$0E,$0E,$0E,$06,$02,$04
Data.b $06,$03,$01,$01,$01,$05,$0B,$0E,$0E,$0E,$0E,$07,$07,$07,$07,$07
Data.b $07,$07,$03,$0E,$06,$0E,$0E,$0C,$0E,$05,$05,$0A,$0B,$0B,$0E,$0E
Data.b $0B,$0A,$0A,$0A,$0E,$0E,$0E,$0B,$0E,$09,$07,$07,$04,$0E,$08,$07
Data.b $07,$07,$06,$0E,$0E,$08,$06,$02,$0C,$08,$0E,$0A,$0A,$05,$05,$08
Data.b $0A,$0A,$0E,$0E,$0E,$0E,$0E,$03,$08,$02,$0E,$0E,$03,$0E,$09,$07
Data.b $07,$07,$07,$0E,$08,$03,$03,$03,$08,$06,$0E,$06,$0E,$0E,$0E,$0E
Data.b $0E,$0E,$0E,$0E,$0E,$04,$02,$04,$0B,$0E,$0E,$03,$08,$0E,$07,$07
Data.b $07,$07,$07,$07,$06,$0B,$03,$03,$08,$0E,$0E,$03,$07,$07,$07,$07
Data.b $03,$04,$00,$00,$04,$08,$03,$03,$03,$03,$08,$0E,$04,$07,$07,$07
Data.b $07,$07,$07,$07,$07,$07,$0E,$09,$0B,$0E,$0B,$03,$0B,$0E,$07,$07
Data.b $0E,$0E,$06,$08,$08,$03,$03,$08,$0E,$0E,$0E,$07,$07,$07,$07,$07
Data.b $07,$07,$07,$07,$07,$04,$0E,$03,$06,$0B,$09,$0E,$0E,$08,$07,$07
Data.b $07,$07,$07,$07,$0E,$0E,$09,$0E,$04,$07,$0E,$07,$07,$07,$07,$07
Data.b $07,$07,$07,$07,$07,$07,$04,$07,$07,$08,$04,$07,$07,$07,$07,$07
Data.b $07,$07,$07,$07,$07,$07,$07,$0E,$07,$07,$07,$07,$07,$07,$07,$07
Data.b $07,$07,$07,$07,$07,$07,$07,$07,$07,$06,$07,$07,$07,$07,$07,$07
Data.b $07,$07,$07,$07,$07,$07,$07,$0E,$07,$07,$07,$07,$07,$07,$07,$07
Data.b $07,$07,$07,$07,$07,$07,$07,$07,$07,$03,$0E,$03,$07,$07,$07,$07
Data.b $07,$07,$07,$07,$07,$07,$0E,$09,$07,$07,$07,$07,$07,$07,$07,$07
Data.b $07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$03,$0E,$0B,$04,$07,$07
Data.b $07,$07,$07,$07,$09,$0E,$0E,$07,$07,$07,$07,$07,$07,$07,$07,$07
Data.b $07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$04,$0B,$0B,$0E
Data.b $0B,$0E,$0E,$0E,$09,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07
Data.b $07,$07

ButtonIcon2: 
Data.b $42,$4D,$76,$02,$00,$00,$00,$00,$00,$00,$76,$00,$00,$00,$28,$00
Data.b $00,$00,$20,$00,$00,$00,$20,$00,$00,$00,$01,$00,$04,$00,$00,$00
Data.b $00,$00,$00,$02,$00,$00,$C3,$0E,$00,$00,$C3,$0E,$00,$00,$10,$00
Data.b $00,$00,$00,$00,$00,$00,$FF,$FF,$FF,$00,$F7,$FF,$FF,$00,$97,$FA
Data.b $FF,$00,$79,$FF,$FF,$00,$78,$F2,$FF,$00,$66,$E2,$FF,$00,$F4,$DC
Data.b $AB,$00,$4D,$C5,$FF,$00,$52,$A2,$E1,$00,$AC,$92,$76,$00,$3A,$74
Data.b $A0,$00,$FF,$00,$FF,$00,$46,$2C,$21,$00,$11,$1B,$29,$00,$00,$11
Data.b $2B,$00,$00,$00,$00,$00,$BB,$BB,$BB,$BB,$BB,$BB,$1C,$FF,$FB,$BB
Data.b $BB,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$B0,$CF,$FA,$1F,$FF,$BB
Data.b $BB,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$6C,$FD,$58,$CF,$FF,$DA,$FB
Data.b $BB,$BB,$BB,$BB,$BB,$BB,$BB,$B6,$FF,$D4,$AF,$FD,$84,$33,$AE,$8F
Data.b $BB,$BB,$BB,$BB,$BB,$BB,$B9,$FD,$2A,$FF,$A5,$54,$43,$34,$38,$F8
Data.b $F6,$BB,$BB,$BB,$BB,$BB,$F8,$2C,$FA,$55,$54,$44,$5D,$FF,$A3,$7F
Data.b $8F,$6B,$BB,$BB,$BB,$BB,$FE,$E7,$54,$44,$4A,$FF,$8F,$CF,$73,$47
Data.b $F8,$F6,$BB,$BB,$BB,$BB,$F7,$55,$48,$D7,$4F,$9F,$A7,$57,$DD,$44
Data.b $7F,$8F,$9B,$BB,$BB,$BB,$BF,$55,$EF,$FF,$3A,$DA,$AD,$5F,$CF,$44
Data.b $47,$F8,$F9,$BB,$BB,$BB,$B9,$E5,$8F,$F8,$42,$7F,$CF,$7A,$87,$DD
Data.b $44,$8F,$7F,$CB,$BB,$BB,$BB,$FA,$54,$7F,$FA,$3F,$D7,$53,$5F,$CF
Data.b $34,$4A,$F7,$FC,$BB,$BB,$BB,$BF,$75,$AF,$CF,$22,$8F,$F7,$38,$8A
Data.b $F8,$44,$DD,$7F,$FB,$BB,$BB,$B9,$E7,$58,$8F,$F5,$FF,$E5,$7E,$F9
Data.b $CF,$A4,$4F,$A7,$FF,$BB,$BB,$BB,$F8,$54,$FC,$FA,$37,$DF,$C9,$69
Data.b $FF,$84,$45,$F7,$7F,$CB,$BB,$BB,$BF,$75,$7A,$5A,$FC,$96,$9C,$EA
Data.b $53,$37,$44,$8F,$77,$F6,$BB,$BB,$B6,$F7,$54,$FC,$9C,$FE,$A5,$35
Data.b $AF,$FF,$E3,$3D,$A7,$E9,$BB,$BB,$BB,$CA,$75,$8F,$E8,$33,$3A,$FF
Data.b $FC,$20,$FF,$33,$F8,$A9,$BB,$BB,$BB,$BF,$A7,$54,$33,$8E,$FF,$C2
Data.b $11,$AF,$FF,$D2,$4F,$A9,$BB,$BB,$BB,$BB,$F8,$55,$8F,$FC,$21,$2A
Data.b $FF,$F9,$FF,$F8,$37,$F9,$BB,$BB,$BB,$BB,$0F,$75,$AF,$92,$DF,$FF
Data.b $90,$00,$FF,$FD,$33,$F9,$BB,$BB,$BB,$BB,$B6,$F7,$4E,$FF,$F0,$00
Data.b $00,$00,$FF,$A5,$AF,$F0,$BB,$BB,$BB,$BB,$BB,$9F,$73,$FF,$C0,$00
Data.b $00,$00,$DF,$FF,$FF,$00,$BB,$BB,$BB,$BB,$BB,$B9,$F7,$5F,$C0,$00
Data.b $00,$00,$9F,$60,$0C,$F0,$BB,$BB,$BB,$BB,$BB,$BB,$9F,$78,$F0,$00
Data.b $00,$00,$0F,$00,$00,$F6,$BB,$BB,$BB,$BB,$BB,$BB,$B6,$FF,$F0,$00
Data.b $00,$00,$0F,$60,$00,$9D,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$F1,$00
Data.b $00,$00,$09,$F1,$00,$0F,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$DD,$00
Data.b $00,$00,$00,$FF,$10,$0F,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$BF,$00
Data.b $00,$00,$00,$0F,$F6,$0F,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$B9,$F0
Data.b $00,$00,$00,$00,$9F,$FF,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$DF
Data.b $00,$00,$00,$00,$01,$FB,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$BC
Data.b $F0,$00,$00,$00,$DF,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$BB
Data.b $BF,$FF,$FF,$FC,$BB,$BB
EndDataSection
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

That's really great Sparkie! I knew there would be a "right" way to do themed buttons. I went the long way round with my code but I figured there must be a better way. I just didn't know what it was.
BERESHEIT
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

Thanks netmaestro :) There's almost always more than one way to accomplish any task. :cool:
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
User avatar
fsw
Addict
Addict
Posts: 1603
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Post by fsw »

Sparkie,
very nice, even with FlyAKite.

It looks really sharp 8)

Very good job :!:
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

Wow. Nice!

Thanks guys. It is really great to see stuff develop as ideas bounce around. Almost like watching a team sport, each player's efforts inspiring others to greater efforts still. With a magical result.
@}--`--,-- A rose by any other name ..
User avatar
fsw
Addict
Addict
Posts: 1603
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Post by fsw »

Just found something out:
if a 64x32 image is used (instead of 32x32) then the left part of the image is displayed (pixel 1 to 32) but if the button has the focus the right portion (pixel 33 to 64) is displayed.
With such images nice effects can be done.

@Sparkie,
thanks again for your code.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

i may be dumb but (or may have overlooked it)... why all the troubles?

here's a solution:

1. create an image
2. draw icon on the image
3. draw text on the image
4. create an image button using the freshly created image
5. tadaaaa... done

et voila, problem solved... i think that's a lot easier than mucking around with modified windows etc. etc.

as an alternative, if you want to create your own icons, here's perhaps a start (3.94 and part of the x_lib file but they should point you in a possible way)

Code: Select all

Procedure x_icon_createicon(width,height,image_h,mask_h)                                 ; create icon from two bitmaps
  Protected icon.ICONINFO
  ;
  ; *** turn any two images into an icon
  ;
  ; note: you have to delete this icon manually when exiting the program!
  ;
  ; how do icons behave?
  ;
  ; to replace a pixel: pixel in mask should be black, pixel in image should be whatever
  ; for no changes to a pixel: pixel in mask should be white, pixel in image should be black
  ;
  icon.ICONINFO
  icon\ficon = #True
  icon\hbmmask = mask_h
  icon\hbmcolor = image_h
  ProcedureReturn CreateIconIndirect_(@icon)
  ;
EndProcedure

Procedure x_icon_charactericon(width.l,height.l,text.s,r.l,g.l,b.l)                      ; create an icon from a single character
  ;
  ; *** create an icon using one or two characters as template
  ;
  ; note: you have to delete this icon manually when exiting the program!
  ;
  ; step 1: draw the image
  ;
  image_nr = CreateImage(#PB_Any,width,height)
  image_h = ImageID()
  StartDrawing(ImageOutput())
    Box(0,0,width,height,$000000)                   ; background should be black so xor has no effect
    d = width/2-TextLength(text)/2-1
    DrawingMode(1)
    FrontColor(r,g,b)                               ; then the character in given colour
    Locate(d,0)
    DrawText(text)
  StopDrawing()
  ;
  ; step 2: the mask
  ;
  mask_nr = CreateImage(#PB_Any,width,height)
  mask_h = ImageID()
  StartDrawing(ImageOutput())
    DrawingMode(1)
    Box(0,0,width,height,$FFFFFF)
    FrontColor(0,0,0)
    Locate(d,0)
    DrawText(text)
  StopDrawing()
  ;
  icon_h = x_icon_createicon(widht,height,image_h,mask_h)
  FreeImage(image_nr)
  FreeImage(mask_nr)
  ;
  ProcedureReturn icon_h
EndProcedure

Procedure x_icon_freeicon(icon_h)                                                        ; free icon object
  DeleteObject_(icon_h)
EndProcedure
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
dagcrack
Addict
Addict
Posts: 1868
Joined: Sun Mar 07, 2004 8:47 am
Location: Argentina
Contact:

Post by dagcrack »

I think they didnt want it the "easy" way :)
I would of gone the image way though, I can't be wasting hours for seeking other methods that could end up being slower and eating more mem...
! Black holes are where God divided by zero !
My little blog!
(Not for the faint hearted!)
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

@blueznl: Could you post a short sample that shows how your method looks on skinned buttons please?
BERESHEIT
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

i'll cook up something
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
sverson
Enthusiast
Enthusiast
Posts: 286
Joined: Sun Jul 04, 2004 12:15 pm
Location: Germany

Post by sverson »

[REMOVED] -> see next post
;-) sverson
Last edited by sverson on Fri Jun 30, 2006 4:23 pm, edited 1 time in total.
sverson
Enthusiast
Enthusiast
Posts: 286
Joined: Sun Jul 04, 2004 12:15 pm
Location: Germany

Post by sverson »

sparkie wrote:;/ OS Support : Windows 98/NT/2000/XP/Server 2003
Just running on XP and above!!!
I get error messages on all versions except XP!

Win95,Win98SE,WinME,WinNT4SP6a,Win2000Pro:
Image

This is running on all win versions:

Code: Select all

;/=============================================================
;/ Code       : ButtonGadgets with BMP Icons
;/ Author     : Sparkie
;/ Date       : 03/16/06
;/ PB Version : PB 4.00 Beta7
;/ OS Support : Windows 98/NT/2000/XP/Server 2003
;/ Ref        : /http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwxp/html/winxpintro.asp
;/=============================================================
;/ ThemeCheck by sverson 06-06-30

;/===============================================
;/ Constants / Enumerations
;/===============================================
#BCM_FIRST = $1600
#BCM_SETIMAGELIST = #BCM_FIRST + 2
#BUTTON_IMAGELIST_ALIGN_LEFT = 0

#MyWindow1 = 1
#Dummy = 0
#MyButton1 = 1
#MyButton2 = 2

;/===============================================
;/ Structure used for Button ImageList
;/===============================================
Structure _BUTTON_IMAGELIST
  himl.l
  margin.RECT
  uAlign.l
EndStructure
Global buttonImgList._BUTTON_IMAGELIST

;/===============================================
;/ Procedure - Create icon/text ButtonImageGadget
;/ (Only used when XP theme not active)
;/===============================================
Procedure ButtonIconGadget(num, gadgetX, gadgetY, gadgetW, gadgetH, text$, imageNum, icoW, icoH, maskColor)
  buttonBack = GetSysColor_(#COLOR_BTNFACE)
  StartDrawing(ImageOutput(imageNum))
  ;...Replce mask color with Button color
  For x = 0 To icoW - 1
    For y = 0 To icoH - 1
      If Point(x, y) = maskColor
        Plot(x, y, buttonBack)
      EndIf
    Next y
  Next x
  StopDrawing()
  ;...Create image for ButtonImageGadget
  thisImg = CreateImage(#PB_Any, gadgetW, gadgetH)
  StartDrawing(ImageOutput(thisImg))
  ;...Fill with Button Color
  Box(0, 0, gadgetW, gadgetH, buttonBack)
  ;...Draw our Graphic image
  DrawImage(ImageID(imageNum), 5, (gadgetH - icoH)/2, icoW, icoH)
  DrawingFont(GetStockObject_(#DEFAULT_GUI_FONT))
  ;...Add our text
  DrawText(icoW + 10, (gadgetH - TextHeight(text$))/2, text$, #Black, buttonBack)
  StopDrawing()
  ;...Create ButtonImageGadget
  gadId = ButtonImageGadget(num, gadgetX, gadgetY, gadgetW, gadgetH, ImageID(thisImg))
  ProcedureReturn gadId
EndProcedure

;/===============================================
;/ Procedure - Create icon/text ButtonImageGadget
;/ (Only used when XP theme is active)
;/===============================================
Procedure ButtonImageList(imgW, imgH, ImageID, maskColor)
  ;...Add our image with mask
  hButtonImgList = ImageList_Create_(imgW, imgH, #ILC_COLOR24 | #ILC_MASK, 0, 2)
  ImageList_AddMasked_(hButtonImgList, ImageID, maskColor)
  ;...Fill our Button ImageList strcuture
  With buttonImgList
    \uAlign = #BUTTON_IMAGELIST_ALIGN_LEFT
    \margin\top = 3
    \margin\bottom = 3
    \margin\left = 3
    \margin\right = 3
  EndWith
  ProcedureReturn hButtonImgList
EndProcedure

;/===============================================
;/ Procedure - ThemeCheck
;/ (True when Themes used [XP and above])
;/===============================================
Procedure.l ThemeCheck()
  Protected ThFlags.l
  If OpenLibrary(0, "UxTheme.dll")
    ThFlags = CallFunction(0,"GetThemeAppProperties")
    CloseLibrary(0)
  Else
    ThFlags.l=#False
  EndIf
  ProcedureReturn ThFlags
EndProcedure

;/===============================================
;/ Main Window
;/===============================================
If OpenWindow(#MyWindow1, 100, 100, 250, 200, "Buttons With Icons", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(#MyWindow1))
  
  If ThemeCheck()
    ButtonGadget(#MyButton1, 75, 50, 100, 42, "Clock", #PB_Button_Left) 
    
    ;...Get our image for Button 1
    img1 = CatchImage(#PB_Any, ?ButtonIcon1)
    
    ;...Set ImageList for #MyButton1
    hImgList1 = ButtonImageList(32, 32, ImageID(img1), RGB(255, 0, 255))
    buttonImgList\himl = hImgList1
    SendMessage_(GadgetID(#MyButton1), #BCM_SETIMAGELIST, 0, @buttonImgList)
    
    ;...Create ButtonGadget 2
    ButtonGadget(#MyButton2, 75, 100, 100, 42, "Calculator", #PB_Button_Left)
    
    ;...Get our image for Button 2
    img2 = CatchImage(#PB_Any, ?ButtonIcon2)
    
    ;...Set ImageList for #MyButton2
    hImgList2 = ButtonImageList(32, 32, ImageID(img2), RGB(255, 0, 255))
    buttonImgList\himl = hImgList2
    SendMessage_(GadgetID(#MyButton2), #BCM_SETIMAGELIST, 0, @buttonImgList)
  Else
    ;...Not running with XP skins so go to plan B
    FreeGadget(#Dummy)
    img1 = CatchImage(#PB_Any, ?ButtonIcon1)
    img2 = CatchImage(#PB_Any, ?ButtonIcon2)
    ButtonIconGadget(#MyButton1, 75, 50, 100, 42, "Clock", img1, 32, 32, RGB(255, 0, 255))
    ButtonIconGadget(#MyButton2, 75, 100, 100, 42, "Calculator", img2, 32, 32, RGB(255, 0, 255))
  EndIf
  ;/===============================================
  ;/ Main Event Loop
  ;/===============================================
  Repeat
    event = WaitWindowEvent()
  Until event = #PB_Event_CloseWindow
  
  ;...Destroy image lists
  If hImgList1
    ImageList_Destroy_(hImgList1)
  EndIf
  If hImgList2
    ImageList_Destroy_(hImgList2)
  EndIf
EndIf

End

DataSection
ButtonIcon1:
Data.b $42,$4D,$72,$04,$00,$00,$00,$00,$00,$00,$72,$00,$00,$00,$28,$00
Data.b $00,$00,$20,$00,$00,$00,$20,$00,$00,$00,$01,$00,$08,$00,$00,$00
Data.b $00,$00,$00,$04,$00,$00,$C3,$0E,$00,$00,$C3,$0E,$00,$00,$0F,$00
Data.b $00,$00,$00,$00,$00,$00,$FF,$FF,$FF,$00,$EF,$FF,$FF,$00,$F7,$F7
Data.b $E6,$00,$B5,$F7,$F7,$00,$AD,$B5,$9C,$00,$6B,$6B,$EF,$00,$84,$84
Data.b $73,$00,$FF,$00,$FF,$00,$42,$5A,$6B,$00,$42,$42,$31,$00,$08,$08
Data.b $9C,$00,$00,$08,$21,$00,$10,$08,$00,$00,$00,$08,$00,$00,$00,$00
Data.b $00,$00,$07,$07,$07,$06,$06,$04,$09,$09,$09,$06,$04,$03,$07,$07
Data.b $07,$07,$07,$03,$04,$04,$09,$06,$03,$06,$09,$07,$07,$07,$07,$07
Data.b $07,$07,$07,$07,$07,$07,$0E,$04,$00,$00,$00,$06,$04,$04,$09,$07
Data.b $0E,$07,$04,$04,$09,$06,$00,$00,$06,$0E,$07,$07,$07,$07,$07,$07
Data.b $07,$07,$07,$07,$07,$07,$07,$0E,$03,$00,$00,$04,$09,$0E,$0E,$0E
Data.b $0B,$0E,$0E,$0C,$04,$00,$00,$00,$0E,$07,$07,$07,$07,$07,$07,$07
Data.b $07,$07,$07,$07,$07,$07,$07,$07,$0E,$0C,$0E,$0B,$0A,$05,$05,$0A
Data.b $0B,$0B,$0E,$0E,$0E,$0B,$0E,$0E,$09,$07,$07,$07,$07,$07,$07,$07
Data.b $07,$07,$07,$07,$07,$07,$07,$09,$0B,$05,$05,$0B,$0B,$09,$06,$06
Data.b $09,$06,$06,$0B,$0E,$0E,$0B,$0B,$0E,$09,$07,$07,$07,$07,$07,$07
Data.b $07,$07,$07,$07,$07,$07,$0E,$0A,$05,$0E,$09,$01,$01,$01,$01,$01
Data.b $0D,$01,$01,$01,$01,$01,$0B,$0E,$0A,$0B,$0E,$07,$07,$07,$07,$07
Data.b $07,$07,$07,$07,$07,$0E,$0A,$0A,$0E,$01,$01,$08,$01,$01,$01,$09
Data.b $0E,$01,$01,$01,$06,$09,$01,$03,$0E,$0A,$0A,$0A,$07,$07,$07,$07
Data.b $07,$07,$07,$07,$0E,$0E,$0A,$0A,$01,$01,$01,$0E,$0E,$01,$01,$01
Data.b $06,$01,$01,$01,$0E,$09,$01,$01,$01,$0A,$0A,$0A,$05,$07,$07,$07
Data.b $07,$07,$07,$09,$0E,$05,$0E,$01,$01,$01,$01,$01,$01,$01,$01,$01
Data.b $01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$0E,$0B,$0A,$09,$07,$07
Data.b $07,$07,$07,$0E,$0E,$0B,$08,$04,$0C,$0E,$01,$01,$01,$01,$01,$01
Data.b $01,$01,$01,$01,$01,$01,$01,$09,$0E,$01,$01,$0E,$08,$0E,$07,$07
Data.b $07,$07,$04,$0E,$08,$0A,$04,$01,$06,$06,$01,$01,$01,$01,$01,$01
Data.b $01,$01,$01,$01,$01,$01,$01,$01,$09,$01,$01,$0B,$0B,$0E,$06,$07
Data.b $07,$07,$09,$0E,$05,$0B,$03,$01,$01,$01,$01,$01,$01,$01,$01,$01
Data.b $01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$04,$0E,$0B,$0E,$07
Data.b $07,$07,$0C,$0E,$05,$0E,$06,$09,$03,$01,$01,$01,$01,$01,$01,$04
Data.b $0C,$01,$01,$01,$01,$01,$01,$01,$08,$0E,$01,$04,$0A,$0A,$0E,$07
Data.b $07,$07,$0E,$0E,$08,$0E,$0E,$06,$08,$01,$01,$01,$01,$01,$01,$06
Data.b $0E,$01,$01,$01,$01,$01,$01,$01,$0B,$0E,$01,$04,$0A,$0B,$0E,$07
Data.b $07,$07,$0E,$08,$05,$0E,$0E,$01,$01,$01,$01,$01,$01,$01,$01,$0B
Data.b $0E,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$0C,$0A,$0E,$0E,$07
Data.b $07,$07,$06,$0A,$05,$0E,$0E,$09,$01,$04,$01,$01,$01,$01,$01,$0A
Data.b $0B,$09,$01,$01,$01,$01,$01,$06,$04,$01,$01,$0E,$0A,$0B,$06,$07
Data.b $07,$07,$07,$0E,$05,$05,$0E,$0E,$0C,$09,$09,$01,$01,$01,$01,$0B
Data.b $0A,$04,$01,$01,$01,$01,$01,$09,$08,$01,$06,$0A,$05,$0E,$07,$07
Data.b $07,$07,$07,$0A,$0A,$05,$0A,$0B,$0E,$01,$01,$01,$01,$01,$01,$09
Data.b $09,$01,$01,$01,$01,$01,$01,$04,$01,$04,$0E,$0A,$0E,$07,$07,$07
Data.b $07,$07,$07,$07,$0A,$0A,$05,$05,$0E,$0E,$01,$03,$0C,$01,$08,$00
Data.b $08,$01,$01,$01,$09,$01,$01,$01,$01,$0E,$0A,$0E,$0E,$07,$07,$07
Data.b $07,$07,$07,$07,$04,$0E,$05,$05,$0A,$0E,$0E,$0E,$09,$01,$06,$04
Data.b $0C,$04,$01,$01,$09,$01,$01,$01,$0E,$0E,$0E,$0E,$07,$07,$07,$07
Data.b $07,$07,$07,$07,$07,$07,$0E,$0A,$05,$0A,$0E,$0E,$0E,$06,$02,$04
Data.b $06,$03,$01,$01,$01,$05,$0B,$0E,$0E,$0E,$0E,$07,$07,$07,$07,$07
Data.b $07,$07,$03,$0E,$06,$0E,$0E,$0C,$0E,$05,$05,$0A,$0B,$0B,$0E,$0E
Data.b $0B,$0A,$0A,$0A,$0E,$0E,$0E,$0B,$0E,$09,$07,$07,$04,$0E,$08,$07
Data.b $07,$07,$06,$0E,$0E,$08,$06,$02,$0C,$08,$0E,$0A,$0A,$05,$05,$08
Data.b $0A,$0A,$0E,$0E,$0E,$0E,$0E,$03,$08,$02,$0E,$0E,$03,$0E,$09,$07
Data.b $07,$07,$07,$0E,$08,$03,$03,$03,$08,$06,$0E,$06,$0E,$0E,$0E,$0E
Data.b $0E,$0E,$0E,$0E,$0E,$04,$02,$04,$0B,$0E,$0E,$03,$08,$0E,$07,$07
Data.b $07,$07,$07,$07,$06,$0B,$03,$03,$08,$0E,$0E,$03,$07,$07,$07,$07
Data.b $03,$04,$00,$00,$04,$08,$03,$03,$03,$03,$08,$0E,$04,$07,$07,$07
Data.b $07,$07,$07,$07,$07,$07,$0E,$09,$0B,$0E,$0B,$03,$0B,$0E,$07,$07
Data.b $0E,$0E,$06,$08,$08,$03,$03,$08,$0E,$0E,$0E,$07,$07,$07,$07,$07
Data.b $07,$07,$07,$07,$07,$04,$0E,$03,$06,$0B,$09,$0E,$0E,$08,$07,$07
Data.b $07,$07,$07,$07,$0E,$0E,$09,$0E,$04,$07,$0E,$07,$07,$07,$07,$07
Data.b $07,$07,$07,$07,$07,$07,$04,$07,$07,$08,$04,$07,$07,$07,$07,$07
Data.b $07,$07,$07,$07,$07,$07,$07,$0E,$07,$07,$07,$07,$07,$07,$07,$07
Data.b $07,$07,$07,$07,$07,$07,$07,$07,$07,$06,$07,$07,$07,$07,$07,$07
Data.b $07,$07,$07,$07,$07,$07,$07,$0E,$07,$07,$07,$07,$07,$07,$07,$07
Data.b $07,$07,$07,$07,$07,$07,$07,$07,$07,$03,$0E,$03,$07,$07,$07,$07
Data.b $07,$07,$07,$07,$07,$07,$0E,$09,$07,$07,$07,$07,$07,$07,$07,$07
Data.b $07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$03,$0E,$0B,$04,$07,$07
Data.b $07,$07,$07,$07,$09,$0E,$0E,$07,$07,$07,$07,$07,$07,$07,$07,$07
Data.b $07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$04,$0B,$0B,$0E
Data.b $0B,$0E,$0E,$0E,$09,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07
Data.b $07,$07

ButtonIcon2:
Data.b $42,$4D,$76,$02,$00,$00,$00,$00,$00,$00,$76,$00,$00,$00,$28,$00
Data.b $00,$00,$20,$00,$00,$00,$20,$00,$00,$00,$01,$00,$04,$00,$00,$00
Data.b $00,$00,$00,$02,$00,$00,$C3,$0E,$00,$00,$C3,$0E,$00,$00,$10,$00
Data.b $00,$00,$00,$00,$00,$00,$FF,$FF,$FF,$00,$F7,$FF,$FF,$00,$97,$FA
Data.b $FF,$00,$79,$FF,$FF,$00,$78,$F2,$FF,$00,$66,$E2,$FF,$00,$F4,$DC
Data.b $AB,$00,$4D,$C5,$FF,$00,$52,$A2,$E1,$00,$AC,$92,$76,$00,$3A,$74
Data.b $A0,$00,$FF,$00,$FF,$00,$46,$2C,$21,$00,$11,$1B,$29,$00,$00,$11
Data.b $2B,$00,$00,$00,$00,$00,$BB,$BB,$BB,$BB,$BB,$BB,$1C,$FF,$FB,$BB
Data.b $BB,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$B0,$CF,$FA,$1F,$FF,$BB
Data.b $BB,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$6C,$FD,$58,$CF,$FF,$DA,$FB
Data.b $BB,$BB,$BB,$BB,$BB,$BB,$BB,$B6,$FF,$D4,$AF,$FD,$84,$33,$AE,$8F
Data.b $BB,$BB,$BB,$BB,$BB,$BB,$B9,$FD,$2A,$FF,$A5,$54,$43,$34,$38,$F8
Data.b $F6,$BB,$BB,$BB,$BB,$BB,$F8,$2C,$FA,$55,$54,$44,$5D,$FF,$A3,$7F
Data.b $8F,$6B,$BB,$BB,$BB,$BB,$FE,$E7,$54,$44,$4A,$FF,$8F,$CF,$73,$47
Data.b $F8,$F6,$BB,$BB,$BB,$BB,$F7,$55,$48,$D7,$4F,$9F,$A7,$57,$DD,$44
Data.b $7F,$8F,$9B,$BB,$BB,$BB,$BF,$55,$EF,$FF,$3A,$DA,$AD,$5F,$CF,$44
Data.b $47,$F8,$F9,$BB,$BB,$BB,$B9,$E5,$8F,$F8,$42,$7F,$CF,$7A,$87,$DD
Data.b $44,$8F,$7F,$CB,$BB,$BB,$BB,$FA,$54,$7F,$FA,$3F,$D7,$53,$5F,$CF
Data.b $34,$4A,$F7,$FC,$BB,$BB,$BB,$BF,$75,$AF,$CF,$22,$8F,$F7,$38,$8A
Data.b $F8,$44,$DD,$7F,$FB,$BB,$BB,$B9,$E7,$58,$8F,$F5,$FF,$E5,$7E,$F9
Data.b $CF,$A4,$4F,$A7,$FF,$BB,$BB,$BB,$F8,$54,$FC,$FA,$37,$DF,$C9,$69
Data.b $FF,$84,$45,$F7,$7F,$CB,$BB,$BB,$BF,$75,$7A,$5A,$FC,$96,$9C,$EA
Data.b $53,$37,$44,$8F,$77,$F6,$BB,$BB,$B6,$F7,$54,$FC,$9C,$FE,$A5,$35
Data.b $AF,$FF,$E3,$3D,$A7,$E9,$BB,$BB,$BB,$CA,$75,$8F,$E8,$33,$3A,$FF
Data.b $FC,$20,$FF,$33,$F8,$A9,$BB,$BB,$BB,$BF,$A7,$54,$33,$8E,$FF,$C2
Data.b $11,$AF,$FF,$D2,$4F,$A9,$BB,$BB,$BB,$BB,$F8,$55,$8F,$FC,$21,$2A
Data.b $FF,$F9,$FF,$F8,$37,$F9,$BB,$BB,$BB,$BB,$0F,$75,$AF,$92,$DF,$FF
Data.b $90,$00,$FF,$FD,$33,$F9,$BB,$BB,$BB,$BB,$B6,$F7,$4E,$FF,$F0,$00
Data.b $00,$00,$FF,$A5,$AF,$F0,$BB,$BB,$BB,$BB,$BB,$9F,$73,$FF,$C0,$00
Data.b $00,$00,$DF,$FF,$FF,$00,$BB,$BB,$BB,$BB,$BB,$B9,$F7,$5F,$C0,$00
Data.b $00,$00,$9F,$60,$0C,$F0,$BB,$BB,$BB,$BB,$BB,$BB,$9F,$78,$F0,$00
Data.b $00,$00,$0F,$00,$00,$F6,$BB,$BB,$BB,$BB,$BB,$BB,$B6,$FF,$F0,$00
Data.b $00,$00,$0F,$60,$00,$9D,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$F1,$00
Data.b $00,$00,$09,$F1,$00,$0F,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$DD,$00
Data.b $00,$00,$00,$FF,$10,$0F,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$BF,$00
Data.b $00,$00,$00,$0F,$F6,$0F,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$B9,$F0
Data.b $00,$00,$00,$00,$9F,$FF,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$DF
Data.b $00,$00,$00,$00,$01,$FB,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$BC
Data.b $F0,$00,$00,$00,$DF,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$BB,$BB
Data.b $BF,$FF,$FF,$FC,$BB,$BB
EndDataSection
;-) sverson
Post Reply