It is currently Thu May 23, 2013 4:00 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 429 posts ]  Go to page Previous  1 ... 23, 24, 25, 26, 27, 28, 29  Next
Author Message
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Tue Sep 13, 2011 10:33 pm 
Offline
User
User

Joined: Sat Sep 02, 2006 7:56 pm
Posts: 14
Location: Oostzaan / Netherlands
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.


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Wed Sep 14, 2011 8:59 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
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 : viewtopic.php?f=25&t=13224

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Thu Sep 15, 2011 11:41 pm 
Offline
User
User

Joined: Sat Sep 02, 2006 7:56 pm
Posts: 14
Location: Oostzaan / Netherlands
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.


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Fri Sep 16, 2011 7:33 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
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 ...).

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
 
 Post subject: PureLVSORT: Is there an 'OnAfterSorting'-Event?
PostPosted: Wed Nov 02, 2011 4:43 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Tue Mar 02, 2004 1:20 pm
Posts: 684
Location: Cologne / Germany
Hello,

this one is a simple code to explain my problem:
Code:
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

_________________
Sorry for my weird english


Top
 Profile  
 
 Post subject: Re: PureLVSORT: Is there an 'OnAfterSorting'-Event?
PostPosted: Wed Nov 02, 2011 6:18 pm 
Offline
Addict
Addict

Joined: Fri Oct 23, 2009 2:33 am
Posts: 2862
Location: Wales, UK
....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.

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


Top
 Profile  
 
 Post subject: Re: PureLVSORT: Is there an 'OnAfterSorting'-Event?
PostPosted: Thu Nov 03, 2011 10:58 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
Kiffi wrote:
Is there an event like 'OnAfterSorting' ?
Yes, there is.
It's an undocumented feature added for Srod's eGrid.
Code:
#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

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
 
 Post subject: Re: PureLVSORT: Is there an 'OnAfterSorting'-Event?
PostPosted: Thu Nov 03, 2011 11:59 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Tue Mar 02, 2004 1:20 pm
Posts: 684
Location: Cologne / Germany
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

_________________
Sorry for my weird english


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Fri Nov 04, 2011 9:24 am 
Offline
Enthusiast
Enthusiast

Joined: Sun Nov 06, 2005 6:07 am
Posts: 133
Location: Perth Western Australia
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

_________________
Regards
Leo


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Fri Nov 04, 2011 12:41 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
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:
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

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Mon Nov 07, 2011 9:01 am 
Offline
Enthusiast
Enthusiast

Joined: Sun Nov 06, 2005 6:07 am
Posts: 133
Location: Perth Western Australia
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.

_________________
Regards
Leo


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Mon Nov 07, 2011 9:19 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
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:
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

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Tue Nov 08, 2011 3:28 am 
Offline
Enthusiast
Enthusiast

Joined: Sun Nov 06, 2005 6:07 am
Posts: 133
Location: Perth Western Australia
Hi gnozal,

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

Code:
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.

_________________
Regards
Leo


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Tue Nov 08, 2011 12:31 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
Update (PureLVSORT Plus for PB4.6x)

Changes :
- fixed GadgetList issue (posted by leodh)

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Wed Nov 09, 2011 1:23 am 
Offline
Enthusiast
Enthusiast

Joined: Sun Nov 06, 2005 6:07 am
Posts: 133
Location: Perth Western Australia
Hi Gnozal,

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

_________________
Regards
Leo


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 429 posts ]  Go to page Previous  1 ... 23, 24, 25, 26, 27, 28, 29  Next

All times are UTC + 1 hour


Who is online

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