Exemple #1
0
void ToolbarDlg::DeleteSelectedBar()
{
	// we can't delete the control bank !!
   	if (!CanDeleteSelection())
		return;

	String_32 BarName;
	GetSelectedBarName(&BarName);

	// If nothing is selected, we can't do anything
	if (BarName == String_8(TEXT("")))
		return;
	
	// we can't delete the infoobar
	if (BarName == String_32(TEXT("Infobar")))
		return;

	DialogBarOp* pBar = DialogBarOp::FindDialogBarOp(BarName);

	ENSURE(pBar,"Cannot find named bar in TakeToolbarDetails");

	// If bar is of correct type then adjust its visibility according to the
	// check mark...
	if ( !( pBar->IsKindOf(CC_RUNTIME_CLASS(SystemBarOp)) ||
			pBar->IsKindOf(CC_RUNTIME_CLASS(InformationBarOp))
	       )
		)
	{
		pBar->Delete();
		pBar->End();
		ShowToolbarList();
	}
}