本文整理匯總了C++中B_TRANSLATE_SYSTEM_NAME函數的典型用法代碼示例。如果您正苦於以下問題:C++ B_TRANSLATE_SYSTEM_NAME函數的具體用法?C++ B_TRANSLATE_SYSTEM_NAME怎麽用?C++ B_TRANSLATE_SYSTEM_NAME使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了B_TRANSLATE_SYSTEM_NAME函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: BWindow
PulseWindow::PulseWindow(BRect rect)
:
BWindow(rect, B_TRANSLATE_SYSTEM_NAME("Pulse"), B_TITLED_WINDOW,
B_NOT_RESIZABLE | B_NOT_ZOOMABLE)
{
SetPulseRate(200000);
PulseApp *pulseapp = (PulseApp *)be_app;
BRect bounds = Bounds();
fNormalPulseView = new NormalPulseView(bounds);
AddChild(fNormalPulseView);
fMiniPulseView = new MiniPulseView(bounds, "MiniPulseView",
pulseapp->prefs);
AddChild(fMiniPulseView);
fMode = pulseapp->prefs->window_mode;
if (fMode == MINI_WINDOW_MODE) {
SetLook(B_MODAL_WINDOW_LOOK);
SetFeel(B_NORMAL_WINDOW_FEEL);
SetFlags(B_NOT_ZOOMABLE);
fNormalPulseView->Hide();
SetSizeLimits(GetMinimumViewWidth() - 1, 4096, 2, 4096);
ResizeTo(rect.Width(), rect.Height());
} else
fMiniPulseView->Hide();
fPrefsWindow = NULL;
}
示例2: B_TRANSLATE_SYSTEM_NAME
void
PulseApp::ShowAbout(bool asApplication)
{
// static version to be used in replicant mode
BString name;
if (asApplication)
name = B_TRANSLATE_SYSTEM_NAME("Pulse");
else
name = B_TRANSLATE("Pulse");
BString message = B_TRANSLATE(
"%s\n\nBy David Ramsey and Arve Hjønnevåg\n"
"Revised by Daniel Switkin\n");
message.ReplaceFirst("%s", name);
BAlert *alert = new BAlert(B_TRANSLATE("Info"),
message.String(), B_TRANSLATE("OK"));
BTextView* view = alert->TextView();
BFont font;
view->SetStylable(true);
view->GetFont(&font);
font.SetSize(18);
font.SetFace(B_BOLD_FACE);
view->SetFontAndColor(0, name.Length(), &font);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
// Use the asynchronous version so we don't block the window's thread
alert->Go(NULL);
}
示例3: BWindow
CDPlayerWindow::CDPlayerWindow()
:
BWindow(BRect (100, 100, 405, 280), B_TRANSLATE_SYSTEM_NAME("CDPlayer"),
B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE
| B_ASYNCHRONOUS_CONTROLS)
{
}
示例4: BAboutWindow
void
WorkspacesView::_AboutRequested()
{
BAboutWindow* window = new BAboutWindow(
B_TRANSLATE_SYSTEM_NAME("Workspaces"), kSignature);
const char* authors[] = {
"Axel Dörfler",
"Oliver \"Madison\" Kohl",
"Matt Madia",
"François Revol",
NULL
};
const char* extraCopyrights[] = {
"2002 François Revol",
NULL
};
const char* extraInfo = "Send windows behind using the Option key. "
"Move windows to front using the Control key.\n";
window->AddCopyright(2002, "Haiku, Inc.",
extraCopyrights);
window->AddAuthors(authors);
window->AddExtraInfo(extraInfo);
window->Show();
}
示例5: switch
bool
WindowTitlePlaceholderMapper::MapPlaceholder(char placeholder, int64 number,
bool numberGiven, BString& _string)
{
switch (placeholder) {
case 'T':
// The Terminal application name for the current locale
_string = B_TRANSLATE_SYSTEM_NAME("Terminal");
return true;
case 'i':
// window index
_string.Truncate(0);
if (fWindowIndex != 0)
_string << fWindowIndex;
return true;
case 't':
// the tab title
_string = fTabTitle;
return true;
}
return TitlePlaceholderMapper::MapPlaceholder(placeholder, number,
numberGiven, _string);
}
示例6: BAboutWindow
void
MainWindow::AboutRequested()
{
BAboutWindow* about = new BAboutWindow(
B_TRANSLATE_SYSTEM_NAME("BeMines"), "application/x-vnd.dw-BeMines");
const char* kCopyright = "Kevin Adams, Humdinger, Janus";
const char* kExtraCopyrights[] = {
"2015 Justin Stressman",
"2009 DarkWyrm",
NULL
};
const char* kAuthors[] = {
B_TRANSLATE("DarkWyrm (original author)"),
"Kevin Adams",
"Adrien Destugues",
"Humdinger",
"Janus",
"Justin Stressman",
NULL
};
about->AddDescription(
B_TRANSLATE("A themable, open-source rendition of Minesweeper."));
about->AddCopyright(2018, kCopyright, kExtraCopyrights);
about->AddAuthors(kAuthors);
about->Show();
}
示例7: BWindow
ScreenSaverWindow::ScreenSaverWindow()
:
BWindow(BRect(50.0f, 50.0f, 50.0f + kWindowWidth, 50.0f + kWindowHeight),
B_TRANSLATE_SYSTEM_NAME("ScreenSaver"), B_TITLED_WINDOW,
B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS)
{
fSettings.Load();
fMinWidth = floorf(be_control_look->DefaultItemSpacing()
* (kWindowWidth / kDefaultItemSpacingAt12pt));
font_height fontHeight;
be_plain_font->GetHeight(&fontHeight);
float textHeight = ceilf(fontHeight.ascent + fontHeight.descent);
fMinHeight = ceilf(std::max(kWindowHeight, textHeight * 28));
// Create the password editing window
fPasswordWindow = new PasswordWindow(fSettings);
fPasswordWindow->Run();
// Create the tab view
fTabView = new TabView();
fTabView->SetBorder(B_NO_BORDER);
// Create the controls inside the tabs
fFadeView = new FadeView(B_TRANSLATE("General"), fSettings);
fModulesView = new ModulesView(B_TRANSLATE("Screensavers"), fSettings);
fTabView->AddTab(fFadeView);
fTabView->AddTab(fModulesView);
// Create the topmost background view
BView* topView = new BView("topView", B_WILL_DRAW);
topView->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
topView->SetExplicitAlignment(BAlignment(B_ALIGN_USE_FULL_WIDTH,
B_ALIGN_USE_FULL_HEIGHT));
topView->SetExplicitMinSize(BSize(fMinWidth, fMinHeight));
BLayoutBuilder::Group<>(topView, B_VERTICAL)
.SetInsets(0, B_USE_DEFAULT_SPACING, 0, B_USE_WINDOW_SPACING)
.Add(fTabView)
.End();
SetLayout(new BGroupLayout(B_VERTICAL));
GetLayout()->AddView(topView);
fTabView->Select(fSettings.WindowTab());
if (fSettings.WindowFrame().left > 0 && fSettings.WindowFrame().top > 0)
MoveTo(fSettings.WindowFrame().left, fSettings.WindowFrame().top);
if (fSettings.WindowFrame().Width() > 0
&& fSettings.WindowFrame().Height() > 0) {
ResizeTo(fSettings.WindowFrame().Width(),
fSettings.WindowFrame().Height());
}
CenterOnScreen();
}
示例8: BWindow
UninstallWindow::UninstallWindow()
:
BWindow(BRect(100, 100, 600, 300),
B_TRANSLATE_SYSTEM_NAME("InstalledPackages"), B_TITLED_WINDOW,
B_NOT_ZOOMABLE | B_QUIT_ON_WINDOW_CLOSE | B_AUTO_UPDATE_SIZE_LIMITS)
{
SetLayout(new BGroupLayout(B_HORIZONTAL));
AddChild(new UninstallView());
}
示例9: BWindow
NetworkWindow::NetworkWindow()
:
BWindow(BRect(50, 50, 269, 302), B_TRANSLATE_SYSTEM_NAME("Network"),
B_TITLED_WINDOW, B_NOT_RESIZABLE | B_ASYNCHRONOUS_CONTROLS
| B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS | B_QUIT_ON_WINDOW_CLOSE)
{
SetLayout(new BGroupLayout(B_HORIZONTAL));
GetLayout()->AddView(new EthernetSettingsView());
}
示例10: BWindow
KeyboardWindow::KeyboardWindow()
:
BWindow(BRect(0, 0, 200, 200), B_TRANSLATE_SYSTEM_NAME("Keyboard"),
B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE
| B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS)
{
MoveTo(fSettings.WindowCorner());
// Add the main settings view
fSettingsView = new KeyboardView();
BBox* fSettingsBox = new BBox("keyboard_box");
fSettingsBox->AddChild(fSettingsView);
// Add the "Default" button..
fDefaultsButton = new BButton(B_TRANSLATE("Defaults"), new BMessage(BUTTON_DEFAULTS));
// Add the "Revert" button...
fRevertButton = new BButton(B_TRANSLATE("Revert"), new BMessage(BUTTON_REVERT));
fRevertButton->SetEnabled(false);
// Build the layout
SetLayout(new BGroupLayout(B_VERTICAL));
AddChild(BGroupLayoutBuilder(B_VERTICAL, 10)
.Add(fSettingsBox)
.AddGroup(B_HORIZONTAL, 7)
.Add(fDefaultsButton)
.Add(fRevertButton)
.AddGlue()
.End()
.SetInsets(10, 10, 10, 10)
);
BSlider* slider = (BSlider* )FindView("key_repeat_rate");
if (slider !=NULL)
slider->SetValue(fSettings.KeyboardRepeatRate());
slider = (BSlider* )FindView("delay_until_key_repeat");
if (slider !=NULL)
slider->SetValue(fSettings.KeyboardRepeatDelay());
fDefaultsButton->SetEnabled(fSettings.IsDefaultable());
// center window if it would be off-screen
BScreen screen;
if (screen.Frame().right < Frame().right
|| screen.Frame().bottom < Frame().bottom) {
CenterOnScreen();
}
#ifdef DEBUG
fSettings.Dump();
#endif
Show();
}
示例11: BApplication
HApp::HApp()
:
BApplication("application/x-vnd.Haiku-Sounds")
{
BRect rect;
rect.Set(200, 150, 590, 570);
HWindow* window = new HWindow(rect, B_TRANSLATE_SYSTEM_NAME("Sounds"));
window->Show();
}
示例12: B_TRANSLATE_SYSTEM_NAME
void
MainWin::UpdateWindowTitle()
{
BString title;
title.SetToFormat("%s - %d x %d, %.3f:%.3f => %.0f x %.0f",
B_TRANSLATE_SYSTEM_NAME(NAME),
fSourceWidth, fSourceHeight, fWidthScale, fHeightScale,
fVideoView->Bounds().Width() + 1, fVideoView->Bounds().Height() + 1);
SetTitle(title);
}
示例13: BWindow
TTimeWindow::TTimeWindow()
:
BWindow(BRect(0, 0, 0, 0), B_TRANSLATE_SYSTEM_NAME("Time"), B_TITLED_WINDOW,
B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS)
{
_InitWindow();
_AlignWindow();
AddShortcut('A', B_COMMAND_KEY, new BMessage(B_ABOUT_REQUESTED));
}
示例14: BWindow
PowerStatusWindow::PowerStatusWindow()
:
BWindow(BRect(100, 150, 281, 299), B_TRANSLATE_SYSTEM_NAME("PowerStatus"),
B_TITLED_WINDOW, B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS)
{
BView* topView = new BView(Bounds(), NULL, B_FOLLOW_ALL, B_WILL_DRAW);
topView->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
AddChild(topView);
topView->AddChild(new PowerStatusReplicant(Bounds(), B_FOLLOW_ALL));
}
示例15: VideoWindow
void
CodyCam::ReadyToRun()
{
fWindow = new VideoWindow(BRect(28, 28, 28, 28),
(const char*) B_TRANSLATE_SYSTEM_NAME("CodyCam"), B_TITLED_WINDOW,
B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS, &fPort);
_SetUpNodes();
((VideoWindow*)fWindow)->ApplyControls();
}