A console, that displays logger messages, and where the user can enter commands.
More...
#include <geogram_gfx/gui/console.h>
|
typedef void(* | CompletionCallback) (Console *console, const std::string &line, index_t startw, index_t endw, const std::string &cmpword, std::vector< std::string > &matches) |
|
typedef void(* | HistoryCallback) (Console *console, index_t index, std::string &command) |
|
|
| Console (bool *visible_flag=nullptr) |
| Console constructor. More...
|
|
void | div (const std::string &value) override |
| Creates a new division. More...
|
|
void | out (const std::string &value) override |
| Handles an information message. More...
|
|
void | warn (const std::string &value) override |
| Handles a warning message. More...
|
|
void | err (const std::string &value) override |
| Handles an error message. More...
|
|
void | status (const std::string &value) override |
| Handles a status message. More...
|
|
void | clear () |
| Clears the contents of the console.
|
|
virtual void | printf (const char *fmt,...) |
| Displays a formatted string to the console.
|
|
virtual void | draw (bool *visible=nullptr, bool with_window=true) |
| Draws the console and handles the gui. More...
|
|
int | TextEditCallback (ImGuiInputTextCallbackData *data) |
|
void | show () |
|
void | hide () |
|
void | set_completion_callback (CompletionCallback CB) |
|
void | set_history_callback (HistoryCallback CB) |
|
void | set_history_size (index_t n) |
|
void | show_command_prompt () |
|
void | hide_command_prompt () |
|
| ~LoggerClient () override |
| LoggerClient destructor.
|
|
void | ref () const |
| Increments the reference count. More...
|
|
void | unref () const |
| Decrements the reference count. More...
|
|
bool | is_shared () const |
| Check if the object is shared. More...
|
|
int | nb_refs () const |
| Gets the number of references that point to this object. More...
|
|
|
virtual void | notify_error (const std::string &err) |
| This function is called whenever an error is displayed using err() More...
|
|
virtual bool | exec_command (const char *command) |
|
virtual void | update () |
| Redraws the GUI.
|
|
| Counted () |
| Creates a reference counted object. More...
|
|
virtual | ~Counted () |
| Destroys a reference counted object. More...
|
|
|
bool | command_prompt_ |
|
ImGuiTextBuffer | buf_ |
|
ImGuiTextFilter | filter_ |
|
ImVector< int > | line_offsets_ |
| Index to lines offset.
|
|
index_t | scroll_to_bottom_ |
|
bool * | visible_flag_ |
|
char | input_buf_ [geo_imgui_string_length] |
|
CompletionCallback | completion_callback_ |
|
HistoryCallback | history_callback_ |
|
index_t | history_index_ |
|
index_t | max_history_index_ |
|
A console, that displays logger messages, and where the user can enter commands.
Inspired from ImGui AppLog example.
Definition at line 59 of file console.h.
◆ Console()
GEO::Console::Console |
( |
bool * |
visible_flag = nullptr | ) |
|
Console constructor.
- Parameters
-
[in] | visible_flag | an optional pointer to application's variable that controls the visibility of this Console. |
◆ div()
void GEO::Console::div |
( |
const std::string & |
value | ) |
|
|
overridevirtual |
Creates a new division.
This creates a new division entitled with title
- Parameters
-
[in] | title | the text of the title |
Implements GEO::LoggerClient.
◆ draw()
virtual void GEO::Console::draw |
( |
bool * |
visible = nullptr , |
|
|
bool |
with_window = true |
|
) |
| |
|
virtual |
Draws the console and handles the gui.
- Parameters
-
[in] | visible | an optional pointer to a visibility flag, controlled by a close button if different from nullptr. |
[in] | with_window | if true, then creates a new window using imgui::Begin() / imgui::End(), else caller is responsible for doing that. |
◆ err()
void GEO::Console::err |
( |
const std::string & |
value | ) |
|
|
overridevirtual |
Handles an error message.
- Parameters
-
[in] | str | the text of the message |
Implements GEO::LoggerClient.
◆ notify_error()
virtual void GEO::Console::notify_error |
( |
const std::string & |
err | ) |
|
|
protectedvirtual |
This function is called whenever an error is displayed using err()
Base implementation does nothing. This function is meant to be overloaded in derived classes.
- Parameters
-
[in] | err | the error message sent to err() |
◆ out()
void GEO::Console::out |
( |
const std::string & |
value | ) |
|
|
overridevirtual |
Handles an information message.
- Parameters
-
[in] | str | the text of the message |
Implements GEO::LoggerClient.
◆ status()
void GEO::Console::status |
( |
const std::string & |
value | ) |
|
|
overridevirtual |
Handles a status message.
- Parameters
-
[in] | str | the text of the message |
Implements GEO::LoggerClient.
◆ warn()
void GEO::Console::warn |
( |
const std::string & |
value | ) |
|
|
overridevirtual |
Handles a warning message.
- Parameters
-
[in] | str | the text of the message |
Implements GEO::LoggerClient.
The documentation for this class was generated from the following file: