It is currently Fri Oct 18, 2019 11:06 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: ListIconGadget without table header?
PostPosted: Fri May 17, 2019 7:14 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Jun 11, 2004 7:07 am
Posts: 600
It is possible to hide/tirn off the header of a ListIconGadget?


Top
 Profile  
Reply with quote  
 Post subject: Re: ListIconGadget without table header?
PostPosted: Fri May 17, 2019 7:20 am 
Offline
Addict
Addict
User avatar

Joined: Tue Oct 09, 2007 2:15 am
Posts: 1084
On Windows you can use the Flag : #LVS_NOCOLUMNHEADER.

_________________
PureBasic 5.71 LTS (Windows x86/x64) | Windows10 Pro x64 | Z370 Extreme4 | i7 8770k | 32GB RAM | iChill GeForce GTX 980 X4 Ultra | HAF XF Evo​​
English is not my native language... (I often use DeepL to translate my texts.)


Top
 Profile  
Reply with quote  
 Post subject: Re: ListIconGadget without table header?
PostPosted: Fri May 17, 2019 7:26 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Jun 11, 2004 7:07 am
Posts: 600
Nice! Thanks.
Is there possibility for Mac OS too?


Top
 Profile  
Reply with quote  
 Post subject: Re: ListIconGadget without table header?
PostPosted: Fri May 17, 2019 9:57 am 
Offline
Addict
Addict
User avatar

Joined: Thu Apr 21, 2005 2:38 pm
Posts: 1651
Location: Germany
Lebostein wrote:
Is there possibility for Mac OS too?
http://www.purebasic.fr/english/viewtop ... 5&start=72

Cross-platform for Linux, MacOS and Windows:
Code:
Procedure HideListIconHeader(ListIconID.I)
  CompilerSelect #PB_Compiler_OS
    CompilerCase #PB_OS_Linux
      gtk_tree_view_set_headers_visible_(GadgetID(ListIconID), #False)
    CompilerCase #PB_OS_MacOS
      CocoaMessage(0, GadgetID(ListIconID), "setHeaderView:", 0)
    CompilerCase #PB_OS_Windows
      SetWindowLongPtr_(GadgetID(ListIconID), #GWL_STYLE,
        GetWindowLongPtr_(GadgetID(ListIconID),
        #GWL_STYLE) | #LVS_NOCOLUMNHEADER)
  CompilerEndSelect
EndProcedure

OpenWindow(0, 200, 100, 430, 135, "ListIcon Example")
ListIconGadget(0, 10, 10, WindowWidth(0) - 20, WindowHeight(0) - 50, "Name", 110)
AddGadgetColumn(0, 1, "Address", GadgetWidth(0) - GetGadgetItemAttribute(0, 0,
  #PB_ListIcon_ColumnWidth) - 8)
AddGadgetItem(0, -1, "Harry Rannit" + #LF$ +
  "12 Parliament Way, Battle Street, By the Bay")
AddGadgetItem(0, -1, "Ginger Brokeit" + #LF$ +
  "130 PureBasic Road, BigTown, CodeCity")
AddGadgetItem(0, -1, "Didi Findit" + #LF$ +
  "321 Logo Drive, Mouse House, Downtown")
ButtonGadget(1, WindowWidth(0) / 2 - 70, WindowHeight(0) - 33, 140, 25,
  "Hide title header")

Repeat
  Select WaitWindowEvent()
    Case #PB_Event_CloseWindow
      Break
    Case #PB_Event_Gadget
      If EventGadget() = 1 And EventType() = #PB_EventType_LeftClick
        HideListIconHeader(0)
        DisableGadget(1, #True)
      EndIf
  EndSelect
ForEver


Last edited by Shardik on Fri May 17, 2019 10:13 am, edited 2 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: ListIconGadget without table header?
PostPosted: Fri May 17, 2019 10:03 am 
Offline
Moderator
Moderator
User avatar

Joined: Thu Dec 31, 2009 11:05 pm
Posts: 1102
Location: Germany::Berlin()
For Linux: http://chabba.de/ :arrow: http://chabba.de/Linux/ListIconGadget/L ... ibility.pb

_________________
ImageImageImageImage Image


Top
 Profile  
Reply with quote  
 Post subject: Re: ListIconGadget without table header?
PostPosted: Fri May 17, 2019 1:01 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Jun 11, 2004 7:07 am
Posts: 600
@Shardik, RSBasic: Thank YOU!


Top
 Profile  
Reply with quote  
 Post subject: Re: ListIconGadget without table header?
PostPosted: Fri May 17, 2019 1:19 pm 
Offline
PureBasic Expert
PureBasic Expert

Joined: Sun Apr 12, 2009 6:27 am
Posts: 3423
I am not sure about Mac & Linux
Code:
LoadFont(0,"Consolas",12)
 
  If OpenWindow(0, 0, 0, 600, 355, "ListIconGadgets", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  ContainerGadget(0,10,10,580,300,#PB_Container_Flat)
    ListIconGadget(1,  -1,  -25, 580, 400, "Column 1", 100,#PB_ListIcon_GridLines)
    For b = 1 To 4          ; add 3 more columns to each listicon
      AddGadgetColumn(1, b, "Column " + Str(b), 100)
    Next
    For b = 0 To 2          ; add 4 items to each line of the listicons
      AddGadgetItem(1, b, "Item 1"+Chr(10)+"Item 2"+Chr(10)+"Item 3"+Chr(10)+"Item 4")
    Next
    SetGadgetFont(1,FontID(0))
    CloseGadgetList()
   
    ButtonGadget(5,10,320,60,25,"Toggle")

    Repeat
      Select WaitWindowEvent()
        Case #PB_Event_CloseWindow
          Quit =1
         
        Case #PB_Event_Gadget
          Select EventGadget()
            Case 5
              Run ! 1
              If Run = 1
                ResizeGadget(1,-1,-1,580,400)
              Else
                ResizeGadget(1,-1,-25,580,400)
              EndIf
          EndSelect
      EndSelect
    Until Quit = 1
  EndIf

_________________
Egypt my love


Top
 Profile  
Reply with quote  
 Post subject: Re: ListIconGadget without table header?
PostPosted: Fri May 17, 2019 9:55 pm 
Offline
Enthusiast
Enthusiast

Joined: Thu Dec 29, 2011 5:03 pm
Posts: 463
If using Qt on Linux, you can do:
Code:
QtScript(~"gadget(" + Str(gadget) + ~").headerHidden = \"true\"")


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: zxretrosoft and 18 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye