PDA

View Full Version : Custom Toolbar Button Controls



Kyudos
05-22-2013, 07:36 PM
Is this example still available anywhere:

http://kb.roguewave.com/kb/?View=entry&EntryID=222&Msg=

Or is there a different / better way to do this?

I already have two custom combobox classes that I'd like to use on a toolbar.

Kyudos
05-26-2013, 09:36 PM
I solved this by making a new version of my classes based on the COMBO_BUTTON classes. Now I'd like to do the same with the colorwell - is there a way to put a colorwell button on the toolbar? Or do I need some class customisation again?

Kyudos
05-27-2013, 03:41 PM
I looked at this and found I can use SECBmpMgr to get at the HBITMAPS for my toolbars. Can I thence change the bits of the bitmaps directly? (I've got a popup colorwell to work on the button click, but I'd like to change the button bitmap to display the chosen colour). Is this the best approach?

Kyudos
05-29-2013, 10:30 PM
OK, I've got most of the way there by deriving a class from SECWellButton and SECWndBtn, but it isn't fully customisable - I can't add my new toolbar well button to new toolbars or resize it. What else do I need to do?

Kyudos
05-30-2013, 04:09 PM
I'm getting pretty good at answering my own questions!

In the OnLButtonDown handler I needed this:


BOOL bAlt = (::GetKeyState(VK_MENU) & 0x8000000L) ? TRUE : FALSE;
if (m_pToolBar->InConfigMode() || bAlt)
{
if (::GetCapture() != NULL)
{
::ReleaseCapture();
}
}

Before handing off the message to SECWndBtn.