Archicad C++ API
About Archicad add-on development using the C++ API.

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
Expert

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

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!