ListIconGadget with different fonts in body and header ?

Just starting out? Need help? Post your questions and find answers here.
User avatar
Tomi
Enthusiast
Enthusiast
Posts: 270
Joined: Wed Sep 03, 2008 9:29 am

ListIconGadget with different fonts in body and header ?

Post by Tomi »

Hello
Is there a sample for it?
Thanks in advanced
Tomi
User avatar
hallodri
Enthusiast
Enthusiast
Posts: 208
Joined: Tue Nov 08, 2005 7:59 am
Location: Germany
Contact:

Post by hallodri »

under windows try this :

Code: Select all


EnableExplicit

Enumeration ; Window
  #WINDOW_MAIN
EndEnumeration

Enumeration ; Gadget
  #GADGET_TEST
EndEnumeration

#WINDOW_MAIN_CX    = 400
#WINDOW_MAIN_CY    = 300
#WINDOW_MAIN_TITLE = "Test"
#WINDOW_MAIN_STYLE = #PB_Window_SystemMenu

Procedure main()  

  Protected hwnd
  Protected event
  Protected header
  Protected font
  
  hwnd = OpenWindow(#WINDOW_MAIN,#PB_Ignore,#PB_Ignore,#WINDOW_MAIN_CX,#WINDOW_MAIN_CY,#WINDOW_MAIN_TITLE,#WINDOW_MAIN_STYLE)

  CompilerIf #PB_Compiler_Version < 430
    CreateGadgetList(hwnd)
  CompilerEndIf 
 
  ListIconGadget(#GADGET_TEST,0,0,#WINDOW_MAIN_CX,#WINDOW_MAIN_CY,"Col 1",60) 
  
  AddGadgetColumn(#GADGET_TEST,1,"Col 2",60)
  
  AddGadgetItem(#GADGET_TEST,0,"blub"+#LF$+"bla") 
  
  header = SendMessage_(GadgetID(#GADGET_TEST),#LVM_GETHEADER,0,0)
  
  font = LoadFont(#PB_Any,"Arial",15)
  
  SendMessage_(header,#WM_SETFONT,FontID(font),1)
  
    
  Repeat
    event = WaitWindowEvent()
    
    
    If event = #PB_Event_CloseWindow
      End
    EndIf
    
  ForEver  
  
  
EndProcedure:main()

User avatar
Tomi
Enthusiast
Enthusiast
Posts: 270
Joined: Wed Sep 03, 2008 9:29 am

Post by Tomi »

Very nice work
Thanksful :)
User avatar
Tomi
Enthusiast
Enthusiast
Posts: 270
Joined: Wed Sep 03, 2008 9:29 am

Post by Tomi »

if have a way for change HeaderHeight() please get me
becuase no change HeaderHeight Automaticaly with change font size :oops:
Post Reply