English
Source / code snippets

Babyklappe entry

GridBOX too to date sort

 

H.Brill
ACHTUNG : AB XPROFAN X3 : WEGEN SORTLIST
/* HAUPTPROGRAMM */
Declare lever gb, btn1, btn2, btn3, btn4, btn5, btn6, Long end
Window 600, 400
btn1 = Create("Button", %HWnd, "ASC",  10, 10, 60, 25)
btn2 = Create("Button", %HWnd, "DESC", 10, 40, 60, 25)
btn3 = Create("Button", %HWnd, "ASC",  100, 10, 60, 25)
btn4 = Create("Button", %HWnd, "DESC", 100, 40, 60, 25)
btn5 = Create("Button", %HWnd, "ASC",  190, 10, 60, 25)
btn6 = Create("Button", %HWnd, "DESC", 190, 40, 60, 25)
gb   = Create("Gridbox",%HWnd, "DATUM;0;80;MENGE;0;80;ARTIKEL;0;120", 0, 10, 70, 300, 150)
AddStrings(gb, "20.10.2015|500|Tomaten")
AddStrings(gb, "15.12.2017|200|Birnen")
AddStrings(gb, "22.11.2015|100|Ananas")
AddStrings(gb, "10.04.2016|50|Äpfel")
AddStrings(gb, "11.10.2017|1000|Zitronen")
AddStrings(gb, "01.04.2017|1500|Kirschen")
' SetHeader_SetArrow(gb, 0, 0)
end = 0

WhileNot end

    WaitInput

    If Clicked(btn1)

        SortListview(gb, 0, 2, 0)

    ElseIf Clicked(btn2)

        SortListview(gb, 0, 2, 1)

    ElseIf Clicked(btn3)

        SortListview(gb, 1, 3, 0)

    ElseIf Clicked(btn4)

        SortListview(gb, 1, 3, 1)

    Elseif Clicked(btn5)

        SortListview(gb, 2, 1, 0)

    ElseIf Clicked(btn6)

        SortListview(gb, 2, 1, 1)

    EndIf

    Case %Key = 2 : end = 1

EndWhile

END

PROC SortListview

    ' ACHTUNG   : uses The interne Listboxliste (Own data before with Move o.ä. secure)
    ' lv        : lever the GridBOX
    ' slot    : Nullbasierend (1. slot = 0)
    ' SortType  : Spalteninhalt (1 = STRINGS, 2 = DATUM (tt.mm.jjjj), 3 = ZAHLEN)
    ' order     : 0 = ascending, 1 = absteigend
    Parameters lever lv, Long slot, SortType, order
    DECLARE lever list, LONG sOrder, sTyp, STRING item, row, Float date
    list = Create("List", 0)

    SELECT SortType

        CASEOF 1

        sTyp = 4' properly Gebietsschema

        CASEOF 2

        sTyp = 5

        CASEOF 3

        sTyp = 5

    ENDSELECT

    Select order

        CaseOf 0

        sOrder = 1

        CASEOF 1

        sOrder = -1

    ENDSELECT

    IF SortType = 2' DATUM - SORTIERUNG

        CLEARLIST 0
        MOVE("HandleToList", lv)

        WHILELOOP 0, GETCOUNT(0) -1

            item = SubStr$(GetSTRING$(0, &LOOP), slot + 1, "|")
            date = Str $(DT("SetDate", item))
            row = Translate$(GetString$(0, &LOOP), item, Str $(date))
            AddStrings(list, row)

        ENDWHILE

        CLEARLIST 0
        MOVE("HandleToList", list)
        SortList "|", slot + 1, (sTyp * sOrder)
        CLEARLIST list
        MOVE("ListToHandle", list)
        CLEARLIST 0

        WHILELOOP 0, GETCOUNT(list) - 1

            item = SubStr$(GetString$(list, &LOOP), slot + 1, "|")
            row = Translate$(GetString$(list, &LOOP), item, DT("GetDate", 0, VAL(item)))
            AddStrings(0, row)

        ENDWHILE

    ELSE

        CLEARLIST 0
        MOVE("HandleToList", lv)
        SortList "|", slot + 1, (sTyp * sOrder)

    ENDIF

    CLEARLIST lv
    MOVE("ListToHandle", lv)
    CLEARLIST 0

ENDPROC

 
Benutze XPROFAN X3 + FREEPROFAN
Wir sind die XProfaner.
Sie werden von uns assimiliert.
Widerstand ist zwecklos!
Wir werden alle ihre Funktionen und Algorithmen den unseren hinzufügen.

Was die Borg können, können wir schon lange.
10/15/17  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

2.985 Views

Untitledvor 0 min.
Gast.081509/23/24
Member 862464105/12/24
H.Brill06/14/23
Walter11/28/22
More...

Themeninformationen

this Topic has 1 subscriber:

H.Brill (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie