Gnozal libraries for PB4.xx

Developed or developing a new product in PureBasic? Tell the world about it.
User avatar
mk-soft
Always Here
Always Here
Posts: 6202
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Gnozal libraries for PB4.xx

Post by mk-soft »

I think, freenet have losed all homepages.

New link for gnozal hompage -> http://gnozal.ucoz.com/
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
QuimV
Enthusiast
Enthusiast
Posts: 337
Joined: Mon May 29, 2006 11:29 am
Location: BARCELONA - SPAIN

Re: Gnozal libraries for PB4.xx

Post by QuimV »

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

Re: Gnozal libraries for PB4.xx

Post by gnozal »

Yes, all files should be available at http://gnozal.ucoz.com/
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
doctorized
Addict
Addict
Posts: 882
Joined: Fri Mar 27, 2009 9:41 am
Location: Athens, Greece

Re: Gnozal libraries for PB4.xx

Post by doctorized »

linkerstorm
User
User
Posts: 47
Joined: Sun Feb 18, 2007 11:57 am

Re: Gnozal libraries for PB4.xx

Post by linkerstorm »

Hi gnozal.

Maybe it's a feature request, you'll see.

I use with pleasure the PureLVSORT library.
But my needs are somewhat complex : I would want to filter a column with several words, spaces (or whatsoever) separated.
To achieve this behavior, I copied your source code example from the help file (PureLVSORT_LoadListIconFromMem() page) and adjusted it to my needs.
Here is it :

Code: Select all

