English
Source / code snippets

Ownerdraw Subclass Trackmenu

 
TrackMenu SubClass OwnerDraw  [...] 

Andreas Miethe
is on The speedy zusammenkopiert, means not yet integrally reif.
'Header-Files
 $H windows.ph
 $H messages.ph
Declare Ende&
Declare Rect1#,hIcon1&,lpmis#,Size#
Dim Rect1#,16
Dim lpmis#,24
Dim Size#,8
Declare MyItem#[3]'reicht for 4 Entries
Struct Item = Eintrag&,Icon&
Dim MyItem#[],Item
Var Text$ = "Info"
Var Text2$ = "Beenden"
MyItem#[0].Eintrag& = Addr(Text$)
MyItem#[1].Eintrag& = Addr(Text2$)
MyItem#[0].Icon&    = ~LoadIcon(%hInstance,"A")
MyItem#[1].Icon&    = ~LoadIcon(%hInstance,"Eimer")

Proc Menue

    CreateMenu
    AppendMenu 101, "Info"
    ~ModifyMenu(&hMenu,101,~MF_BYCOMMAND | ~MF_OWNERDRAW,101,MyItem#[0])
    AppendMenu 103, "Beenden"
    ~ModifyMenu(&hMenu,103,~MF_BYCOMMAND | ~MF_OWNERDRAW,103,MyItem#[1])
    Return @TrackMenu()

ENDPROC

Windowstyle 26 + 512
Window Title "Test"
Window 0,0-640,480
SubClass %HWnd, 1

Whilenot Ende&

    Waitinput

    If %MousePressed = 2'right Mausbutton pressed

        Menue()

        If (%MenuItem = 101)

            @Messagebox("Programmiert in XProfan 11","Hinweis",64)

        ElseIf (%MenuItem = 103)

            Ende&=1

        EndIf

    Endif

Endwhile

Dispose Rect1#,lpmis#,Size#
End

SubClassProc

    If SubClassMessage(%hWnd,~WM_MEASUREITEM)

        lpmis# = &slParam
        ~GetTextExtentPoint32(%hdc,Long(Long(&slParam,20),0),Len(String $(Long(Long(&slParam,20),0),0)),Size#)
        Long lpmis#,12 = Long(Size#,0)
        Set("WinProc", 0)

    ElseIf SubClassMessage(%hWnd,~WM_DRAWITEM)

        IF Long(&slParam,16) & 1'if selektiert

            ~SetTextColor(Long(&slParam,24),$FFFFFF)
            ~SetBkColor(Long(&slParam,24),$8000)

        Else

            ~SetTextColor(Long(&slParam,24),0)
            ~SetBkColor(Long(&slParam,24),$FCFDC8)

        EndIf

        'rectangle for spending detect
        Long Rect1#,0 = Long(&slParam,28)'X
        Long Rect1#,4 = Long(&slParam,32)'Y
        Long Rect1#,8 = Long(&slParam,36)'wide
        Long Rect1#,12 =Long(&slParam,40)'Höhe
        'spending
        ~ExtTextOut(Long(&slParam,24),Long(&slParam,28)+20,Long(&slParam,32),~ETO_OPAQUE,Rect1#,Long(Long(&slParam,44),0),Len(String $(Long(Long(&slParam,44),0),0))  ,0)
        ~DrawIconEx(Long(&slParam,24),0,Long(&slParam,32),Long(Long(&slParam,44),4),13,13,0,0,~DI_NORMAL)
        Set("WinProc", 0)

    EndIf

ENDPROC

 
02/14/09  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

2.270 Views

Untitledvor 0 min.
Jörg Sellmeyer07/02/18
Georg Teles01/30/16
Ernst04/30/14
Peter Max Müller09/10/13
More...

Themeninformationen

this Topic has 1 subscriber:

iF (1x)


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