cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
Developer forum

Dialog Manager: Set the tooltip string to a custom value? (DGSetItemTooltipString)

Sam Karli
Enthusiast

As I see, for Dialog Manager, the tooltip string for any dialog element seems to be readonly, there is no DGSetItemTooltipString. (While, interestingly, in the GDL world, it's a widely used commonplace to manipulate a GDL object's UI element's tooltip to any custom value.)

 

Isn't there a way to set a tooltip for a custom (non GRC-defined) string?

GDL/Python/C++ dev
2 REPLIES 2

Oleg
Advocate

See 
ItemObserver::ItemToolTipRequested (const ItemHelpEvent& ev, GS::UniString* toolTipText);
Or

PanelObserver::PanelToolTipRequested (const PanelHelpEvent& ev, GS::UniString* toolTipText);

 

Like this

 

class TabSettingLabelMain 
: private DG::UserItemObserver
{
private:

virtual void ItemToolTipRequested (const DG::ItemHelpEvent& ev, GS::UniString* toolTipText);

private:
DG::UserItem mi_image_preview;
};



TabSettingLabelMain::TabSettingLabelMain( )
: mi_image_preview( GetReference(), IMAGE_PREVIEW )
{
	mi_image_preview.Attach(*this);
}

void TabSettingLabelMain::ItemToolTipRequested(const DG::ItemHelpEvent& ev, GS::UniString* toolTipText)
{
	if ( ev.GetSource() == &mi_image_preview )
	{
		*toolTipText = str::CvtUni( m_block->image_path );
	}
}

 

Cool, thanks, I'll give it a check today or tomorrow.

GDL/Python/C++ dev

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!