Jump to content
Developer Wiki and Function Reference Links ×

How to disable pull-down menu entries in OIP widgets?


Stefan Bender

Recommended Posts

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

Link to comment

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?

 

Link to comment

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.

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...