Global *OriginalListBuffer
Procedure MyFilterCallback(GadgetNumber.l, FilterString.s, ListIconColumn.l, EventCode.l) ; simple filter example
    If EventCode = #PureLVSORT_FilterBtnClick
        FilterString = Trim(FilterString)
        If *OriginalListBuffer
            PureLVSORT_LoadListIconFromMem(GadgetNumber, *OriginalListBuffer, "", ListIconColumn, #True)
        EndIf
        If Len(FilterString) = 0
            ProcedureReturn
        EndIf
        *ListBuffer = *OriginalListBuffer
        SpacesCount = CountString(FilterString, " ")
        WordsCount = SpacesCount + 1
        For w = 1 To WordsCount
            Word.s = StringField(FilterString, w, " ")
            If *ListBuffer
                PureLVSORT_LoadListIconFromMem(GadgetNumber, *ListBuffer, Word, ListIconColumn, #True)
                *ListBuffer = PureLVSORT_SaveListIconToMem(GadgetNumber)
            EndIf
        Next
    EndIf
EndProcedure
;
#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) 
        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 RTGFG" + Chr(10) + "514" + Chr(10) + "0.9" + Chr(10) + "31/12/2004" + Chr(10) + "12/31/2004") 
        AddGadgetItem(#ListIcon_0, -1, "ACDEF RTGFG" + Chr(10) + "118" + Chr(10) + "1.9" + Chr(10) + "11/12/2004" + Chr(10) + "12/11/2004") 
        AddGadgetItem(#ListIcon_0, -1, "ZABCD RTGFG" + Chr(10) + "-414" + Chr(10) + "7.0" + Chr(10) + "21/01/2003" + Chr(10) + "01/21/2003") 
        AddGadgetItem(#ListIcon_0, -1, "DEFGH RTGFG" + Chr(10) + "524" + Chr(10) + "900" + Chr(10) + "10/06/2001" + Chr(10) + "06/10/2001") 
        AddGadgetItem(#ListIcon_0, -1, "AFFGH RTGFG" + Chr(10) + "352" + Chr(10) + "911" + Chr(10) + "10/06/2004" + Chr(10) + "06/10/2003") 
        AddGadgetItem(#ListIcon_0, -1, "ZSFZI RTGFG" + Chr(10) + "574" + Chr(10) + "921" + Chr(10) + "10/06/2002" + Chr(10) + "06/10/2004") 
        AddGadgetItem(#ListIcon_0, -1, "ZEKZH RTGFG" + Chr(10) + "521" + Chr(10) + "931" + Chr(10) + "10/06/2011" + Chr(10) + "06/10/2005") 
        AddGadgetItem(#ListIcon_0, -1, "ZFFGH RTGFG" + Chr(10) + "523" + Chr(10) + "913" + Chr(10) + "10/06/2011" + Chr(10) + "06/10/2001") 
        AddGadgetItem(#ListIcon_0, -1, "AZFHI RTGFG" + Chr(10) + "522" + Chr(10) + "923" + Chr(10) + "10/06/2006" + Chr(10) + "06/10/2001") 
        AddGadgetItem(#ListIcon_0, -1, "AEZGH RTGFG" + Chr(10) + "529" + Chr(10) + "933" + Chr(10) + "10/06/2000" + Chr(10) + "06/11/2001") 
        AddGadgetItem(#ListIcon_0, -1, "DZFKH RTGFG" + Chr(10) + "624" + Chr(10) + "900" + Chr(10) + "10/07/2001" + Chr(10) + "06/11/2001") 
        AddGadgetItem(#ListIcon_0, -1, "DEFGI RTGFG" + Chr(10) + "625" + Chr(10) + "900" + Chr(10) + "10/08/2001" + Chr(10) + "06/11/2001") 
        AddGadgetItem(#ListIcon_0, -1, "DSFKH RTGFG" + Chr(10) + "623" + Chr(10) + "900" + Chr(10) + "10/09/2001" + Chr(10) + "06/11/2001") 
    EndIf 
EndProcedure 
;
Open_Window_0() 
;
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_SortListIconNow(#ListIcon_0, 3, 1)
    *OriginalListBuffer = PureLVSORT_SaveListIconToMem(#ListIcon_0)
    PureLVSORT_DefineFilterCallback(@MyFilterCallback())
    PureLVSORT_SetFilterTimeOut(100)
    PureLVSORT_SetFilter(#ListIcon_0)
EndIf 
; 
Repeat 
    Event = WaitWindowEvent() 
Until Event = #PB_Event_CloseWindow 
If *ListBuffer
    FreeMemory(*ListBuffer)
EndIf
End

The principle is simple : I slice the phrase into words and for each word, I filter the current content of the list.
In this adapted example, if you type "a r", it should return some rows (exactly 6).
Except that it returns nothing.
Furthermore, if I blank the filter in the filter field, the list stays empty.
This last behavior exists also in your original example : this is because the FilterString parameter contains some weird chars, I don't know why.

An aside on your help file : in the PureLVSORT_DefineFilterCallback() page, you talk about "#HDN_FILTERCHANGE or #HDN_FILTERBTNCLICK events." and in your original above example, the code refers to "#PureLVSORT_FilterChange"; in my adapted example, the code refers to "#PureLVSORT_FilterBtnClick".
Is it a mistake ?

Thank you for your attention.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Re: Gnozal libraries for PB4.xx

Post by gnozal »

linkerstorm wrote:...if I blank the filter in the filter field, the list stays empty.
This last behavior exists also in your original example : this is because the FilterString parameter contains some weird chars, I don't know why.
There is an issue with Windows Se7en, posted by QuimV, which tested a lot of code on his Win7 machine (thread : http://www.purebasic.fr/english/viewtop ... &start=277).
We found out that it's an issue with the API function SendMessage_(hHeader, #HDM_GETITEM, *pNMHdr\iItem, @hHDItem)
In Windows XP :
When len(filtertext)>0 the function returns 1
When len(filtertext)=0 the function returns 0
In Windows W7 :
When len(filtertext)>0 the function returns 1
When len(filtertext)=0 the function returns 1, and there is garbage in the filter string...

According to MSDN, HDM_GETITEM returns 0 if failed...
linkerstorm wrote:An aside on your help file : in the PureLVSORT_DefineFilterCallback() page, you talk about "#HDN_FILTERCHANGE or #HDN_FILTERBTNCLICK events." and in your original above example, the code refers to "#PureLVSORT_FilterChange"; in my adapted example, the code refers to "#PureLVSORT_FilterBtnClick".
These constants have the same values. I forgot to update the help file.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
linkerstorm
User
User
Posts: 47
Joined: Sun Feb 18, 2007 11:57 am

Re: Gnozal libraries for PB4.xx

Post by linkerstorm »

Ok for the 7 issue.
Tested on WinXP SP3 and it works fine, for the filter blank string.

But the other problem is still active.

I would want to filter the list with several words and the technique used (see code in my previous post) does'nt work for which I have no explanation.

Any idea ?
linkerstorm
User
User
Posts: 47
Joined: Sun Feb 18, 2007 11:57 am

Re: Gnozal libraries for PB4.xx

Post by linkerstorm »

Up
linkerstorm
User
User
Posts: 47
Joined: Sun Feb 18, 2007 11:57 am

Re: Gnozal libraries for PB4.xx

Post by linkerstorm »

Up again.

For the Windows 7 issue, if you disable the Support XP Theme in your project properties, the bug disappears.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Re: Gnozal libraries for PB4.xx

Post by gnozal »

linkerstorm wrote:Up again.
I do not fully understand your code, but I don't think it's possible / convenient to call PureLVSORT_LoadListIconFromMem() repeatedly to achieve want you want.
I would load the full listicon content and then parse each line, deleting a line it if it does not match the keywords. You can use #WM_SETREDRAW On/Off to avoid flickering.
linkerstorm wrote:For the Windows 7 issue, if you disable the Support XP Theme in your project properties, the bug disappears.
So it seems to be a common controls issue.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
linkerstorm
User
User
Posts: 47
Joined: Sun Feb 18, 2007 11:57 am

Re: Gnozal libraries for PB4.xx

Post by linkerstorm »

Thanks for your answer
jassing
Addict
Addict
Posts: 1885
Joined: Wed Feb 17, 2010 12:00 am

PurePROCS vs. linker

Post by jassing »

When I include PureProcs_Execute() in my app, and then compile it, I"m getting:
Image

is there any way to figure out what that means?
Or is this akin to the "string error" message when a library is out of date?

-- end --
never mind -- it turns out that it really meant "Access denied" (the target exe was running)
Post Reply