Español
Fuente/ Codesnippets

GridBox con (Sub)Item-Editar

 

Matthias
Arlt

'Lo no es el standardmäßige Inplace-Editor el Listview genutzt.
'Dieser sería sólo para el erste Spalte disponible posición...
'Original-Source Thomas Freier - modifiziert Matthias Arlt
Ventana 0,0 - 600,410
declarar LV&,Spalte&,Zeile&,Item&,Edit&,Font&,Txt$
declarar rect#,cellpos_x%,cellpos_y%,cellwidth%,cellheight%
Font&=CreateFont("Verdana",16,0,0,0,0)
SetDialogFont Font&
LV&=Crear("GridBox",%hwnd,"Spalte 1;1;60;Spalte 2;1;120;Spalte 3;1;80;Spalte 4;1;80;Spalte 5;1;80",0,10,10,460,250)
SetFont LV&,Font&

whileloop 0,20

    Addstring(LV&,str$(&bucle) + "|0|0|0|0")

wend

Edit& = create("Edit",LV&,"",0,0,0,0)
setfont Edit&,Font&

proc SetSubItemEdit

    dim rect#,16
    SendMessage(LV&,$100E,Zeile&,rect#)'LVM_GETITEMRECT
    cellpos_x% = long(rect#,0)
    cellpos_y% = long(rect#,4) - 1
    cellwidth% = sendmessage(LV&,$101D,Spalte&,0)
    cellheight% = (long(rect#,12) - long(rect#,4)) + 1

    if Spalte& > 0

        whileloop 0,(Spalte& - 1),1

            cellpos_x% = cellpos_x% + sendmessage(LV&,$101D,&bucle,0)

        wend

    endif

    disponer rect#
    settext Edit&, Txt$
    setwindowpos Edit& = cellpos_x%,cellpos_y% - cellwidth%,cellheight%
    setfocus(Edit&)
    'SendMessage(Edit&,"+({FIN})") 'Cursor en Ende conjunto...
    SendMessage(Edit&,$B1,0,-1)'oder Alles marca... (Explorer-konform)

ENDPROC

AddHotKey 13, 13, 0
AddHotKey 37, 37, 0
AddHotKey 38, 38, 0
AddHotKey 39, 39, 0
AddHotKey 40, 40, 0
SubClass %hwnd, 1
usermessages 2000

SubClassProc

    if SubClassMessage(%hwnd, 78)'WM_NOTIFY

        if (Largo(&sLParam,8) = -3)

            Item&=Largo(&sLParam,12)

            if (Item& <> -1)

                SendMessage(%hwnd,2000,Item&,Largo(&sLParam,16))

            endif

        elseif (Largo(&sLParam,8) = -180)'LVN_BEGINSCROLL

            settext LV&,Zeile&,Spalte&,gettext$(Edit&)
            setwindowpos Edit& = 0,0-0,0

        endif

    endif

ENDPROC

mientras que 1

    waitinput

    if (%umessage = 2000)

        Txt$ = GetText $(LV&,&uwparam,&ulparam)
        Spalte&= &ulparam
        Zeile&= &uwparam
        SetSubItemEdit

        mientras que getfocus(Edit&)

            waitinput

            if (%menuitem = 13)

                romper

            elseif (%menuitem = 37) | (%menuitem = 38) | (%menuitem = 39) | (%menuitem = 40)

                settext LV&,Zeile&,Spalte&,gettext$(Edit&)
                caso (%menuitem = 37) : Spalte& = (Spalte& - 1)
                caso (%menuitem = 38) : Zeile& = (Zeile& - 1)
                caso (%menuitem = 39) : Spalte& = (Spalte& + 1)
                caso (%menuitem = 40) : Zeile& = (Zeile& + 1)
                Txt$ = GetText $(LV&,Zeile&,Spalte&)
                SetSubItemEdit

            endif

        wend

        settext LV&,Zeile&,Spalte&,gettext$(Edit&)
        setwindowpos Edit& = 0,0-0,0
        setfocus(%hwnd)

    endif

wend

usermessages 0
SubClass %hwnd, 0
end
 
WinXP SP2, Win7 - XProfan 10/11/FreeProfan32 - Xpia
02.11.2016  
 




Ernst
Einen Haken ha el Geschichte, si la Scrollbalken en el Spiel kommt - Edit-Feld o. el Cursor lässt se no mitscrollen.

z.B.: una Subitem en el dritten Línea se doppelgeklickt -> Editar erscheint; beim hinaufscrollen una Línea sieht al Erscheinungsbild des Edits en el zweiten y el Cursor darunter en el dritten Línea. En Eingabe se en el dritten Línea bajo el Editar geschrieben (scheinbar) - beim Clic en una más Subitem se el Texto en el eigentlich richtige Subitem (zweite Línea) übernommen.
 
11.01.2017  
 




Matthias
Arlt
Eigentlich se Edit standardmäßig sí garnicht mitscrollen (en el Explorer tut lo el en efecto no...). Yo habs otra vez überarbeitet. Damit debería nun el gewohnte Comportamiento producido ser.

Und el Vollständigkeit halber el Ganze todavía algo optimiert y igual todavía con Weiterschaltung mittels Pfeiltasten...

Yo habe el veces en el Code-Box en el Eingangsbeitrag movido. Schließlich macht lo no Sinn, hay el todavía no fehlerbereinigten Source posición que se. Es sólo a Lasten el Übersichtlichkeit. Siehe also más oben...

Saludo Matthias
 
WinXP SP2, Win7 - XProfan 10/11/FreeProfan32 - Xpia
11.01.2017  
 



Zum Quelltext


Título del Tema, max. 100 Signo.
 

Systemprofile:

Kein Systemprofil creado. [anlegen]

XProfan:

 Contribución  Font  Smilies  ▼ 

Bitte registro en una Contribución a verfassen.
 

Tema opciones

6.061 Views

Untitledvor 0 min.
Gast.0815 vor 27 Tagen
Member 862464112.05.2024
Walter28.11.2022
RudiB.20.08.2022
Más...

Themeninformationen

Dieses Thema ha 2 subscriber:

Matthias Arlt (2x)
Ernst (1x)


Admins  |  AGB  |  Applications  |  Autores  |  Chat  |  Política de Privacidad  |  Descargar  |  Entrance  |  Ayuda  |  Merchantportal  |  Pie de imprenta  |  Mart  |  Interfaces  |  SDK  |  Services  |  Juegos  |  Búsqueda  |  Support

Ein Projekt aller XProfan, el lo son!


Mi XProfan
Privado Noticias
Eigenes Ablageforum
Temas-Merkliste
Eigene Beiträge
Eigene Temas
Zwischenablage
Cancelar
 Deutsch English Français Español Italia
Traducciones

Política de Privacidad


Wir uso Cookies sólo como Session-Cookies wegen el technischen Notwendigkeit y en uns hay no Cookies de Drittanbietern.

Wenn du hier en unsere Webseite klickst oder navigierst, stimmst du unserer Erfassung de Informationen en unseren Cookies en XProfan.Net a.

Weitere Informationen a unseren Cookies y dazu, como du el Kontrolle darüber behältst, findest du en unserer nachfolgenden Datenschutzerklärung.


einverstandenDatenschutzerklärung
Yo möchte no Cookie