当前位置: 首页>>代码示例>>C++>>正文


C++ BMailSettings::ConfigWindowFrame方法代码示例

本文整理汇总了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;
}
开发者ID:HaikuArchives,项目名称:BeMailDaemon,代码行数:29,代码来源:ConfigWindow.cpp

示例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);
    }
}
开发者ID:mmadia,项目名称:haiku-1,代码行数:29,代码来源:ConfigWindow.cpp

示例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);
	}
}
开发者ID:mylegacy,项目名称:haiku,代码行数:33,代码来源:ConfigWindow.cpp


注:本文中的BMailSettings::ConfigWindowFrame方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。