| |
|
|
| KompilierenMarcaSeparación****************** ListView-Demo: Grouping
****************** XProfan 10 / Windows XP
****************** © by TCS (Uwe Pascal Niemeier) 052007
Separiert von http://www.paules-pc-forum.de/forum/spezielles/112310-listview-gruppieren-aber-wie.html#post685865
window 100,10-500,550
usefont MS Sans Serif,15,7,0,0,0
setdialogfont 1
usermessages 16
$H Windows.ph
$H commctrl.ph
declare Text#
dim Text#,255
declare LvGroup#
struct LVGROUP=Size&,Mask&,pszHeader&,cchHeader&,pszFooter&,cchFooter&,
GroupId&,StateMask&,State&,Align&
dim LvGroup#,LVGROUP
LvGroup#.Size&=sizeof(LvGroup#)
LvGroup#.Mask&=$11--LVGF_HEADER | LVGF_GROUPID
LvGroup#.pszHeader&=Text#
declare Lv#
struct Lv=Mask&,Item&,x#(32),GroupID&
dim Lv#,Lv
Lv#.Mask&=$100--LVIF_GROUPID
var Lv&=create(gridbox,%hwnd,a;0;50;b;0;50;c;0;50;d;0;50;e;0;50,0,10,10,300,310)
sendmessage(Lv&,(~LVM_FIRST+157),1,0)--LVM_ENABLEGROUPVIEW (Grouping ein/aus)
~MultiByteToWideChar(0,0,Test,-1,Text#,255)-------------Gruppe 1 anlegen
LvGroup#.GroupId&=111
sendmessage(Lv&,(~LVM_FIRST+145),-1,LvGroup#)--LVM_INSERTGROUP
~MultiByteToWideChar(0,0,Nochn Test,-1,Text#,255)------Gruppe 1 anlegen
LvGroup#.GroupId&=222
sendmessage(Lv&,(~LVM_FIRST+145),-1,LvGroup#)--LVM_INSERTGROUP
addstring(Lv&,Name 1|Info 1|Extra 1|Daten 1|Text 1)
addstring(Lv&,Name 2|Info 2|Extra 2|Daten 2|Text 2)
addstring(Lv&,Name 3|Info 3|Extra 3|Daten 3|Text 3)
Lv#.Item&=0-------------------------------------Zeile 0
Lv#.GroupID&=111
sendmessage(Lv&,~LVM_SETITEM,0,Lv#)
Lv#.Item&=1-------------------------------------Zeile 1
Lv#.GroupID&=222
sendmessage(Lv&,~LVM_SETITEM,0,Lv#)
Lv#.Item&=2-------------------------------------Zeile 2
Lv#.GroupID&=111
sendmessage(Lv&,~LVM_SETITEM,0,Lv#)
while 1
waitinput
case %umessage=16:break-------Ende
endwhile
|
|
|
| |
|
|