Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Winwords Help Toolbar
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Winwords Help Toolbar

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


Joined: 05 August 2004
Status: Offline
Points: 26
Post Options Post Options   Thanks (0) Thanks(0)   Quote developer Quote  Post ReplyReply Direct Link To This Post Topic: Winwords Help Toolbar
    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
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post 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;
        }
            
    }
Back to Top
developer View Drop Down
Newbie
Newbie


Joined: 05 August 2004
Status: Offline
Points: 26
Post Options Post Options   Thanks (0) Thanks(0)   Quote developer Quote  Post ReplyReply Direct Link To This Post 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.
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.156 seconds.