bool UMatineeTrackEventHelper::PreCreateKeyframe( UInterpTrack *Track, float KeyTime ) const
{
	KeyframeAddDataName = NAME_None;

	// Prompt user for name of new event.
	FEdModeInterpEdit* Mode = (FEdModeInterpEdit*)GEditorModeTools().GetActiveMode( FBuiltinEditorModes::EM_InterpEdit );
	check(Mode != NULL);
	check(Mode->InterpEd != NULL);
	TSharedRef<STextEntryPopup> TextEntryPopup = 
		SNew(STextEntryPopup)
		.Label(NSLOCTEXT("Matinee.Popups", "NewEventName", "New Event Name").ToString())
		.DefaultText(FText::FromString(TEXT("Event")))
		.OnTextCommitted_UObject(this, &UMatineeTrackEventHelper::OnAddKeyTextEntry, (IMatineeBase*)Mode->InterpEd, Track)
		.SelectAllTextWhenFocused(true)
		.ClearKeyboardFocusOnCommit(false)
		.MaxWidth(1024.0f)
		;

	TSharedPtr< SWindow > Parent = FSlateApplication::Get().GetActiveTopLevelWindow();
	if ( Parent.IsValid() )
	{
		EntryPopupWindow = FSlateApplication::Get().PushMenu(
			Parent.ToSharedRef(),
			TextEntryPopup,
			FSlateApplication::Get().GetCursorPos(),
			FPopupTransitionEffect(FPopupTransitionEffect::TypeInPopup)
			);
	}

	TextEntryPopup->FocusDefaultWidget();

	return false;
}
bool UMatineeTrackToggleHelper::PreCreateKeyframe( UInterpTrack *Track, float KeyTime ) const
{

	bool bResult = false;

	FEdModeInterpEdit* Mode = (FEdModeInterpEdit*)GEditorModeTools().GetActiveMode( FBuiltinEditorModes::EM_InterpEdit );
	check(Mode != NULL);

	IMatineeBase* InterpEd = Mode->InterpEd;
	check(InterpEd != NULL);

	TArray<FString> PropStrings;
	PropStrings.AddZeroed( 3 );
	PropStrings[0] = TEXT("Trigger");
	PropStrings[1] = TEXT("On");
	PropStrings[2] = TEXT("Off");

	TSharedRef<STextComboPopup> TextEntryPopup = 
		SNew(STextComboPopup)
		.Label(NSLOCTEXT("Matinee.Popups", "ToggleAction", "Toggle Action").ToString())
		.TextOptions(PropStrings)
		.OnTextChosen_UObject(this, &UMatineeTrackToggleHelper::OnAddKeyTextEntry, InterpEd, Track)
		;

	TSharedPtr< SWindow > Parent = FSlateApplication::Get().GetActiveTopLevelWindow();
	if ( Parent.IsValid() )
	{
		EntryPopupWindow = FSlateApplication::Get().PushMenu(
			Parent.ToSharedRef(),
			TextEntryPopup,
			FSlateApplication::Get().GetCursorPos(),
			FPopupTransitionEffect(FPopupTransitionEffect::TypeInPopup)
			);
	}

	TextEntryPopup->FocusDefaultWidget();

	return bResult;
}
void FStaticMeshLightingInfoStatsPage::GetUserSetStaticLightmapResolution(TWeakPtr<IStatsViewer> InParentStatsViewer, bool bSwap) const
{
	if(InParentStatsViewer.IsValid())
	{
		int32 DefaultRes = 0;
		verify(GConfig->GetInt(TEXT("DevOptions.StaticLighting"), TEXT("DefaultStaticMeshLightingRes"), DefaultRes, GLightmassIni));

		TSharedRef<STextEntryPopup> TextEntry = 
			SNew(STextEntryPopup)
			.Label(LOCTEXT("StaticMeshLightingInfo_GetResolutionTitle", "Enter Lightmap Resolution"))
			.HintText(LOCTEXT("StaticMeshLightingInfo_GetResolutionToolTip", "Will round to power of two"))
			.DefaultText(FText::AsNumber(DefaultRes))
			.OnTextCommitted( FOnTextCommitted::CreateSP( this, &FStaticMeshLightingInfoStatsPage::OnResolutionCommitted, InParentStatsViewer, bSwap ) )
			.ClearKeyboardFocusOnCommit( false );

		ResolutionEntryPopupWindow = FSlateApplication::Get().PushMenu(
			InParentStatsViewer.Pin().ToSharedRef(),
			TextEntry,
			FSlateApplication::Get().GetCursorPos(),
			FPopupTransitionEffect( FPopupTransitionEffect::TypeInPopup )
			);

		TextEntry->FocusDefaultWidget();
	}
}