Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Get the pointer to ComboBox from cmd Bar?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Get the pointer to ComboBox from cmd Bar?

 Post Reply Post Reply
Author
Message
mikexyz View Drop Down
Newbie
Newbie
Avatar

Joined: 03 May 2005
Location: United States
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote mikexyz Quote  Post ReplyReply Direct Link To This Post Topic: Get the pointer to ComboBox from cmd Bar?
    Posted: 18 May 2005 at 2:17pm
Hello:

I create command bar that have combo box control.  The combo box automatically update the selection when user select a particular drawing shape.

How do write a simple codes to access to CommandBar--> Combox Box control pointer?

In the bottom example, I would like to access to the pointer of pComboFontName from other class.

---------------- SAMPLE CREATE COMBO BOX CONTROL FOR COMMANDBARS ----------

int CMainFrame::OnCreateControl(LPCREATECONTROLSTRUCT lpCreateControl)
{
    if (lpCreateControl->bToolBar == FALSE)
    {
       
    }
    else
    {
        CXTPToolBar* pToolBar = DYNAMIC_DOWNCAST(CXTPToolBar, lpCreateControl->pCommandBar);
        if (!pToolBar)
        {
            return FALSE;
        }

        //--------------------- Create Font Face Name -------------------------
        if (lpCreateControl->nID == ID_FONT_FACENAME && pToolBar->GetBarID() == IDR_EASY_FONT_BAR)
        {           
            CXTPControlFontComboBox *pComboFontName = new CXTPControlFontComboBox();
            pComboFontName->SetDropDownListStyle();
            lpCreateControl->pControl = pComboFontName;
            return TRUE;
        }       
        //---------------------------------------------------------- ------------

    return FALSE;
}
Back to Top
mikexyz View Drop Down
Newbie
Newbie
Avatar

Joined: 03 May 2005
Location: United States
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote mikexyz Quote  Post ReplyReply Direct Link To This Post Posted: 18 May 2005 at 2:22pm
In this case, I would like to access from the CView class, where void CEasyFlowChartView::UpdateCells() function is called.

Mike
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


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: 19 May 2005 at 5:35am

I recommend you update it in UpdateHandler, use:

CXTPControl::FromUI(pCmdUI)

 

see

void CWordPadView::OnUpdateComboFont(CCmdUI* pCmd)

 

in GUI_Office11  sample.

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

Joined: 03 May 2005
Location: United States
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote mikexyz Quote  Post ReplyReply Direct Link To This Post Posted: 19 May 2005 at 10:11am
Oleg,

Thank you. I am looking into GUI_Office11 sample.

Mike
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.062 seconds.