PureLVSORT library : sorting ListIconGadgets (and more)

All PureFORM, JaPBe, Libs and useful code maintained by gnozal

Moderator: gnozal

gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Re: PureLVSORT library : sorting ListIconGadgets (and more)

Post by gnozal »

QuimV wrote:This is the result in debug screen, with the word "test".

t
te
tes
test
tes
te
t
C
Thanks, I think I found the problem (maybe...)
Could you test again http://freenet-homepage.de/gnozal/PureLVSORT_TEST.zip ?
(No warning anymore, use your own debug command)
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
QuimV
Enthusiast
Enthusiast
Posts: 337
Joined: Mon May 29, 2006 11:29 am
Location: BARCELONA - SPAIN

Re: PureLVSORT library : sorting ListIconGadgets (and more)

Post by QuimV »

Output Debug:

t
te
tes
test
tes
te
t
C
QuimV
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Re: PureLVSORT library : sorting ListIconGadgets (and more)

Post by gnozal »

QuimV wrote:Output Debug:
t
te
tes
test
tes
te
t
C
Is this the result with the latest test library (PureLVSORT 21972 bytes 27/04/2010 10:19) ?
I don't understand .... I am checking the value returned by the HDM_GETITEM message and if it is #False, I set the string to "".

Code: Select all

            GetItemOk = SendMessage_(hHeader, #HDM_GETITEM, *pNMHdr\iItem, @hHDItem)
            If GetItemOk
              FilterText = PeekS(TFilter\pszText, TFilter\cchTextMax)
            Else
              FilterText = ""
            EndIf
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
QuimV
Enthusiast
Enthusiast
Posts: 337
Joined: Mon May 29, 2006 11:29 am
Location: BARCELONA - SPAIN

Re: PureLVSORT library : sorting ListIconGadgets (and more)

Post by QuimV »

Yes, this is the result with the latest test library (PureLVSORT 21972 bytes 27/04/2010 10:19)
QuimV
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Re: PureLVSORT library : sorting ListIconGadgets (and more)

Post by gnozal »

QuimV wrote:Yes, this is the result with the latest test library (PureLVSORT 21972 bytes 27/04/2010 10:19)
:(
I am out of ideas ...
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
QuimV
Enthusiast
Enthusiast
Posts: 337
Joined: Mon May 29, 2006 11:29 am
Location: BARCELONA - SPAIN

Re: PureLVSORT library : sorting ListIconGadgets (and more)

Post by QuimV »

Could you send me, by PM, source files (no libraries) that i could debug directly on W7 and then I report you back?
You have my honored word and my total discretion about to destroy the files after the problem is solved.
QuimV
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Re: PureLVSORT library : sorting ListIconGadgets (and more)

Post by gnozal »

QuimV wrote:Could you send me, by PM, source files (no libraries) that i could debug directly on W7 and then I report you back?
You have my honored word and my total discretion about to destroy the files after the problem is solved.
Sure, no problem.
Check your PM.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Re: PureLVSORT library : sorting ListIconGadgets (and more)

Post by gnozal »

We got some information about the Se7en issue:
QuimV wrote:The problem is located in the function:
GetItemOk = SendMessage_(hHeader, #HDM_GETITEM, *pNMHdr\iItem, @hHDItem)
In Windows XP-SP3:
When len(userfiltertext)>0 the function returns 1 (GetItemOk = 1)
When len(userfiltertext)=0 the function returns 0 (GetItemOk = 0)
In Windows W7-x32:
When len(userfiltertext)>0 the function returns 1 (GetItemOk = 1)
When len(userfiltertext)=0 the function returns 1 (GetItemOk = 1)
According to MSDN, HDM_GETITEM returns 0 if failed.
If anyone has some idea ...
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
QuimV
Enthusiast
Enthusiast
Posts: 337
Joined: Mon May 29, 2006 11:29 am
Location: BARCELONA - SPAIN

Re: PureLVSORT library : sorting ListIconGadgets (and more)

Post by QuimV »

Hi,
Compiled in Unicode it runs fine!
Is PB or Se7en bug?
QuimV
dige
Addict
Addict
Posts: 1391
Joined: Wed Apr 30, 2003 8:15 am
Location: Germany
Contact:

Re: PureLVSORT library : sorting ListIconGadgets (and more)

Post by dige »

with pb4.50 b4 I've got an Illegal memory access with PureLVSORT_SelectGadgetToSort(). May be recompiling the source
with b4 helps?
"Daddy, I'll run faster, then it is not so far..."
QuimV
Enthusiast
Enthusiast
Posts: 337
Joined: Mon May 29, 2006 11:29 am
Location: BARCELONA - SPAIN

Re: PureLVSORT library : sorting ListIconGadgets (and more)

Post by QuimV »

Hi,

SetGadgetItemData and GetGadgetItemData doesn't run properly in the LisIcon when I use it with PureLVSORT library (PureLVSORT_SelectGadgetToSort).

Look at the next piece of code. Comment and uncomment the marked lines and look at the effect.

Code: Select all

  #CONTIS = 1
  #LI0 = 2
  #BTN = 3

  ; This code uses SetGadgetItemData to store the user data
  ; of each item to later know it, even if the items index changed.
  ;
  If OpenWindow(0, 0, 0, 280, 350, "SetGadgetItemData", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)

    ButtonGadget(#BTN, 190, 10, 80, 20, "Test")
    ContainerGadget(#CONTIS, 0, 100, 280, 350, #PB_Container_Raised)
      ;- ListIcon de Usuarios
      ListIconGadget(#LI0, 0, 0, 280, 250, "Name", 150,#PB_ListIcon_CheckBoxes|#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection)
    CloseGadgetList()

    ;****** Comment and Uncomment the next two lines in order to show the effect ****
    If PureLVSORT_SelectGadgetToSort(#LI0, #PureLVSORT_ShowClickedHeader_IconLeft) = #PureLVSORT_Ok
    EndIf  
    ;********************************************************************************

    ;-- Add  row
    AddGadgetItem(#LI0, CountGadgetItems(#LI0),"1")
    SetGadgetItemData(#LI0,CountGadgetItems(#LI0)-1,100)
  
    ;-- Add  row
    AddGadgetItem(#LI0, CountGadgetItems(#LI0),"2")
    SetGadgetItemData(#LI0,CountGadgetItems(#LI0)-1,200)
  
    ;-- Add  row
    AddGadgetItem(#LI0, CountGadgetItems(#LI0),"3")
    SetGadgetItemData(#LI0,CountGadgetItems(#LI0)-1,300)
  
    ;-- Add  row
    AddGadgetItem(#LI0, CountGadgetItems(#LI0),"4")
    SetGadgetItemData(#LI0,CountGadgetItems(#LI0)-1,400)
  
    ;-- Add  row
    AddGadgetItem(#LI0, CountGadgetItems(#LI0),"5")
    SetGadgetItemData(#LI0,CountGadgetItems(#LI0)-1,500)
  
    ;-- Add  row
    AddGadgetItem(#LI0, CountGadgetItems(#LI0),"6")
    SetGadgetItemData(#LI0,CountGadgetItems(#LI0)-1,600)

    Repeat
      Event = WaitWindowEvent()
      If Event = #PB_Event_Gadget
        If EventGadget() = #BTN
          Debug GetGadgetItemData(#LI0, GetGadgetState(#LI0))
        EndIf
      EndIf
    Until Event = #PB_Event_CloseWindow
  EndIf
Regards
QuimV
PBUser
User
User
Posts: 20
Joined: Mon Aug 20, 2007 6:03 pm
Location: Germany

Re: PureLVSORT library : sorting ListIconGadgets (and more)

Post by PBUser »

I have the same problem in my project. I´m currently using PureBasic 4.50 Beta 4
It worked with the old beta-versions (Beta 1 to Beta 3), but not with the latest.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Re: PureLVSORT library : sorting ListIconGadgets (and more)

Post by gnozal »

QuimV wrote:SetGadgetItemData and GetGadgetItemData doesn't run properly in the LisIcon when I use it with PureLVSORT library (PureLVSORT_SelectGadgetToSort).
Yes, and it's documented in the help file.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Re: PureLVSORT library : sorting ListIconGadgets (and more)

Post by gnozal »

I have have just recompiled the library for PB 4.50 beta 4
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
dige
Addict
Addict
Posts: 1391
Joined: Wed Apr 30, 2003 8:15 am
Location: Germany
Contact:

Re: PureLVSORT library : sorting ListIconGadgets (and more)

Post by dige »

Thx gnozal. Unfortunately all my programs crashing now at the end...
Pls PM me, if I can do some tests with the source for you...

EDIT:
After some more tests, I've find out it depends on PureCOLOR.
Could you recompile the lib too? thx!
"Daddy, I'll run faster, then it is not so far..."
Post Reply