![]() |
How to make some icon of toolbar grayed |
Post Reply
|
| Author | |
yanlv
Groupie
Joined: 23 June 2008 Location: China Status: Offline Points: 23 |
Post Options
Thanks(0)
Quote Reply
Topic: How to make some icon of toolbar grayedPosted: 24 July 2008 at 5:38am |
|
There's an icon on my toolbar. I hope it is grayed from the beginning, but will become bright when I send a command. How to make this icon grayed in the function oncreate() or oncreatecontrol().
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 24 July 2008 at 7:37am |
|
Hi,
you need add Update handler for Id and enable/disable your command.
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
barobax
Senior Member
Joined: 07 May 2008 Status: Offline Points: 117 |
Post Options
Thanks(0)
Quote Reply
Posted: 30 July 2008 at 3:19pm |
|
Hi,
what about MiniToolbar ?! My buttons are disabled. |
|
|
(Farsi IS WRONG you must say [PARSI])
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 31 July 2008 at 1:46am |
|
Hi, Did you add update handlers? See how it works with our sample.
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
yanlv
Groupie
Joined: 23 June 2008 Location: China Status: Offline Points: 23 |
Post Options
Thanks(0)
Quote Reply
Posted: 31 July 2008 at 2:55am |
|
sorry, I didn't add updated handlers, but I'll test it. Could you answer me another problem about cutomize which is in another topic? Thanks.
|
|
![]() |
|
yanlv
Groupie
Joined: 23 June 2008 Location: China Status: Offline Points: 23 |
Post Options
Thanks(0)
Quote Reply
Posted: 03 August 2008 at 2:58am |
|
*****************
To oleg: I test your idea and it works. In details: add the code in updated handler CMainFrame* mainwnd=(CMainFrame *)AfxGetMainWnd(); CXTPControlAction* pMenuItem = mainwnd->GetpAction(pCmdUI->m_nID); if(flag != 0) { pMenuItem->SetEnabled(TRUE); } else { pMenuItem->SetEnabled(FALSE); } ****** to barobax: I didn't test your idea. Maybe later when I'm free. |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 03 August 2008 at 4:14am |
|
All above lines can be replaced to
pCmdUI->Enable(flag);
:)
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
yanlv
Groupie
Joined: 23 June 2008 Location: China Status: Offline Points: 23 |
Post Options
Thanks(0)
Quote Reply
Posted: 04 August 2008 at 9:43pm |
|
thanks. I'm only a new guy to GUI.
|
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |