Print Page | Close Window

Get the pointer to ComboBox from cmd Bar?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=2251
Printed Date: 08 November 2025 at 9:49pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Get the pointer to ComboBox from cmd Bar?
Posted By: mikexyz
Subject: Get the pointer to ComboBox from cmd Bar?
Date 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;
}



Replies:
Posted By: mikexyz
Date 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


Posted By: Oleg
Date 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


Posted By: mikexyz
Date Posted: 19 May 2005 at 10:11am
Oleg,

Thank you. I am looking into GUI_Office11 sample.

Mike



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net