CToolBar button click focus state problem 
Author Message
 CToolBar button click focus state problem
Hello gurus,

I have a wizard generated doc/view app to which, apart from the regular
CCeCommandBar to host menu and toolbar, I have a second toolbar(CToolBar)
docked to the bottom. Running on emulator(PPC2000), the CToolBar toolbar
buttons never update their selection states when leftclicked(selection state
drawing happens if I left click while holding the right button pressed). I
know that the problem issue is SHRecognizeGesture() and following a how-to
on the topic, have created a CMyToolBar(derived from CToolBar) where I
handle OnLButtonDown() to return CWnd::Default().

This shows me the toolbar selection state correctly( a black selection rect
over button) when clicked, but unlike the CCeCommandBar, the selected
button's light colored background rectangle is not drawn. So how do I rig up
this support for my CMyToolBar class?

My idea is to use NM_CUSTOMDRAW and paint the light background on selected
button in POSTPAINT. Is this the solution? Is there an easier way than doing
the drawing myself?? I can't seem to get the custom drawing right and
although I have seen a couple of customdraw list samples, I haven't come
across any toolbar related customdrawing sample and desperately need some
assistance. I'm sure somebody must have come across this issue and there
must be a KB somewhere(except I cannot find it :)! Could someone please help
me out with an existing sample or with their ideas and code?

TIA.



Sat, 05 Feb 2005 22:12:34 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. CToolBar with two state buttons

2. CToolBar button clicked

3. Radio button click event being sent when Dialog gains focus

4. CToolBar selection state drawing problem!!

5. Identifying which control lost focus on button click event

6. Click 1 button = click 2 button?

7. ?CToolbar button customization problem

8. CToolBar button transparency problem

9. CToolBar - can I reflect click/ui messages from the buttons back to the CToolBar class I have created ?

10. Saving and retrieving the state of toolbars CToolBar

11. CToolbar--How to set the HOT state?

12. saving CToolBar state

 

 
Powered by phpBB® Forum Software