Click here to Skip to main content
15,923,681 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionIncreasing/Decreasing text size of a shown html Pin
babyspidy26-Aug-05 7:50
babyspidy26-Aug-05 7:50 
AnswerRe: Increasing/Decreasing text size of a shown html Pin
David Crow26-Aug-05 9:14
David Crow26-Aug-05 9:14 
GeneralRe: Increasing/Decreasing text size of a shown html Pin
babyspidy27-Aug-05 15:33
babyspidy27-Aug-05 15:33 
GeneralRe: Increasing/Decreasing text size of a shown html Pin
Jose Lamas Rios27-Aug-05 18:45
Jose Lamas Rios27-Aug-05 18:45 
GeneralRe: Increasing/Decreasing text size of a shown html Pin
babyspidy28-Aug-05 7:39
babyspidy28-Aug-05 7:39 
GeneralRe: Increasing/Decreasing text size of a shown html Pin
Jose Lamas Rios28-Aug-05 8:53
Jose Lamas Rios28-Aug-05 8:53 
GeneralRe: Increasing/Decreasing text size of a shown html Pin
babyspidy28-Aug-05 15:53
babyspidy28-Aug-05 15:53 
AnswerRe: Increasing/Decreasing text size of a shown html Pin
Jose Lamas Rios29-Aug-05 7:30
Jose Lamas Rios29-Aug-05 7:30 
You need to add ON_UPDATE_COMMAND_UI entries with a handler for each of the options. In each handler, you can call SetRadio on the CCmdUI parameter you receive. The value for SetRadio is TRUE when the current selection (obtained as shown in previous posts) matches the value that correspond to the menu entry for which you are handling the update command message.

For example:
// In the class declaration
   afx_msg void OnUpdateViewTextSize(CCmdUI* pCmdUI);

// In the message map
   ON_UPDATE_COMMAND_UI(ID_VIEW_SMALLEST, OnUpdateViewTextSize)
   ON_UPDATE_COMMAND_UI(ID_VIEW_SMALL, OnUpdateViewTextSize)
   ON_UPDATE_COMMAND_UI(ID_VIEW_MEDIUM, OnUpdateViewTextSize)
   ON_UPDATE_COMMAND_UI(ID_VIEW_LARGE, OnUpdateViewTextSize)
   ON_UPDATE_COMMAND_UI(ID_VIEW_LARGEST, OnUpdateViewTextSize)

// After the message map
long GetTextSizeFromMenuID(UINT nId)
{
   /*
   If the menu IDs are consecutive and in the
   appropriate order, you can simply do
 
   return nId - ID_VIEW_SMALLEST;
 
   Otherwise...
   */
 
   long lVal = 2;
   switch (nId)
   {
     default:
        ASSERT(FALSE);
        break;
     case ID_VIEW_SMALLEST:
        lVal = 0;
        break;
     case ID_VIEW_SMALL:
        lVal = 1;
        break;
     case ID_VIEW_MEDIUM:
        lVal = 2;
        break;
     case ID_VIEW_LARGE:
        lVal = 3;
        break;
     case ID_VIEW_LARGEST:
        lVal = 4;
        break;
   }
   return lVal;
}
 
void CYourView::OnUpdateViewTextSize(CCmdUI* pCmdUI)
{
   long lSize = GetTextSizeFromMenuID(pCmdUI->m_nID);
 
   VARIANT var;
   ExecWB(OLECMDID_ZOOM, OLECMDEXECOPT_DONTPROMPTUSER, NULL, &var);
   pCmdUI->SetRadio(var.vt == VT_I4 && var.lVal == lSize);
}



--
jlr
http://jlamas.blogspot.com/[^]
GeneralRe: Increasing/Decreasing text size of a shown html Pin
babyspidy29-Aug-05 14:12
babyspidy29-Aug-05 14:12 
QuestionMCI Commands and AVI Video files; help needed... Pin
Bryan Anslow26-Aug-05 7:16
Bryan Anslow26-Aug-05 7:16 
AnswerRe: MCI Commands and AVI Video files; help needed... Pin
Bryan Anslow26-Aug-05 12:23
Bryan Anslow26-Aug-05 12:23 
QuestionMixed language dll Pin
Kash26-Aug-05 6:20
Kash26-Aug-05 6:20 
AnswerRe: Mixed language dll Pin
David Crow26-Aug-05 6:50
David Crow26-Aug-05 6:50 
GeneralRe: Mixed language dll Pin
Tim Smith26-Aug-05 11:14
Tim Smith26-Aug-05 11:14 
QuestionCMenu selected Pin
picazo26-Aug-05 6:08
picazo26-Aug-05 6:08 
AnswerRe: CMenu selected Pin
Roger Allen26-Aug-05 6:11
Roger Allen26-Aug-05 6:11 
GeneralRe: CMenu selected Pin
picazo26-Aug-05 6:24
picazo26-Aug-05 6:24 
GeneralRe: CMenu selected Pin
Roger Allen26-Aug-05 6:51
Roger Allen26-Aug-05 6:51 
AnswerRe: CMenu selected Pin
David Crow26-Aug-05 6:11
David Crow26-Aug-05 6:11 
GeneralRe: CMenu selected Pin
picazo26-Aug-05 6:19
picazo26-Aug-05 6:19 
GeneralRe: CMenu selected Pin
David Crow26-Aug-05 6:40
David Crow26-Aug-05 6:40 
GeneralRe: CMenu selected Pin
picazo26-Aug-05 6:53
picazo26-Aug-05 6:53 
GeneralRe: CMenu selected Pin
David Crow26-Aug-05 7:01
David Crow26-Aug-05 7:01 
GeneralRe: CMenu selected Pin
Maximilien26-Aug-05 9:26
Maximilien26-Aug-05 9:26 
QuestionWS_CLIPCHILDREN causing MORE flicker?! Pin
Intangir26-Aug-05 6:07
Intangir26-Aug-05 6:07 

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.