Print Page | Close Window

SplitButtonPopup enabling & disabling

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=12462
Printed Date: 28 February 2025 at 8:19am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: SplitButtonPopup enabling & disabling
Posted By: mrmathis
Subject: SplitButtonPopup enabling & disabling
Date 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



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


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


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


Posted By: luizturmina
Date Posted: 05 March 2009 at 2:40pm
i have the same problem, but i work in VB6.
Any help?



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