本文整理汇总了C++中vgui::DHANDLE::SetMultiline方法的典型用法代码示例。如果您正苦于以下问题:C++ DHANDLE::SetMultiline方法的具体用法?C++ DHANDLE::SetMultiline怎么用?C++ DHANDLE::SetMultiline使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vgui::DHANDLE
的用法示例。
在下文中一共展示了DHANDLE::SetMultiline方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TextEntry
//-----------------------------------------------------------------------------
// Purpose: Constructor
//-----------------------------------------------------------------------------
Tooltip::Tooltip(Panel *parent, const char *text)
{
if (!s_TooltipWindow.Get())
{
s_TooltipWindow = new TextEntry(NULL, "tooltip");
}
s_iTooltipWindowCount++;
// this line prevents the main window from losing focus
// when a tooltip pops up
s_TooltipWindow->MakePopup(false, true);
s_TooltipWindow->SetKeyBoardInputEnabled( false );
s_TooltipWindow->SetMouseInputEnabled( false );
SetText(text);
s_TooltipWindow->SetText(m_Text.Base());
s_TooltipWindow->SetEditable(false);
s_TooltipWindow->SetMultiline(true);
s_TooltipWindow->SetVisible(false);
_displayOnOneLine = false;
_makeVisible = false;
_isDirty = false;
_tooltipDelay = 500; // default delay for opening tooltips
_delay = 0;
}
示例2: BaseTooltip
//-----------------------------------------------------------------------------
// Purpose: Constructor
//-----------------------------------------------------------------------------
TextTooltip::TextTooltip(Panel *parent, const char *text) : BaseTooltip( parent, text )
{
if (!s_TooltipWindow.Get())
{
s_TooltipWindow = new TextEntry(NULL, "tooltip");
s_TooltipWindow->InvalidateLayout(false, true);
// this bit of hackery is necessary because tooltips don't get ApplySchemeSettings called from their parents
IScheme *pScheme = scheme()->GetIScheme( s_TooltipWindow->GetScheme() );
s_TooltipWindow->SetBgColor(s_TooltipWindow->GetSchemeColor("Tooltip.BgColor", s_TooltipWindow->GetBgColor(), pScheme));
s_TooltipWindow->SetFgColor(s_TooltipWindow->GetSchemeColor("Tooltip.TextColor", s_TooltipWindow->GetFgColor(), pScheme));
s_TooltipWindow->SetBorder(pScheme->GetBorder("ToolTipBorder"));
s_TooltipWindow->SetFont( pScheme->GetFont("DefaultSmall", s_TooltipWindow->IsProportional()));
}
s_iTooltipWindowCount++;
// this line prevents the main window from losing focus
// when a tooltip pops up
s_TooltipWindow->MakePopup(false, true);
s_TooltipWindow->SetKeyBoardInputEnabled( false );
s_TooltipWindow->SetMouseInputEnabled( false );
SetText(text);
s_TooltipWindow->SetText(m_Text.Base());
s_TooltipWindow->SetEditable(false);
s_TooltipWindow->SetMultiline(true);
s_TooltipWindow->SetVisible(false);
}
示例3: SizeTextWindow
//-----------------------------------------------------------------------------
// Purpose: Size the text window so all the text fits inside it.
//-----------------------------------------------------------------------------
void Tooltip::SizeTextWindow()
{
if ( !s_TooltipWindow.Get() )
return;
if (_displayOnOneLine)
{
// We want the tool tip to be one line
s_TooltipWindow->SetMultiline(false);
s_TooltipWindow->SetToFullWidth();
}
else
{
// We want the tool tip to be one line
s_TooltipWindow->SetMultiline(false);
s_TooltipWindow->SetToFullWidth();
int wide, tall;
s_TooltipWindow->GetSize( wide, tall );
double newWide = sqrt( (2.0/1) * wide * tall );
double newTall = (1/2) * newWide;
s_TooltipWindow->SetMultiline(true);
s_TooltipWindow->SetSize((int)newWide, (int)newTall );
s_TooltipWindow->SetToFullHeight();
s_TooltipWindow->GetSize( wide, tall );
if (( wide < 100 ) && ( s_TooltipWindow->GetNumLines() == 2) )
{
s_TooltipWindow->SetMultiline(false);
s_TooltipWindow->SetToFullWidth();
}
else
{
while ( (float)wide/(float)tall < 2 )
{
s_TooltipWindow->SetSize( wide + 1, tall );
s_TooltipWindow->SetToFullHeight();
s_TooltipWindow->GetSize( wide, tall );
}
}
s_TooltipWindow->GetSize( wide, tall );
// ivgui()->DPrintf("End Ratio: %f\n", (float)wide/(float)tall);
}
}