Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
Divide::GUIConsole Class Referencefinal

GUIConsole implementation, CEGUI based, as in the practical tutorial series. More...

#include <GUIConsole.h>

+ Inheritance diagram for Divide::GUIConsole:

Public Member Functions

 GUIConsole (GUI &parent, PlatformContext &context)
 
 ~GUIConsole () override
 
void setVisible (bool visible)
 Hide or show the console.
 
bool isVisible () const
 Return true if console is visible, false if is hidden.
 
void update (U64 deltaTimeUS)
 
void printText (const Console::OutputEntry &entry)
 Add text to the console Window. Uses a text buffer if the console isn't ready for display yet.
 
- Public Member Functions inherited from Divide::PlatformContextComponent
 PlatformContextComponent (PlatformContext &context) noexcept
 
virtual ~PlatformContextComponent ()=default
 
PlatformContextcontext () noexcept
 
const PlatformContextcontext () const noexcept
 
- Public Member Functions inherited from Divide::NonCopyable
 NonCopyable (const NonCopyable &)=delete
 
NonCopyableoperator= (const NonCopyable &)=delete
 
 NonCopyable (NonCopyable &&)=default
 
NonCopyableoperator= (NonCopyable &&)=default
 

Protected Member Functions

void RegisterHandlers ()
 Register our handler functions.
 
bool Handle_TextSubmitted (const CEGUI::EventArgs &e)
 Handle when we press Enter after typing.
 
bool Handle_TextInput (const CEGUI::EventArgs &e)
 A key is pressed in the console input editbox.
 
void createCEGUIWindow ()
 The function which will load in the CEGUI Window and register event handlers.
 
void OutputText (const Console::OutputEntry &text) const
 
- Protected Member Functions inherited from Divide::NonCopyable
 NonCopyable ()=default
 
 ~NonCopyable ()=default
 

Protected Attributes

GUI_parent
 
bool _init
 used to check if the console is ready
 
bool _closing
 
Console::EntryType _lastMsgType
 
CEGUI::String _lastMsg
 
CEGUI::Editbox * _editBox
 pointer to the editBox to reduce typing and casting
 
CEGUI::Listbox * _outputWindow
 
std::unique_ptr< GUIConsoleCommandParser_cmdParser
 pointer to the command parser instance used
 
CEGUI::Window * _consoleWindow
 This will be a pointer to the ConsoleRoot Window.
 
CEGUI::String _inputBuffer
 
std::deque< CEGUI::String > _inputHistory
 Used to manage the input history.
 
I16 _inputHistoryIndex
 Used to cycle through history.
 
moodycamel::ConcurrentQueue< Console::OutputEntry_outputBuffer
 
size_t _consoleCallbackIndex
 
- Protected Attributes inherited from Divide::PlatformContextComponent
PlatformContext_context
 

Friends

class GUI
 

Detailed Description

GUIConsole implementation, CEGUI based, as in the practical tutorial series.

Definition at line 52 of file GUIConsole.h.

Constructor & Destructor Documentation

◆ GUIConsole()

Divide::GUIConsole::GUIConsole ( GUI parent,
PlatformContext context 
)
explicit

Definition at line 21 of file GUIConsole.cpp.

◆ ~GUIConsole()

Divide::GUIConsole::~GUIConsole ( )
override

Definition at line 40 of file GUIConsole.cpp.

Member Function Documentation

◆ createCEGUIWindow()

void Divide::GUIConsole::createCEGUIWindow ( )
protected

The function which will load in the CEGUI Window and register event handlers.

Definition at line 57 of file GUIConsole.cpp.

◆ Handle_TextInput()

bool Divide::GUIConsole::Handle_TextInput ( const CEGUI::EventArgs &  e)
protected

A key is pressed in the console input editbox.

Definition at line 98 of file GUIConsole.cpp.

◆ Handle_TextSubmitted()

