Page 26 of 30

Re: PureLVSORT library : sorting ListIconGadgets (and more)

Posted: Tue Sep 13, 2011 10:33 pm
by rule
gnozal wrote:It looks like your are using the wrong library version.
With PB4.51, you should be using PureLVSORT_450.zip.
Gnozal,
Thanks for the reply.
No, I'm using V4.5+ and tried it on 2 XPsp3 machines and a Win7sp1 machine. They all gave the same error.

Roel.

Re: PureLVSORT library : sorting ListIconGadgets (and more)

Posted: Wed Sep 14, 2011 8:59 am
by gnozal
rule wrote:No, I'm using V4.5+ and tried it on 2 XPsp3 machines and a Win7sp1 machine. They all gave the same error.
This polink error definitly indicates a version mismatch between PB and PureLVSORT.
I could reproduce it using PureLVSORT for PB4.6x with Purebasic 4.51.

The correct PureLVSORT version for PB4.5x is http://gnozal.ucoz.com/PureLVSORT_450.zip.
I assume you downloaded http://gnozal.ucoz.com/PureLVSORT_460.zip.
See first post of this thread : http://www.purebasic.fr/english/viewtop ... 25&t=13224

Re: PureLVSORT library : sorting ListIconGadgets (and more)

Posted: Thu Sep 15, 2011 11:41 pm
by rule
Gnozal,

Yes, you are right. It solved my problem, however Libmanager indicated version 4.51+ with both versions.
But nevertheless, thank you for your time and support.

Regards,
Roel.

Re: PureLVSORT library : sorting ListIconGadgets (and more)

Posted: Fri Sep 16, 2011 7:33 am
by gnozal
rule wrote:Yes, you are right. It solved my problem, however Libmanager indicated version 4.51+ with both versions.
But nevertheless, thank you for your time and support.
Lib manager can only guess the version (based on the PB libraries used).
Btw, "PB4.5+" means PB4.5x or above (like PB4.6x, PB4.7x ...).

PureLVSORT: Is there an 'OnAfterSorting'-Event?

Posted: Wed Nov 02, 2011 4:43 pm
by Kiffi
Hello,

this one is a simple code to explain my problem:

Code: Select all

OpenWindow(0, #PB_Ignore, #PB_Ignore, 300, 300, "")

ListIconGadget(0, 0, 0, 300, 300, "test", 100)

AddGadgetItem(0, -1, "entry1")
AddGadgetItem(0, -1, "entry2")
AddGadgetItem(0, -1, "entry3")

PureCOLOR_SetCellColor(0, 2, 0, #Black, #Green)

If PureLVSORT_SelectGadgetToSort(0, #PureLVSORT_ShowClickedHeader_IconLeft) = #PureLVSORT_Ok
  PureLVSORT_SetColumnType(0, 0, 0)
EndIf

Repeat
Until WaitWindowEvent()=#PB_Event_CloseWindow
I want to color the cell with 'entry3'. After clicking on the columnheader,
the entries are sorted but now 'entry1' ist green colored.

Is there an event like 'OnAfterSorting' (or so) so i can recolorize the Listicongadget?

Thanks in advance & Greetings ... Kiffi

Re: PureLVSORT: Is there an 'OnAfterSorting'-Event?

Posted: Wed Nov 02, 2011 6:18 pm
by IdeasVacuum
....What I do is to use a hammer to crack a nut - but it is fast even with long lists:

1) Save the list (PureLVSORT_SaveListIconXXX)
2) Reload the list (PureLVSORT_LoadListIconXXX)
3) Re-colour the Cell.

Re: PureLVSORT: Is there an 'OnAfterSorting'-Event?

Posted: Thu Nov 03, 2011 10:58 am
by gnozal
Kiffi wrote:Is there an event like 'OnAfterSorting' ?
Yes, there is.
It's an undocumented feature added for Srod's eGrid.

Code: Select all

#PureLVSORT_eGrid_SortIsDone = #WM_USER + 1

