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


C++ BCheckBox::SetTarget方法代码示例

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


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

示例1:

void
FadeView::AttachedToWindow()
{
	fEnableCheckBox->SetTarget(this);
	fRunSlider->SetTarget(this);
	fTurnOffCheckBox->SetTarget(this);
	fTurnOffSlider->SetTarget(this);
	fFadeNow->SetTarget(this);
	fFadeNever->SetTarget(this);
	fPasswordCheckBox->SetTarget(this);
	fPasswordSlider->SetTarget(this);

	fEnableCheckBox->SetValue(
		fSettings.TimeFlags() & ENABLE_SAVER ? B_CONTROL_ON : B_CONTROL_OFF);
	fRunSlider->SetTime(fSettings.BlankTime());
	fTurnOffSlider->SetTime(fSettings.OffTime() + fSettings.BlankTime());
	fFadeNow->SetCorner(fSettings.BlankCorner());
	fFadeNever->SetCorner(fSettings.NeverBlankCorner());
	fPasswordCheckBox->SetValue(fSettings.LockEnable());
	fPasswordSlider->SetTime(fSettings.PasswordTime());

	_UpdateColors();
	UpdateTurnOffScreen();
	UpdateStatus();
}
开发者ID:AmirAbrams,项目名称:haiku,代码行数:25,代码来源:ScreenSaverWindow.cpp

示例2:

void
BMailProtocolConfigView::AttachedToWindow()
{
	BMenuField *menu = (BMenuField *)(FindView("auth_method"));
	if (menu != NULL)
		menu->Menu()->SetTargetForItems(this);

	BCheckBox *box = (BCheckBox *)(FindView("leave_mail_on_server"));
	if (box != NULL)
		box->SetTarget(this);
}
开发者ID:mylegacy,项目名称:haiku,代码行数:11,代码来源:ProtocolConfigView.cpp

示例3:

void
AutomountSettingsPanel::AttachedToWindow()
{
	fInitialMountAllCheck->SetTarget(this);
	fInitialMountAllBFSCheck->SetTarget(this);
	fInitialMountRestoreCheck->SetTarget(this);
	fInitialDontMountCheck->SetTarget(this);

	fAutoMountAllCheck->SetTarget(this);
	fAutoMountAllBFSCheck->SetTarget(this);
	fScanningDisabledCheck->SetTarget(this);
	fEjectWhenUnmountingCheckBox->SetTarget(this);

	fDone->SetTarget(this);
	fMountAllNow->SetTarget(fTarget);
}
开发者ID:veer77,项目名称:Haiku-services-branch,代码行数:16,代码来源:AutoMounterSettings.cpp

示例4: ChildAt

void
AccountView::AttachedToWindow()
{
	// Once we are attached to window, the GUI is already created
	// so we can set our window as target for messages
	for (int32 i = 0; i < CountChildren(); i++) {
		BView* child = ChildAt(i);

		BMenu* menu = dynamic_cast<BMenu*>(child);
		BMenuField* menuField
			= dynamic_cast<BMenuField*>(child);
		BTextControl* textControl
			= dynamic_cast<BTextControl*>(child);
		NotifyingTextView* textView
			= dynamic_cast<NotifyingTextView*>(child);
		BCheckBox* checkBox = dynamic_cast<BCheckBox*>(child);

		if (menuField)
			menu = menuField->Menu();

		if (menu) {
			for (int32 j = 0; j < menu->CountItems(); j++) {
				BMenuItem* item = menu->ItemAt(j);
				item->SetMessage(new BMessage(kChanged));
				item->SetTarget(Window());
			}

			menu->SetTargetForItems(Window());
		}

		if (textControl) {
			textControl->SetMessage(new BMessage(kChanged));
			textControl->SetTarget(Window());
		}

		if (checkBox) {
			checkBox->SetMessage(new BMessage(kChanged));
			checkBox->SetTarget(Window());
		}

		if (textView) {
			textView->SetMessage(new BMessage(kChanged));
			textView->SetTarget(Window());
		}
	}
}
开发者ID:Barrett17,项目名称:Caya,代码行数:46,代码来源:AccountView.cpp

示例5: AttachedToWindow