bool Divide::GUIConsole::Handle_TextSubmitted ( const CEGUI::EventArgs &  e)
protected

Handle when we press Enter after typing.

Definition at line 123 of file GUIConsole.cpp.

◆ isVisible()

bool Divide::GUIConsole::isVisible ( ) const

Return true if console is visible, false if is hidden.

Definition at line 176 of file GUIConsole.cpp.

◆ OutputText()

void Divide::GUIConsole::OutputText ( const Console::OutputEntry text) const
protected

Definition at line 199 of file GUIConsole.cpp.

◆ printText()

void Divide::GUIConsole::printText ( const Console::OutputEntry entry)

Add text to the console Window. Uses a text buffer if the console isn't ready for display yet.

Definition at line 183 of file GUIConsole.cpp.

◆ RegisterHandlers()

void Divide::GUIConsole::RegisterHandlers ( )
protected

Register our handler functions.

Definition at line 85 of file GUIConsole.cpp.

◆ setVisible()

void Divide::GUIConsole::setVisible ( bool  visible)

Hide or show the console.

Definition at line 145 of file GUIConsole.cpp.

◆ update()

void Divide::GUIConsole::update ( U64  deltaTimeUS)

Definition at line 219 of file GUIConsole.cpp.

Friends And Related Function Documentation

◆ GUI

friend class GUI
friend

Definition at line 73 of file GUIConsole.h.

Member Data Documentation

◆ _closing

bool Divide::GUIConsole::_closing
protected

Definition at line 82 of file GUIConsole.h.

◆ _cmdParser

std::unique_ptr<GUIConsoleCommandParser> Divide::GUIConsole::_cmdParser
protected

pointer to the command parser instance used

Definition at line 91 of file GUIConsole.h.

◆ _consoleCallbackIndex

size_t Divide::GUIConsole::_consoleCallbackIndex
protected

Definition at line 104 of file GUIConsole.h.

◆ _consoleWindow

CEGUI::Window* Divide::GUIConsole::_consoleWindow
protected

This will be a pointer to the ConsoleRoot Window.

Definition at line 93 of file GUIConsole.h.

◆ _editBox

CEGUI::Editbox* Divide::GUIConsole::_editBox
protected

pointer to the editBox to reduce typing and casting

Definition at line 86 of file GUIConsole.h.

◆ _init

bool Divide::GUIConsole::_init
protected

used to check if the console is ready

Definition at line 81 of file GUIConsole.h.

◆ _inputBuffer

CEGUI::String Divide::GUIConsole::_inputBuffer
protected

Used to check the text we are typing so that we don't close the console in the middle of a sentence/command

Definition at line 96 of file GUIConsole.h.

◆ _inputHistory

std::deque<CEGUI::String> Divide::GUIConsole::_inputHistory
protected

Used to manage the input history.

Definition at line 98 of file GUIConsole.h.

◆ _inputHistoryIndex

I16 Divide::GUIConsole::_inputHistoryIndex
protected

Used to cycle through history.

Definition at line 100 of file GUIConsole.h.

◆ _lastMsg

CEGUI::String Divide::GUIConsole::_lastMsg
protected

Definition at line 84 of file GUIConsole.h.

◆ _lastMsgType

Console::EntryType Divide::GUIConsole::_lastMsgType
protected

Definition at line 83 of file GUIConsole.h.

◆ _outputBuffer

moodycamel::ConcurrentQueue<Console::OutputEntry> Divide::GUIConsole::_outputBuffer
protected

Definition at line 102 of file GUIConsole.h.

◆ _outputWindow

CEGUI::Listbox* Divide::GUIConsole::_outputWindow
protected

pointer to the listbox that will contain all of the text we output to the console

Definition at line 89 of file GUIConsole.h.

◆ _parent

GUI& Divide::GUIConsole::_parent
protected

Definition at line 79 of file GUIConsole.h.


The documentation for this class was generated from the following files: