Forum | | | | - Page 1 - |
| Normann Strübli | Hello Frank, Hello Community,
I bastel straight in a List view which Bargraphen and Images include can. (was indeed already time somewhere demand ) this code is solely one beginning but can and should with Eurer Help weiterentwickelt go. unfortunately have I it too not yet auskommentiert, but so heavy is it mean so did i not To understand.
I hope though Frank of it convincing to so a function in its List view with aufzunehmen ;D as attachment have I time Vorlagen The with masm program are enclosed. -best time angucken The Examples are too as ausführbare File present. FRANK BITTE GUCK DIR DAS AN!!!
same another question: I have the List view whom LVS_OWNDERDRAWFIXED Style missed, there Yes otherwise no wm_drawitem message on the Elternfenster gesand becomes. Can it hinbekommen the only of/ one slot these Message sent becomes, then should one not the complete control self draw?!...
Greeting Normann CompileMarkSeparation $H Windows.ph
$H Structs.ph
$H Messages.ph
$H Commctrl.ph
$H Structs.ph
Set(FastMode,1)
Def Hiword(1) And(&(1)>>16,$Ffff)
Def Loword(1) And(&(1),$Ffff)
declare test&,itemtext$
itemtext$ = TestItem
Struct Hd_notify = ~Hd_notify
Declare Hd_notify#
Dim Hd_notify#,Hd_notify
Struct NMHDR = ~NMHDR
Declare NMHDR#
Dim NMHDR#,NMHDR
Struct DRAWITEMSTRUCT = ~DRAWITEMSTRUCT
Declare DRAWITEMSTRUCT#
Dim DRAWITEMSTRUCT#,DRAWITEMSTRUCT
Struct Rect = ~Rect
Declare Rect#
Dim Rect#,Rect
struct TWindowClass = ~WndClass
struct TMsg = ~Msg
declare WindowClass#, Msg#
declare AppName$
$I Listview_Funktionen.inc
Declare lvdll&
lvdll&=usedll(Listview.dll)
AppName$ = Listview Test
proc WindowProc
parameters Window&, Message&, WParam&, LParam&
If Message& = ~Wm_notify
NMHDR# = Lparam&
if NMHDR#.hwndfrom& = listview&
if NMHDR#.code& = ~NM_KILLFOCUS Das Control hat den Focus verloren
elseif NMHDR#.code& = ~NM_SETFOCUS Das Control hat den Focus bekommmen
elseif NMHDR#.code& = ~NM_CLICK Der Anwender hat die linke Maustaste im Control geklickt
elseif NMHDR#.code& = ~NM_DBLCLK Der Anwender hat die linke Maustaste im Control doppel-geklickt
elseif NMHDR#.code& = ~NM_OUTOFMEMORY Das Control konnte die Aktion Aufgrund zu wenig Speicher nicht ausführen
elseif NMHDR#.code& = ~NM_RCLICK Der Anwender hat die rechte Maustaste im Control geklickt.
elseif NMHDR#.code& = ~NM_RDBLCLK Der Anwender hat die rechte Maustaste im Control doppel-geklickt.
elseif NMHDR#.code& = ~NM_RETURN Der Anwender hat die ENTER-Taste im Control gedrückt
elseif NMHDR#.code& = ~LVN_COLUMNCLICK Das Control hat den Focus bekommmen
Endif
endif
endif
if Message& = ~wm_drawitem
if Wparam& = listviewid&
DRAWITEMSTRUCT# = lparam&
Long Rect#,0 = Long(DRAWITEMSTRUCT#,28)
Long Rect#,4 = Long(DRAWITEMSTRUCT#,32)
Long Rect#,8 = Long(DRAWITEMSTRUCT#,36)
Long Rect#,12 = Long(DRAWITEMSTRUCT#,40)
If And(Long(Lparam&,16),1)
~SelectObject(DRAWITEMSTRUCT#.Hdc&,~CreateSolidBrush(@RGB(200,0,0)))
~SetBkColor(DRAWITEMSTRUCT#.hdc&,@RGB(100,100,200))
else
~SetBkColor(DRAWITEMSTRUCT#.hdc&,@RGB(200,200,200))
~SelectObject(DRAWITEMSTRUCT#.Hdc&,~CreateSolidBrush(@RGB(0,200,0)))
endif
~Exttextout(DRAWITEMSTRUCT#.Hdc&,rect#.left&,rect#.top&,~Eto_OPAQUE,Rect#,Addr(Itemtext$),Len(Itemtext$),0)
~Rectangle(DRAWITEMSTRUCT#.Hdc&,120,rect#.top&,120 + rect#.top&,rect#.bottom&)
endif
endif
if Message& = ~wm_Destroy
CloseProc
~PostQuitMessage(0)
END
endif
return ~DefWindowProc(Window&, Message&, WParam&, LParam&)
endproc
proc WinMain
declare Window&, Message&
dim WindowClass#,TWindowClass
dim Msg#,TMsg
with WindowClass#
.style& = 0
.lpfnWndProc& = ProcAddr(WindowProc,4)
.cbClsExtra& = 0
.cbWndExtra& = 0
.hInstance& = %HInstance
.hIcon& = ~LoadIcon(0,~idi_Information)
.hCursor& = ~LoadCursor(0, ~idc_Arrow)
.hbrBackground& = ~GetStockObject(~white_Brush)
.lpszMenuName& = Addr(AppName$)
.lpszClassName& = Addr(AppName$)
endwith
if ~RegisterClass(WindowClass#) = 0
~MessageBox(0,Fenster konnte nicht registriert werden!,Fehler,0)
end
endif
Window& = ~CreateWindowEx(
0,
Addr(AppName$),
Addr(AppName$),
~ws_OverlappedWindow,
~cw_UseDefault,
~cw_UseDefault,
~cw_UseDefault,
~cw_UseDefault,
0,
0,
%HInstance,
0)
~ShowWindow(Window&, ~sw_ShowNormal)
~UpdateWindow(Window&)
InitMessages(Window&)
Declare listview&,ListviewId&,Column$
Listview& = CreateListview(Window&,%HInstance,0,-1,-1,$23)
~SetWindowLong(Listview&,~GWL_STYLE,@Or(~Getwindowlong(Listview&,~GWL_STYLE),~LVS_OWNERDRAWFIXED))
~Setprop(Listview&,OldCallback,~Setwindowlong(Listview&,~Gwl_wndproc, Procaddr(Listviewcallback,4)))
ListviewId& = ~Getwindowlong(Listview&,~GWL_ID)
Autosortlistview Listview&,1,1,1,1,2,2
Column$ = Column 1
IColumn(Listview&,addr(Column$),120,0)
Column$ = Column 2
IColumn(Listview&,addr(Column$),120,0)
Column$ = Column 3
IColumn(Listview&,addr(Column$),120,0)
Declare bereich#,text1$,text2$,text3$
dim bereich#,1000
text1$=Neues_Item 1
text2$=Neues_Item 2
text3$=Neues_Item 3
long bereich#,0=addr(text1$)
long bereich#,4=addr(text2$)
long bereich#,8=addr(text3$)
WhileLoop 8
SItem(listview&,bereich#,3)
EndWhile
Showlistview(Listview&,32,32,500,400)
Dispose bereich#
while ~GetMessage(Msg#, 0, 0, 0) > 0
~TranslateMessage(Msg#)
~DispatchMessage(Msg#)
endwhile
end
endproc
WinMain
Proc Listviewcallback
Parameters Wnd&, Msg&, Wparam&, Lparam&
If Msg& = ~Wm_notify
NMHDR# = Lparam&
If (NMHDR#.code& = ~Hdn_begintrackw) OR (NMHDR#.code& = ~Hdn_DIVIDERDBLCLICKw) Die HDN_BeginTrack Botschaft abfangen und löschen!
Hd_notify# = Lparam&
if (Hd_notify#.iButton& = 0) OR (Hd_notify#.iButton& = 1)
Return 1
Endif
Endif
Endif
Return ~Callwindowproc(~Getprop(Wnd&,OldCallback),Wnd&, Msg&,Wparam&,Lparam&)
Endproc
Proc Closeproc
Clo ages (window& )
$I Listview_dispose.inc
endproc
|
| | | | |
| | | | | - Page 1 - |
| Normann Strübli | Hi,
@Frank: I hope you have The celebration schadenfrei überstanden
I werd yet demented with the Owerdraw-story Please help me !!!
the following trouble:
The WM_DRAWITEM -Message becomes always only once per row sent, The SubItems must Yes but too new drawn and be very there missing me the right Lösungsansatz.
now read in a Loop each Split from, but this is now really not optimal...
Please schaut you the example once on and give me something Hilfestellung How I it rather solve can. |
| | | | |
| | Frank Abbing | Hello Normann,
Yes, The celebration was well. my computer was but in Reparatur and behave itself still something strange. i'm not yet To your things come. tommorrow, hope I. |
| | | | |
| | Normann Strübli | Hi,
new Version, Please testing! (now without same a Farbflash To get) ought to itself now like a integrally normales List view-Control behaviour.
The benefit is z.B. the The Backgroundcolor the selektierten row always discernible remaining
Greeting Normann
here maln Screenshot: |
| | | | |
| | Frank Abbing | Hi,
Normann, poste here too time your ph-Files. I get a Error Message and kanns not testing.
The Assembler.dll knew I already. If I correctly. remember, is tappt im dunkeln but never ready become. Why should I The Dll-functions because for List view.dll umsetzen, if You The additional Dll already have? Kombiniere still simply both Dlls. |
| | | | |
| | Normann Strübli | Aarrghh!!!
is correct The Structs.ph has a Error, here The corrected version. |
| | | | |
| | Frank Abbing | Hi,
ok, habs tested. but what bezweckst You now so? What exactly want You of me? want You beam and Torten in Listviews? |
| | | | |
| | Michael Wodrich | at least still The beam. can I me as Prozentbalken with one File-Downloader well present. Since there it with safety many Opportunities.
Best wishes Michael Wodrich |
| | | Programmieren, das spannendste Detektivspiel der Welt. | 11/09/05 ▲ |
| |
| | Normann Strübli | Hello Frank,
i want really (meanwhile) so bezwecken I to langer Time time with the X-menu bezweckt have. One List view-Control complete whom own Bedürfnissen anzupassen. original wished I Yes only a Balkenanzeige install, there this not so without weiters functions has, have I I with the Ownerdraw-List view engage, and so I ment then moreover...
an Support of z.B. Bargraphen of your Dll would a super thing, I faith so think not only Michael what about me.
my Ansatz should a Nischenlösung his for denjenigen the even yet something other as Text- or icons in whom Lines stand having would like, what Yes theroretisch so already functions. (z.B. Bitmaps, Graphen, mehzeilige boxes etc...)
your Dll can the naturally not supplant and should the interested only time aufzeigen the so a pretty bunte List view too in reinem (X-)Profan To erschaffen is.
my Hauptproblem is now The speed with the whole story, and there was my question How I my code- particularly with the Abarbeitung the Wm_notify-Message optimize and faster can make. and who has there More Idea of tables as You, Frank
As I said for your List view.dll would the I vorhabe To individually, and I the whole now To foot erledige would I for each hint grateful How I the whole can optimize...
More wished I still none |
| | | | |
| | Normann Strübli | @Frank:
apiece longer I with the List view-story engage umso More Problems yield itself there now have I The Sort Lines with Help the XPIA completed and times one comparison with your List view.dll made. with ca. 20.000 Einträgen lasts it with of my Variante still stolze 21 sec, with the Listviev.dll only concise 3 sec. (means ca. 10time faster) This will Yes certainly by the limp appeal of Profan come.
there in of my list but certainly 13.000 Entries present his go, have I me The whole work well umsonst made -but at least have I plenty dazugelernt.
means have your List view.dll quick again eingebunden, unfortunately weg now The Zeilenfarben after a Sorting flöten. is indeed clear I the lParam& member of LV_ITEM# moreover mißbraucht have The Farbinformationen for suitable row To Save. You using richtigerweise the value of lParam circa to the Sorting whom new index the Lines To Save.
But if I not any more white which row to the Sorting whom index has, and the commands Raise Line on only 1024 Lines beschränk is must I well begin To Zaubern circa of/ one row a eindeutigen Farbwert zuzuordnen the independent of the Sorting is. somewhere have You Schonmal on a question answered: [quote:06c4627aa6]If you Lines einfügst and want, the The coloured Mark mitwandert, must You the yourself program.[/quote:06c4627aa6] to that Happiness is the Superdupieinfach
...No, I have no idea! Irgendeinen suggestion??? *verzweifel*
Greeting Normann |
| | | | |
| | Normann Strübli | Have I yet forget:
Frank, can You Perhaps a function install around the Zeilenhöhe einzustellen? or white jmd. How the with of/ one List view functions??? |
| | | | |
| | | | - Page 2 - |
| | Frank Abbing | at least To your last question there irgendeine Message. once my computer again runs, trouble I therefore. |
| | | | |
| | Frank Abbing | Hi,
Have The Zeilenhöhe installed. an Message there were to not, Have a little bit with Imagelisten getricks. in the next Version.
Übrigens. here Fortschrittsbalken in the list view: CompileMarkSeparationRandomize
Declare listview&,lvdll&,text$,text2$,x&,y&,z&,font&
Def GetSysColor(1) !USER32,GetSysColor
$I Listview_Funktionen.inc
lvdll&=usedll(Listview.dll)
Windowstyle 543
Windowtitle Listview.dll / Prozentanzeige
Window 0,0-400,256
Cls GetSysColor(15)
font&=Create(Font,MS Sans Serif,13,0,0,0,0)
x&=MixRGBs(GetSysColor(15),$00ffffffff)
listview&=CreateListView(%hwnd,%hinstance,0,x&,-1,$31)
SetFont listview&,font&
InsertColumn listview&,Text,60,0
InsertColumn listview&,Prozent,240,0
Whileloop 12
text2$=
x&=Rnd(30)
Whileloop x&
text2$=text2$+Chr$(127)
Wend
text2$=text2$+ +Str$(Int(100/30*x&))+%
text$=Item +Str$(&loop)
SetItem listview&,text$,text2$
Wend
AutoSortListview listview&,1,1
ShowListView(listview&,8,8,370,200)
InitMessages(%hwnd)
SetTimer 1500
While 1
waitinput
Case %key=2:BREAK
y&=Rnd(4)
Whileloop 12
text2$=
x&=Rnd(30)
Whileloop x&
text2$=text2$+Chr$(127)
Wend
Case y&=0:text2$=text2$+ +Str$(Int(100/30*x&))+%
SetItemText(listview&,addr(text2$),1,(&loop-1))
Wend
Wend
KillTimer
DestroyWindow(listview&)
CloseMessages(%hwnd)
freedll lvdll&
DeleteObject font&
$I Listview_Dispose.inc ass=s4 href='./../../Function-References/XProfan/end/'>End
|
| | | | |
|
AnswerThemeninformationenthis Topic has 3 subscriber: |