Refactor CommandLine to not naiively override Window::Open, Close()
This commit is contained in:
@@ -24,10 +24,6 @@ namespace JUI {
|
||||
|
||||
/// This event is invoked when the user has sent a message to the command line.
|
||||
Event<std::string> OnInput;
|
||||
/// This event is invoked when the CommandLine window is opened.
|
||||
Event<> OnOpen;
|
||||
/// This event is invoked when the CommandLine window is closed.
|
||||
Event<> OnClose;
|
||||
|
||||
/// The default constructor initializes the layout and events of child elements.
|
||||
/// This constructor is a delegate called by the explicit constructor with parent parameter.
|
||||
@@ -42,18 +38,8 @@ namespace JUI {
|
||||
/// @param color
|
||||
void Log(const std::string& message, const Color4& color = Colors::White);
|
||||
|
||||
/// @return True if the window widget is currently open and visible. Input will be ignored if not.
|
||||
[[nodiscard]] bool Opened() const;
|
||||
|
||||
/// @return True if the window widget is currently closed and invisible. Input will be ignored if so.
|
||||
[[nodiscard]] bool Closed() const;
|
||||
|
||||
/// Opens the window widget.
|
||||
void Open(bool openVal = true);
|
||||
/// Closes the window widget.
|
||||
void Close(bool openVal = false);
|
||||
/// Sets the "open"-ness of the window widget. The widget will be invisible and ignore input if it is not open.
|
||||
void SetOpen(bool openVal);
|
||||
void SetOpen(bool openVal) override;
|
||||
|
||||
/// Passes input events down the widget hierarchy.
|
||||
/// @return True if this widget will "consume" the input.
|
||||
@@ -70,7 +56,6 @@ namespace JUI {
|
||||
int index = 0;
|
||||
int input_form_height = 20;
|
||||
int message_height = 16;
|
||||
bool open = false;
|
||||
std::vector<std::string> msg_history;
|
||||
private:
|
||||
};
|
||||
|
Reference in New Issue
Block a user