Page 1 of 1

PureLVSORT - Bug filtering an ListIconGadget

Posted: Wed Aug 02, 2006 9:58 pm
by QuimV
Hello,

I'm using the PureLVSORT library in order to filter an ListIconGadget.
If I add a MenuTitle and/or a MenuItem and then enter some text to filter for, I get an "Invalid memory access" message. Is a PureLVSORT library bug or I'm doing something wrong?.

Here it is the test code:

Code: Select all

#Window_0 = 0
#ListIcon_0 = 0
Procedure Open_Window_0()
  If OpenWindow(#Window_0, 216, 0, 602, 302, "PureLVSORT Test",  #PB_Window_SystemMenu | #PB_Window_TitleBar | #PB_Window_ScreenCentered)

    If CreateMenu(0, WindowID(#Window_0)) 
  ;*** Uncomment the line <MenuTitle("Project")>, if we enter some text to filter
  ;    WE GET THE MESSAGE -> [ERROR] Invalid memory access
;      MenuTitle("Project")
    EndIf

    If CreateGadgetList(WindowID(#Window_0))
      ListIconGadget(#ListIcon_0, 5, 5, 590, 285, "String", 110)
      AddGadgetColumn(#ListIcon_0, 1, "Numeric", 110)
      AddGadgetColumn(#ListIcon_0, 2, "Float", 110)
      AddGadgetColumn(#ListIcon_0, 3, "DateDDMMYYYY", 120)
      AddGadgetColumn(#ListIcon_0, 4, "DateMMDDYYYY", 120)
      AddGadgetItem(#ListIcon_0, -1, "ABCDE" + Chr(10) + "514" + Chr(10) + "0.9" + Chr(10) + "31/12/2004" + Chr(10) + "12/31/2004")
      AddGadgetItem(#ListIcon_0, -1, "ACDEF" + Chr(10) + "118" + Chr(10) + "1.9" + Chr(10) + "11/12/2004" + Chr(10) + "12/11/2004")
      AddGadgetItem(#ListIcon_0, -1, "ZABCD" + Chr(10) + "-414" + Chr(10) + "7.0" + Chr(10) + "21/01/2003" + Chr(10) + "01/21/2003")
      AddGadgetItem(#ListIcon_0, -1, "DEFGH" + Chr(10) + "524" + Chr(10) + "900" + Chr(10) + "10/06/2001" + Chr(10) + "06/10/2001")
    EndIf
  EndIf
EndProcedure
Open_Window_0()

; ListIcon Sort Setup
If PureLVSORT_SelectGadgetToSort(#ListIcon_0, #PureLVSORT_ShowClickedHeader_IconLeft) = #PureLVSORT_Ok
  PureLVSORT_SetColumnType(#ListIcon_0, 0, #PureLVSORT_String) ; default, not necessary
  PureLVSORT_SetColumnType(#ListIcon_0, 1, #PureLVSORT_Numeric)
  PureLVSORT_SetColumnType(#ListIcon_0, 2, #PureLVSORT_Float)
  PureLVSORT_SetColumnType(#ListIcon_0, 3, #PureLVSORT_DateDDMMYYYY)
  PureLVSORT_SetColumnType(#ListIcon_0, 4, #PureLVSORT_DateMMDDYYYY)
  PureLVSORT_SetFilter(#ListIcon_0) 
EndIf
;
Repeat
  Event = WaitWindowEvent()
  If EventType() = #PB_EventType_LeftDoubleClick 
    PureLVSORT_ClearGadget(#ListIcon_0)
  EndIf
Until Event = #PB_Event_CloseWindow
End
Could anybody help me?
Thanks in advanced.
QuimV

Posted: Thu Aug 03, 2006 7:57 am
by gnozal
It's a bug.
It should be fixed in version 4.11

Posted: Thu Aug 03, 2006 9:04 am
by QuimV
Thanks gnozal,
Do you know when will be available the version 4.11?
Can I help?
Thanks again!
QuimV

Posted: Thu Aug 03, 2006 9:28 am
by gnozal
QuimV wrote:Thanks gnozal,
Do you know when will be available the version 4.11?
Can I help?
Thanks again!
QuimV
It is available : http://www.purebasic.fr/english/viewtopic.php?t=13224

Posted: Thu Aug 03, 2006 10:25 am
by QuimV
Hello gnozal
With version 4.11, the example runs perfect!
Thanks a lot for your help!
QuimV