Source / code snippets | | | | Uwe ''Pascal'' Niemeier | Hi people!
here a couple Opportunities, ListViews something interessanter To style (XProfan 11): CompileMarkSeparationwindow 10,100-750,300
$H Messages.ph
$H Windows.ph
$H commctrl.ph
struct HD=Mask&,cxy&,Text&,hbm&,TextMax&,fmt&,Param&,Image&,Order&,Type&,Filter&
declare hd#
dim hd#,HD
--Alle Spalten links
var a$=Spalte 1;0;120;Spalte 2;0;120;Spalte 3;0;120;Spalte 4;0;120;Spalte 5;0;120
var Lv&=create(gridbox,%hwnd,a$,0,10,30,700,200)
--Lv ohne Header:
setstyle Lv&,getstyle(Lv&) | ~LVS_NOCOLUMNHEADER
var Header&=sendmessage(Lv&,~LVM_GETHEADER,0,0)
addstring(Lv&,Test1a|Test2a|Test3a|Test4a|Test5a)
--Bei Bedarf:
setstyle Header&,$50000002--Header aktivieren
external(uxtheme.dll,SetWindowTheme,Header&,,)--XP-Style aus
var IcoList&=create(imagelist,16,16)
ImageList(AddIcon,IcoList&,~LoadIcon(0,32513))-- X-Icon
sendmessage(Header&,~HDM_SETIMAGELIST,0,IcoList&)
mcls 16,32--Bei aktivem Header überlagert hohes bmp den Tracking-Streifen!
startpaint -1
cls 255
endpaint
var Pic1&=create(hPic,0,&MEMBMP)
mcls 40,14
startpaint -1
cls 255*255
endpaint
var Pic2&=create(hPic,0,&MEMBMP)
--Kein Text: HDF_STRING weglassen
hd#.Mask&=~HDI_BITMAP | ~HDI_FORMAT
hd#.hbm&=Pic1&
hd#.fmt&=~HDF_STRING | ~HDF_BITMAP | ~HDF_RIGHT
sendmessage(Header&,~HDM_SETITEM,0,hd#)
hd#.Mask&=~HDI_BITMAP | ~HDI_FORMAT
hd#.hbm&=Pic2&
hd#.fmt&=~HDF_STRING | ~HDF_BITMAP | ~HDF_BITMAP_ON_RIGHT | ~HDF_RIGHT
sendmessage(Header&,~HDM_SETITEM,1,hd#)
hd#.Mask&= ~HDI_IMAGE | ~HDI_FORMAT
hd#.Image&=0---Icon aus ImageList
hd#.fmt&=~HDF_STRING | ~HDF_IMAGE | ~HDF_RIGHT
sendmessage(Header&,~HDM_SETITEM,2,hd#)
hd#.Mask&=~HDI_FORMAT
hd#.fmt&=~HDF_STRING | ~HDF_RIGHT | $200--HDF_SORTDOWN
sendmessage(Header&,~HDM_SETITEM,3,hd#)
hd#.Mask&=~HDI_FORMAT
hd#.fmt&=~HDF_STRING | ~HDF_RIGHT | $400--HDF_SORTUP
sendmessage(Header&,~HDM_SETITEM,4,hd#)
--aktiver Header durchbricht WaitInput bei Klicken *und* loslassen!
print hier klicken!
--Änderung der Textausrichtung des Headers wirkt sich auch auf das Lv aus,
--wird aber erst nach Neuzeichnen sichtbar:
waitinput
repaint
waitinput
--Größe & Position des Headers läßt sich im Prinzip ändern;
--wird aber vom Lv bei nächster Gelegenheit zurückgesetzt.
--Könnte aber als Toolbar verwendet werden :-)
setwindowpos Header&=0,0-700,100
repaint
waitinput
addstring(Lv&,Test1b|Test2b|Test3b|Test4b|Test5b)
repaint
while 1
waitinput
ef='./../../Function-References/XProfan/endwhile/'>endwhile
CompileMarkSeparationwindow 10,100-450,300
$H Messages.ph
$H windows.ph
$H commctrl.ph
declare Lv#
struct Lv=Mask&,Item&,SubItem&,State&,StateMask&,Text&,TextMax&,Image&
dim Lv#,Lv
proc LvSetIcon---------------------------------------------LvSetIcon
Lv#.Item&=&(2)
Lv#.SubItem&=&(3)
Lv#.Mask&=~LVIF_IMAGE
Lv#.Image&=%(4)
sendmessage(&(1),~LVM_SETITEM,0,Lv#)
endproc-------------------------------------------------------------
var IcoList&=create(ImageList,16,16)
ImageList(AddIcon,IcoList&,~LoadIcon(0,32512))
ImageList(AddIcon,IcoList&,~LoadIcon(0,32513))
ImageList(AddIcon,IcoList&,~LoadIcon(0,32514))
ImageList(AddIcon,IcoList&,~LoadIcon(0,32515))
var a$=slot 1;0;120;slot 2;0;120;slot 3;0;120
var Lv&=create(gridbox,%hwnd,a$,0,10,30,400,200)
sendmessage(Lv&,~LVM_SETIMAGELIST,~LVSIL_SMALL,IcoList&)
sendmessage(Lv&,~LVM_SETEXTENDEDLISTVIEWSTYLE,0,~LVS_EX_SUBITEMIMAGES | ~LVS_EX_GRIDLINES)
--Gitterlinien überzeichnen Icons partly!
--Lv without Header:
setstyle Lv&,getstyle(Lv&) | ~LVS_NOCOLUMNHEADER
a$=Test x a|Test x b|Test x c|Test x d|Test x e
whileloop 1,5
addstring(Lv&,translate $(a$,x,st$(&loop)))
endwhile
LvSetIcon(Lv&,0,0,1)--appeal: LvSetIcon(Handle&,row%,slot%,Icon%)
LvSetIcon(Lv&,1,1,2)--values for row,slot,Icon 0-basiert!
LvSetIcon(Lv&,2,2,3)
LvSetIcon(Lv&,3,0,getcount(IcoList&))
LvSetIcon(Lv&,4,0,99)
LvSetIcon(Lv&,4,2,0)
while 1
waitinput
endwhile
@ Thomas: meant You something like?
SeeYou Pascal
[offtopic] @ iF: is me straight noticed: in the Codebox becomes Yes The Original-spelling (big/small) to maintain would be but beautiful if too Leerzeilen receive stayed. Edit of iF: with the space and Tabs fight I already a while - if I ready have go (naturally) too space and Tabs (unless strain leading or abschliessend) to maintain. [/offtopic] |
| | | | |
| | Thomas Freier | hey Pascal,
thanks for Examples. is the, I sought. |
| | | Gruß Thomas Windows XP SP2, XProfan X2 | 03/13/09 ▲ |
| |
| | | i'm I do not sure whether the so pseudo is (Screenshot) at first Male Draggen the Column at example 1:
ex the 2. Male (Draggen the Column) against sustain I no Anzeigefehler (?).
but: Juhu! so does it means! |
| | | | |
| | Uwe ''Pascal'' Niemeier | Hi iF!
i'm I do not sure whether the so pseudo is (Screenshot) at first Male Draggen the Column
pseudo not ,but foreseeable
it'll Yes to each WaitInput To Demozwecken something ausprobiert.
with activities in the Header go but even several WaitInputs durchbrochen; therefore standing Yes in the Window extra here clicking
SeeYou Pascal |
| | | | |
| | | Ah! |
| | | | |
|
Zum QuelltextThemeninformationenthis Topic has 3 subscriber: |