void AGMSBayesianSpamFilterConfig::AttachedToWindow ()
{
	char		 numberString [30];
	BRect		 tempRect;
	char		*tempStringPntr;

	SetViewColor (ui_color (B_PANEL_BACKGROUND_COLOR));

	// Make the checkbox for choosing whether the spam is marked by a
	// modification to the subject of the mail message.

	tempRect = Bounds ();
	fAddSpamToSubjectCheckBoxPntr = new BCheckBox (
		tempRect,
		"AddToSubject",
		"Add spam rating to start of subject",
		new BMessage (kAddSpamToSubjectPressed));
	AddChild (fAddSpamToSubjectCheckBoxPntr);
	fAddSpamToSubjectCheckBoxPntr->ResizeToPreferred ();
	fAddSpamToSubjectCheckBoxPntr->SetValue (fAddSpamToSubject);
	fAddSpamToSubjectCheckBoxPntr->SetTarget (this);

	tempRect = Bounds ();
	tempRect.top = fAddSpamToSubjectCheckBoxPntr->Frame().bottom + 1;
	tempRect.bottom = tempRect.top + 20;

	// Add the checkbox on the right for the no words means spam option.

	fNoWordsMeansSpamCheckBoxPntr = new BCheckBox (
		tempRect,
		"NoWordsMeansSpam",
		"or empty e-mail",
		new BMessage (kNoWordsMeansSpam));
	AddChild (fNoWordsMeansSpamCheckBoxPntr);
	fNoWordsMeansSpamCheckBoxPntr->ResizeToPreferred ();
	fNoWordsMeansSpamCheckBoxPntr->MoveBy (
		floorf (tempRect.right - fNoWordsMeansSpamCheckBoxPntr->Frame().right),
		0.0);
	fNoWordsMeansSpamCheckBoxPntr->SetValue (fNoWordsMeansSpam);
	fNoWordsMeansSpamCheckBoxPntr->SetTarget (this);

	// Add the box displaying the spam cutoff ratio to the left, in the space
	// remaining between the left edge and the no words checkbox.

	tempRect.right = fNoWordsMeansSpamCheckBoxPntr->Frame().left -
		be_plain_font->StringWidth ("a");
	tempStringPntr = "Spam above:";
	sprintf (numberString, "%06.4f", (double) fSpamCutoffRatio);
	fSpamCutoffRatioTextBoxPntr	= new BTextControl (
		tempRect,
		"spamcutoffratio",
		tempStringPntr,
		numberString,
		NULL /* BMessage */);
	AddChild (fSpamCutoffRatioTextBoxPntr);
	fSpamCutoffRatioTextBoxPntr->SetDivider (
		be_plain_font->StringWidth (tempStringPntr) +
		1 * be_plain_font->StringWidth ("a"));

	tempRect = Bounds ();
	tempRect.top = fSpamCutoffRatioTextBoxPntr->Frame().bottom + 1;
	tempRect.bottom = tempRect.top + 20;

	// Add the box displaying the genuine cutoff ratio, on a line by itself.

	tempStringPntr = "Genuine below and uncertain above:";
	sprintf (numberString, "%08.6f", (double) fGenuineCutoffRatio);
	fGenuineCutoffRatioTextBoxPntr = new BTextControl (
		tempRect,
		"genuinecutoffratio",
		tempStringPntr,
		numberString,
		NULL /* BMessage */);
	AddChild (fGenuineCutoffRatioTextBoxPntr);
	fGenuineCutoffRatioTextBoxPntr->SetDivider (
		be_plain_font->StringWidth (tempStringPntr) +
		1 * be_plain_font->StringWidth ("a"));

	tempRect = Bounds ();
	tempRect.top = fGenuineCutoffRatioTextBoxPntr->Frame().bottom + 1;
	tempRect.bottom = tempRect.top + 20;

    // Checkbox for automatically training on incoming mail.

	fAutoTrainingCheckBoxPntr = new BCheckBox (
		tempRect,
		"autoTraining",
		"Learn from all incoming e-mail",
		new BMessage (kAutoTrainingPressed));
	AddChild (fAutoTrainingCheckBoxPntr);
	fAutoTrainingCheckBoxPntr->ResizeToPreferred ();
	fAutoTrainingCheckBoxPntr->SetValue (fAutoTraining);
	fAutoTrainingCheckBoxPntr->SetTarget (this);

	tempRect = Bounds ();
	tempRect.top = fAutoTrainingCheckBoxPntr->Frame().bottom + 1;
	tempRect.bottom = tempRect.top + 20;

	// Button for editing the server settings.

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

示例6:

/*!	\brief		Updates targets of all controls currently in the view.
 *	\details	BView::AttachToWindow(), among other things, modifies the targets
 *				of controls to point to main looper of the application. This is
 *				not desirable way. This function corrects it.
 */
void		CalendarModulePreferencesView::UpdateTargetting( void )
{
	BCheckBox* tempCheckBox = NULL;
	int i, limit;

	// Updating calendar chooser part
	BMenuItem* menuItem = NULL;
	if ( calendarModules ) {
		limit = calendarModules->CountItems();
		for ( i = 0; i < limit; ++i )
		{
			menuItem = dynamic_cast< BMenuItem* >( calendarModules->ItemAt( i ) );
			if ( menuItem )
				menuItem->SetTarget( this );
		}
	}

	// Update Weekends selector box
	BBox* tempBBox = ( BBox* )this->FindView( "Weekend selector" );
	if ( tempBBox ) {
		limit = tempBBox->CountChildren();
		for ( i = 0; i < limit; ++i )
		{
			tempCheckBox = dynamic_cast< BCheckBox* >( tempBBox->ChildAt( i ) );
			if ( tempCheckBox )
				tempCheckBox->SetTarget( this );
		}
	}
	
	// Update First day of week chooser
	BPopUpMenu* tempMenu = ( BPopUpMenu* )this->FindView( "First day of week" );
	if ( tempMenu )
	{
		limit = tempMenu->CountItems();
		for ( i = 0; i < limit; ++i )
		{
			menuItem = dynamic_cast< BMenuItem* >( tempMenu->ItemAt( i ) );
			if ( menuItem )
				menuItem->SetTarget( this );
		}
	}
	
	// Update day-month-year order chooser
	tempMenu = ( BPopUpMenu* )this->FindView( "DmyOrderChooser" );
	if ( tempMenu )
	{
		limit = tempMenu->CountItems();
		for ( i = 0; i < limit; ++i )
		{
			menuItem = dynamic_cast< BMenuItem* >( tempMenu->ItemAt( i ) );
			if ( menuItem )
				menuItem->SetTarget( this );
		}
	}
	
	// Update the target of Color selector
	CategoryListView* catListView = ( CategoryListView* )this->FindView("Colors list view");
	if ( catListView )
	{
		catListView->SetTarget( this );
	}
	
}	// <-- end of function CalendarModulePreferencesView::UpdateTargetting
开发者ID:BackupTheBerlios,项目名称:haiku-pim-svn,代码行数:68,代码来源:CalendarModulePreferencesView.cpp


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