Foro | | | | - Página 1 - |
| Thomas Freier | Angelehnt a Andreas Ejemplo para una Listbox Yo quería de optischen Gründen auch una Merker haben. Leider kann Yo ihn no dazu bewegen, dass él se bewegt. Como gehts ?
$H Windows.ph
$H Messages.ph
$H ListView.ph
$H commctrl.ph
DEF $DRAGLISTMSGSTRING "commctrl_DragListMsg"
DEF &DL_BEGINDRAG 1157
DEF &DL_DRAGGING 1158
DEF &DL_DROPPED 1159
DEF &DL_MOVECURSOR 3
DEF &DL_COPYCURSOR 2
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Struct LVHitTestInfo = X&,Y&,flags&,Item&,SubItem&
Declarar LVHTI#,l%,L.SubItem$
Dim LVHTI#,LVHitTestInfo
Proc LV_HitTest
Parámetros LV&,X%,Y%
~GetCursorPos(LVHTI#)
~ScreenToClient(LV&,LVHTI#)
SendMessage(LV&,~LVM_SUBITEMHITTEST,0,LVHTI#)
Volver LVHTI#.SubItem&
ENDPROC
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
proc LvDeSelect'deselectieren
parámetros Lv&,Item&
Declarar s#
dim s#,1024
long s#,12=0
long s#,16=~LVIS_SELECTED | ~LVIS_FOCUSED
sendmessage(Lv&,~LVM_SETITEMSTATE,Item&,s#)
disponer s#
ENDPROC
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
proc LvSelect'selectieren
parámetros Lv&,Item&
Declarar s#
dim s#,1024
long s#,12=$2
long s#,16=~LVIS_SELECTED | ~LVIS_FOCUSED
sendmessage(Lv&,~LVM_SETITEMSTATE,Item&,s#)
sendmessage(lv&,~LVM_SETHOTITEM ,item&,0)
sendmessage(lv&,~LVM_ENSUREVISIBLE ,Item&,0)
disponer s#
ENDPROC
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Struct POINT = X&,Y&
Struct DRAGLISTINFO = uNotification&,hWnd&,ptCursor!POINT
Var FirstItem& = 0
Var LastItem& = 0
Var MoveString$ = ""
Var MoveCursor& = ~LoadCursor(~GetModuleHandle("shell32.dll"),1003)
'Exactamente esta spezielle Meldung muss registiert voluntad
'así el Ventana el Drag&Drop Operationen verarbeiten kann.
Var DragMSG& = ~RegisterWindowMessage($DRAGLISTMSGSTRING)
CLS
SetDialogFont ~GetStockObject(~ANSI_VAR_FONT)
Var Ende& = 0
Var dlg& = @Crear("ChildWindow", %hwnd, "Liste", 80, 60,300,300)
var Texto$ = "Name;0;140"
var draglist& = Crear("GridBox", dlg&, texto$, 0, 80, 14, 100, 220)
'El Listbox para Drag&Drop vobereiten
Externo("comctl32.dll","MakeDragList",Draglist&)
Addstring(Draglist&,"Eintrag")
Addstring(Draglist&,"Auftrag")
Addstring(Draglist&,"Anton")
Addstring(Draglist&,"Otto")
Addstring(Draglist&,"Werner")
Addstring(Draglist&,"Karl")
SubClass dlg&,1
Sinestar encargado Ende&
Waitinput
EndWhile
SubClass dlg&,0
end
SubClassProc
If SubClassMessage(dlg&,DragMSG&)
Var Info# = New(DRAGLISTINFO)
locate 0,0
l% = LV_HitTest(Draglist&,%mousex,%mousey)
L.SubItem$=GetText $(Draglist&,LVHTI#.Item&,LVHTI#.SubItem&)
Info# = &slParam
If Info#.uNotification& = &DL_BEGINDRAG'Drag&Drop beginnt y Item merken
FirstItem& = LVHTI#.Item&
imprimir FirstItem&, " después de "
'Marker dibujar, muss no ser, aumenta aber el Sichtbarkeit
Externo("comctl32.dll","DrawInsert",dlg&,Draglist&,Firstitem&)
MoveString$ = GetText $(Draglist&,LVHTI#.Item&,LVHTI#.SubItem&)'Item-Texto merken
Conjunto("WinProc", 0)
~SetCursor(MoveCursor&)
Volver &DL_COPYCURSOR
ElseIf Info#.uNotification& = &DL_DRAGGING'Drag&Drop es en el Gange
LastItem& = LVHTI#.Item&
locate 0,10
Imprimir LastItem&
LvSelect Draglist&,LastItem&
'Marker neuzeichnen
Externo("comctl32.dll","DrawInsert",dlg&,Draglist&,LastItem&)
Conjunto("WinProc", 0)
'Item marca
SendMessage(DragList&,~Lb_SETCURSEL,LastItem&,0)
~SetCursor(MoveCursor&)
ElseIf Info#.uNotification& = &DL_DROPPED'Drag&Drop es final
LastItem& = LVHTI#.Item&
If Lastitem& <> -1
'Marker entfernen
Externo("comctl32.dll","DrawInsert",dlg&,Draglist&,-1)
'el erste gemerkte Item löschen
DeleteString(DragList&,FirstItem&)
'y a el Position des letzten gemerkten Items einfügen
InsertString(DragList&,LastItem&,MoveString$)
Conjunto("WinProc", 0)
LvSelect Draglist&,LastItem&
EndIf
EndIf
EndIf
ENDPROC
|
| | | | |
| | « Dieser Contribución wurde como Solución gekennzeichnet. » | | Andreas Miethe
| Thomas Freier (11/21/10)
Angelehnt a Andreas Ejemplo para una Listbox Yo quería de optischen Gründen auch una Merker haben. Leider kann Yo ihn no dazu bewegen, dass él se bewegt. Como gehts ?
Hola Tomás,
para Listviews es el auch no pensamiento. Dafür nimmt uno Insert-Marks
$H Windows.ph
$H Messages.ph
'$H ListView.ph
$H commctrl.ph
DEF &LVM_SETINSERTMARK 4262
Struct LVINSERTMARK = cbSize&,dwFlags&,iItem&,dwReserved&
DEF $DRAGLISTMSGSTRING "commctrl_DragListMsg"
DEF &DL_BEGINDRAG 1157
DEF &DL_DRAGGING 1158
DEF &DL_DROPPED 1159
DEF &DL_MOVECURSOR 3
DEF &DL_COPYCURSOR 2
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Struct LVHitTestInfo = X&,Y&,flags&,Item&,SubItem&
Declarar LVHTI#,l%,L.SubItem$
Dim LVHTI#,LVHitTestInfo
Proc LV_HitTest
Parámetros LV&,X%,Y%
~GetCursorPos(LVHTI#)
~ScreenToClient(LV&,LVHTI#)
SendMessage(LV&,~LVM_SUBITEMHITTEST,0,LVHTI#)
Volver LVHTI#.SubItem&
ENDPROC
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Proc LvDeSelect'deselectieren
Parámetros Lv&,Item&
Declarar s#
Dim s#,1024
LONG s#,12=0
LONG s#,16=~LVIS_SELECTED | ~LVIS_FOCUSED
sendmessage(Lv&,~LVM_SETITEMSTATE,Item&,s#)
disponer s#
ENDPROC
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Proc LvSelect'selectieren
Parámetros Lv&,Item&
Declarar s#
Dim s#,1024
LONG s#,12=$2
LONG s#,16=~LVIS_SELECTED | ~LVIS_FOCUSED
sendmessage(Lv&,~LVM_SETITEMSTATE,Item&,s#)
sendmessage(lv&,~LVM_SETHOTITEM ,item&,0)
sendmessage(lv&,~LVM_ENSUREVISIBLE ,Item&,0)
disponer s#
ENDPROC
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Struct POINT = X&,Y&
Struct DRAGLISTINFO = uNotification&,hWnd&,ptCursor!POINT
Var FirstItem& = 0
Var LastItem& = 0
Var MoveString$ = ""
Var MoveCursor& = ~LoadCursor(~GetModuleHandle("shell32.dll"),1003)
'Exactamente esta spezielle Meldung muss registiert voluntad
'así el Ventana el Drag&Drop Operationen verarbeiten kann.
Var DragMSG& = ~RegisterWindowMessage($DRAGLISTMSGSTRING)
CLS
SetDialogFont ~GetStockObject(~ANSI_VAR_FONT)
Var Ende& = 0
Var dlg& = @Crear("ChildWindow", %hwnd, "Liste", 80, 60,300,300)
Var Texto$ = "Name;0;140"
Var draglist& = Crear("GridBox", dlg&, texto$, 0, 80, 14, 100, 220)
'El Listbox para Drag&Drop vobereiten
Externo("comctl32.dll","MakeDragList",Draglist&)
Addstring(Draglist&,"Eintrag")
Addstring(Draglist&,"Auftrag")
Addstring(Draglist&,"Anton")
Addstring(Draglist&,"Otto")
Addstring(Draglist&,"Werner")
Addstring(Draglist&,"Karl")
SubClass dlg&,1
Sinestar encargado Ende&
Waitinput
EndWhile
SubClass dlg&,0
End
SubClassProc
If SubClassMessage(dlg&,DragMSG&)
Var structInsertMark# = New(LVINSERTMARK)
structInsertMark#.cbSize& = 16
structInsertMark#.dwFlags& = 1'LVIM_AFTER
structInsertMark#.dwReserved& = 0
Var Info# = New(DRAGLISTINFO)
locate 0,0
l% = LV_HitTest(Draglist&,%mousex,%mousey)
L.SubItem$=GetText $(Draglist&,LVHTI#.Item&,LVHTI#.SubItem&)
Info# = &slParam
If Info#.uNotification& = &DL_BEGINDRAG'Drag&Drop beginnt y Item merken
FirstItem& = LVHTI#.Item&
imprimir FirstItem&, " después de "
'Marker dibujar, muss no ser, aumenta aber el Sichtbarkeit
structInsertMark#.iItem& = -1
SendMessage(Draglist&, &LVM_SETINSERTMARK, 0,structInsertMark#)
MoveString$ = GetText $(Draglist&,LVHTI#.Item&,LVHTI#.SubItem&)'Item-Texto merken
Conjunto("WinProc", 0)
~SetCursor(MoveCursor&)
Volver &DL_COPYCURSOR
ElseIf Info#.uNotification& = &DL_DRAGGING'Drag&Drop es en el Gange
LastItem& = LVHTI#.Item&
locate 0,10
Imprimir LastItem&
LvSelect Draglist&,LastItem&
'Marker neuzeichnen
structInsertMark#.iItem& = LastItem&
SendMessage(Draglist&, &LVM_SETINSERTMARK, 0,structInsertMark#)
Conjunto("WinProc", 0)
'Item marca
SendMessage(DragList&,~Lb_SETCURSEL,LastItem&,0)
~SetCursor(MoveCursor&)
ElseIf Info#.uNotification& = &DL_DROPPED'Drag&Drop es final
LastItem& = LVHTI#.Item&
If Lastitem& <> -1
'el erste gemerkte Item löschen
DeleteString(DragList&,FirstItem&)
'y a el Position des letzten gemerkten Items einfügen
InsertString(DragList&,LastItem&,MoveString$)
Conjunto("WinProc", 0)
LvSelect Draglist&,LastItem&
EndIf
EndIf
EndIf
ENDPROC
|
| | | Gruss Andreas ________ ________ ________ ________ _ Profan 3.3 - XProfanX2 Win 95,98,ME,2000,XP,Vista - Win 7 32 / 64 Bit ASUS X93S - Intel Core I7-NVIDIA GForce 540M 8GB Arbeitsspeicher Homepage : [...] | 21.11.2010 ▲ |
| | |
| | Thomas Freier | ¡Hola Andreas. Gracias para rápido Reacción. Leider bekomme Yo no Merker a sehen ??? |
| | | | |
| | Andreas Miethe
| Hola Tomás,
laut MS funktioniert el sólo en el Iconview,SmallIconview y Tileview, also no como Liste. Das gilt scheinbar no mehr de Vista, como funktioniert lo auch con Liste, por lo tanto Yo no más probiert. Mit XP funktioniert lo probablemente no
Yo habe hier Vista en el Laptop y lo va bestens, uno kann incluso el Farbe el Insertmark festlegen. |
| | | Gruss Andreas ________ ________ ________ ________ _ Profan 3.3 - XProfanX2 Win 95,98,ME,2000,XP,Vista - Win 7 32 / 64 Bit ASUS X93S - Intel Core I7-NVIDIA GForce 540M 8GB Arbeitsspeicher Homepage : [...] | 21.11.2010 ▲ |
| |
| | | En me bajo XP sehe Yo beim Code por Thomas (aber auch sólo si yo por Interpreter ablaufen lasse) immerhin solch Pfeil während Yo dragge:
el aber a dieser Position klebt o. se no bewegt. |
| | | | |
| | Dieter Zornow | Mit Win 7 sehe Yo auch no Pfeil |
| | | Er ist ein Mann wie ein Baum. Sie nennen ihn Bonsai., Win 7 32 bit und Win 7 64 bit, mit XProfan X2 | 21.11.2010 ▲ |
| |
| | Thomas Freier | Yo voluntad en el Merker verzichten y veces después de uno Möglichkeit suchen, dass si D&D eingeleitet se el a verschiebende Línea andersfarbig darzustellen y después de Ende de D&D otra vez aufheben. Ist en me como stochern en el Nebel, como bisher sólo el Listview.dll gearbeitet. |
| | | | |
| | | | | | | |
| | Thomas Freier | Hatte Yo auch ya angesehen, si auch todavía no abgearbeitet. Werde, por qué no es igual, ToolTip einsetzen, hilft en efecto, si vergessen, welcher Texto movido voluntad debería.
$H Windows.ph
$H Messages.ph
$H ListView.ph
$H commctrl.ph
DEF $DRAGLISTMSGSTRING "commctrl_DragListMsg"
DEF &DL_BEGINDRAG 1157
DEF &DL_DRAGGING 1158
DEF &DL_DROPPED 1159
DEF &DL_MOVECURSOR 3
DEF &DL_COPYCURSOR 2
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Struct LVHitTestInfo = X&,Y&,flags&,Item&,SubItem&
Declarar LVHTI#,l%,L.SubItem$,T_Tip&
Dim LVHTI#,LVHitTestInfo
Proc LV_HitTest
Parámetros LV&,X%,Y%
~GetCursorPos(LVHTI#)
~ScreenToClient(LV&,LVHTI#)
SendMessage(LV&,~LVM_SUBITEMHITTEST,0,LVHTI#)
Volver LVHTI#.SubItem&
ENDPROC
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
proc LvDeSelect'deselectieren
parámetros Lv&,Item&
Declarar s#
dim s#,1024
long s#,12=0
long s#,16=~LVIS_SELECTED | ~LVIS_FOCUSED
sendmessage(Lv&,~LVM_SETITEMSTATE,Item&,s#)
disponer s#
ENDPROC
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
proc LvSelect'selectieren
parámetros Lv&,Item&
Declarar s#
dim s#,1024
long s#,12=$2
long s#,16=~LVIS_SELECTED | ~LVIS_FOCUSED
sendmessage(Lv&,~LVM_SETITEMSTATE,Item&,s#)
sendmessage(lv&,~LVM_SETHOTITEM ,item&,0)
sendmessage(lv&,~LVM_ENSUREVISIBLE ,Item&,0)
disponer s#
ENDPROC
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Struct POINT = X&,Y&
Struct DRAGLISTINFO = uNotification&,hWnd&,ptCursor!POINT
Var FirstItem& = 0
Var LastItem& = 0
Var MoveString$ = ""
Var MoveCursor& = ~LoadCursor(~GetModuleHandle("shell32.dll"),1003)
'Exactamente esta spezielle Meldung muss registiert voluntad
'así el Ventana el Drag&Drop Operationen verarbeiten kann.
Var DragMSG& = ~RegisterWindowMessage($DRAGLISTMSGSTRING)
CLS
SetDialogFont ~GetStockObject(~ANSI_VAR_FONT)
Var Ende& = 0
Var dlg& = @Crear("ChildWindow", %hwnd, "Liste", 80, 60,300,300)
var Texto$ = "Name;0;140"
var draglist& = Crear("GridBox", dlg&, texto$, 0, 80, 14, 100, 220)
'El Listbox para Drag&Drop vobereiten
Externo("comctl32.dll","MakeDragList",Draglist&)
Addstring(Draglist&,"Eintrag")
Addstring(Draglist&,"Auftrag")
Addstring(Draglist&,"Anton")
Addstring(Draglist&,"Otto")
Addstring(Draglist&,"Werner")
Addstring(Draglist&,"Karl")
SubClass dlg&,1
Sinestar encargado Ende&
Waitinput
EndWhile
SubClass dlg&,0
end
SubClassProc
If SubClassMessage(dlg&,DragMSG&)
Var Info# = New(DRAGLISTINFO)
locate 0,0
l% = LV_HitTest(Draglist&,%mousex,%mousey)
L.SubItem$=GetText $(Draglist&,LVHTI#.Item&,LVHTI#.SubItem&)
Info# = &slParam
If Info#.uNotification& = &DL_BEGINDRAG'Drag&Drop beginnt y Item merken
FirstItem& = LVHTI#.Item&
imprimir FirstItem&, " después de "
MoveString$ = GetText $(Draglist&,LVHTI#.Item&,LVHTI#.SubItem&)'Item-Texto merken
T_Tip&=Crear("Tooltip",%hwnd,Draglist&,MoveString$)
Conjunto("WinProc", 0)
~SetCursor(MoveCursor&)
Volver &DL_COPYCURSOR
ElseIf Info#.uNotification& = &DL_DRAGGING'Drag&Drop es en el Gange
LastItem& = LVHTI#.Item&
locate 0,10
Imprimir LastItem&
LvSelect Draglist&,LastItem&
Conjunto("WinProc", 0)
'Item marca
SendMessage(DragList&,~Lb_SETCURSEL,LastItem&,0)
~SetCursor(MoveCursor&)
ElseIf Info#.uNotification& = &DL_DROPPED'Drag&Drop es final
LastItem& = LVHTI#.Item&
If Lastitem& <> -1
'el erste gemerkte Item löschen
DeleteString(DragList&,FirstItem&)
'y a el Position des letzten gemerkten Items einfügen
InsertString(DragList&,LastItem&,MoveString$)
Conjunto("WinProc", 0)
LvSelect Draglist&,LastItem&
DestroyWindow(T_Tip&)
EndIf
EndIf
EndIf
ENDPROC
|
| | | | |
| | | Yo weiß no mehr en welchem Programa Yo veces ListBox-Einträge mausverschiebbar gemacht habe aber dadurch el Yo, el Eintrag inmediatamente después de Erreichen el neuen Línea se han trasladado fue un weitere Kennzeichnung irgendwie garnicht notwendig.
Könnte uno zusätzlich en efecto todavía una > a el Zeilenanfang el a verschiebenden Línea conjunto. |
| | | | |
|
RespuestaTema opciones | 14.329 Views |
ThemeninformationenDieses Thema ha 4 subscriber: |