Page 1 of 1

ListIconGadget with different fonts in body and header ?

Posted: Thu Nov 27, 2008 7:16 am
by Tomi
Hello
Is there a sample for it?
Thanks in advanced
Tomi

Posted: Thu Nov 27, 2008 11:04 am
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()


Posted: Thu Nov 27, 2008 11:17 am
by Tomi
Very nice work
Thanksful :)

Posted: Thu Nov 27, 2008 11:46 am
by Tomi
if have a way for change HeaderHeight() please get me
becuase no change HeaderHeight Automaticaly with change font size :oops: