PanelGadget height

Just starting out? Need help? Post your questions and find answers here.
mag
Enthusiast
Enthusiast
Posts: 104
Joined: Mon Mar 29, 2004 1:46 pm

PanelGadget height

Post by mag »

Hi, How to change the size of PanelGadget icon and font size for the tab title (not the content)
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4996
Joined: Sun Apr 12, 2009 6:27 am

Re: PanelGadget height

Post by RASHAD »

For Windows ?
Egypt my love
mag
Enthusiast
Enthusiast
Posts: 104
Joined: Mon Mar 29, 2004 1:46 pm

Re: PanelGadget height

Post by mag »

Something like this:
Image

Yes on window
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4996
Joined: Sun Apr 12, 2009 6:27 am

Re: PanelGadget height

Post by RASHAD »

Hi

Code: Select all

ilw = 40

hnd1 = ExtractIcon_(0,"Shell32.dll",$55)
hnd2 = ExtractIcon_(0,"Shell32.dll",$82)
il = ImageList_Create_(ilw,ilw,#ILC_COLOR32	,2,10)   
ImageList_AddIcon_(il,hnd1)                   
ImageList_AddIcon_(il,hnd2)                   

LoadFont(0,"Broadway",12)

OpenWindow(0,0,0,320,240,"",$CF0001)
StartDrawing(WindowOutput(0))
DrawingFont(FontID(0))
sp = TextWidth(" ")
StopDrawing()
trim$ = Space(ilw/sp+1)
PanelGadget(0,10,10,300,220)
SetGadgetFont(0,FontID(0))
SetWindowLongPtr_( GadgetID(0), #GWL_STYLE, GetWindowLongPtr_( GadgetID(0), #GWL_STYLE )|#TCS_FIXEDWIDTH ) 
SendMessage_( GadgetID(0), #TCM_SETITEMSIZE, 0, 140|40<<16)
SendMessage_(GadgetID(0),#TCM_SETIMAGELIST,0,il)
AddGadgetItem(0,0,trim$+"Tab 0")
AddGadgetItem(0,1,trim$+"Tab 1")
TC.TC_ITEM
tC\mask = #TCIF_IMAGE
tc\iImage = 0
SendMessage_(GadgetID(0),#TCM_SETITEM, 0, @TC)
tc\iImage = 1
SendMessage_(GadgetID(0),#TCM_SETITEM, 1, @TC)
Repeat
  Select WaitWindowEvent()
    Case #PB_Event_CloseWindow
      Quit = 1
      
  EndSelect
Until Quit = 1
Egypt my love
mag
Enthusiast
Enthusiast
Posts: 104
Joined: Mon Mar 29, 2004 1:46 pm

Re: PanelGadget height

Post by mag »

wow. thank you
AZJIO
Addict
Addict
Posts: 2228
Joined: Sun May 14, 2017 1:48 am

Re: PanelGadget height

Post by AZJIO »

But when closing the program you need to use the following commands

Code: Select all

DestroyIcon_(hnd1)
DestroyIcon_(hnd2)
ImageList_Destroy_(il)
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4996
Joined: Sun Apr 12, 2009 6:27 am

Re: PanelGadget height

Post by RASHAD »

DestroyIcon_(hnd1) if the icon created using (CreateIcon_()) :mrgreen:
Egypt my love
AZJIO
Addict
Addict
Posts: 2228
Joined: Sun May 14, 2017 1:48 am

Re: PanelGadget height

Post by AZJIO »

Remarks

When it is no longer needed, you must destroy the icon handle returned by ExtractIcon by calling the DestroyIcon function.
Post Reply