Forum | | | | - Page 1 - |
| Thomas Freier | Angelehnt on Andreas Example for a Listbox wished I from optischen Found too a Merker having. unfortunately can I it not moreover moving, that it itself moving. How 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&
Declare LVHTI#,l%,L.SubItem$
Dim LVHTI#,LVHitTestInfo
Proc LV_HitTest
Parameters LV&,X%,Y%
~GetCursorPos(LVHTI#)
~ScreenToClient(LV&,LVHTI#)
SendMessage(LV&,~LVM_SUBITEMHITTEST,0,LVHTI#)
Return LVHTI#.SubItem&
ENDPROC
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
proc LvDeSelect'deselectieren
parameters Lv&,Item&
Declare s#
dim s#,1024
long s#,12=0
long s#,16=~LVIS_SELECTED | ~LVIS_FOCUSED
sendmessage(Lv&,~LVM_SETITEMSTATE,Item&,s#)
dispose s#
endproc
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
proc LvSelect'selectieren
parameters Lv&,Item&
Declare 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)
dispose 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)
'very these Special Message must registiert go
'so the window The Drag&Drop Operationen process can.
Var DragMSG& = ~RegisterWindowMessage($DRAGLISTMSGSTRING)
CLS
SetDialogFont ~GetStockObject(~ANSI_VAR_FONT)
Var Ende& = 0
Var dlg& = @Create("ChildWindow", %hwnd, "Liste", 80, 60,300,300)
var Text$ = "Name;0;140"
var draglist& = Create("GridBox", dlg&, Text$, 0, 80, 14, 100, 220)
'The Listbox for Drag&Drop vobereiten
External("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
WhileNot 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 begins and Item remember
FirstItem& = LVHTI#.Item&
print FirstItem&, " to "
'Marker draw, must not his, increased but the Sichtbarkeit
External("comctl32.dll","DrawInsert",dlg&,Draglist&,Firstitem&)
MoveString$ = GetText$(Draglist&,LVHTI#.Item&,LVHTI#.SubItem&)'Item-Text remember
Set("WinProc", 0)
~SetCursor(MoveCursor&)
Return &DL_COPYCURSOR
ElseIf Info#.uNotification& = &DL_DRAGGING'Drag&Drop is in the Gange
LastItem& = LVHTI#.Item&
locate 0,10
Print LastItem&
LvSelect Draglist&,LastItem&
'Marker Redraw
External("comctl32.dll","DrawInsert",dlg&,Draglist&,LastItem&)
Set("WinProc", 0)
'Item Mark
SendMessage(DragList&,~Lb_SETCURSEL,LastItem&,0)
~SetCursor(MoveCursor&)
ElseIf Info#.uNotification& = &DL_DROPPED'Drag&Drop is exits
LastItem& = LVHTI#.Item&
If Lastitem& <> -1
'Marker Remove
External("comctl32.dll","DrawInsert",dlg&,Draglist&,-1)
'the first gemerkte Item delete
DeleteString(DragList&,FirstItem&)
'and on the position the last gemerkten Items insert
InsertString(DragList&,LastItem&,MoveString$)
Set("WinProc", 0)
LvSelect Draglist&,LastItem&
EndIf
EndIf
EndIf
ENDPROC
|
| | | Gruß Thomas Windows XP SP2, XProfan X2 | 11/21/10 ▲ |
| |
| | « this Posting watts as Solution marked. » | | Andreas Miethe
| Thomas suitor (11/21/10)
Angelehnt on Andreas Example for a Listbox wished I from optischen Found too a Merker having. unfortunately can I it not moreover moving, that it itself moving. How GEHTS ?
Hello Thomas,
for Listviews is the neither virtual. For this takes one 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&
Declare LVHTI#,l%,L.SubItem$
Dim LVHTI#,LVHitTestInfo
Proc LV_HitTest
Parameters LV&,X%,Y%
~GetCursorPos(LVHTI#)
~ScreenToClient(LV&,LVHTI#)
SendMessage(LV&,~LVM_SUBITEMHITTEST,0,LVHTI#)
Return LVHTI#.SubItem&
ENDPROC
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Proc LvDeSelect'deselectieren
Parameters Lv&,Item&
Declare s#
Dim s#,1024
LONG s#,12=0
LONG s#,16=~LVIS_SELECTED | ~LVIS_FOCUSED
sendmessage(Lv&,~LVM_SETITEMSTATE,Item&,s#)
dispose s#
ENDPROC
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Proc LvSelect'selectieren
Parameters Lv&,Item&
Declare 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)
dispose 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)
'very these Special Message must registiert go
'so the window The Drag&Drop Operationen process can.
Var DragMSG& = ~RegisterWindowMessage($DRAGLISTMSGSTRING)
CLS
SetDialogFont ~GetStockObject(~ANSI_VAR_FONT)
Var Ende& = 0
Var dlg& = @Create("ChildWindow", %hwnd, "Liste", 80, 60,300,300)
Var Text$ = "Name;0;140"
Var draglist& = Create("GridBox", dlg&, Text$, 0, 80, 14, 100, 220)
'The Listbox for Drag&Drop vobereiten
External("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
WhileNot 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 begins and Item remember
FirstItem& = LVHTI#.Item&
print FirstItem&, " to "
'Marker draw, must not his, increased but the Sichtbarkeit
structInsertMark#.iItem& = -1
SendMessage(Draglist&, &LVM_SETINSERTMARK, 0,structInsertMark#)
MoveString$ = GetText$(Draglist&,LVHTI#.Item&,LVHTI#.SubItem&)'Item-Text remember
Set("WinProc", 0)
~SetCursor(MoveCursor&)
Return &DL_COPYCURSOR
ElseIf Info#.uNotification& = &DL_DRAGGING'Drag&Drop is in the Gange
LastItem& = LVHTI#.Item&
locate 0,10
Print LastItem&
LvSelect Draglist&,LastItem&
'Marker Redraw
structInsertMark#.iItem& = LastItem&
SendMessage(Draglist&, &LVM_SETINSERTMARK, 0,structInsertMark#)
Set("WinProc", 0)
'Item Mark
SendMessage(DragList&,~Lb_SETCURSEL,LastItem&,0)
~SetCursor(MoveCursor&)
ElseIf Info#.uNotification& = &DL_DROPPED'Drag&Drop is exits
LastItem& = LVHTI#.Item&
If Lastitem& <> -1
'the first gemerkte Item delete
DeleteString(DragList&,FirstItem&)
'and on the position the last gemerkten Items insert
InsertString(DragList&,LastItem&,MoveString$)
Set("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 : [...] | 11/21/10 ▲ |
| | |
| | Thomas Freier | Hello Andreas. thanks for speedy reaction. unfortunately I get none Merker To see ??? |
| | | Gruß Thomas Windows XP SP2, XProfan X2 | 11/21/10 ▲ |
| |
| | Andreas Miethe
| Hello Thomas,
loudly MS functions the only Iconview,SmallIconview and Tileview, means not as list. This is apparently not any more ex Vista, there functions it too with list, therefore have I do not moreover probiert. with XP functions it well not
I have here Vista on the Laptop and It's all right fine, one can even The colour the Insertmark determine. |
| | | 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 : [...] | 11/21/10 ▲ |
| |
| | | by me XP see I at Code Thomas (but too only if I by Interpreter run out let) still such arrow during I dragge:
the but on this position glue or. not moving. |
| | | | |
| | Dieter Zornow | with Win 7 see so did i none arrow |
| | | Er ist ein Mann wie ein Baum. Sie nennen ihn Bonsai., Win 7 32 bit und Win 7 64 bit, mit XProfan X2 | 11/21/10 ▲ |
| |
| | Thomas Freier | i'll on the Merker dispense and times after a Possibility search, that if D&D eingeleitet becomes The To verschiebende row andersfarbig darzustellen and to end of D&D again pick up. is by me How poke about in the mist, there yet only with the List view.dll worked. |
| | | Gruß Thomas Windows XP SP2, XProfan X2 | 11/21/10 ▲ |
| |
| | | | | | | |
| | Thomas Freier | having I me already respected, if too not yet worn out. will be, Why not same, ToolTip bring into action, helps indeed, if forget, which Text moved go ought to.
$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&
Declare LVHTI#,l%,L.SubItem$,T_Tip&
Dim LVHTI#,LVHitTestInfo
Proc LV_HitTest
Parameters LV&,X%,Y%
~GetCursorPos(LVHTI#)
~ScreenToClient(LV&,LVHTI#)
SendMessage(LV&,~LVM_SUBITEMHITTEST,0,LVHTI#)
Return LVHTI#.SubItem&
ENDPROC
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
proc LvDeSelect'deselectieren
parameters Lv&,Item&
Declare s#
dim s#,1024
long s#,12=0
long s#,16=~LVIS_SELECTED | ~LVIS_FOCUSED
sendmessage(Lv&,~LVM_SETITEMSTATE,Item&,s#)
dispose s#
endproc
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
proc LvSelect'selectieren
parameters Lv&,Item&
Declare 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)
dispose 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)
'very these Special Message must registiert go
'so the window The Drag&Drop Operationen process can.
Var DragMSG& = ~RegisterWindowMessage($DRAGLISTMSGSTRING)
CLS
SetDialogFont ~GetStockObject(~ANSI_VAR_FONT)
Var Ende& = 0
Var dlg& = @Create("ChildWindow", %hwnd, "Liste", 80, 60,300,300)
var Text$ = "Name;0;140"
var draglist& = Create("GridBox", dlg&, Text$, 0, 80, 14, 100, 220)
'The Listbox for Drag&Drop vobereiten
External("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
WhileNot 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 begins and Item remember
FirstItem& = LVHTI#.Item&
print FirstItem&, " to "
MoveString$ = GetText$(Draglist&,LVHTI#.Item&,LVHTI#.SubItem&)'Item-Text remember
T_Tip&=Create("Tooltip",%hwnd,Draglist&,MoveString$)
Set("WinProc", 0)
~SetCursor(MoveCursor&)
Return &DL_COPYCURSOR
ElseIf Info#.uNotification& = &DL_DRAGGING'Drag&Drop is in the Gange
LastItem& = LVHTI#.Item&
locate 0,10
Print LastItem&
LvSelect Draglist&,LastItem&
Set("WinProc", 0)
'Item Mark
SendMessage(DragList&,~Lb_SETCURSEL,LastItem&,0)
~SetCursor(MoveCursor&)
ElseIf Info#.uNotification& = &DL_DROPPED'Drag&Drop is exits
LastItem& = LVHTI#.Item&
If Lastitem& <> -1
'the first gemerkte Item delete
DeleteString(DragList&,FirstItem&)
'and on the position the last gemerkten Items insert
InsertString(DragList&,LastItem&,MoveString$)
Set("WinProc", 0)
LvSelect Draglist&,LastItem&
DestroyWindow(T_Tip&)
EndIf
EndIf
EndIf
ENDPROC
|
| | | Gruß Thomas Windows XP SP2, XProfan X2 | 11/21/10 ▲ |
| |
| | | i don't know More in welchem Program I time ListBox-Entries mausverschiebbar made have but therefore that I whom entry immediate to achieve the new row moved have was a further Kennzeichnung somehow not at all necessary.
might one additional indeed another > on whom Beginning of the line the To verschiebenden row settle. |
| | | | |
|
AnswerTopic-Options | 14.311 Views |
Themeninformationenthis Topic has 4 subscriber: |