CToolBar selection state drawing problem!! 
Author Message
 CToolBar selection state drawing 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.



Sun, 06 Feb 2005 05:11:58 GMT  
 CToolBar selection state drawing problem!!
Please post all development questions to the development newsgroups.

Thanks,

--
Steven Perry
Microsoft MVP/Mobile Devices


Quote:
> 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.



Sun, 06 Feb 2005 06:11:40 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. CToolBar button click focus state problem

2. CListCtrl - Problems with selection state

3. MFC Line drawing and selection problem.....

4. Saving and retrieving the state of toolbars CToolBar

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

6. saving CToolBar state

7. Saving CToolbar's state, Bug?

8. CToolBar with two state buttons

9. CListView - click on state icon and selection

10. CToolbar & Owner Draw

11. Owner Draw CListView not showing selection box

12. How to draw selection handles

 

 
Powered by phpBB® Forum Software