// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved. #pragma once /** Geometry Mode widget for controls */ class SGeometryModeControls : public SCompoundWidget, public FNotifyHook { public: SLATE_BEGIN_ARGS(SGeometryModeControls) {} SLATE_END_ARGS() public: void SelectionChanged(); /** SCompoundWidget functions */ void Construct(const FArguments& InArgs); protected: /** Called when a new modifier mode is selected */ void OnModifierStateChanged(ESlateCheckBoxState::Type NewCheckedState, UGeomModifier* Modifier); /** Returns the state of a modifier radio button */ ESlateCheckBoxState::Type IsModifierChecked(UGeomModifier* Modifier) const; /** Returns the enabled state of a modifier button */ bool IsModifierEnabled(UGeomModifier* Modifier) const; /** Returns the visibility state of the properties control */ EVisibility IsPropertiesVisible() const; /** Called when the Apply button is clicked */ FReply OnApplyClicked(); /** Called when a modifier button is clicked */ FReply OnModifierClicked(UGeomModifier* Modifier); private: /** Creates the geometry mode controls */ void CreateLayout(); /** Creates controls for the modifiers section */ TSharedRef CreateTopModifierButtons(); /** Creates controls for the actions section */ TSharedRef CreateBottomModifierButtons(); /** Creates controls for the modifier properties section */ TSharedRef CreateModifierProperties(); /** Creates a modifier radio button */ TSharedRef CreateSingleModifierRadioButton(UGeomModifier* Modifier); /** Creates an action button */ TSharedRef CreateSingleModifierButton(UGeomModifier* Modifier); /** Returns a reference to the geometry mode tool */ class FModeTool_GeometryModify* GetGeometryModeTool() const; void MakeBuilderBrush( UClass* BrushBuilderClass ); void OnAddVolume( UClass* VolumeClass ); private: /** Pointer to the parent window, so we know to destroy it when done */ TWeakPtr ParentWindow; /** A list of the checkbox modifier controls */ TArray< TSharedPtr > ModifierControls; /** The properties control */ TSharedPtr PropertiesControl; }; /** * Mode Toolkit for the Geometry Tools */ class FGeometryMode : public FModeToolkit { public: virtual void RegisterTabSpawners(const TSharedRef& TabManager) OVERRIDE; virtual void UnregisterTabSpawners(const TSharedRef& TabManager) OVERRIDE; /** Initializes the geometry mode toolkit */ virtual void Init(const TSharedPtr< class IToolkitHost >& InitToolkitHost); /** IToolkit interface */ virtual FName GetToolkitFName() const OVERRIDE; virtual FText GetBaseToolkitName() const OVERRIDE; virtual class FEdMode* GetEditorMode() const OVERRIDE; virtual TSharedPtr GetInlineContent() const OVERRIDE; /** Method called when the selection */ virtual void SelectionChanged(); private: /** Geometry tools widget */ TSharedPtr GeomWidget; };