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


C++ TTeamMenuItem::Signature方法代码示例

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


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

示例1: BString

void
TBarView::ChangeState(int32 state, bool vertical, bool left, bool top)
{
	bool vertSwap = (fVertical != vertical);
	bool leftSwap = (fLeft != left);

	fState = state;
	fVertical = vertical;
	fLeft = left;
	fTop = top;

	BRect screenFrame = (BScreen(Window())).Frame();

	PlaceBeMenu();
	PlaceTray(vertSwap, leftSwap, screenFrame);

	// We need to keep track of what apps are expanded.
	BList expandedItems;
	BString* signature = NULL;
	if (fVertical && Expando()
		&& static_cast<TBarApp*>(be_app)->Settings()->superExpando) {
		// Get a list of the signatures of expanded apps. Can't use 
		// team_id because there can be more than one team per application
		if (fVertical && Expando() && vertical && fExpando) {
			for (int index = 0; index < fExpando->CountItems(); index++) {
				TTeamMenuItem* item
					= dynamic_cast<TTeamMenuItem*>(fExpando->ItemAt(index));
				if (item != NULL && item->IsExpanded()) {
					signature = new BString(item->Signature());
					expandedItems.AddItem((void*)signature);
				}
			}
		}
	}

 	PlaceApplicationBar(screenFrame);
 	SizeWindow(screenFrame);
 	PositionWindow(screenFrame);
 	Window()->UpdateIfNeeded();

	// Re-expand those apps.
	if (expandedItems.CountItems() > 0) {
		for (int sigIndex = expandedItems.CountItems(); sigIndex-- > 0;) {
			signature = static_cast<BString*>(expandedItems.ItemAt(sigIndex));
			if (signature == NULL)
				continue;

			// Start at the 'bottom' of the list working up.
			// Prevents being thrown off by expanding items.
			for (int teamIndex = fExpando->CountItems(); teamIndex-- > 0;) {
				TTeamMenuItem* item
					= dynamic_cast<TTeamMenuItem*>(fExpando->ItemAt(teamIndex));
				if (item != NULL && !signature->Compare(item->Signature())) {
					item->ToggleExpandState(false);
					break;
				}
			}
		}

		// Clean up expanded signature list.
		while (!expandedItems.IsEmpty()) {
			delete static_cast<BString*>(expandedItems.RemoveItem((int32)0));
		}

		fExpando->SizeWindow();
	}

	Invalidate();
}
开发者ID:mmanley,项目名称:Antares,代码行数:69,代码来源:BarView.cpp


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