Procedure MyListIconCallback(WindowID, Message, wParam, lParam)
  Shared OldCB
  If OldCB
    Result = CallWindowProc_(OldCB, WindowID, Message, wParam, lParam)
    ;
    If Message = #PureLVSORT_eGrid_SortIsDone
      Debug "just sorted : listicon " + Str(GetDlgCtrlID_(WindowID)) + " (column " + Str(wParam) +")"
    EndIf
  EndIf
  ;
  ProcedureReturn Result
EndProcedure


OpenWindow(0, #PB_Ignore, #PB_Ignore, 300, 300, "")

ListIconGadget(0, 0, 0, 300, 300, "test", 100)

AddGadgetColumn(0, 1, "test 2", 100)
AddGadgetItem(0, -1, "entry1" + Chr(10) + "entry1")
AddGadgetItem(0, -1, "entry2" + Chr(10) + "entry2")
AddGadgetItem(0, -1, "entry3" + Chr(10) + "entry3")

OldCB = SetWindowLongPtr_(GadgetID(0), #GWL_WNDPROC, @MyListIconCallback())


PureCOLOR_SetCellColor(0, 2, 0, #Black, #Green)

If PureLVSORT_SelectGadgetToSort(0, #PureLVSORT_ShowClickedHeader_IconLeft) = #PureLVSORT_Ok
  PureLVSORT_SetColumnType(0, 0, 0)
EndIf

Repeat
Until WaitWindowEvent()=#PB_Event_CloseWindow

Re: PureLVSORT: Is there an 'OnAfterSorting'-Event?

Posted: Thu Nov 03, 2011 11:59 am
by Kiffi
gnozal wrote:
Kiffi wrote:Is there an event like 'OnAfterSorting' ?
Yes, there is. [...]
Great! Works like a charm. Thanks a lot! :D

@IdeasVacuum: Thanks for your answer as well.

Greetings ... Kiffi

Re: PureLVSORT library : sorting ListIconGadgets (and more)

Posted: Fri Nov 04, 2011 9:24 am
by leodh
Hi Gnozal,

I have been using PureLVSort in a project which has several ListIconGadgets on different contianer gadgets, how do I get Columns on different Gadgets to be editable at the same time ( so I can jump between them )

Each container gadget is hidden and is only shown when input is required. The First ListIcongadget seems to work but I can not get any of the other ones to be editable.


Is it possible if so what do I have to do to get it to work.

Using PB 4.50

Re: PureLVSORT library : sorting ListIconGadgets (and more)

Posted: Fri Nov 04, 2011 12:41 pm
by gnozal
leodh wrote:I have been using PureLVSort in a project which has several ListIconGadgets on different contianer gadgets, how do I get Columns on different Gadgets to be editable at the same time ( so I can jump between them )

Each container gadget is hidden and is only shown when input is required. The First ListIcongadget seems to work but I can not get any of the other ones to be editable.

Is it possible if so what do I have to do to get it to work.
Without code, I can only guess...
However, this example seems to work (2 listicons in 2 containers) :

Code: Select all

Enumeration
  #Window_0
EndEnumeration
Enumeration
  #Container_2
  #ListIcon_0
  #Container_3
  #ListIcon_1
EndEnumeration
Procedure.l MyEditCallback(Event.l, ListIconNumber.l, Column.l, Row.l, Text.s)
  Select Event
    Case #PureLVSORT_EditStart
      Debug "EDITSTART " + Str(ListIconNumber) + " (" + Str(Column) + ":" + Str(Row) + ") -> '" + Text + "'"
      ; Return  :	- 0 to enable stringgadget (default)
      ; 		- *string to enable a spingadget [the string holds the choice items (separator = '|']
    Case #PureLVSORT_EditText
      Debug "EDITTEXT " + Str(ListIconNumber) + " (" + Str(Column) + ":" + Str(Row) + ") -> '" + Text + "'"
      ; Return  :	- 0 to keep the text (default)
      ; 		- *string to change the text [the string holds the changed text]
    Case #PureLVSORT_EditEnd
      Debug "EDITEND"
    Case #PureLVSORT_EditEscape
      Debug "EDITESCAPE"
  EndSelect
EndProcedure
Procedure OpenWindow_Window_0()
  If OpenWindow(#Window_0, 450, 200, 420, 400, "Window_0", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar)
    ContainerGadget(#Container_2, 11, 4, 400, 191, #PB_Container_Raised)
      ListIconGadget(#ListIcon_0, 17, 8, 374, 166, "Gadget_0", 100, #PB_ListIcon_AlwaysShowSelection|#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect)
      AddGadgetColumn(#ListIcon_0, 1, "Column #2", 100)
      AddGadgetColumn(#ListIcon_0, 2, "Column #3", 100)
      AddGadgetColumn(#ListIcon_0, 3, "Column #4", 100)
    CloseGadgetList()
    ContainerGadget(#Container_3, 12, 198, 400, 201, #PB_Container_Raised)
      ListIconGadget(#ListIcon_1, 19, 17, 374, 166, "Gadget_1", 100, #PB_ListIcon_AlwaysShowSelection|#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect)
      AddGadgetColumn(#ListIcon_1, 1, "Column #2", 100)
      AddGadgetColumn(#ListIcon_1, 2, "Column #3", 100)
      AddGadgetColumn(#ListIcon_1, 3, "Column #4", 100)
    CloseGadgetList()
    AddGadgetItem(#ListIcon_0, -1, "1" + Chr(10) + "2" + Chr(10) + "3" + Chr(10) + "4")
    AddGadgetItem(#ListIcon_0, -1, "1" + Chr(10) + "2" + Chr(10) + "3" + Chr(10) + "4")
    AddGadgetItem(#ListIcon_0, -1, "1" + Chr(10) + "2" + Chr(10) + "3" + Chr(10) + "4")
    AddGadgetItem(#ListIcon_0, -1, "1" + Chr(10) + "2" + Chr(10) + "3" + Chr(10) + "4")
    AddGadgetItem(#ListIcon_0, -1, "1" + Chr(10) + "2" + Chr(10) + "3" + Chr(10) + "4")
    SendMessage_(GadgetID(#ListIcon_0), #LVM_SETCOLUMNWIDTH, 0, #LVSCW_AUTOSIZE_USEHEADER)
    SendMessage_(GadgetID(#ListIcon_0), #LVM_SETCOLUMNWIDTH, 1, #LVSCW_AUTOSIZE_USEHEADER)
    SendMessage_(GadgetID(#ListIcon_0), #LVM_SETCOLUMNWIDTH, 2, #LVSCW_AUTOSIZE_USEHEADER)
    SendMessage_(GadgetID(#ListIcon_0), #LVM_SETCOLUMNWIDTH, 3, #LVSCW_AUTOSIZE_USEHEADER)
    AddGadgetItem(#ListIcon_1, -1, "1" + Chr(10) + "2" + Chr(10) + "3" + Chr(10) + "4")
    AddGadgetItem(#ListIcon_1, -1, "1" + Chr(10) + "2" + Chr(10) + "3" + Chr(10) + "4")
    AddGadgetItem(#ListIcon_1, -1, "1" + Chr(10) + "2" + Chr(10) + "3" + Chr(10) + "4")
    AddGadgetItem(#ListIcon_1, -1, "1" + Chr(10) + "2" + Chr(10) + "3" + Chr(10) + "4")
    AddGadgetItem(#ListIcon_1, -1, "1" + Chr(10) + "2" + Chr(10) + "3" + Chr(10) + "4")
    AddGadgetItem(#ListIcon_1, -1, "1" + Chr(10) + "2" + Chr(10) + "3" + Chr(10) + "4")
    SendMessage_(GadgetID(#ListIcon_1), #LVM_SETCOLUMNWIDTH, 0, #LVSCW_AUTOSIZE_USEHEADER)
    SendMessage_(GadgetID(#ListIcon_1), #LVM_SETCOLUMNWIDTH, 1, #LVSCW_AUTOSIZE_USEHEADER)
    SendMessage_(GadgetID(#ListIcon_1), #LVM_SETCOLUMNWIDTH, 2, #LVSCW_AUTOSIZE_USEHEADER)
    SendMessage_(GadgetID(#ListIcon_1), #LVM_SETCOLUMNWIDTH, 3, #LVSCW_AUTOSIZE_USEHEADER)
    
    PureLVSORT_SelectGadgetToSort(#ListIcon_0, #PureLVSORT_ShowClickedHeader_No)
    PureLVSORT_SelectGadgetToSort(#ListIcon_1, #PureLVSORT_ShowClickedHeader_No)
    
    PureLVSORT_MakeColumnEditable(#ListIcon_0, 1, #True)
    PureLVSORT_MakeColumnEditable(#ListIcon_1, 2, #True)
    
    PureLVSORT_SetEditingCallback(@MyEditCallback())
  EndIf
EndProcedure

OpenWindow_Window_0()

Repeat
  Event = WaitWindowEvent()
  Select Event
    Case #PB_Event_CloseWindow
        CloseWindow(#Window_0)
        Break
  EndSelect
ForEver

Re: PureLVSORT library : sorting ListIconGadgets (and more)

Posted: Mon Nov 07, 2011 9:01 am
by leodh
Hi Gnozal,

I have narrowed down my problem with PureLVSort, it seems that when you open a new window it causes some problem with the focus of PureLVsort ( not sure focus is the right word ) It upsets the the event select in the callback. Once the window is opened and active you can not get the #PureLVSORT_EditText to reappear after the window is closed.

I will try and show some code ( Source Code 8000 lines) when I have it narrowed down further.

Re: PureLVSORT library : sorting ListIconGadgets (and more)

Posted: Mon Nov 07, 2011 9:19 am
by gnozal
leodh wrote:Hi Gnozal,

I have narrowed down my problem with PureLVSort, it seems that when you open a new window it causes some problem with the focus of PureLVsort ( not sure focus is the right word ) It upsets the the event select in the callback. Once the window is opened and active you can not get the #PureLVSORT_EditText to reappear after the window is closed.

I will try and show some code ( Source Code 8000 lines) when I have it narrowed down further.
I added a second window to my test code. It still seems to work.

Code: Select all

Enumeration
  #Window_0
  #Window_1
EndEnumeration
Enumeration
  #Container_2
  #ListIcon_0
  #Container_3
  #ListIcon_1
EndEnumeration
Procedure.l MyEditCallback(Event.l, ListIconNumber.l, Column.l, Row.l, Text.s)
  Select Event
    Case #PureLVSORT_EditStart
      Debug "EDITSTART " + Str(ListIconNumber) + " (" + Str(Column) + ":" + Str(Row) + ") -> '" + Text + "'"
      ; Return  :   - 0 to enable stringgadget (default)
      ;       - *string to enable a spingadget [the string holds the choice items (separator = '|']
    Case #PureLVSORT_EditText
      Debug "EDITTEXT " + Str(ListIconNumber) + " (" + Str(Column) + ":" + Str(Row) + ") -> '" + Text + "'"
      ; Return  :   - 0 to keep the text (default)
      ;       - *string to change the text [the string holds the changed text]
    Case #PureLVSORT_EditEnd
      Debug "EDITEND"
    Case #PureLVSORT_EditEscape
      Debug "EDITESCAPE"
  EndSelect
EndProcedure
Procedure OpenWindow_Window_0()
  If OpenWindow(#Window_0, 450, 200, 420, 400, "Window_0", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar)
    ContainerGadget(#Container_2, 11, 4, 400, 191, #PB_Container_Raised)
      ListIconGadget(#ListIcon_0, 17, 8, 374, 166, "Gadget_0", 100, #PB_ListIcon_AlwaysShowSelection|#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect)
      AddGadgetColumn(#ListIcon_0, 1, "Column #2", 100)
      AddGadgetColumn(#ListIcon_0, 2, "Column #3", 100)
      AddGadgetColumn(#ListIcon_0, 3, "Column #4", 100)
    CloseGadgetList()
    OpenWindow(#Window_1, 450, 200, 420, 400, "Window_1", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar)
    ContainerGadget(#Container_3, 12, 198, 400, 201, #PB_Container_Raised)
      ListIconGadget(#ListIcon_1, 19, 17, 374, 166, "Gadget_1", 100, #PB_ListIcon_AlwaysShowSelection|#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect)
      AddGadgetColumn(#ListIcon_1, 1, "Column #2", 100)
      AddGadgetColumn(#ListIcon_1, 2, "Column #3", 100)
      AddGadgetColumn(#ListIcon_1, 3, "Column #4", 100)
    CloseGadgetList()
    AddGadgetItem(#ListIcon_0, -1, "1" + Chr(10) + "2" + Chr(10) + "3" + Chr(10) + "4")
    AddGadgetItem(#ListIcon_0, -1, "1" + Chr(10) + "2" + Chr(10) + "3" + Chr(10) + "4")
    AddGadgetItem(#ListIcon_0, -1, "1" + Chr(10) + "2" + Chr(10) + "3" + Chr(10) + "4")
    AddGadgetItem(#ListIcon_0, -1, "1" + Chr(10) + "2" + Chr(10) + "3" + Chr(10) + "4")
    AddGadgetItem(#ListIcon_0, -1, "1" + Chr(10) + "2" + Chr(10) + "3" + Chr(10) + "4")
    SendMessage_(GadgetID(#ListIcon_0), #LVM_SETCOLUMNWIDTH, 0, #LVSCW_AUTOSIZE_USEHEADER)
    SendMessage_(GadgetID(#ListIcon_0), #LVM_SETCOLUMNWIDTH, 1, #LVSCW_AUTOSIZE_USEHEADER)
    SendMessage_(GadgetID(#ListIcon_0), #LVM_SETCOLUMNWIDTH, 2, #LVSCW_AUTOSIZE_USEHEADER)
    SendMessage_(GadgetID(#ListIcon_0), #LVM_SETCOLUMNWIDTH, 3, #LVSCW_AUTOSIZE_USEHEADER)
    AddGadgetItem(#ListIcon_1, -1, "1" + Chr(10) + "2" + Chr(10) + "3" + Chr(10) + "4")
    AddGadgetItem(#ListIcon_1, -1, "1" + Chr(10) + "2" + Chr(10) + "3" + Chr(10) + "4")
    AddGadgetItem(#ListIcon_1, -1, "1" + Chr(10) + "2" + Chr(10) + "3" + Chr(10) + "4")
    AddGadgetItem(#ListIcon_1, -1, "1" + Chr(10) + "2" + Chr(10) + "3" + Chr(10) + "4")
    AddGadgetItem(#ListIcon_1, -1, "1" + Chr(10) + "2" + Chr(10) + "3" + Chr(10) + "4")
    AddGadgetItem(#ListIcon_1, -1, "1" + Chr(10) + "2" + Chr(10) + "3" + Chr(10) + "4")
    SendMessage_(GadgetID(#ListIcon_1), #LVM_SETCOLUMNWIDTH, 0, #LVSCW_AUTOSIZE_USEHEADER)
    SendMessage_(GadgetID(#ListIcon_1), #LVM_SETCOLUMNWIDTH, 1, #LVSCW_AUTOSIZE_USEHEADER)
    SendMessage_(GadgetID(#ListIcon_1), #LVM_SETCOLUMNWIDTH, 2, #LVSCW_AUTOSIZE_USEHEADER)
    SendMessage_(GadgetID(#ListIcon_1), #LVM_SETCOLUMNWIDTH, 3, #LVSCW_AUTOSIZE_USEHEADER)
    
    PureLVSORT_SelectGadgetToSort(#ListIcon_0, #PureLVSORT_ShowClickedHeader_No)
    PureLVSORT_SelectGadgetToSort(#ListIcon_1, #PureLVSORT_ShowClickedHeader_No)
    
    PureLVSORT_MakeColumnEditable(#ListIcon_0, 1, #True)
    PureLVSORT_MakeColumnEditable(#ListIcon_1, 2, #True)
    
    PureLVSORT_SetEditingCallback(@MyEditCallback())
  EndIf
EndProcedure

OpenWindow_Window_0()

Repeat
  Event = WaitWindowEvent()
  Select Event
    Case #PB_Event_CloseWindow
      CloseWindow(#Window_0)
      CloseWindow(#Window_1)
      Break
  EndSelect
ForEver

Re: PureLVSORT library : sorting ListIconGadgets (and more)

Posted: Tue Nov 08, 2011 3:28 am
by leodh
Hi gnozal,

I have some code here that kind of shows the problem.

Code: Select all

Enumeration
  #Window_0
  #Window_1
EndEnumeration
Enumeration
  #Button_1
  #Button_2
  #Button_3
  #Button_4
  #NWCancel
  #Container_1
  #Container_2
  #Container_3
  #ListIcon_0
  #ListIcon_1
  #ListIcon_2
EndEnumeration
Procedure.l MyEditCallback(Event.l, ListIconNumber.l, Column.l, Row.l, Text.s)
  Select Event
    Case #PureLVSORT_EditStart
      Debug "EDITSTART " + Str(ListIconNumber) + " (" + Str(Column) + ":" + Str(Row) + ") -> '" + Text + "'"
      ; Return  :   - 0 to enable stringgadget (default)
      ;       - *string to enable a spingadget [the string holds the choice items (separator = '|']
    Case #PureLVSORT_EditText
      Debug "EDITTEXT " + Str(ListIconNumber) + " (" + Str(Column) + ":" + Str(Row) + ") -> '" + Text + "'"
      ; Return  :   - 0 to keep the text (default)
      ;       - *string to change the text [the string holds the changed text]
    Case #PureLVSORT_EditEnd
      Debug "EDITEND"
    Case #PureLVSORT_EditEscape
      Debug "EDITESCAPE"
  EndSelect
EndProcedure
Procedure NewWindow()
Quit = 0  
OpenWindow(#Window_1,0,0,300,175,"",#PB_Window_BorderLess|#PB_Window_ScreenCentered)
SetWindowColor(#Window_1,RGB(100,175,175))
ButtonGadget  (#NWCancel,200,145, 75, 20,"Cancel")
EndProcedure


Procedure OpenWindow_Window_0()
  If OpenWindow(#Window_0, 450, 200, 420, 400, "Window_0", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar)
    
    ButtonGadget(#Button_1, 10, 5, 90, 20," Container 1")
    ButtonGadget(#Button_2,110, 5, 90, 20," Container 2")
    ButtonGadget(#Button_3,210, 5, 90, 20," Container 3")
    ButtonGadget(#Button_4,310, 5, 90, 20," Window ")
    
    ContainerGadget(#Container_1, 10, 35,400,300, #PB_Container_Raised)
      ListIconGadget(#ListIcon_0, 17, 8, 374, 166, "List Gadget_0", 100, #PB_ListIcon_AlwaysShowSelection|#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect)
      AddGadgetColumn(#ListIcon_0, 1, "Column #2", 100)
      AddGadgetColumn(#ListIcon_0, 2, "Column #3", 100)
      AddGadgetColumn(#ListIcon_0, 3, "Column #4", 100)
    CloseGadgetList()
    ContainerGadget(#Container_2, 10, 35, 400,300, #PB_Container_Raised)
      ListIconGadget(#ListIcon_1, 19, 17, 374, 166, "List Gadget_1", 100, #PB_ListIcon_AlwaysShowSelection|#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect)
      AddGadgetColumn(#ListIcon_1, 1, "Column #2", 100)
      AddGadgetColumn(#ListIcon_1, 2, "Column #3", 100)
      AddGadgetColumn(#ListIcon_1, 3, "Column #4", 100)
    CloseGadgetList()
    ContainerGadget(#Container_3, 10, 35, 400,300, #PB_Container_Raised)
      ListIconGadget(#ListIcon_2, 19, 17, 374, 166, "ListGadget_2", 100, #PB_ListIcon_AlwaysShowSelection|#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect)
      AddGadgetColumn(#ListIcon_2, 1, "Column #2", 100)
      AddGadgetColumn(#ListIcon_2, 2, "Column #3", 100)
      AddGadgetColumn(#ListIcon_2, 3, "Column #4", 100)
    CloseGadgetList()
    HideGadget(#Container_1,1)
    HideGadget(#Container_2,1)
    HideGadget(#Container_3,1)
    
    
    
    AddGadgetItem(#ListIcon_0, -1, "1" + Chr(10) + "2" + Chr(10) + "3" + Chr(10) + "4")
    AddGadgetItem(#ListIcon_0, -1, "1" + Chr(10) + "2" + Chr(10) + "3" + Chr(10) + "4")
    AddGadgetItem(#ListIcon_0, -1, "1" + Chr(10) + "2" + Chr(10) + "3" + Chr(10) + "4")
    AddGadgetItem(#ListIcon_0, -1, "1" + Chr(10) + "2" + Chr(10) + "3" + Chr(10) + "4")
    AddGadgetItem(#ListIcon_0, -1, "1" + Chr(10) + "2" + Chr(10) + "3" + Chr(10) + "4")
    SendMessage_(GadgetID(#ListIcon_0), #LVM_SETCOLUMNWIDTH, 0, #LVSCW_AUTOSIZE_USEHEADER)
    SendMessage_(GadgetID(#ListIcon_0), #LVM_SETCOLUMNWIDTH, 1, #LVSCW_AUTOSIZE_USEHEADER)
    SendMessage_(GadgetID(#ListIcon_0), #LVM_SETCOLUMNWIDTH, 2, #LVSCW_AUTOSIZE_USEHEADER)
    SendMessage_(GadgetID(#ListIcon_0), #LVM_SETCOLUMNWIDTH, 3, #LVSCW_AUTOSIZE_USEHEADER)
    AddGadgetItem(#ListIcon_1, -1, "1" + Chr(10) + "2" + Chr(10) + "3" + Chr(10) + "4")
    AddGadgetItem(#ListIcon_1, -1, "1" + Chr(10) + "2" + Chr(10) + "3" + Chr(10) + "4")
    AddGadgetItem(#ListIcon_1, -1, "1" + Chr(10) + "2" + Chr(10) + "3" + Chr(10) + "4")
    AddGadgetItem(#ListIcon_1, -1, "1" + Chr(10) + "2" + Chr(10) + "3" + Chr(10) + "4")
    AddGadgetItem(#ListIcon_1, -1, "1" + Chr(10) + "2" + Chr(10) + "3" + Chr(10) + "4")
    AddGadgetItem(#ListIcon_1, -1, "1" + Chr(10) + "2" + Chr(10) + "3" + Chr(10) + "4")
    SendMessage_(GadgetID(#ListIcon_1), #LVM_SETCOLUMNWIDTH, 0, #LVSCW_AUTOSIZE_USEHEADER)
    SendMessage_(GadgetID(#ListIcon_1), #LVM_SETCOLUMNWIDTH, 1, #LVSCW_AUTOSIZE_USEHEADER)
    SendMessage_(GadgetID(#ListIcon_1), #LVM_SETCOLUMNWIDTH, 2, #LVSCW_AUTOSIZE_USEHEADER)
    SendMessage_(GadgetID(#ListIcon_1), #LVM_SETCOLUMNWIDTH, 3, #LVSCW_AUTOSIZE_USEHEADER)
    AddGadgetItem(#ListIcon_2, -1, "1" + Chr(10) + "2" + Chr(10) + "3" + Chr(10) + "4")
    AddGadgetItem(#ListIcon_2, -1, "1" + Chr(10) + "2" + Chr(10) + "3" + Chr(10) + "4")
    AddGadgetItem(#ListIcon_2, -1, "1" + Chr(10) + "2" + Chr(10) + "3" + Chr(10) + "4")
    AddGadgetItem(#ListIcon_2, -1, "1" + Chr(10) + "2" + Chr(10) + "3" + Chr(10) + "4")
    AddGadgetItem(#ListIcon_2, -1, "1" + Chr(10) + "2" + Chr(10) + "3" + Chr(10) + "4")
    AddGadgetItem(#ListIcon_2, -1, "1" + Chr(10) + "2" + Chr(10) + "3" + Chr(10) + "4")
    SendMessage_(GadgetID(#ListIcon_2), #LVM_SETCOLUMNWIDTH, 0, #LVSCW_AUTOSIZE_USEHEADER)
    SendMessage_(GadgetID(#ListIcon_2), #LVM_SETCOLUMNWIDTH, 1, #LVSCW_AUTOSIZE_USEHEADER)
    SendMessage_(GadgetID(#ListIcon_2), #LVM_SETCOLUMNWIDTH, 2, #LVSCW_AUTOSIZE_USEHEADER)
    SendMessage_(GadgetID(#ListIcon_2), #LVM_SETCOLUMNWIDTH, 3, #LVSCW_AUTOSIZE_USEHEADER)
    
    
    PureLVSORT_SelectGadgetToSort(#ListIcon_0, #PureLVSORT_ShowClickedHeader_No)
    PureLVSORT_SelectGadgetToSort(#ListIcon_1, #PureLVSORT_ShowClickedHeader_No)
    PureLVSORT_SelectGadgetToSort(#ListIcon_2, #PureLVSORT_ShowClickedHeader_No)
    
    PureLVSORT_SetEditingColors(RGB(184, 223, 223), #Black)
    
    PureLVSORT_MakeColumnEditable(#ListIcon_0, 1, #True)
    PureLVSORT_MakeColumnEditable(#ListIcon_1, 2, #True)
    PureLVSORT_MakeColumnEditable(#ListIcon_2, 3, #True)
    
    PureLVSORT_SetEditingCallback(@MyEditCallback())
  EndIf
EndProcedure

OpenWindow_Window_0()

Repeat
  Event = WaitWindowEvent()
  Select Event
      
    Case #PB_Event_Gadget
           
      Select EventGadget()  
             
        Case #Button_1
          HideGadget(#Container_1,0)
          HideGadget(#Container_2,1)
          HideGadget(#Container_3,1)
        Case #Button_2
          HideGadget(#Container_1,1)
          HideGadget(#Container_2,0)
          HideGadget(#Container_3,1)
        Case #Button_3
          HideGadget(#Container_1,1)
          HideGadget(#Container_2,1)
          HideGadget(#Container_3,0)
        Case #Button_4
          NewWindow()
        Case #NWCancel
          Quit = 1
          CloseWindow(#Window_1)  
          
      EndSelect 
      
    Case #PB_Event_CloseWindow
        CloseWindow(#Window_0)
        Break
  EndSelect
ForEver
Just click on it a few times opening and closing the window.

I stumped, every thing works until I add the window and open and close it.

I sure I must be doing something wrong but I just cannot find it.

Re: PureLVSORT library : sorting ListIconGadgets (and more)

Posted: Tue Nov 08, 2011 12:31 pm
by gnozal
Update (PureLVSORT Plus for PB4.6x)

Changes :
- fixed GadgetList issue (posted by leodh)

Re: PureLVSORT library : sorting ListIconGadgets (and more)

Posted: Wed Nov 09, 2011 1:23 am
by leodh
Hi Gnozal,

Great. Thanks for that, I was starting to batty.
:D