Пример #1
0
BOOL LLFloaterWorldMap::postBuild()
{
	mPanel = getChild<LLPanel>("objects_mapview");

	childSetCommitCallback("friend combo", onAvatarComboCommit, this);

	LLComboBox *avatar_combo = getChild<LLComboBox>("friend combo");
	if (avatar_combo)
	{
		avatar_combo->selectFirstItem();
		avatar_combo->setPrearrangeCallback( onAvatarComboPrearrange );
		avatar_combo->setTextEntryCallback( onComboTextEntry );
	}

	childSetAction("DoSearch", onLocationCommit, this);

	childSetFocusChangedCallback("location", onLocationFocusChanged, this);

	LLLineEditor *location_editor = getChild<LLLineEditor>("location");
	if (location_editor)
	{
		location_editor->setKeystrokeCallback( onSearchTextEntry );
	}
	
	childSetCommitCallback("search_results", onCommitSearchResult, this);
	childSetDoubleClickCallback("search_results", onClickTeleportBtn);
	childSetCommitCallback("spin x", onCommitLocation, this);
	childSetCommitCallback("spin y", onCommitLocation, this);
	childSetCommitCallback("spin z", onCommitLocation, this);

	childSetCommitCallback("landmark combo", onLandmarkComboCommit, this);

	LLComboBox *landmark_combo = getChild<LLComboBox>( "landmark combo");
	if (landmark_combo)
	{
		landmark_combo->selectFirstItem();
		landmark_combo->setPrearrangeCallback( onLandmarkComboPrearrange );
		landmark_combo->setTextEntryCallback( onComboTextEntry );
	}

	childSetAction("Go Home", onGoHome, this);

	childSetAction("Teleport", onClickTeleportBtn, this);

	childSetAction("Show Destination", onShowTargetBtn, this);
	childSetAction("Show My Location", onShowAgentBtn, this);
	childSetAction("Clear", onClearBtn, this);
	childSetAction("copy_slurl", onCopySLURL, this);

	mCurZoomVal = log(LLWorldMapView::sMapScale)/log(2.f);
	childSetValue("zoom slider", LLWorldMapView::sMapScale);

	setDefaultBtn(NULL);

	mZoomTimer.stop();

	return TRUE;
}
Пример #2
0
BOOL LLFloaterWorldMap::postBuild()
{
	mTabs = getChild<LLTabContainer>("maptab");
	if (!mTabs) return FALSE;

	LLPanel *panel;

	panel = mTabs->getChild<LLPanel>("objects_mapview");
	if (panel)
	{
		mTabs->setTabChangeCallback(panel, onCommitBackground);
		mTabs->setTabUserData(panel, this);
	}
	panel = mTabs->getChild<LLPanel>("terrain_mapview");
	if (panel)
	{
		mTabs->setTabChangeCallback(panel, onCommitBackground);
		mTabs->setTabUserData(panel, this);
	}

	// The following callback syncs the worlmap tabs with the images.
	// Commented out since it was crashing when LLWorldMap became a singleton.
	// We should be fine without it but override the onOpen method and put it 
	// there if it turns out to be needed. -MG
	//
	//onCommitBackground((void*)this, false);

	childSetCommitCallback("friend combo", onAvatarComboCommit, this);

	LLComboBox *avatar_combo = getChild<LLComboBox>("friend combo");
	if (avatar_combo)
	{
		avatar_combo->selectFirstItem();
		avatar_combo->setPrearrangeCallback( onAvatarComboPrearrange );
		avatar_combo->setTextEntryCallback( onComboTextEntry );
	}

	childSetAction("DoSearch", onLocationCommit, this);

	childSetFocusChangedCallback("location", onLocationFocusChanged, this);

	LLLineEditor *location_editor = getChild<LLLineEditor>("location");
	if (location_editor)
	{
		location_editor->setKeystrokeCallback( onSearchTextEntry );
	}
	
	childSetCommitCallback("search_results", onCommitSearchResult, this);
	childSetDoubleClickCallback("search_results", onClickTeleportBtn);
	childSetCommitCallback("spin x", onCommitLocation, this);
	childSetCommitCallback("spin y", onCommitLocation, this);
	childSetCommitCallback("spin z", onCommitLocation, this);

	childSetCommitCallback("landmark combo", onLandmarkComboCommit, this);

	LLComboBox *landmark_combo = getChild<LLComboBox>( "landmark combo");
	if (landmark_combo)
	{
		landmark_combo->selectFirstItem();
		landmark_combo->setPrearrangeCallback( onLandmarkComboPrearrange );
		landmark_combo->setTextEntryCallback( onComboTextEntry );
	}

	childSetAction("Go Home", onGoHome, this);

	childSetAction("Teleport", onClickTeleportBtn, this);

	childSetAction("Show Destination", onShowTargetBtn, this);
	childSetAction("Show My Location", onShowAgentBtn, this);
	childSetAction("Clear", onClearBtn, this);
	childSetAction("copy_slurl", onCopySLURL, this);

	mCurZoomVal = log(gMapScale)/log(2.f);
	childSetValue("zoom slider", gMapScale);

	setDefaultBtn(NULL);

	mZoomTimer.stop();

	return TRUE;
}