Click here to Skip to main content
15,898,960 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CToolBar disable/enable buttons Pin
Mark Salsbery8-Jun-07 4:32
Mark Salsbery8-Jun-07 4:32 
GeneralRe: CToolBar disable/enable buttons Pin
Romiks8-Jun-07 18:54
Romiks8-Jun-07 18:54 
GeneralRe: CToolBar disable/enable buttons Pin
Mark Salsbery9-Jun-07 7:51
Mark Salsbery9-Jun-07 7:51 
GeneralRe: CToolBar disable/enable buttons Pin
Romiks11-Jun-07 20:38
Romiks11-Jun-07 20:38 
QuestionRe: CToolBar disable/enable buttons Pin
Mark Salsbery12-Jun-07 6:28
Mark Salsbery12-Jun-07 6:28 
AnswerRe: CToolBar disable/enable buttons Pin
Romiks16-Jun-07 23:37
Romiks16-Jun-07 23:37 
GeneralRe: CToolBar disable/enable buttons Pin
Mark Salsbery17-Jun-07 7:29
Mark Salsbery17-Jun-07 7:29 
GeneralRe: CToolBar disable/enable buttons Pin
Mark Salsbery17-Jun-07 8:09
Mark Salsbery17-Jun-07 8:09 
Ok..

It all works fine in the authors demo app.

The author actually omits the last parametr in the call to CTrueColorToolBar::LoadTrueColorToolBar
for the RIGHT toolbar. So, the right toolbar shows button bitmaps grayed by the system.

For the left toolbar he uses special bitmaps for disabled buttons that don't have any color,
just white/black/grays.

All the buttons except the first three on left and right are disabled. If you try to disable them
yourself they won't look any different Smile | :)

To enable them, you can add command enablers. For example, there's 9 buttons on the toolbars.
I enabled the 7th and 8th buttons like this (in MainFrm.cpp/.h):
// In MainFrm.h
 
// add these declarations to the CMainFrame class
afx_msg void OnUpdateButton32777(CCmdUI* pCmdUI);
afx_msg void OnUpdateButton32778(CCmdUI* pCmdUI);
 
 
// In MainFrm.cpp
 
// add this to CMainFrame message map
ON_UPDATE_COMMAND_UI(ID_BUTTON32777, OnUpdateButton32777)
ON_UPDATE_COMMAND_UI(ID_BUTTON32778, OnUpdateButton32778)
 
// add these handler methods
void CMainFrame::OnUpdateButton32777(CCmdUI* pCmdUI) 
{
	pCmdUI->Enable(TRUE);
}
 
void CMainFrame::OnUpdateButton32778(CCmdUI* pCmdUI) 
{
	pCmdUI->Enable(TRUE);
}



"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder

GeneralRe: CToolBar disable/enable buttons Pin
Romiks17-Jun-07 18:58
Romiks17-Jun-07 18:58 
GeneralRe: CToolBar disable/enable buttons Pin
Mark Salsbery18-Jun-07 4:29
Mark Salsbery18-Jun-07 4:29 
GeneralRe: CToolBar disable/enable buttons Pin
Romiks18-Jun-07 5:52
Romiks18-Jun-07 5:52 
QuestionMerge Modules Pin
bob169727-Jun-07 7:42
bob169727-Jun-07 7:42 
Questionerror C2665: 'AfxBeginThread' : none of the 2 overloads can convert parameter 1 from type 'void (void)' Pin
shivditya7-Jun-07 7:17
shivditya7-Jun-07 7:17 
AnswerRe: error C2665: 'AfxBeginThread' : none of the 2 overloads can convert parameter 1 from type 'void (void)' Pin
Mark Salsbery7-Jun-07 7:27
Mark Salsbery7-Jun-07 7:27 
GeneralRe: error C2665: 'AfxBeginThread' : none of the 2 overloads can convert parameter 1 from type 'void (void)' Pin
bolivar1237-Jun-07 7:28
bolivar1237-Jun-07 7:28 
GeneralRe: error C2665: 'AfxBeginThread' : none of the 2 overloads can convert parameter 1 from type 'void (void)' Pin
Mark Salsbery7-Jun-07 7:29
Mark Salsbery7-Jun-07 7:29 
QuestionRe: error C2665: 'AfxBeginThread' : none of the 2 overloads can convert parameter 1 from type 'void (void)' Pin
shivditya9-Jun-07 5:34
shivditya9-Jun-07 5:34 
AnswerRe: error C2665: 'AfxBeginThread' : none of the 2 overloads can convert parameter 1 from type 'void (void)' Pin
Mark Salsbery9-Jun-07 7:56
Mark Salsbery9-Jun-07 7:56 
GeneralRe: error C2665: 'AfxBeginThread' : none of the 2 overloads can convert parameter 1 from type 'void (void)' Pin
shivditya10-Jun-07 22:14
shivditya10-Jun-07 22:14 
AnswerRe: error C2665: 'AfxBeginThread' : none of the 2 overloads can convert parameter 1 from type 'void (void)' Pin
bolivar1237-Jun-07 7:27
bolivar1237-Jun-07 7:27 
QuestionRe: error C2665: 'AfxBeginThread' : none of the 2 overloads can convert parameter 1 from type 'void (void)' Pin
David Crow7-Jun-07 10:28
David Crow7-Jun-07 10:28 
JokeRe: error C2665: 'AfxBeginThread' : none of the 2 overloads can convert parameter 1 from type 'void (void)' Pin
shivditya9-Jun-07 5:40
shivditya9-Jun-07 5:40 
JokeRe: error C2665: 'AfxBeginThread' : none of the 2 overloads can convert parameter 1 from type 'void (void)' Pin
shivditya9-Jun-07 5:41
shivditya9-Jun-07 5:41 
QuestionCE C++ - list control color and font problems Pin
LaCoder7-Jun-07 6:25
LaCoder7-Jun-07 6:25 
AnswerRe: CE C++ - list control color and font problems Pin
Matthew Faithfull7-Jun-07 7:42
Matthew Faithfull7-Jun-07 7:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.