* Console input box with command-completion support */
| 30 | * Console input box with command-completion support |
| 31 | */ |
| 32 | class SPythonConsoleInputBox |
| 33 | : public SCompoundWidget |
| 34 | { |
| 35 | |
| 36 | public: |
| 37 | |
| 38 | SLATE_BEGIN_ARGS(SPythonConsoleInputBox) {} |
| 39 | |
| 40 | /** Called when a console command is executed */ |
| 41 | SLATE_EVENT( FSimpleDelegate, OnConsoleCommandExecuted ) |
| 42 | SLATE_END_ARGS() |
| 43 | |
| 44 | /** Protected console input box widget constructor, called by Slate */ |
| 45 | SPythonConsoleInputBox(); |
| 46 | |
| 47 | /** |
| 48 | * Construct this widget. Called by the SNew() Slate macro. |
| 49 | * |
| 50 | * @param InArgs Declaration used by the SNew() macro to construct this widget |
| 51 | */ |
| 52 | void Construct( const FArguments& InArgs ); |
| 53 | |
| 54 | /** Returns the editable text box associated with this widget. Used to set focus directly. */ |
| 55 | TSharedRef< SEditableTextBox > GetEditableTextBox() |
| 56 | { |
| 57 | return InputText.ToSharedRef(); |
| 58 | } |
| 59 | |
| 60 | /** SWidget interface */ |
| 61 | virtual void Tick( const FGeometry& AllottedGeometry, const double InCurrentTime, const float InDeltaTime ) override; |
| 62 | |
| 63 | |
| 64 | TArray<FString> History; |
| 65 | int HistoryPosition; |
| 66 | |
| 67 | |
| 68 | protected: |
| 69 | |
| 70 | virtual bool SupportsKeyboardFocus() const override { return true; } |
| 71 | |
| 72 | /** Handles entering in a command */ |
| 73 | void OnTextCommitted(const FText& InText, ETextCommit::Type CommitInfo); |
| 74 | |
| 75 | |
| 76 | private: |
| 77 | |
| 78 | /** Editable text widget */ |
| 79 | TSharedPtr< SEditableTextBox > InputText; |
| 80 | |
| 81 | /** Delegate to call when a console command is executed */ |
| 82 | FSimpleDelegate OnConsoleCommandExecuted; |
| 83 | |
| 84 | /** to prevent recursive calls in UI callback */ |
| 85 | bool bIgnoreUIUpdate; |
| 86 | }; |
| 87 | |
| 88 | /** |
| 89 | * Widget which holds a list view of logs of the program output |
nothing calls this directly
no outgoing calls
no test coverage detected