本文整理汇总了C++中SetToolTip函数的典型用法代码示例。如果您正苦于以下问题:C++ SetToolTip函数的具体用法?C++ SetToolTip怎么用?C++ SetToolTip使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetToolTip函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetToolTip
BOOL RcuEditDrillSiteDlg::OnInitDialog()
{
RcuAcUiBaseDlg::OnInitDialog();
m_locaCombBox.AddString(_T("左帮"));
m_locaCombBox.AddString(_T("右帮"));
m_locaCombBox.AddString(_T("迎头"));
SetToolTip(IDC_DRILL_WIDTH_EDIT,_T("单位:m"));
SetToolTip(IDC_DRILL_HEIGHT_EDIT,_T("单位:m"));
SetToolTip(IDC_DRILL_DIS_EDIT,_T("单位:m"));
if(m_drill_site.isNull())
{
SetDlgItemText(IDOK, _T("新设计钻场"));
m_locaCombBox.SetCurSel(0);
}
else
{
SetDlgItemText(IDOK, _T("更新钻场参数"));
m_locaCombBox.SetCurSel(m_pos);
}
//更新数据到界面
UpdateData(FALSE);
return TRUE;
}
示例2: ideal
bool nuiLabel::SetRect(const nuiRect& rRect)
{
bool needRecalcLayout = false;
if (mUseEllipsis || mWrapping)
needRecalcLayout = (rRect.GetWidth() != mRect.GetWidth());
nuiWidget::SetRect(rRect);
nuiRect ideal(mIdealLayoutRect);
if (needRecalcLayout || ideal.GetWidth() > mRect.GetWidth())
{
if (mUseEllipsis)
{
CalcLayout();
nuiSize diff = ideal.GetWidth() - mRect.GetWidth();
int NbLetterToRemove = ToNearest(diff / (ideal.GetWidth() / mText.GetLength())) + 3;
nglString text = mText;
if (NbLetterToRemove > 0)
{
int len = text.GetLength();
text.DeleteRight(MIN(NbLetterToRemove, len));
text.Append(_T("..."));
}
delete mpLayout;
mpLayout = new nuiTextLayout(mpFont);
mpLayout->SetWrapX(0);
mpLayout->Layout(text);
GetLayoutRect();
}
else if (mWrapping)
{
CalcLayout();
delete mpLayout;
mpLayout = new nuiTextLayout(mpFont);
delete mpIdealLayout;
mpIdealLayout = new nuiTextLayout(mpFont);
mpLayout->SetWrapX(mRect.GetWidth() - mBorderLeft - mBorderRight);
mpIdealLayout->SetWrapX(mRect.GetWidth() - mBorderLeft - mBorderRight);
mpLayout->Layout(mText);
mpIdealLayout->Layout(mText);
GetLayoutRect();
}
SetToolTip(mText);
}
else
{
if (GetToolTip() == mText)
SetToolTip(nglString::Empty);
}
return true;
}
示例3: SetToolTip
void wxCustomStatusBar::OnMouseMotion(wxMouseEvent& event)
{
event.Skip();
SetToolTip(wxEmptyString);
wxPoint point = event.GetPosition();
for(size_t i = 0; i < m_fields.size(); ++i) {
if(m_fields.at(i)->HitTest(point)) {
SetToolTip(m_fields.at(i)->GetTooltip());
return;
}
}
SetToolTip(m_text);
}
示例4: SetModal
void LoadSave::Init(int command, gedString title, gedString confirmButtonText)
{
SetModal();
this->command = command;
Text *text;
Button *button;
int y;
text = AddText(title, CENTER_TEXT, 5);
y = DrawHLine(text->Down() + 2);
if(command == SAVE_DIALOG)
{
SetToolTip(TIP_SAVE);
text = AddText("File: ", 10, y);
name = AddEditBox(text->Right(), text->Top(), 200);
dir = AddListDirectory(name->Right() + 2, y, 80, 0, 0, "select"); dir->SetToolTip(TIP_SAVE_FILE);
dir->SetSave();
y = name->Down();
}
else if(command == LOAD_DIALOG)
{
SetToolTip(TIP_LOAD);
text = AddText("File: ", 40, y);
dir = AddListDirectory(text->Right(), y, 200, 0, 0); dir->SetToolTip(TIP_LOAD_FILE);
y = dir->Down();
}
else if(command == MERGE_DIALOG)
{
SetToolTip(TIP_MERGE);
text = AddText("File: ", 40, y);
dir = AddListDirectory(text->Right(), y, 200, 0, 0); dir->SetToolTip(TIP_MERGE_FILE);
y = dir->Down();
command = LOAD_DIALOG;
}
//Close
y = DrawHLine(Height() - 40);
button = AddButton(confirmButtonText, (WIDTH-135)/2, y, 0, 0, LOADSAVE_OK); SetConfirmButton(button);
button = AddButton("Cancel", button->Right()+8, y, 0, 0, LOADSAVE_CLOSE); SetCancelButton(button);
chdir(GameControl::Get()->getGamePath().c_str());
}
示例5: SetTooltipText
void FWwiseEventDragDropOp::SetCanDrop(bool InCanDrop)
{
CanDrop = InCanDrop;
SetTooltipText();
if( InCanDrop )
{
MouseCursor = EMouseCursor::GrabHandClosed;
SetToolTip(GetTooltipText(), NULL);
}
else
{
MouseCursor = EMouseCursor::SlashedCircle;
SetToolTip(GetTooltipText(), FEditorStyle::GetBrush(TEXT("Graph.ConnectorFeedback.Error")));
}
}
示例6: GetAbsX
DWORD CMiniMapDlg::ActionEvent( CMouse* mouseInfo )
{
DWORD we = cDialog::ActionEvent( mouseInfo );
if( ! m_bActive )
{
return we;
}
if( we & WE_MOUSEOVER )
{
cImageRect& rect = m_MiniMap.mRect;
char text[128] = {0,};
VECTOR2 trans;
trans.x = GetAbsX() + m_MiniMap.mTranslation.x - rect.left;
trans.y = GetAbsY() + m_MiniMap.mTranslation.y - rect.top;
m_IconTable.SetPositionHead();
for(CMiniMapIcon* pIcon = m_IconTable.GetData();
0 < pIcon;
pIcon = m_IconTable.GetData())
{
int sort = pIcon->GetToolTip(mouseInfo->GetMouseX(),mouseInfo->GetMouseY(),&trans,text);
if(sort == 1) // Npc
{
SetToolTip( text, RGB_HALF( 255, 255, 0 ), &m_TooltipImage, RGB_HALF( 0, 0, 0 ) );
}
else if(sort == 2) // Party
{
SetToolTip( text, RGB_HALF(185, 241, 69), &m_TooltipImage, RGB_HALF( 0, 0, 0 ) );
}
else if(sort == 3) // Farm
{
SetToolTip( text, RGB_HALF( 255, 255, 0 ), &m_TooltipImage, RGB_HALF( 0, 0, 0 ) );
}
}
if( ! strlen( text ) )
{
SetToolTip("");
}
}
return we;
}
示例7: wxToolTip
void wxTabbedCtrl::Create(wxWindow *parent, wxWindowID id,
const wxPoint &position, const wxSize &size,
long style, const wxString &name) {
wxWindow::Create(parent, id, position, size, wxNO_BORDER, name);
active = -1;
img_list = 0;
tipTab = -1;
this->style = style;
padding.x = 5;
padding.y = 3;
hover = false;
hover_next = false;
hover_prev = false;
hover_menu = false;
m_intStartPage = 0;
m_intLastPage = 0;
wxToolTip * tooltip = new wxToolTip( "" );
tooltip->Enable( true );
tooltip->SetDelay( 100 );
SetToolTip( tooltip );
wxFont normal_font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
wxFont bold_font = normal_font;
bold_font.SetWeight(wxFONTWEIGHT_BOLD);
wxPaintDC dc(this);
int height = 22, pom = 0;
dc.SetFont(bold_font);
dc.GetTextExtent("Aq", &pom, &height);
SetSizeHints( wxSize(-1, height+padding.y*3) );
}
示例8: Panel
VariableEditor::VariableEditor(ExpressionEditor *_editor, ScriptGlobals *_globals)
: Panel("VariableEditor", (GameControl::Get()->Width() - WIDTH)/2,
(GameControl::Get()->Height() - HEIGHT)/2,
WIDTH, HEIGHT)
{
SetModal();
SetToolTip(TIP_VARIABLEEDITOR);
editor = _editor;
globals = _globals;
Text *text;
Button *button;
int y;
//Title
text = AddText("User Variables", CENTER_TEXT, 5);
y = DrawHLine(text->Down() + 2);
//Body
text = AddText("Variables: ", 10, y);
listVars = AddListPop(text->Right() + 2, text->Top(), 300); listVars->SetToolTip(TIP_VARIABLEEDITOR_VARIABLES);
button = AddButton("Add", listVars->Left(), listVars->Down() + 2, 0, 0, BT_ADD); button->SetToolTip(TIP_VARIABLEEDITOR_ADD);
button = AddButton("Edit", button->Right(), button->Top(), 0, 0, BT_EDIT); button->SetToolTip(TIP_VARIABLEEDITOR_EDIT);
button = AddButton("Remove", button->Right(), button->Top(), 0, 0, BT_REMOVE); button->SetToolTip(TIP_VARIABLEEDITOR_REMOVE);
//Close
y = DrawHLine(button->Down() + 4);
button = AddButton("Close", (WIDTH - 60)/2, y, 0, 0, BT_CLOSE);
UpdateVars();
}
示例9: wxControl
SToolBarButton::SToolBarButton(wxWindow* parent, string action, string icon)
: wxControl(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxDefaultValidator, "stbutton")
{
// Init variables
this->action = theApp->getAction(action);
this->state = STATE_NORMAL;
// Set size
int size = 22;
SetSizeHints(size, size, size, size);
SetMinSize(wxSize(size, size));
SetSize(size, size);
// Load icon
if (icon.IsEmpty())
this->icon = getIcon(this->action->getIconName());
else
this->icon = getIcon(icon);
// Set tooltip
string tip = this->action->getText();
tip.Replace("&", "");
SetToolTip(tip);
// Bind events
Bind(wxEVT_PAINT, &SToolBarButton::onPaint, this);
Bind(wxEVT_ENTER_WINDOW, &SToolBarButton::onMouseEvent, this);
Bind(wxEVT_LEAVE_WINDOW, &SToolBarButton::onMouseEvent, this);
Bind(wxEVT_LEFT_DOWN, &SToolBarButton::onMouseEvent, this);
Bind(wxEVT_LEFT_UP, &SToolBarButton::onMouseEvent, this);
Bind(wxEVT_KILL_FOCUS, &SToolBarButton::onFocus, this);
Bind(wxEVT_LEFT_DCLICK, &SToolBarButton::onMouseEvent, this);
Bind(wxEVT_ERASE_BACKGROUND, &SToolBarButton::onEraseBackground, this);
}
示例10: BPictureButton
HSPictureButton::HSPictureButton(BRect frame, BBitmap* off, BBitmap* on,
BMessage* message, const char* helpMessage, const char* longHelpMessage,
uint32 behavior, uint32 mode, uint32 flags)
: BPictureButton(frame, "?", NULL, NULL, message, behavior, mode, flags)
, fLongHelpMessage(longHelpMessage)
{
if (helpMessage)
SetToolTip(helpMessage);
BRect rect(0, 0, 0, 0);
BBitmap* offScreen = new BBitmap(rect, B_RGB_32_BIT, true);
BView* offView = new BView(rect, "", B_FOLLOW_ALL, 0);
offScreen->AddChild(offView);
offScreen->Lock();
offView->SetHighColor(255, 0, 0);
offView->SetLowColor(0, 0, 120);
offView->SetDrawingMode(B_OP_COPY);
offView->BeginPicture(new BPicture());
offView->DrawBitmap(on, BPoint(0, 0));
SetEnabledOn(offView->EndPicture());
offView->BeginPicture(new BPicture());
offView->DrawBitmap(off, BPoint(0, 0));
SetEnabledOff(offView->EndPicture());
offScreen->Unlock();
delete offScreen;
}
示例11: wxASSERT
void LAYER_WIDGET::insertLayerRow( int aRow, const ROW& aSpec )
{
wxASSERT( aRow >= 0 );
int col;
int index = aRow * LYR_COLUMN_COUNT;
const int flags = wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT;
auto& iconProvider = useAlternateBitmap(aRow) ? alternativeRowIcons : defaultRowIcons;
// column 0
col = COLUMN_ICON_ACTIVE;
auto sbm = new INDICATOR_ICON( m_LayerScrolledWindow, iconProvider,
ROW_ICON_PROVIDER::STATE::OFF,
encodeId( col, aSpec.id ) );
sbm->Bind( wxEVT_LEFT_DOWN, &LAYER_WIDGET::OnLeftDownLayers, this );
m_LayersFlexGridSizer->wxSizer::Insert( index+col, sbm, 0, flags );
// column 1 (COLUMN_COLORBM)
col = COLUMN_COLORBM;
auto bmb = new COLOR_SWATCH( m_LayerScrolledWindow, aSpec.color, encodeId( col, aSpec.id ),
AreArbitraryColorsAllowed(), getBackgroundLayerColor() );
bmb->Bind( wxEVT_LEFT_DOWN, &LAYER_WIDGET::OnLeftDownLayers, this );
bmb->Bind( COLOR_SWATCH_CHANGED, &LAYER_WIDGET::OnLayerSwatchChanged, this );
bmb->SetToolTip( _("Left double click or middle click for color change, right click for menu" ) );
m_LayersFlexGridSizer->wxSizer::Insert( index+col, bmb, 0, flags );
// column 2 (COLUMN_COLOR_LYR_CB)
col = COLUMN_COLOR_LYR_CB;
wxCheckBox* cb = new wxCheckBox( m_LayerScrolledWindow, encodeId( col, aSpec.id ), wxEmptyString );
cb->SetValue( aSpec.state );
cb->Bind( wxEVT_COMMAND_CHECKBOX_CLICKED, &LAYER_WIDGET::OnLayerCheckBox, this );
cb->SetToolTip( _( "Enable this for visibility" ) );
m_LayersFlexGridSizer->wxSizer::Insert( index+col, cb, 0, flags );
// column 3 (COLUMN_COLOR_LYRNAME)
col = COLUMN_COLOR_LYRNAME;
wxStaticText* st = new wxStaticText( m_LayerScrolledWindow, encodeId( col, aSpec.id ), aSpec.rowName );
shrinkFont( st, m_PointSize );
st->Bind( wxEVT_LEFT_DOWN, &LAYER_WIDGET::OnLeftDownLayers, this );
st->SetToolTip( aSpec.tooltip );
m_LayersFlexGridSizer->wxSizer::Insert( index+col, st, 0, flags );
// Bind right click eventhandler to all columns
wxString layerName( aSpec.rowName );
sbm->Bind( wxEVT_RIGHT_DOWN, [this, bmb, layerName] ( wxMouseEvent& aEvt ) {
OnRightDownLayer( aEvt, bmb, layerName );
} );
bmb->Bind( wxEVT_RIGHT_DOWN, [this, bmb, layerName] ( wxMouseEvent& aEvt ) {
OnRightDownLayer( aEvt, bmb, layerName );
} );
cb->Bind( wxEVT_RIGHT_DOWN, [this, bmb, layerName] ( wxMouseEvent& aEvt ) {
OnRightDownLayer( aEvt, bmb, layerName );
} );
st->Bind( wxEVT_RIGHT_DOWN, [this, bmb, layerName] ( wxMouseEvent& aEvt ) {
OnRightDownLayer( aEvt, bmb, layerName );
} );
}
示例12: glClear
/**
* wechselt den Desktop in den neuen Desktop
*
* @author OLiver
*/
void WindowManager::Switch(void)
{
// einmal richtig clearen
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
SetToolTip(NULL, "");
// haben wir einen aktuell gültigen Desktop?
if(desktop)
{
// Alle (alten) Fenster zumachen
for(IgwListIterator it = windows.begin(); it != windows.end(); ++it)
delete (*it);
windows.clear();
// Desktop löschen
delete desktop;
}
// Desktop auf Neuen umstellen
desktop = nextdesktop;
// ist der neue Desktop gültig?
if(desktop)
{
// Desktop aktivieren
desktop->SetActive(true);
// aufräumen
nextdesktop = NULL;
nextdesktop_data = NULL;
}
}
示例13: Width
void ListPop::SetListText(gedString text)
{
int width = Width() - 20, n;
KrRect rect;
gedString s(text);
rect.Set(0, 0, 0, 0);
if(s.length() > 5)
{
for(n = 1; n <= text.length() && rect.Width() < width; n++)
{
s = text.substr(0, n);
rect = Text::GetDimensions(s);
}
if(s.length() != text.length() && n > 3)
{
s = s.substr(0, s.length() - 3) + "...";
SetToolTip(text);
}
}
SetText(s);
selectedText = text;
}
示例14: pSaveBtn
C4Network2ResDlg::ListItem::ListItem(C4Network2ResDlg *pForResDlg, const C4Network2Res *pByRes)
: pSaveBtn(NULL)
{
// init by res core (2do)
iResID = pByRes->getResID();
const char *szFilename = GetFilename(pByRes->getCore().getFileName());
// get size
int iIconSize = ::GraphicsResource.TextFont.GetLineHeight();
int iWidth = pForResDlg->GetItemWidth();
int iVerticalIndent = 2;
SetBounds(C4Rect(0, 0, iWidth, iIconSize+2*iVerticalIndent));
C4GUI::ComponentAligner ca(GetContainedClientRect(), 0,iVerticalIndent);
// create subcomponents
pFileIcon = new C4GUI::Icon(ca.GetFromLeft(iIconSize), C4GUI::Ico_Resource);
pLabel = new C4GUI::Label(szFilename, iIconSize + IconLabelSpacing,iVerticalIndent, ALeft);
pProgress = NULL;
// add components
AddElement(pFileIcon); AddElement(pLabel);
// tooltip
SetToolTip(LoadResStr("IDS_DESC_RESOURCE"));
// add to listbox (will eventually get moved)
pForResDlg->AddElement(this);
// first-time update
Update(pByRes);
}
示例15: wxT
void CProjectListCtrl::OnHover( wxHtmlCellEvent& event )
{
long i = 0;
wxHtmlCell* pCell = event.GetCell();
wxHtmlCell* pRootCell = pCell->GetRootCell();
wxString strNvidiaIcon = wxT("nvidiaicon");
wxString strATIIcon = wxT("atiicon");
wxString strWebsiteIcon = wxT("website");
wxString strTooltip = wxEmptyString;
wxHtmlCell* pAnchor = pCell->GetParent()->GetFirstChild();
if (pAnchor->Find(wxHTML_COND_ISANCHOR, &strNvidiaIcon)) {
strTooltip = _("Nvidia GPU Supported");
} else if (pAnchor->Find(wxHTML_COND_ISANCHOR, &strATIIcon)) {
strTooltip = _("ATI GPU Supported");
} else if (pAnchor->Find(wxHTML_COND_ISANCHOR, &strWebsiteIcon)) {
strTooltip = _("Project Website");
} else {
// Convert current HTML cell into an array index
pRootCell->GetId().ToLong(&i);
strTooltip = m_Items[i]->GetDescription();
}
// Set Tooltip to the item currently being hovered over
SetToolTip(strTooltip);
}