本文整理汇总了C++中BButton::SetToolTip方法的典型用法代码示例。如果您正苦于以下问题:C++ BButton::SetToolTip方法的具体用法?C++ BButton::SetToolTip怎么用?C++ BButton::SetToolTip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BButton
的用法示例。
在下文中一共展示了BButton::SetToolTip方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LockableButton
void
BToolbar::AddAction(BMessage* message, BHandler* target,
const BBitmap* icon, const char* toolTipText, bool lockable)
{
BButton* button;
if (lockable)
button = new LockableButton(NULL, NULL, message);
else
button = new BButton(NULL, NULL, message);
button->SetIcon(icon);
button->SetFlat(true);
if (toolTipText != NULL)
button->SetToolTip(toolTipText);
_AddView(button);
button->SetTarget(target);
}
示例2: messenger
ProjectSettingsWindow::ProjectSettingsWindow(BRect frame, Project* project)
:
BWindow(frame, TR("Project settings"), B_TITLED_WINDOW,
B_NOT_ZOOMABLE | B_NOT_RESIZABLE | B_AUTO_UPDATE_SIZE_LIMITS),
fProject(project),
fDirty(false)
{
if (fProject == NULL)
debugger("Bad project given to Project Settings window");
fRefFilter = new TypedRefFilter(NULL, B_DIRECTORY_NODE);
BMessenger messenger(this);
entry_ref projectFolderRef;
BEntry(fProject->GetPath().GetFolder()).GetRef(&projectFolderRef);
fFilePanel = new BFilePanel(B_OPEN_PANEL, &messenger, &projectFolderRef,
B_DIRECTORY_NODE, true, new BMessage(M_ADD_PATH), fRefFilter);
fAutolock = new BAutolock(fProject);
AddCommonFilter(new EscapeCancelFilter());
fTargetText = new AutoTextControl("targetname", TR("Target name:"),
fProject->GetTargetName(), new BMessage(M_TARGET_NAME_CHANGED));
BPopUpMenu* targetTypeMenu = new BPopUpMenu(TR("Target type"));
targetTypeMenu->AddItem(new BMenuItem(TR("Application"),
new BMessage(M_SET_TARGET_TYPE)));
targetTypeMenu->AddItem(new BMenuItem(TR("Shared library"),
new BMessage(M_SET_TARGET_TYPE)));
targetTypeMenu->AddItem(new BMenuItem(TR("Static library"),
new BMessage(M_SET_TARGET_TYPE)));
targetTypeMenu->AddItem(new BMenuItem(TR("Device driver"),
new BMessage(M_SET_TARGET_TYPE)));
fTypeField = new BMenuField("type", TR("Target type:"), targetTypeMenu);
SetToolTip(fTypeField, TR("The kind of program you want to build"));
BMenuItem* item = targetTypeMenu->ItemAt(fProject->TargetType());
if (item != NULL)
item->SetMarked(true);
fIncludeList = new IncludeList(fProject->GetPath().GetFolder());
SetToolTip(fIncludeList,
TR("The folders you want Paladin to search for header files"));
BScrollView* includeScrollView = new BScrollView("includescrollview",
fIncludeList, B_WILL_DRAW, true, true);
includeScrollView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
includeScrollView->SetExplicitMinSize(
BSize(be_plain_font->StringWidth("M") * 34.0f,
be_plain_font->StringWidth("M") * 12.0f));
for (int32 i = 0; i < fProject->CountLocalIncludes(); i++) {
fIncludeList->AddItem(new BStringItem(
fProject->LocalIncludeAt(i).Relative().String()));
}
float buttonWidth = be_plain_font->StringWidth("+") * 2.0f + 3.0f;
BButton* addButton = new BButton("addbutton", TR("+"),
new BMessage(M_SHOW_ADD_PATH));
addButton->SetExplicitSize(BSize(buttonWidth, buttonWidth));
addButton->SetToolTip(TR("Add a file to the include path list"));
BButton* removeButton = new BButton("removebutton", TR("−"),
new BMessage(M_REMOVE_PATH));
removeButton->SetExplicitSize(BSize(buttonWidth, buttonWidth));
removeButton->SetToolTip(TR("Remove the selected path"));
// general tab
fGeneralView = new BView(TR("General"), B_WILL_DRAW);
fGeneralView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
BLayoutBuilder::Group<>(fGeneralView, B_VERTICAL, 0)
.AddGrid(B_USE_DEFAULT_SPACING, B_USE_SMALL_SPACING)
.Add(fTargetText->CreateLabelLayoutItem(), 0, 0)
.Add(fTargetText->CreateTextViewLayoutItem(), 1, 0)
.Add(fTypeField->CreateLabelLayoutItem(), 0, 1)
.AddGroup(B_HORIZONTAL, B_USE_DEFAULT_SPACING, 1, 1)
.Add(fTypeField->CreateMenuBarLayoutItem())
.AddGlue()
.End()
.End()
.AddStrut(B_USE_DEFAULT_SPACING)
.AddGroup(B_VERTICAL, 2.0f)
.Add(new BStringView("include paths", TR("Include paths:")))
.AddGroup(B_HORIZONTAL, B_USE_SMALL_SPACING)
.Add(includeScrollView)
.AddGroup(B_VERTICAL, B_USE_SMALL_SPACING)
.Add(addButton)
.Add(removeButton)
.AddGlue()
.End()
.End()
.End()
.SetInsets(B_USE_DEFAULT_SPACING)
.End();
//.........这里部分代码省略.........