Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - SplitButtonPopup enabling & disabling
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

SplitButtonPopup enabling & disabling

 Post Reply Post Reply
Author
Message
mrmathis View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 May 2007
Location: United States
Status: Offline
Points: 105
Post Options Post Options   Thanks (0) Thanks(0)   Quote mrmathis Quote  Post ReplyReply Direct Link To This Post Topic: SplitButtonPopup enabling & disabling
    Posted: 16 October 2008 at 5:18pm
I have several xtpControlSplitButtonPopup controls on my ribbon bar.  It seems that the enabled state of the droplist half of the control (the little down-arrow) is tied to the enabled state of the button half of the control.  I would like to separate this linkage, since I have cases in which the command tied to the button is disabled, but one or more of the commands on the droplist are valid/enabled.  In those cases, my users can't get to the enabled commands, since the entire control is disabled and the list won't drop.  Is there any way to get around this?
--Mike
Back to Top
mrmathis View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 May 2007
Location: United States
Status: Offline
Points: 105
Post Options Post Options   Thanks (0) Thanks(0)   Quote mrmathis Quote  Post ReplyReply Direct Link To This Post Posted: 16 October 2008 at 5:21pm
Whoops, hit Post too quickly.  What I would like to see would be the droplist control disabled only if all the commands on it are disabled, independent of whether the button half of the control is enabled or disabled.  Is that possible?
--Mike
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: 17 October 2008 at 2:40am
Hi,
Here non documented workaround :)
 
void CRibbonSampleView::OnUpdateCharUnderline(CCmdUI* pCmdUI)
{
 pCmdUI->m_bEnableChanged = 1;
 CXTPControl* pControl = CXTPControl::FromUI(pCmdUI);
 if (pControl && pControl->GetType() == xtpControlSplitButtonPopup)
 {
  pControl->SetEnabled(TRUE_SPLITDROPDOWN);
 }
}
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
mrmathis View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 May 2007
Location: United States
Status: Offline
Points: 105
Post Options Post Options   Thanks (0) Thanks(0)   Quote mrmathis Quote  Post ReplyReply Direct Link To This Post Posted: 08 January 2009 at 6:04pm
Maybe it was implied, but I didn't catch that and had to add this to get exactly what I wanted:
 
{
    BOOL bDisableButton = (...my code...) ? TRUE : FALSE;
    pControl->SetEnabled(bDisableButton ? TRUE_SPLITDROPDOWN : TRUE);
}

Without the bDisableButton check, my button was always disabled.  Sorry if I was dense, but thanks for putting me on the right track.
 
 
--Mike
Back to Top
luizturmina View Drop Down
Newbie
Newbie
Avatar

Joined: 05 March 2009
Location: Brazil
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote luizturmina Quote  Post ReplyReply Direct Link To This Post Posted: 05 March 2009 at 2:40pm
i have the same problem, but i work in VB6.
Any help?
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.063 seconds.