It is currently Mon Dec 09, 2019 4:00 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: Listicon, Hide-Unhide columns by clicking on Listicon Header
PostPosted: Tue Aug 13, 2019 2:04 pm 
Offline
User
User

Joined: Fri Aug 04, 2017 11:03 pm
Posts: 78
Hi.

I want to hide, unhide Listicon Columns, by clicking on it's Headers.

Code:
Enumeration
  #win1
  #Menu
  #ListIcon_1
  #OpenFile
  #SaveFile
  #col0
  #Col1
  #Col2
  #Col3
  #Col4
  #Col5
  #Col6
  #Col7
  #Col8
  #Exit
EndEnumeration

flg=#PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_ScreenCentered
OpenWindow(#win1, 0, 0, 770, 500, "Hide And UnHideColumns",flg)
    If CreateMenu(#Menu, WindowID(#win1))
      MenuTitle("Hide-UnhideColumn Test")
      MenuItem( #OpenFile, "Open")
      MenuItem( #SaveFile, "Save")
      MenuItem( #col0, "Col 0")
      MenuItem( #Col1, "Col 1")
      MenuItem( #Col2, "Col 2")
      MenuItem( #Col3, "Col 3")
      MenuItem( #Col4, "Col 4")
      MenuItem( #Col5, "Col 5")
      MenuItem( #Col6, "Col 6")
      MenuItem( #Col7, "Col 7")
      MenuItem( #Col8, "Col 8")
      MenuItem( #Exit, "Exit")
    EndIf
   
    ListIconGadget(#ListIcon_1, 10, 10, 750, 440, "Col 0", 100)
    AddGadgetColumn(#ListIcon_1, 1, "Col 1", 80)
    AddGadgetColumn(#ListIcon_1, 2, "Col 2", 75)
    AddGadgetColumn(#ListIcon_1, 3, "Col 3", 50)
    AddGadgetColumn(#ListIcon_1, 4, "Col 4", 40)
    AddGadgetColumn(#ListIcon_1, 5, "Col 5", 100)
    AddGadgetColumn(#ListIcon_1, 6, "Col 6", 110)
    AddGadgetColumn(#ListIcon_1, 7, "Col 7", 60)
    AddGadgetColumn(#ListIcon_1, 8, "Col 8", 45)
 
    col_0 =SendMessage_(GadgetID(#ListIcon_1),#LVM_GETCOLUMNWIDTH,0 ,0)
    col_1 =SendMessage_(GadgetID(#ListIcon_1),#LVM_GETCOLUMNWIDTH,1 ,0)
    col_2 =SendMessage_(GadgetID(#ListIcon_1),#LVM_GETCOLUMNWIDTH,2 ,0)
    col_3 =SendMessage_(GadgetID(#ListIcon_1),#LVM_GETCOLUMNWIDTH,3 ,0)
    col_4 =SendMessage_(GadgetID(#ListIcon_1),#LVM_GETCOLUMNWIDTH,4 ,0)
    col_5 =SendMessage_(GadgetID(#ListIcon_1),#LVM_GETCOLUMNWIDTH,5 ,0)
    col_6 =SendMessage_(GadgetID(#ListIcon_1),#LVM_GETCOLUMNWIDTH,6 ,0)
    col_7 =SendMessage_(GadgetID(#ListIcon_1),#LVM_GETCOLUMNWIDTH,7 ,0)
    col_8 =SendMessage_(GadgetID(#ListIcon_1),#LVM_GETCOLUMNWIDTH,8 ,0)
   
TotHeaders=SendMessage_(SendMessage_(GadgetID(#ListIcon_1),#LVM_GETHEADER,0,0), #HDM_GETITEMCOUNT,0,0)
Global Dim HideColumns(TotHeaders)

Procedure HideColumnCallBack(WindowID, Message, wParam, lParam)
 
    Result = #PB_ProcessPureBasicEvents
   
    If Message=#WM_NOTIFY
         *nmhdr.NMHEADER = lParam
         If *nmhdr\hdr\code=#HDN_ITEMCHANGING
           If HideColumns(*nmhdr\iItem)
              *nmdata.HD_ITEM = *nmhdr\pitem
              *nmdata\cxy=0
           EndIf
         EndIf
      EndIf
     
    ProcedureReturn Result
   
  EndProcedure
   
  SetWindowCallback(@HideColumnCallBack())
 
      Repeat
         
          Select WaitWindowEvent()
           
          Case #PB_Event_CloseWindow           
            appQuit = 1
           
            Case #PB_Event_Menu
              Select EventMenu()
                 
              Case #col0               
                If GetMenuItemState(#Menu,#col0) = 0
                   SetMenuItemState(#Menu,#col0, 1)
                   SendMessage_(GadgetID(#ListIcon_1),#LVM_SETCOLUMNWIDTH,0 ,0)
                   HideColumns(0)=#True                   
                Else                   
                   SetMenuItemState(#Menu,#col0, 0)
                   HideColumns(0)=#False                 
                   SendMessage_(GadgetID(#ListIcon_1),#LVM_SETCOLUMNWIDTH,0,col_0)                 
                EndIf
             ;********************************************
              Case #Col1                               
                If GetMenuItemState(#Menu,#Col1) = 0
                   SetMenuItemState(#Menu, #Col1, 1)
                   SendMessage_(GadgetID(#ListIcon_1),#LVM_SETCOLUMNWIDTH,1 ,0)
                   HideColumns(1)=#True                   
                Else                           
                   SetMenuItemState(#Menu, #Col1, 0)
                   HideColumns(1)=#False
                   SendMessage_(GadgetID(#ListIcon_1),#LVM_SETCOLUMNWIDTH,1,col_1)               
                EndIf
               ;********************************************               
              Case #Col2               
                If GetMenuItemState(#Menu,#Col2) = 0
                   SetMenuItemState(#Menu, #Col2, 1)
                   SendMessage_(GadgetID(#ListIcon_1),#LVM_SETCOLUMNWIDTH,2 ,0)
                   HideColumns(2)=#True                   
                Else                           
                   SetMenuItemState(#Menu, #Col2, 0)
                   HideColumns(2)=#False
                   SendMessage_(GadgetID(#ListIcon_1),#LVM_SETCOLUMNWIDTH,2,col_2)
                EndIf               
               ;********************************************   
              Case #Col3             
                If GetMenuItemState(#Menu,#Col3) = 0
                   SetMenuItemState(#Menu, #Col3, 1)
                   SendMessage_(GadgetID(#ListIcon_1),#LVM_SETCOLUMNWIDTH,3 ,0)
                   HideColumns(3)=#True
                Else                           
                   SetMenuItemState(#Menu, #Col3, 0)
                   HideColumns(3)=#False
                   SendMessage_(GadgetID(#ListIcon_1),#LVM_SETCOLUMNWIDTH,3,col_3)
                EndIf
              ;********************************************   
              Case #Col4               
                If GetMenuItemState(#Menu,#Col4) = 0
                   SetMenuItemState(#Menu, #Col4, 1)
                   SendMessage_(GadgetID(#ListIcon_1),#LVM_SETCOLUMNWIDTH,4 ,0)
                   HideColumns(4)=#True 
                Else                           
                   SetMenuItemState(#Menu, #Col4, 0)
                   HideColumns(4)=#False
                   SendMessage_(GadgetID(#ListIcon_1),#LVM_SETCOLUMNWIDTH,4,col_4)
              EndIf                         
              ;********************************************
             Case #Col5
               If GetMenuItemState(#Menu,#Col5) = 0
                  SetMenuItemState(#Menu, #Col5, 1)
                  SendMessage_(GadgetID(#ListIcon_1),#LVM_SETCOLUMNWIDTH,5 ,0)
                  HideColumns(5)=#True   
                Else                           
                  SetMenuItemState(#Menu, #Col5, 0)
                  HideColumns(5)=#False
                  SendMessage_(GadgetID(#ListIcon_1),#LVM_SETCOLUMNWIDTH,5,col_5)
              EndIf
              ;********************************************
              Case #Col6
                If GetMenuItemState(#Menu,#Col6) = 0
                   SetMenuItemState(#Menu, #Col6, 1)
                   SendMessage_(GadgetID(#ListIcon_1),#LVM_SETCOLUMNWIDTH,6 ,0)
                   HideColumns(6)=#True
               Else                           
                   SetMenuItemState(#Menu, #Col6, 0)
                   HideColumns(6)=#False
                   SendMessage_(GadgetID(#ListIcon_1),#LVM_SETCOLUMNWIDTH,6,col_6)
               EndIf
              ;********************************************
              Case #Col7
                If GetMenuItemState(#Menu,#Col7) = 0
                   SetMenuItemState(#Menu, #Col7, 1)
                   SendMessage_(GadgetID(#ListIcon_1),#LVM_SETCOLUMNWIDTH,7 ,0)
                   HideColumns(7)=#True
                Else                           
                   SetMenuItemState(#Menu, #Col7, 0)
                   HideColumns(7)=#False
                   SendMessage_(GadgetID(#ListIcon_1),#LVM_SETCOLUMNWIDTH,7,col_7)
              EndIf
              ;********************************************
              Case #Col8
                If GetMenuItemState(#Menu,#Col8) = 0
                   SetMenuItemState(#Menu, #Col8, 1)
                   SendMessage_(GadgetID(#ListIcon_1),#LVM_SETCOLUMNWIDTH,8 ,0)
                   HideColumns(8)=#True
                Else                           
                   SetMenuItemState(#Menu, #Col8, 0)
                   HideColumns(8)=#False
                   SendMessage_(GadgetID(#ListIcon_1),#LVM_SETCOLUMNWIDTH,8,col_8)
                EndIf

              EndSelect
       
           Case #PB_Event_Gadget
             
            Select EventGadget()
             
        EndSelect
       
      EndSelect
     
      Until appQuit
 


Top
 Profile  
Reply with quote  
 Post subject: Re: Listicon, Hide-Unhide columns by clicking on Listicon He
PostPosted: Tue Aug 13, 2019 6:53 pm 
Offline
PureBasic Expert
PureBasic Expert

Joined: Sun Apr 12, 2009 6:27 am
Posts: 3475
How can you unhide the column if the column header is hidden too?

_________________
Egypt my love


Top
 Profile  
Reply with quote  
 Post subject: Re: Listicon, Hide-Unhide columns by clicking on Listicon He
PostPosted: Tue Aug 13, 2019 9:05 pm 
Offline
Always Here
Always Here

Joined: Fri Oct 23, 2009 2:33 am
Posts: 5884
Location: Wales, UK
You might be able to fake it - define the ListIcon without headers and have buttons instead.

_________________
IdeasVacuum
If it sounds simple, you have not grasped the complexity.


Top
 Profile  
Reply with quote  
 Post subject: Re: Listicon, Hide-Unhide columns by clicking on Listicon He
PostPosted: Tue Aug 13, 2019 9:16 pm 
Offline
User
User

Joined: Fri Aug 04, 2017 11:03 pm
Posts: 78
Quote:
How can you unhide the column if the column header is hidden too?



Good question.? :mrgreen: :oops: :oops:


My Listicon has 30 columns.

Any :idea: how to reduce the code for the Case #PB_Event_Menu.
Code:
Case #PB_Event_Menu
     Select EventMenu()

     Case #col0
               
     If GetMenuItemState(#Menu,#col0) = 0
        SetMenuItemState(#Menu,#col0, 1)
        SendMessage_(GadgetID(#ListIcon_1),#LVM_SETCOLUMNWIDTH,0 ,0)
        HideColumns(0)=#True                   
     Else                   
        SetMenuItemState(#Menu,#col0, 0)
        HideColumns(0)=#False                 
        SendMessage_(GadgetID(#ListIcon_1),#LVM_SETCOLUMNWIDTH,0,col_0)                 
     EndIf
     ;********************************************             
             
     Case #Col1                               
     If GetMenuItemState(#Menu,#Col1) = 0
        SetMenuItemState(#Menu, #Col1, 1)
        SendMessage_(GadgetID(#ListIcon_1),#LVM_SETCOLUMNWIDTH,1 ,0)
        HideColumns(1)=#True                   
     Else                           
        SetMenuItemState(#Menu, #Col1, 0)
        HideColumns(1)=#False
        SendMessage_(GadgetID(#ListIcon_1),#LVM_SETCOLUMNWIDTH,1,col_1)               
     EndIf
     ;********************************************


etc..etc..etc..

Possible Suggestions:

1. A Button that reveals all hidden columns.

2. If I LeftClick a column header to hide the column.
Then I could use RightClick on it's neighbor to
unhide it.

For Example: Columns 3,8,12,17,19 are hidden.

RightClick on Column Header 2 unhide 3
RightClick on Column Header 7 unhide 8
RightClick on Column Header 11 unhide 12
RightClick on Column Header 16 unhide 17
etc...

Maybe this is, to long a shot.

3. PopMenu. As long it reduces the code for the Case #PB_Event_Menu.

4. ComboBoxGadget. I am leaning towards this.

I am trying with a ComboBoxGadget check select.
But can't seem to figure out, the logic of it.


Quote:
You might be able to fake it - define the ListIcon without headers and have buttons instead.


A possibility.


Top
 Profile  
Reply with quote  
 Post subject: Re: Listicon, Hide-Unhide columns by clicking on Listicon He
PostPosted: Tue Aug 13, 2019 10:01 pm 
Offline
PureBasic Expert
PureBasic Expert

Joined: Sun Apr 12, 2009 6:27 am
Posts: 3475
Hi dcr3
I suggest the next for simplicity and good looking
You can show or hide ScrollAreaGadget() at any time using special shortcut key or any thing you like
Code:
If OpenWindow(0, 0, 0, 600, 400, "ListIcon Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  ListIconGadget(0, 70, 10, 520, 380, "Col #0", 60, #PB_ListIcon_FullRowSelect | #PB_ListIcon_AlwaysShowSelection | #PB_ListIcon_GridLines)
    For col = 1 To 30
      AddGadgetColumn(0, col, "Col #"+Str(col), 60)
    Next
  ScrollAreaGadget(1,10,10,50,345,50,1000)
    For i = 0 To 30
      id = 10+i     
      CheckBoxGadget(id,0,y,30,18,Str(i))
      y + 20
    Next
  CloseGadgetList()
  ShowScrollBar_(GadgetID(1),#SB_HORZ   ,0)
  but = ButtonGadget(#PB_Any,10,370,40,24,"Do")
Repeat
  Select WaitWindowEvent()
    Case #PB_Event_CloseWindow
      Quit = 1
     
    Case #PB_Event_Gadget
      Select EventGadget()
        Case but
          For item = 10 To 40
            col = item - 10
            If GetGadgetState(item) = 1
              SendMessage_(GadgetID(0),#LVM_SETCOLUMNWIDTH, col ,0)
            Else
              SendMessage_(GadgetID(0),#LVM_SETCOLUMNWIDTH, col ,#LVSCW_AUTOSIZE_USEHEADER & #LVSCW_AUTOSIZE)
            EndIf
          Next

        Case 10 To 40  ; For in instantaneous action
            col = EventGadget() - 10
            If GetGadgetState(EventGadget()) = 1
              SendMessage_(GadgetID(0),#LVM_SETCOLUMNWIDTH, col ,0)
            Else
              SendMessage_(GadgetID(0),#LVM_SETCOLUMNWIDTH, col ,#LVSCW_AUTOSIZE_USEHEADER & #LVSCW_AUTOSIZE)
            EndIf
      EndSelect
  EndSelect   
Until Quit = 1
EndIf


Edit : Updated

_________________
Egypt my love


Last edited by RASHAD on Wed Aug 14, 2019 12:32 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Listicon, Hide-Unhide columns by clicking on Listicon He
PostPosted: Tue Aug 13, 2019 10:47 pm 
Offline
User
User

Joined: Fri Aug 04, 2017 11:03 pm
Posts: 78
Thank you Rashad. That definitely reduces a lot of code. Nice. :D :D

Quote:
You can show or hide ScrollAreaGadget() at any time using special shortcut key or any thing you like


Another good suggestion.


Top
 Profile  
Reply with quote  
 Post subject: Re: Listicon, Hide-Unhide columns by clicking on Listicon He
PostPosted: Wed Aug 14, 2019 12:08 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Mon May 09, 2011 9:36 am
Posts: 479
Rashad,
great code example !!!

is there a way to hide only the horizontal scrollbar on a ScrollAreaGadget ???

Edit : i just found a way :)
Code:
    SetWindowLong_(GadgetID(1), #GWL_STYLE, GetWindowLong_(GadgetID(1), #GWL_STYLE)&~#WS_HSCROLL)
    SetWindowPos_(GadgetID(1), 0,0,0,0,0,#SWP_NOMOVE|#SWP_NOSIZE|#SWP_NOZORDER|#SWP_FRAMECHANGED)


Code:
If OpenWindow(0, 0, 0, 600, 400, "ListIcon Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  ListIconGadget(0, 70, 10, 520, 380, "Col #0", 60, #PB_ListIcon_FullRowSelect | #PB_ListIcon_AlwaysShowSelection | #PB_ListIcon_GridLines)
    For col = 1 To 30
      AddGadgetColumn(0, col, "Col #"+Str(col), 60)
    Next
  ScrollAreaGadget(1,10,10,50,345,50,1000)
    For i = 0 To 30
      id = 10+i     
      CheckBoxGadget(id,0,y,30,18,Str(i))
      y + 20
    Next
  CloseGadgetList()

    SetWindowLong_(GadgetID(1), #GWL_STYLE, GetWindowLong_(GadgetID(1), #GWL_STYLE)&~#WS_HSCROLL)
    SetWindowPos_(GadgetID(1), 0,0,0,0,0,#SWP_NOMOVE|#SWP_NOSIZE|#SWP_NOZORDER|#SWP_FRAMECHANGED)

 
  but = ButtonGadget(#PB_Any,10,370,40,24,"Do")
Repeat
  Select WaitWindowEvent()
    Case #PB_Event_CloseWindow
      Quit = 1
     
    Case #PB_Event_Gadget
      Select EventGadget()
        Case but
          For item = 10 To 40
            col = item - 10
            If GetGadgetState(item) = 1
              SendMessage_(GadgetID(0),#LVM_SETCOLUMNWIDTH, col ,0)
            Else
              SendMessage_(GadgetID(0),#LVM_SETCOLUMNWIDTH, col ,#LVSCW_AUTOSIZE_USEHEADER & #LVSCW_AUTOSIZE)
            EndIf
          Next

        Case 10 To 40  ; For in instantaneous action
            col = EventGadget() - 10
            If GetGadgetState(EventGadget()) = 1
              SendMessage_(GadgetID(0),#LVM_SETCOLUMNWIDTH, col ,0)
            Else
              SendMessage_(GadgetID(0),#LVM_SETCOLUMNWIDTH, col ,#LVSCW_AUTOSIZE_USEHEADER & #LVSCW_AUTOSIZE)
            EndIf
      EndSelect
  EndSelect   
Until Quit = 1
EndIf 




_________________
 
PureBasic .... making tiny electrons do what you want !

"With every mistake we must surely be learning" - George Harrison


Top
 Profile  
Reply with quote  
 Post subject: Re: Listicon, Hide-Unhide columns by clicking on Listicon He
PostPosted: Wed Aug 14, 2019 12:34 am 
Offline
PureBasic Expert
PureBasic Expert

Joined: Sun Apr 12, 2009 6:27 am
Posts: 3475
Hi VB6_to_PBx
Previous post updated
Another simple and direct way to hide the hl scroll bar

_________________
Egypt my love


Top
 Profile  
Reply with quote  
 Post subject: Re: Listicon, Hide-Unhide columns by clicking on Listicon He
PostPosted: Wed Aug 14, 2019 5:39 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Mon May 09, 2011 9:36 am
Posts: 479
RASHAD wrote:
Hi VB6_to_PBx
Previous post updated
Another simple and direct way to hide the hl scroll bar


thanks a bunch RASHAD , yes its so much simpler !

Code:
  ShowScrollBar_(GadgetID(1),#SB_HORZ   ,0)


Also , thanks for ScrollAreaGadget idea , i never thought about using it like in your example .

_________________
 
PureBasic .... making tiny electrons do what you want !

"With every mistake we must surely be learning" - George Harrison


Top
 Profile  
Reply with quote  
 Post subject: Re: Listicon, Hide-Unhide columns by clicking on Listicon He
PostPosted: Wed Aug 14, 2019 10:08 am 
Offline
User
User

Joined: Fri Aug 04, 2017 11:03 pm
Posts: 78
With a ListView.

Code:
OpenWindow(0, 0, 0, 600, 400, "ListIcon Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  ListIconGadget(0, 70, 10, 520, 380, "Col 0", 60, #PB_ListIcon_FullRowSelect | #PB_ListIcon_AlwaysShowSelection | #PB_ListIcon_GridLines)
  For col = 1 To 30
      AddGadgetColumn(0, col, "Col "+Str(col), 60)
  Next
  ListViewGadget(1,10,10,59,345,#PB_ListView_ClickSelect)
  but = ButtonGadget(#PB_Any,10,369,50,24,"Col/Hide")
TotHeaders=SendMessage_(SendMessage_(GadgetID(0),#LVM_GETHEADER,0,0),#HDM_GETITEMCOUNT,0,0)
  For x=0 To totheaders-1
  AddGadgetItem(1,-1,GetGadgetItemText(0, -1,x))
  Next   
  Repeat
  Select WaitWindowEvent()
    Case #PB_Event_CloseWindow
      Quit = 1
     
    Case #PB_Event_Gadget
      Select EventGadget()   
          Case but
           For item =0 To CountGadgetItems(1)-1;CountGadgetItems(1) To 0 Step-1
               If GetGadgetItemState(1, item)
               SendMessage_(GadgetID(0),#LVM_SETCOLUMNWIDTH, item ,0)
           Else
SendMessage_(GadgetID(0),#LVM_SETCOLUMNWIDTH, item,#LVSCW_AUTOSIZE_USEHEADER& #LVSCW_AUTOSIZE)
           EndIf
          Next
   EndSelect
  EndSelect   
Until Quit = 1




Or another ListIcon.

Can't figure out, how to do a CheckBox on ComboGadget. :?:


Top
 Profile  
Reply with quote  
 Post subject: Re: Listicon, Hide-Unhide columns by clicking on Listicon He
PostPosted: Wed Aug 14, 2019 12:59 pm 
Offline
PureBasic Expert
PureBasic Expert

Joined: Sun Apr 12, 2009 6:27 am
Posts: 3475
Now with ComboBoxGadget() and fixed ListIconGadget() column's width
Code:
Global Header

Procedure WinCB(hWnd, uMsg, wParam, lParam)
result = #PB_ProcessPureBasicEvents
  Select uMsg
   Case #WM_NOTIFY
    *NMHDR.NMHDR = lParam
      If *NMHDR\hWndFrom = Header
        ProcedureReturn 1
      EndIf
  EndSelect
  ProcedureReturn result
EndProcedure

CreateImage(0,16,16,32,$FFFFFF)
StartDrawing(ImageOutput(0))
  DrawingMode(#PB_2DDrawing_Outlined )
  Box(1,1,12,12,0)
StopDrawing()

CreateImage(1,16,16,32,$FFFFFF)
StartDrawing(ImageOutput(1))
  DrawingMode(#PB_2DDrawing_Outlined )
  Box(2,2,12,12,0)
  DrawingMode(#PB_2DDrawing_Default)
  Box(4,4,8,8,$0000FF)
StopDrawing()

If OpenWindow(0, 0, 0, 600, 395, "ListIcon Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  ListIconGadget(0, 100, 10, 490, 375, "Col #0", 60, #PB_ListIcon_FullRowSelect | #PB_ListIcon_AlwaysShowSelection | #PB_ListIcon_GridLines)
    For col = 1 To 30
      AddGadgetColumn(0, col, "Col #"+Str(col), 60)
    Next
    Header = SendMessage_(GadgetID(0),#LVM_GETHEADER, 0,0)
    ComboBoxGadget(1,10,10,80,20,#PB_ComboBox_Image )
    For i = 0 To 30
      AddGadgetItem(1, i,"Col :"+Str(i),ImageID(0))
      SetGadgetItemData(1 , i , 0)
    Next
    dLh = FindWindow_("ComboLBox",0)
    GetWindowRect_(dlh,r.RECT)
    MoveWindow_(dlh,r\left,r\top,r\right-r\left,r\bottom-r\top+25,1)
Repeat
  Select WaitWindowEvent()
    Case #PB_Event_CloseWindow
      Quit = 1     
     
    Case #PB_Event_Gadget
      Select EventGadget()
        Case 1
          state = GetGadgetState(1)
          If GetGadgetItemData(1, state) = 0
            SetWindowCallback(0)
            SetGadgetItemData(1 , state , 1)
            SetGadgetItemImage(1,state , ImageID(1))
            SendMessage_(GadgetID(0),#LVM_SETCOLUMNWIDTH, state ,0)
            SetWindowCallback(@WinCB())
          Else
            SetWindowCallback(0)
            SetGadgetItemData(1 , state , 0)
            SetGadgetItemImage(1,state , ImageID(0))
            SendMessage_(GadgetID(0),#LVM_SETCOLUMNWIDTH, state ,#LVSCW_AUTOSIZE_USEHEADER & #LVSCW_AUTOSIZE)
            SetWindowCallback(@WinCB())
          EndIf
      EndSelect
  EndSelect   
Until Quit = 1
EndIf

_________________
Egypt my love


Top
 Profile  
Reply with quote  
 Post subject: Re: Listicon, Hide-Unhide columns by clicking on Listicon He
PostPosted: Wed Aug 14, 2019 1:59 pm 
Offline
User
User

Joined: Fri Aug 04, 2017 11:03 pm
Posts: 78
Once again thank you. Great. :D 8)


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

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 14 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