Print Page | Close Window

Icon Disabled Issue

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=24473
Printed Date: 16 September 2024 at 3:45pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Icon Disabled Issue
Posted By: pmessdev
Subject: Icon Disabled Issue
Date Posted: 02 May 2024 at 1:36pm
Hi,

I'm encountering some issues trying to disable buttons in the ribbon. 
The result I'm getting is that the text beneath the icon appears to be disabled, 
but the icon itself doesn't gray out. We also tried using a disabled icon, but it didn't work.

Additionally, we tried with the two simplified functions below.

With the first one, we get the aforementioned result, while with the call below, 
the same thing happens, but additionally, when hovering over it, the highlight color flickers.


void AClass::DisableButton(CCmdUI* pCmdUI)
{
pCmdUI->Enable(FALSE);
}


void AClass::DisableButton(CCmdUI* pCmdUI)
{
CXTPControl* pControl = CXTPControl::FromUI(pCmdUI);
pControl->SetEnabled(FALSE);
}

Thanks in advance for your help!

PM



Replies:
Posted By: agontarenko
Date Posted: 16 May 2024 at 5:37am
Hello,

Unfortunately it is not clear what exactly is going wrong. Can you please provide more detailed information.
If it cannot be re-produced in any of our sample applications provided
I would appreciate you sending a sample application so that we could debug it.

I've tested our RibbonSample and any problems not found.

I changed RibbonSampleView.h and RibbonSampleView.cpp files with next code:

RibbonSampleView.h
    void OnSimpleButtonCommand();
    void OnUpdateSimpleButton(CCmdUI* pCmdUI);

RibbonSampleView.cpp
replace
    ON_COMMAND_RANGE(ID_BUTTONS_LARGE_SIMPLEBUTTON, ID_BUTTONS_LARGE_SPLITPOPUPBUTTON, OnEmptyCommand)
with
    ON_COMMAND_RANGE(ID_BUTTONS_LARGE_POPUPBUTTON, ID_BUTTONS_LARGE_SPLITPOPUPBUTTON, OnEmptyCommand)

add this lines:
    ON_UPDATE_COMMAND_UI(ID_BUTTONS_LARGE_SIMPLEBUTTON, OnUpdateSimpleButton)

void CRibbonSampleView::OnUpdateSimpleButton(CCmdUI* pCmdUI)
{
    pCmdUI->Enable(m_bToggleButton);
}

And result I attach in screenshot.

Regards,
Artem Gontarenko






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