Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Icon Disabled Issue
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Icon Disabled Issue

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


Joined: 02 May 2024
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmessdev Quote  Post ReplyReply Direct Link To This Post Topic: Icon Disabled Issue
    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
Back to Top
agontarenko View Drop Down
Admin Group
Admin Group


Joined: 25 March 2016
Status: Offline
Points: 270
Post Options Post Options   Thanks (0) Thanks(0)   Quote agontarenko Quote  Post ReplyReply Direct Link To This Post 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



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.094 seconds.