Print Page | Close Window

Winwords Help Toolbar

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=1029
Printed Date: 06 March 2025 at 7:50am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Winwords Help Toolbar
Posted By: developer
Subject: Winwords Help Toolbar
Date Posted: 05 August 2004 at 4:43pm
Is there a way to place a Btn or Ctrl on the right of a toolbar, similar to the Winwords Help ComboBox? Thanks



Replies:
Posted By: SuperMario
Date Posted: 06 August 2004 at 7:07am
I modified the GUI_OneNote sample to illustrate how to do this.

Add an popup menu item to the end of the IDR_MAINFRAME toolbar and give it a caption of "helpcombo".

Then place this code in OnCreateControl:

    if (lpCreateControl->pMenu)
    {

        if (lpCreateControl->strCaption == "helpcombo")
        {
            CXTPControlComboBox* pComboSize = new CXTPControlSizeComboBox();
            pComboSize->SetDropDownListStyle();
            pComboSize->SetFlags(xtpFlagMan ualUpdate|xtpFlagRightAlign|xtpFlagNoMovable);
            pComboSize->SetWidth(150);

            lpCreateControl->pControl = pComboSize;
            return TRUE;
        }
            
    }


Posted By: developer
Date Posted: 06 August 2004 at 10:45am
I am doing this inside of a dialog. It seemed to work at first but in my OnSize Event I have this code:


if (m_wndToolBar.GetSafeHwnd())
{
    sz = m_wndToolBar.CalcDockingLayout(cx, /*LM_HIDEWRAP|*/ LM_HORZDOCK|LM_HORZ | LM_COMMIT);
    m_wndToolBar.MoveWindow(0, 0, cx, sz.cy);
    m_wndToolBar.Invalidate(FALSE);
}


As soon as the OnSize code is called, the Toolbar button moves back to its normal position. Here is the code I have in the OnCreateControl


if (lpCreateControl->nID == ID_MY_BTN)
    {
      CXTPControlButton* pFilter = (CXTPControlButton*)CXTPControlButton::CreateObject();
           pFilter->SetFlags(xtpFlagManualUpdate|xtpFlagRightAlign|x tpFlagNoMovable);
      pFilter->SetStyle(xtp ButtonIconAndCaption);
      lpCreateControl->pCon trol = pFilter;
      return TRUE;
    }


What else am I missing? I also have another post about Modeless Dlgs and KickIdle Messages. Can you check that out also. Thanks.



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