Can someone help with GetNextDlgTabItem??

Can someone help with GetNextDlgTabItem??

Post by T. Daniel Liebst » Sat, 15 Mar 1997 04:00:00



I have a dialog box with twelve radio buttons that are grouped in
pairs.  The radio buttons are the first 12 tab stops in the dialog.
The OK and CANCEL buttons are the 13th and 14th tab stops, and the
static group box that surrounds the radio buttons is the 15th stop.

I have set the first radio button to have the WS_GROUP style and also
the 3rd radio button, the 5th, etc. so that the buttons behave in
pairs.  I am trying to set the font of the radio buttons with the
following code.  What happens is that only the font of the first radio
button and then the OK and CANCEL buttons get set to the new font.  

I created a member variable for the first radio button (m_ctrlradio1)
so that I could easily get a pointer to it. Any suggestions?  Here is
the code:
-------------------------------------------------
BOOL CComponentsDlg::OnInitDialog()
{
        CDialog::OnInitDialog();
        CDC* pDC = GetDC();
        m_Font.CreateFont( blah blah blah ); // all of the parameters
                                        // in my real code are set
                                        // correctly for a 12 point

                                        // "Symbol" font.

        // note that m_font is a class member of type CFont that lives

        // for the entire life of the dialog    
        // Set the font of all the radio button labels to "symbol"

        CWnd* pWnd &m_ctrlradio1;
        for (int i = 0; i < 12; i++)
        {
                pWnd->SetFont(&m_Font);
                pWnd = GetNextDlgTabItem(pWnd);
        }

Quote:}

----------------------------
I managed to set the font of the first two radio buttons by using the
GetNextDlgGroupItem, but nothing I do seems to want to get past the
first pair of radio buttons.

Dan Liebster

 
 
 

Can someone help with GetNextDlgTabItem??

Post by Rail J. Rogu » Sat, 22 Mar 1997 04:00:00



> I have a dialog box with twelve radio buttons that are grouped in
> pairs.  The radio buttons are the first 12 tab stops in the dialog.
> The OK and CANCEL buttons are the 13th and 14th tab stops, and the
> static group box that surrounds the radio buttons is the 15th stop.

> I have set the first radio button to have the WS_GROUP style and also
> the 3rd radio button, the 5th, etc. so that the buttons behave in
> pairs.  I am trying to set the font of the radio buttons with the
> following code.  What happens is that only the font of the first radio
> button and then the OK and CANCEL buttons get set to the new font.

> I created a member variable for the first radio button (m_ctrlradio1)
> so that I could easily get a pointer to it. Any suggestions?  Here is
> the code:
> -------------------------------------------------
> BOOL CComponentsDlg::OnInitDialog()
> {
>         CDialog::OnInitDialog();
>         CDC* pDC = GetDC();
>         m_Font.CreateFont( blah blah blah ); // all of the parameters
>                                         // in my real code are set
>                                         // correctly for a 12 point

>                                         // "Symbol" font.

>         // note that m_font is a class member of type CFont that lives

>         // for the entire life of the dialog
>         // Set the font of all the radio button labels to "symbol"

>         CWnd* pWnd &m_ctrlradio1;
>         for (int i = 0; i < 12; i++)
>         {
>                 pWnd->SetFont(&m_Font);
>                 pWnd = GetNextDlgTabItem(pWnd);
>         }
> }
> ----------------------------
> I managed to set the font of the first two radio buttons by using the
> GetNextDlgGroupItem, but nothing I do seems to want to get past the
> first pair of radio buttons.

> Dan Liebster


Instead of creating a member variable for the 1st radio button use
GetDlgItem and do something like this:

// Need to enable all the track check boxes:

CButton *pButton;

for (int i=0; i < m_iNoTracks; i++)
        {
        pButton = (CButton*)GetDlgItem(IDC_TRACK1 + i);

        pButton->EnableWindow();
        }

Just ensure that all the resource IDs are incremental.

        Rail
        Oceanway Recording


 
 
 

1. Need help with GetNextDlgTabItem()

I have a dialog box with twelve radio buttons that are grouped in
pairs.  The radio buttons are the first 12 tab stops in the dialog.
The OK and CANCEL buttons are the 13th and 14th tab stops, and the
static group box that surrounds the radio buttons is the 15th stop.

I have set the first radio button to have the WS_GROUP style and also
the 3rd radio button, the 5th, etc. so that the buttons behave in
pairs.  I tried to set the font of the radio buttons with the
following code (as well as variations).  It only sets the first radio
button and then the OK and CANCEL buttons to have the "Symbol" font.  

I created a member variable for the first radio button so that I could
easily get a pointer to it.  I then wanted to step through the next
bunch of controls to set them.  I suppose that I could use the brute
force approach and make member variables for all of the radio button
controls, but that seems to lack elegance.  Any suggestions?  Here is
the code.

BOOL CComponentsDlg::OnInitDialog()
{
        CDialog::OnInitDialog();
        CDC* pDC = GetDC();
        m_Font.CreateFont( blah blah blah ); // all of the parameters
                                        // in my real code are set
                                        // correctly for a 12 point

                                        // "Symbol" font.

        // note that m_font is a class member of type CFont that lives

        // for the entire life of the dialog, as it should.    

        // Set the font of all the radio button labels to "symbol"

        CWnd* pStartPoint = &m_ctrlradio1;
        for (int i = 0; i < 12; i++)
        {
                pStartPoint->SetFont(&m_Font);
                pStartPoint = GetNextDlgTabItem(pStartPoint);
        }

2. spell check

3. Canned emails

4. report spam button in Outlook

5. cans shut down only restart

6. Make copy of DVD movie?

7. MS Replies to mt Intellipoint 5.0 request - not a canned reply!!!

8. IE6 always on top?

9. ASP email program - canned

10. Canned Air Cleaner

11. Data entry w/ canned comments

12. Help...Could someone help me

13. Windows Media Player Error, Can someone help?