Ownerdraw menu - Programmer

This is a discussion on Ownerdraw menu - Programmer ; Greetings. I'm still learning MFC so this is probably a newbie post. In Win API environmnent I made an ownerdraw menu which works just fine, but now I want to make a class derived from MFC's CMenu class that will ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: Ownerdraw menu

  1. Ownerdraw menu

    Greetings. I'm still learning MFC so this is probably a newbie post. In Win
    API environmnent I made an ownerdraw menu which works just fine, but now I
    want to make a class derived from MFC's CMenu class that will encapsulate
    that functionality. I derive a class, and I override virtual MeasureItem and
    DrawItem handlers but they just don't work; it's like they are never
    called - there's nothing on menu. BTW, I'm learning MFC by Jeff Prosises
    book and he says (and gives an example) that I should just override DrawItem
    and MeasureItem handlers to get what I want. Why doesn't it work and what
    should I do to make it work? Tnx.


    --
    [ Live long and prosper ]



  2. Re: Ownerdraw menu

    "--[ Spock ]--" wrote in message
    news:chd792$7pl$1@bagan.srce.hr...
    > Greetings. I'm still learning MFC so this is probably a newbie post. In

    Win
    > API environmnent I made an ownerdraw menu which works just fine, but now I
    > want to make a class derived from MFC's CMenu class that will encapsulate
    > that functionality. I derive a class, and I override virtual MeasureItem

    and
    > DrawItem handlers but they just don't work; it's like they are never
    > called - there's nothing on menu. BTW, I'm learning MFC by Jeff Prosises
    > book and he says (and gives an example) that I should just override

    DrawItem
    > and MeasureItem handlers to get what I want. Why doesn't it work and what
    > should I do to make it work? Tnx.
    >
    >
    > --
    > [ Live long and prosper ]
    >


    I haven't worked with ownerdraw menus, but with ownderdraw controls you must
    set a create flag indicating it is ownerdraw. Perhaps you need to do that
    for your menu.



  3. Re: Ownerdraw menu

    "Bill Thompson" je napisao u poruci interesnoj
    grupi:O5t6dHvkEHA.3632@TK2MSFTNGP09.phx.gbl...
    > "--[ Spock ]--" wrote in message
    > news:chd792$7pl$1@bagan.srce.hr...
    >> Greetings. I'm still learning MFC so this is probably a newbie post. In

    > Win
    >> API environmnent I made an ownerdraw menu which works just fine, but now
    >> I
    >> want to make a class derived from MFC's CMenu class that will encapsulate
    >> that functionality. I derive a class, and I override virtual MeasureItem

    > and
    >> DrawItem handlers but they just don't work; it's like they are never
    >> called - there's nothing on menu. BTW, I'm learning MFC by Jeff Prosises
    >> book and he says (and gives an example) that I should just override

    > DrawItem
    >> and MeasureItem handlers to get what I want. Why doesn't it work and what
    >> should I do to make it work? Tnx.
    >>
    >>
    >> --
    >> [ Live long and prosper ]
    >>

    >
    > I haven't worked with ownerdraw menus, but with ownderdraw controls you
    > must
    > set a create flag indicating it is ownerdraw. Perhaps you need to do that
    > for your menu.
    >
    >


    Yes, I know, and I do that bu it just wont work.


    --
    [ Live long and prosper ]



  4. Re: Ownerdraw menu

    "--[ Spock ]--" wrote in message
    news:chfa08$pmo$1@bagan.srce.hr...
    > "Bill Thompson" je napisao u poruci interesnoj
    > grupi:O5t6dHvkEHA.3632@TK2MSFTNGP09.phx.gbl...
    > > "--[ Spock ]--" wrote in message
    > > news:chd792$7pl$1@bagan.srce.hr...
    > >> Greetings. I'm still learning MFC so this is probably a newbie post. In

    > > Win
    > >> API environmnent I made an ownerdraw menu which works just fine, but

    now
    > >> I
    > >> want to make a class derived from MFC's CMenu class that will

    encapsulate
    > >> that functionality. I derive a class, and I override virtual

    MeasureItem
    > > and
    > >> DrawItem handlers but they just don't work; it's like they are never
    > >> called - there's nothing on menu. BTW, I'm learning MFC by Jeff

    Prosises
    > >> book and he says (and gives an example) that I should just override

    > > DrawItem
    > >> and MeasureItem handlers to get what I want. Why doesn't it work and

    what
    > >> should I do to make it work? Tnx.
    > >>
    > >>
    > >> --
    > >> [ Live long and prosper ]
    > >>

    > >
    > > I haven't worked with ownerdraw menus, but with ownderdraw controls you
    > > must
    > > set a create flag indicating it is ownerdraw. Perhaps you need to do

    that
    > > for your menu.
    > >
    > >

    >
    > Yes, I know, and I do that bu it just wont work.



    OK, by doing a Google search on CMenu Ownerdraw MFC, I found this article:

    Create an Owner Draw Menu - Step by Step

    http://www.codeguru.com/Cpp/controls...cle.php/c3721/

    Perhaps it will shed some light.



  5. Re: Ownerdraw menu

    "Bill Thompson" je napisao u poruci interesnoj
    grupi:%23TI$RX4kEHA.3428@TK2MSFTNGP11.phx.gbl...
    > "--[ Spock ]--" wrote in message
    > news:chfa08$pmo$1@bagan.srce.hr...
    >> "Bill Thompson" je napisao u poruci interesnoj
    >> grupi:O5t6dHvkEHA.3632@TK2MSFTNGP09.phx.gbl...
    >> > "--[ Spock ]--" wrote in message
    >> > news:chd792$7pl$1@bagan.srce.hr...
    >> >> Greetings. I'm still learning MFC so this is probably a newbie post.
    >> >> In
    >> > Win
    >> >> API environmnent I made an ownerdraw menu which works just fine, but

    > now
    >> >> I
    >> >> want to make a class derived from MFC's CMenu class that will

    > encapsulate
    >> >> that functionality. I derive a class, and I override virtual

    > MeasureItem
    >> > and
    >> >> DrawItem handlers but they just don't work; it's like they are never
    >> >> called - there's nothing on menu. BTW, I'm learning MFC by Jeff

    > Prosises
    >> >> book and he says (and gives an example) that I should just override
    >> > DrawItem
    >> >> and MeasureItem handlers to get what I want. Why doesn't it work and

    > what
    >> >> should I do to make it work? Tnx.
    >> >>
    >> >>
    >> >> --
    >> >> [ Live long and prosper ]
    >> >>
    >> >
    >> > I haven't worked with ownerdraw menus, but with ownderdraw controls you
    >> > must
    >> > set a create flag indicating it is ownerdraw. Perhaps you need to do

    > that
    >> > for your menu.
    >> >
    >> >

    >>
    >> Yes, I know, and I do that bu it just wont work.

    >
    >
    > OK, by doing a Google search on CMenu Ownerdraw MFC, I found this article:
    >
    > Create an Owner Draw Menu - Step by Step
    >
    > http://www.codeguru.com/Cpp/controls...cle.php/c3721/
    >
    > Perhaps it will shed some light.
    >
    >


    Thank you! I spent hours on Google searching this kind of stuff and found
    only garbage! That site is going to my favourites!


    --
    [ Live long and prosper ]



+ Reply to Thread