本文整理汇总了C++中BMailSettings::ConfigWindowFrame方法的典型用法代码示例。如果您正苦于以下问题:C++ BMailSettings::ConfigWindowFrame方法的具体用法?C++ BMailSettings::ConfigWindowFrame怎么用?C++ BMailSettings::ConfigWindowFrame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BMailSettings
的用法示例。
在下文中一共展示了BMailSettings::ConfigWindowFrame方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: screen
void
ConfigWindow::LoadSettings()
{
Accounts::Delete();
Accounts::Create(fAccountsListView,fConfigView);
// load in general settings
BMailSettings *settings = new BMailSettings();
status_t status = SetToGeneralSettings(settings);
if (status == B_OK)
{
// adjust own window frame
BScreen screen(this);
BRect screenFrame(screen.Frame().InsetByCopy(0,5));
BRect frame(settings->ConfigWindowFrame());
if (screenFrame.Contains(frame.LeftTop()))
MoveTo(frame.LeftTop());
else // center on screen
MoveTo((screenFrame.Width() - frame.Width()) / 2,(screenFrame.Height() - frame.Height()) / 2);
}
else
fprintf(stderr, MDR_DIALECT_CHOICE (
"Error retrieving general settings: %s\n",
"一般設定の収得に失敗: %s\n"),
strerror(status));
delete settings;
}
示例2: screen
void
ConfigWindow::LoadSettings()
{
Accounts::Delete();
Accounts::Create(fAccountsListView, fConfigView);
// load in general settings
BMailSettings settings;
status_t status = SetToGeneralSettings(&settings);
if (status == B_OK) {
// move own window
MoveTo(settings.ConfigWindowFrame().LeftTop());
} else {
fprintf(stderr, B_TRANSLATE("Error retrieving general settings: %s\n"),
strerror(status));
}
BScreen screen(this);
BRect screenFrame(screen.Frame().InsetByCopy(0, 5));
if (!screenFrame.Contains(Frame().LeftTop())
|| !screenFrame.Contains(Frame().RightBottom()))
status = B_ERROR;
if (status != B_OK) {
// center window on screen
MoveTo((screenFrame.Width() - Frame().Width()) / 2,
(screenFrame.Height() - Frame().Height()) / 2);
}
}
示例3: screen
void
ConfigWindow::_LoadSettings()
{
// load accounts
for (int i = 0; i < fAccounts.CountItems(); i++)
delete fAccounts.ItemAt(i);
fAccounts.MakeEmpty();
_LoadAccounts();
// load in general settings
BMailSettings settings;
status_t status = _SetToGeneralSettings(&settings);
if (status == B_OK) {
// move own window
MoveTo(settings.ConfigWindowFrame().LeftTop());
} else {
fprintf(stderr, B_TRANSLATE("Error retrieving general settings: %s\n"),
strerror(status));
}
BScreen screen(this);
BRect screenFrame(screen.Frame().InsetByCopy(0, 5));
if (!screenFrame.Contains(Frame().LeftTop())
|| !screenFrame.Contains(Frame().RightBottom()))
status = B_ERROR;
if (status != B_OK) {
// center window on screen
MoveTo((screenFrame.Width() - Frame().Width()) / 2,
(screenFrame.Height() - Frame().Height()) / 2);
}
}