Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - CXTPCustomControl with radio buttons
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPCustomControl with radio buttons

 Post Reply Post Reply
Author
Message
RayJ View Drop Down
Newbie
Newbie


Joined: 22 November 2004
Location: United States
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote RayJ Quote  Post ReplyReply Direct Link To This Post Topic: CXTPCustomControl with radio buttons
    Posted: 22 November 2004 at 3:21pm

I'm placing radio buttons in a custom conrol in the OnCreateControl method as follows:

if ((lpCreateControl->nID == IDC_RADIO_COORD_TRACK || lpCreateControl->nID == IDC_RADIO_COORD_LOCATE) && pToolBar->GetBarID() == IDR_TOOLBAR_COORDS){

UINT nID = lpCreateControl->nID;

CXTPControlCustom* pControlOption = (CXTPControlCustom*)CXTPControlCustom::CreateObject();

pControlOption->SetID(nID);

CButton& wndOption = m_wndCoordinateBarRadioOptions[nID-IDC_RADIO_COORD_TRACK];

if (!wndOption.Create(pControlOption->GetCaption(), WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON,
CRect(0, 0, 75, 20),
this, nID))
{
return FALSE;
}

wndOption.SetFont(CXTPPaintManager::GetRegularFont());
wndOption.SetCheck(nID == IDC_RADIO_COORD_TRACK);
pControlOption->SetControl(&wndOption);
pControlOption->SetVerticalPositionOption(xtpVerticalShow );
pControlOption->SetFlags(xtpFlagManualUpdate);

lpCreateControl->pControl = pControlOption;
return TRUE;
}

My problem is that after I exist the program and restart it and undock the toolbar I get both the buttons and the radio items showing up on the toolbar like this:

What am I doing wrong.

Thanks

Ray

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 23 November 2004 at 12:42am

from 9.10 you must use CXTPControlCustom::CreateControlCustom:

CButton& wndOption = m_wndCoordinateBarRadioOptions[nID-IDC_RADIO_COORD_TRACK];

if (!wndOption.Create(pControlOption->GetCaption(), WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON,
CRect(0, 0, 75, 20),
this, nID))
{
return FALSE;
}

CXTPControlCustom* pControlOption = CXTPControlCustom::CreateControlCustom(&m_wndOption);

 

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
RayJ View Drop Down
Newbie
Newbie


Joined: 22 November 2004
Location: United States
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote RayJ Quote  Post ReplyReply Direct Link To This Post Posted: 23 November 2004 at 9:20am

So I must have the latest version for this to work?

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 23 November 2004 at 11:39pm
if you haven't CreateControlCustom method then "yes".
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.