Stefan Bender Posted March 23, 2022 Share Posted March 23, 2022 Dear developers, in one of our PIOs I will need to disable/dim several pull-down menu entries in an OIP widget. The widget is created automatically (it represents a kFieldPopUp field of the PIO record). I don't want to disable the entire widget, just some of the pull-down menu entries depending on the PIO's setings. Does anybody have an idea? Thanks for any help. Stefan Bender Quote Link to comment
Maarten DE Posted March 24, 2022 Share Posted March 24, 2022 Hi Stefan I'm not sure it will work in your case because we create our widget via: void IProviderShapePane::Init(CodeRefID objectID, IExtendedProps* extProps) { IWidgetsEditProvider* widgetsProvider = NULL; if ( extProps && VCOM_SUCCEEDED( extProps->GetObjComponentTypeWidgets( objectID, kObjectRootComponentTypeID, widgetsProvider ) ) ) { widgetsProvider->AddWidget( kWidgetID_SizeType, .... not automatically via a kFieldPopUp. But this is how we fill the pull down dynamicly: void IProviderShapePane::Update( IWidgetsProvider* widgetProvider ) { SWidgetDefinition* pSizeTypePU = widgetsProvider->GetWidgetByID( kWidgetID_SizeType); IWidgetDataPopup* pPopupData = dynamic_cast<IWidgetDataPopup*>(pSizeTypePU->fpWidgetData); pPopupData->Clear(); std::vector<TXString> listOptions = this->GetListOptions(); for ( size_t i = 0; i < list_sets.size(); i++ ) pDataSetPU->Add( TXString::ToStringInt( i + 1 ), listOptions[i] ); } Off course, this is not dimming or disabling, but it might work too for you? Quote Link to comment
JBenghiat Posted March 24, 2022 Share Posted March 24, 2022 I did some quick experimenting to see if doing something like placing an underscore in front of the display name would lock the choice the way it does with a parameter, and don't see any difference. I thin this would be a worthy enhancement. I recently had a user confused why a pull-down item disabled other widgets. In theory, the pull-down item itself should have been disabled. Quote Link to comment
Stefan Bender Posted March 24, 2022 Author Share Posted March 24, 2022 Thanks for the replies! But recreating the entire widget does not seem to be a reasonable solution. There really needs to be an SDK call or member function of the widget for that. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.