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


C++ StringView::GetPreferredSize方法代码示例

本文整理汇总了C++中StringView::GetPreferredSize方法的典型用法代码示例。如果您正苦于以下问题:C++ StringView::GetPreferredSize方法的具体用法?C++ StringView::GetPreferredSize怎么用?C++ StringView::GetPreferredSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在StringView的用法示例。


在下文中一共展示了StringView::GetPreferredSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SettingsView

OutboundView::OutboundView( Rect cFrame, Identity *pcIdentity, Handler *pcMainWindow ) : SettingsView( cFrame, "outbound", pcIdentity )
{
	m_pcIdentity = pcIdentity;

	Server cOutboundServer;
	bool bOutboundValid = false;
	if( m_pcIdentity->GetServer( cOutboundServer, SERVER_OUTBOUND, 0 ) == EOK )
		bOutboundValid = true;

	const uint32 nInputLabelWidth = 90;
	Rect cBounds = GetBounds();

	m_pcOutboundView = new View( cBounds, "outbound_view", CF_FOLLOW_LEFT | CF_FOLLOW_RIGHT | CF_FOLLOW_TOP );

	Rect cInputFrame = cBounds;
	cInputFrame.top = 5;
	cInputFrame.bottom = cInputFrame.top + INPUT_HEIGHT;

	/* Server */
	m_pcServerInput = new InputView( cInputFrame, MSG_CFGWND_SENDINGEMAIL_SETTINGS_SMTPSERVER, nInputLabelWidth );
	if( bOutboundValid )
		m_pcServerInput->SetText( cOutboundServer.GetServer() );
	m_pcOutboundView->AddChild( m_pcServerInput );

	/* Does this SMTP server require a authentication? */
	Rect cAuthFrame = cBounds;
	cAuthFrame.top = cInputFrame.bottom + 5;
	cAuthFrame.bottom = cAuthFrame.top + INPUT_HEIGHT;

	m_pcRequiresAuth = new CheckBox( cAuthFrame, "outbound_auth1", MSG_CFGWND_SENDINGEMAIL_SETTINGS_REQUIRESAUTH, new Message( ID_REQUIRES_AUTH ) );
	cAuthFrame.right = m_pcRequiresAuth->GetPreferredSize( false ).x;
	m_pcRequiresAuth->SetFrame( cAuthFrame );
	m_pcOutboundView->AddChild( m_pcRequiresAuth );

	/* Username */
	cInputFrame.top = cAuthFrame.bottom + 5;
	cInputFrame.bottom = cInputFrame.top + INPUT_HEIGHT;
	m_pcUsernameInput = new InputView( cInputFrame, MSG_CFGWND_SENDINGEMAIL_SETTINGS_USERNAME, nInputLabelWidth );
	m_pcOutboundView->AddChild( m_pcUsernameInput );

	/* Password */
	cInputFrame.top = cInputFrame.bottom + 5;
	cInputFrame.bottom = cInputFrame.top + INPUT_HEIGHT;
	m_pcPasswordInput = new InputView( cInputFrame, MSG_CFGWND_SENDINGEMAIL_SETTINGS_PASSWORD, nInputLabelWidth );
	m_pcPasswordInput->SetPasswordMode();
	m_pcOutboundView->AddChild( m_pcPasswordInput );

	Rect cPortFrame = cBounds;
	cPortFrame.top = cInputFrame.bottom + 5;
	cPortFrame.bottom = cPortFrame.top + INPUT_HEIGHT;

	StringView *pcPortLabel = new StringView( cPortFrame, "outbound_port_label", MSG_CFGWND_SENDINGEMAIL_SETTINGS_SRVERPORT );
	cPortFrame.right = pcPortLabel->GetPreferredSize( false ).x;
	pcPortLabel->SetFrame( cPortFrame );
	m_pcOutboundView->AddChild( pcPortLabel );

	cPortFrame.left = cPortFrame.right + 5;
	cPortFrame.right = cBounds.right - 5;

	m_pcPort = new Spinner( cPortFrame, "outbound_port", 25, NULL );
	if( bOutboundValid )
		m_pcPort->SetValue( cOutboundServer.GetPort() );
	m_pcPort->SetMinValue( 1 );
	m_pcPort->SetMaxValue( 65535 );
	m_pcPort->SetStep( 1.0 );
	m_pcPort->SetFormat( "%.0f" );

	/* XXXKV: Spinner doesn't produce a usable width */
	//cPortFrame.right = cPortFrame.left + m_pcPort->GetPreferredSize( false ).x + 1;
	cPortFrame.right = cPortFrame.left + 70;
	cPortFrame.bottom = cPortFrame.top + m_pcPort->GetPreferredSize( false ).y + 1;
	m_pcPort->SetFrame( cPortFrame );
	m_pcOutboundView->AddChild( m_pcPort );

	cAuthFrame = cBounds;
	cAuthFrame.top = cPortFrame.bottom + 5;
	cAuthFrame.bottom = cAuthFrame.top + INPUT_HEIGHT;

	m_pcPopBeforeSmtp = new CheckBox( cAuthFrame, "outbound_auth2", MSG_CFGWND_SENDINGEMAIL_SETTINGS_POPBEFORESMTP, new Message( ID_POP3_AUTH ) );
	cAuthFrame.right = m_pcPopBeforeSmtp->GetPreferredSize( false ).x;
	m_pcPopBeforeSmtp->SetFrame( cAuthFrame );
	m_pcOutboundView->AddChild( m_pcPopBeforeSmtp );

	cAuthFrame.top = cAuthFrame.bottom + 5;
	cAuthFrame.bottom += INPUT_HEIGHT;

	StringView *pcAuthLabel = new StringView( cAuthFrame, "outbound_auth_label", MSG_CFGWND_SENDINGEMAIL_SETTINGS_SMTPAUTH );
	cAuthFrame.right = pcAuthLabel->GetPreferredSize( false ).x;
	pcAuthLabel->SetFrame( cAuthFrame );
	m_pcOutboundView->AddChild( pcAuthLabel );

	cAuthFrame.left = cAuthFrame.right + 5;
	cAuthFrame.right = cBounds.right - 5;

	m_pcPop3Account = new DropdownMenu( cAuthFrame, "outbound_pop3_auth_instance", CF_FOLLOW_LEFT | CF_FOLLOW_RIGHT );
	m_pcPop3Account->SetTabOrder( NEXT_TAB_ORDER );

	cAuthFrame.bottom = cAuthFrame.top + m_pcPop3Account->GetPreferredSize( false ).y + 1;
	m_pcPop3Account->SetFrame( cAuthFrame );

//.........这里部分代码省略.........
开发者ID:PyroOS,项目名称:Pyro,代码行数:101,代码来源:outbound_view.cpp


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