![]() |
SplitButtonPopup enabling & disabling |
Post Reply ![]() |
Author | |
mrmathis ![]() Senior Member ![]() ![]() Joined: 17 May 2007 Location: United States Status: Offline Points: 105 |
![]() ![]() ![]() ![]() ![]() 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
|
|
![]() |
|
mrmathis ![]() Senior Member ![]() ![]() Joined: 17 May 2007 Location: United States Status: Offline Points: 105 |
![]() ![]() ![]() ![]() ![]() |
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
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
mrmathis ![]() Senior Member ![]() ![]() Joined: 17 May 2007 Location: United States Status: Offline Points: 105 |
![]() ![]() ![]() ![]() ![]() |
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
|
|
![]() |
|
luizturmina ![]() Newbie ![]() ![]() Joined: 05 March 2009 Location: Brazil Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() |
i have the same problem, but i work in VB6.
Any help? |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |