Page 6 of 30

Posted: Fri Sep 08, 2006 3:56 pm
by Donald
Hi gnozal,

Sorting error with only one Column.

Code: Select all

#Window_0 = 0
#ListIcon_0 = 0
#ListIcon_1 = 1
Procedure Open_Window_0()
  If OpenWindow(#Window_0, 216, 0, 152, 382, "PureLVSORT Test",#PB_Window_SystemMenu | #PB_Window_TitleBar | #PB_Window_ScreenCentered)
    If CreateGadgetList(WindowID(#Window_0))
      ListIconGadget(#ListIcon_0, 5, 5, 140, 350, "String", 110)
      ;
      ; Sorting Error with only one Column
      ; Is the next Line aktiv Sorting OK
      ;
      ; AddGadgetColumn(#ListIcon_0, 2, "String", 110)
      ;
      AddGadgetItem(#ListIcon_0, -1, "ABCDE")
      AddGadgetItem(#ListIcon_0, -1, "BCDEF")
      AddGadgetItem(#ListIcon_0, -1, "ZABCD")
      AddGadgetItem(#ListIcon_0, -1, "DEFGH")
      AddGadgetItem(#ListIcon_0, -1, "AAAAAABCDE")
      AddGadgetItem(#ListIcon_0, -1, "FCDEF")
      AddGadgetItem(#ListIcon_0, -1, "ZABCD")
      AddGadgetItem(#ListIcon_0, -1, "DEFGH")
      AddGadgetItem(#ListIcon_0, -1, "ABCDE")
      AddGadgetItem(#ListIcon_0, -1, "BBBBBACDEF")
      AddGadgetItem(#ListIcon_0, -1, "AAAAA")
      AddGadgetItem(#ListIcon_0, -1, "KABCD")
      AddGadgetItem(#ListIcon_0, -1, "JABCD")
      AddGadgetItem(#ListIcon_0, -1, "GABCD")
      AddGadgetItem(#ListIcon_0, -1, "KABCD")
      AddGadgetItem(#ListIcon_0, -1, "JABCD")
      AddGadgetItem(#ListIcon_0, -1, "GABCD")
      AddGadgetItem(#ListIcon_0, -1, "KABCD")
      AddGadgetItem(#ListIcon_0, -1, "JABCD")
      AddGadgetItem(#ListIcon_0, -1, "GABCD")
      AddGadgetItem(#ListIcon_0, -1, "DEFGH")
    EndIf
  EndIf
EndProcedure
Open_Window_0()
If PureLVSORT_SelectGadgetToSort(#ListIcon_0, #True) = #PureLVSORT_Ok
  PureLVSORT_SetColumnType(#ListIcon_0, 0, #PureLVSORT_String) ; default, not necessary
  PureLVSORT_SortListIconNow(#ListIcon_0, 0, 1)
EndIf
;
Repeat
  Event = WaitWindowEvent()
  If EventType() = #PB_EventType_LeftDoubleClick 
    PureLVSORT_ClearGadget(#ListIcon_0)
  EndIf
Until Event = #PB_Event_CloseWindow
End

Posted: Fri Sep 08, 2006 4:19 pm
by gnozal
It's a known problem but I don't know why (API limitation maybe)...
If you only want one column, there are two possible workarounds :
1. Create a second column with width = 0 (it will be invisible)

Code: Select all

AddGadgetColumn(#ListIcon_0, 1, "", 0) 
2. Use the (WinAPI) #LVS_SORTASCENDING / #LVS_SORTDESCENDING flags.

Code: Select all

ListIconGadget(#ListIcon_0, 5, 5, 140, 350, "String", 110, #LVS_SORTDESCENDING)
So you don't even need PureLVSORT !

Posted: Fri Sep 08, 2006 5:21 pm
by Donald
Hi Gnozal,

Thanks for the fast Answer.


Can you make a NEW-Funktion in the Lib.
PureLVSORT_ColumnLock()
PureLVSORT_ColumnUnLock()

No chance for the width possible
No Cursor for Width change for the Lock Column
No accept double klick for the Lock Column

I have a Code for this, but it does not works 100%

Posted: Sat Sep 09, 2006 7:29 am
by gnozal
Donald wrote:Can you make a NEW-Funktion in the Lib.
PureLVSORT_ColumnLock()
PureLVSORT_ColumnUnLock()
I have updated the library with 2 new functions. That's all I can do for the moment.

Posted: Sat Sep 09, 2006 10:15 am
by gnozal
Update V4.12 (both libs)

Changes :
- new function PureLVSORT_SetColumnFlag()
- new function PureLVSORT_ResetColumnFlag()
Flags wrote:#PureLVSORT_Column_Fixed : the column width is fixed
#PureLVSORT_Column_Hidden : the column is hidden

Posted: Sun Sep 10, 2006 2:43 am
by Donald
Hi Gnozal,

Thank you. :D

Posted: Mon Oct 16, 2006 12:44 pm
by gnozal
Update PB4.00 version only

Changes :
- fixed a PB4 related issue (lParam messed up because of the new GadgetItemData feature)

Posted: Tue Oct 17, 2006 10:40 am
by mskuma
Hi gnozal - thanks for the update & for collaborating with srod on making your program work with egrid. I'm interested to try the experimental PureLVSORT capability with egrid using unicode (since egrid supports unicode but I think PureLVSort doesn't support unicode yet). Are you planning to update your lib for unicode also? Thanks.

Posted: Tue Oct 17, 2006 11:53 am
by gnozal
mskuma wrote:Hi gnozal - thanks for the update & for collaborating with srod on making your program work with egrid. I'm interested to try the experimental PureLVSORT capability with egrid using unicode (since egrid supports unicode but I think PureLVSort doesn't support unicode yet). Are you planning to update your lib for unicode also? Thanks.
Here is a unicode version you can test : http://people.freenet.de/gnozal/PureLVSORT_U.zip (library only)
It's simply compiled with a custom tailbite version (like I do for threadsafe) ; it's not tested, but since it seems to work for srod's eGrid ...

If the unicode user libs really work that way, I will add an 'automatic use UserLibUnicode subsystem' to jaPBe like I did for the threadsafe libs and the UserLibThreadsafe subsystem.

Posted: Tue Oct 17, 2006 12:05 pm
by mskuma
Thanks alot gnozal! I just quickly tried it standalone & with egrid, and looks like it works well. Excellent stuff!

I see egrid has the \subsystems\UserLibUnicode\ folder to house its lib, so I guess your lib will live there as well?

Thanks for the quick update :D

Posted: Tue Oct 17, 2006 12:11 pm
by srod
gnozal wrote:If the unicode user libs really work that way, I will add an 'automatic use UserLibUnicode subsystem' to jaPBe like I did for the threadsafe libs and the UserLibThreadsafe subsystem.
I for one am using the same subsystems as yourself - as I believe is MrMat and a few others. It might be worth starting a thread in which it is suggested that we all adopt the same subsystems, e.g.
  • UserLibThreadSafe
  • UserLibUnicode
  • UserLibThreadSafeUnicode
I don't know, it could make sharing libs a little easier.

Posted: Tue Oct 17, 2006 12:40 pm
by mskuma
I'm totally naive about these things, but from a noob point of view, the 'downside' to this approach is noobs like me have to remember to specify the subsystem (granted it's done once per source). It's like you have to set 2 settings to get it right, the checkbox 'create unicode executable' & set this subsystem. I can see the need to do the subsystem way, but hopefully in PB's future there might be a better way to do multi-capable libs? Or maybe subsystem is this way - but seems like we're doubling up with the switches/settings in the same dialog..

Posted: Tue Oct 17, 2006 2:14 pm
by ts-soft
gnozal wrote: Here is a unicode version you can test :
thx, works on first test :D

Posted: Tue Oct 17, 2006 4:24 pm
by gnozal
I have upload my custom Tailbite version, best used with jaPBe V3.

It adds two options : /THRD and /UCOD
/THRD : compiles a threadsafe library, best placed in the UserlibThreadSafe subsystem.
/UCOD : compiles a unicode library, best placed in the UserlibUnicode subsystem.
/THRD /UCOD : compiles a unicode+threadsafe library, best placed in the UserlibUnicodeThreadSafe subsystem.

Link : http://people.freenet.de/gnozal/TailBite.zip

Posted: Tue Oct 17, 2006 4:31 pm
by gnozal
Next thing to do :
- update PureLIB library installer to handle unicode / unicode+threadsafe subsystems
- build unicode / unicode+threadsafe versions for my libs