Re: Is CBitmapButton the right tool for a push like checkbox?
"addicted2freefall" <addicted2freefall-/[email protected]>
| Newsgroups | gmane.comp.windows.wtl |
|---|---|
| Message-ID | <[email protected]> |
thanks for your response jim. So do you think I should avoid using the WTL's CBitmapButton and just go with CButton in order to avoid CBitmapButton's ownerdraw behaviour? --- In [email protected], Jim Barry <jim@...> wrote: > > On 27 July 2010 08:25, addicted2freefall <addicted2freefall@...>wrote: > > > I'm creating a custom window in WTL to hold video controls for a DirectShow > > app. I'm first prototyping the window using a dialog. > > > > I've created a set of check boxes that I wish to behave in the "push like" > > manner (BS_PUSHLIKE). They appear defined in the .rc file for the dialog > > like so: > > > > CONTROL "",IDC_VID1,"Button",BS_AUTOCHECKBOX | BS_BITMAP | > > BS_PUSHLIKE | WS_GROUP | WS_TABSTOP,6,7,19,18 > > > > I've also loaded an image list for the button, which correctly shows the > > appropriate image when the button is in mouse button down and up states. > > > > In the code below, m_btnVid1 is defined as a CBitmapButton: > > > I think the problem here is that CBitmapButton sets the BS_OWNERDRAW style, > which is not compatible with other button styles (such as BS_AUTOCHECKBOX). > > By the way, if you look at the button style definitions in WinUser.h you'll > see that they aren't independent from each other. In CBitmapButton::Init(), > the "ModifyStyle(0, BS_OWNERDRAW)" call should be changed to > "ModifyStyle(BS_TYPEMASK, BS_OWNERDRAW)". > > - Jim > > > [Non-text portions of this message have been removed] > ------------------------------------ Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/wtl/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/wtl/join (Yahoo! ID required) <*> To change settings via email: [email protected] [email protected] <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/