Пример #1
0
	void HyperLinkManager::addHyperLink(const Window* OwnerWindow,const String32 name, const Rect hyper_rect , utf32& ocolor)
	{
		// first ensure name uniqueness

		HyperLinkNameRegistry::iterator pos = d_HyperLinkNameMap.find(name);

		if (pos != d_HyperLinkNameMap.end())
		{
			pos->second.addNewRect(OwnerWindow,hyper_rect);
		}
		else
		{
			HyperLink newHyperLink;
			newHyperLink.CleanUp();
			newHyperLink.d_name = name;
			newHyperLink.addNewRect(OwnerWindow,hyper_rect);

			d_HyperLinkNameMap[name] = newHyperLink;
		}
		//如果鼠标在某个超级链接上,那么修改颜色
		if (name == d_lastMouseInLinkName && d_lastMouseInLinkWindow  ==  OwnerWindow)
		{
			ocolor = 0xFF0000FF;
		}
		return;
	}
Пример #2
0
void HyperLinkManager::addHyperLink(const Window* OwnerWindow,const String name, const Rect hyper_rect )
{
	// first ensure name uniqueness

	HyperLinkNameRegistry::iterator pos = d_HyperLinkNameMap.find(name);

	if (pos != d_HyperLinkNameMap.end())
	{
		pos->second.addNewRect(OwnerWindow,hyper_rect);
	}
	else
	{
		HyperLink newHyperLink;
		newHyperLink.CleanUp();
		newHyperLink.d_name = name;
		newHyperLink.addNewRect(OwnerWindow,hyper_rect);

		d_HyperLinkNameMap[name] = newHyperLink;
	}
		return;
}