English
Forum

GridBOX & CUSTOMDRAW by SubClassing

List view-Customdraw with Subclassing: so geht's

 

Jens-Arne
Reumschüssel
If too first well 9 years later... Perhaps hilft's Yes nevertheless yet, or at least someone anderem:
'GridBOX(=ListView)-CustomDraw-example
 $H windows.ph
 $H messages.ph
 $H commctrl.ph
STRUCT NMHDR=hwndFrom&,idFrom&,code&
STRUCT NMCUSTOMDRAW=NMHDR,dwDrawStage&,hdc&,rcLeft&,rcTop&,rcRight&,rcBottom&,dwItemSpec&,uItemState&,lItemlParam&
STRUCT NMLVCUSTOMDRAW=NMCUSTOMDRAW,clrText&,clrTextBk&,iSubItem&,dwItemType&,clrFace&,iIconEffect&,iIconPhase&,iPartId&,iStateId&,rcTextLeft&,rcTextTop&,rcTextRight&,rcTextBottom&,uAlign&
declare _hGB%,_hBende%,_ende%

SUBCLASSPROC

    declare b#,lParam&,ret&

    if &sWnd=%HWnd

        if %sMessage=~WM_NOTIFY

            lParam&=&sLParam
            dim b#,NMLVCUSTOMDRAW
            b#=lParam&

            if (b#.hwndFrom&=_hGB%) and (b#.code&=~NM_CUSTOMDRAW)

                if b#.dwDrawStage&=~CDDS_PREPAINT'same becomes the List view new drawn

                    ret&=~CDRF_NOTIFYITEMDRAW'Folgemessages demand

                elseif b#.dwDrawStage&=~CDDS_ITEMPREPAINT'same becomes one Item drawn

                    'b#.clrText&=$0000FFFF '@rgb(255,255,0) 'Textfarbe the cell Change
                    'b#.clrTextBk&=$00FFFF00 '@rgb(0,255,255) 'Backgroundcolor the cell Change
                    'ret&=~CDRF_NEWFONT 'went too, then any Lines same colored, the next elseif-cut offed would then unnecessary
                    ret&=~CDRF_NOTIFYSUBITEMDRAW'Folgemessages to the draw each individual Subitems demand

                elseif (b#.dwDrawStage& & (~CDDS_ITEMPREPAINT | ~CDDS_SUBITEM))=(~CDDS_ITEMPREPAINT | ~CDDS_SUBITEM)'same becomes one Subitem drawn

                    'b#.dwItemSpec&=Zeile
                    'b#.iSubItem&=Spalte
                    b#.clrText&=@rgb(255,255,b#.dwItemSpec&*13+b#.iSubItem&*30)'Textfarbe the cell Change
                    b#.clrTextBk&=@rgb(0,200,b#.dwItemSpec&*13+b#.iSubItem&*30)'Backgroundcolor the cell Change
                    ret&=~CDRF_NEWFONT

                endif

            endif

            dispose b#

            if ret&<>0

                @set("WINPROC",0)'must his, otherwise goes's not
                return ret&'CustomDraw-specific worth give back

            endif

        endif

    endif

ENDPROC'SUBCLASSPROC

'***** Hauptprogramm
cls
_hGB%=@create("GRIDBOX",%HWnd,"Spalte 1;0;100;Spalte 2;0;100;Spalte 3;0;100;Spalte 4;0;100;Spalte 5;0;100;Spalte 6;0;100",0,0,0,@width(%HWnd),(@height(%HWnd)-40))
_hBende%=@create("BUTTON",%HWnd,"Ende",((@width(%HWnd)\2)-35),(@height(%HWnd)-30),70,20)
@set("FASTMODE",1)'otherwise goes's unfortunately not
subclass %HWnd,1'not The GridBOX subclassen, separate the Mainwindow (to there weg The WM_NOTIFY-Messages)
@addstring(_hGB%,"Test|TestTest|TestTestTest|Test|TestTest|TestTestTest")
@addstring(_hGB%,"Test|TestTest|TestTestTest|Test|TestTest|TestTestTest")
@addstring(_hGB%,"Test|TestTest|TestTestTest|Test|TestTest|TestTestTest")
@addstring(_hGB%,"Test|TestTest|TestTestTest|Test|TestTest|TestTestTest")
@addstring(_hGB%,"Test|TestTest|TestTestTest|Test|TestTest|TestTestTest")
@addstring(_hGB%,"Test|TestTest|TestTestTest|Test|TestTest|TestTestTest")
@addstring(_hGB%,"Test|TestTest|TestTestTest|Test|TestTest|TestTestTest")
@addstring(_hGB%,"Test|TestTest|TestTestTest|Test|TestTest|TestTestTest")
@addstring(_hGB%,"Test|TestTest|TestTestTest|Test|TestTest|TestTestTest")
@addstring(_hGB%,"Test|TestTest|TestTestTest|Test|TestTest|TestTestTest")
@addstring(_hGB%,"Test|TestTest|TestTestTest|Test|TestTest|TestTestTest")
@addstring(_hGB%,"Test|TestTest|TestTestTest|Test|TestTest|TestTestTest")
@addstring(_hGB%,"Test|TestTest|TestTestTest|Test|TestTest|TestTestTest")
@addstring(_hGB%,"Test|TestTest|TestTestTest|Test|TestTest|TestTestTest")
@addstring(_hGB%,"Test|TestTest|TestTestTest|Test|TestTest|TestTestTest")
@addstring(_hGB%,"Test|TestTest|TestTestTest|Test|TestTest|TestTestTest")
@addstring(_hGB%,"Test|TestTest|TestTestTest|Test|TestTest|TestTestTest")
@addstring(_hGB%,"Test|TestTest|TestTestTest|Test|TestTest|TestTestTest")
@addstring(_hGB%,"Test|TestTest|TestTestTest|Test|TestTest|TestTestTest")
_ende%=0

whilenot _ende%

    waitinput

    if @clicked(_hBende%)

        _ende%=1

    endif

endwhile

subclass %HWnd,0
@set("FASTMODE",0)
end
 
XProfan X4 * Prf2Cpp * XPSE * JRPC3 * Win11 Pro 64bit * PC i7-7700K@4,2GHz, 32 GB RAM
PM: jreumsc@web.de
05/22/18  
 




Jörg
Sellmeyer
cool! and for ne good idea is it never To late. would you nevertheless whom Posting again directly under Uwes Posting new create? then must one not by a additional Link hangeln.
i'd it move but the Forumprogrammierung can me strain not
 
XProfan X3
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
05/23/18  
 




Jens-Arne
Reumschüssel
Hmm, but then is the Headline lane, if I directly answer. or mean You, the differently?
 
XProfan X3
XProfan X4 * Prf2Cpp * XPSE * JRPC3 * Win11 Pro 64bit * PC i7-7700K@4,2GHz, 32 GB RAM
PM: jreumsc@web.de
05/23/18  
 




Jörg
Sellmeyer
just as my I the. then Although The Headline lane but You can it Yes in the Text insert.
find I anyway rather, as one Sub-Topic, by which the Thrad unübersichtlicher becomes, there one to Solution again durchklicken must.
 
XProfan X3
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
05/23/18  
 




Jens-Arne
Reumschüssel
but then is the entry not any more in the Overview and the Search to find. the find I explicit badly, as a Click More make To must. or becomes the Text ("Body") the Message in the Search ditto with include? then wär's objectively a improvement.
 
XProfan X3
XProfan X4 * Prf2Cpp * XPSE * JRPC3 * Win11 Pro 64bit * PC i7-7700K@4,2GHz, 32 GB RAM
PM: jreumsc@web.de
05/23/18  
 




Jens-Arne
Reumschüssel
...alas alike, I poste the simply once more directly under the Originaleintrag, then any Opportunities bedient.
 
XProfan X3
XProfan X4 * Prf2Cpp * XPSE * JRPC3 * Win11 Pro 64bit * PC i7-7700K@4,2GHz, 32 GB RAM
PM: jreumsc@web.de
05/23/18  
 




Jörg
Sellmeyer
Why? If man List view, Customdraw or Subclassing types, comes still this Thread. or Dou you mean, someone seek to "so gehts"?
 
XProfan X3
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
05/23/18  
 




Jens-Arne
Reumschüssel
No, the naturally not. but The Solution diving then even not in the Threadübersicht on, where tappt im dunkeln jemandem in that eye entrapments could, the Perhaps very the same thing trouble has. But this is already everything. for may part can this Unterthread too gladly deleted go.
 
XProfan X3
XProfan X4 * Prf2Cpp * XPSE * JRPC3 * Win11 Pro 64bit * PC i7-7700K@4,2GHz, 32 GB RAM
PM: jreumsc@web.de
05/23/18  
 




Jörg
Sellmeyer
we let it simply first drin.
 
XProfan X3
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
05/23/18  
 




p.specht

anyway a really great thing, Have something like yet never seen!
Ähnliches with einfärbig Einfärben gabs time of Sebastian Koenig, but I find the part unfortunately not any more...
 
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
05/24/18  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

8.230 Views

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie