Elaztek Developer Hub
Blamite Game Engine - Keystone  00390.07.02.23.1947.blamite
A library that enables the use of Qt in Blamite's editing tools.
CodeEditorDialog Class Reference

A dialog used for general-purpose text and code editing. More...

#include <CodeEditorDialog.h>

+ Inheritance diagram for CodeEditorDialog:
+ Collaboration diagram for CodeEditorDialog:

Public Member Functions

 CodeEditorDialog (std::string contents="", QWidget *parent=Q_NULLPTR)
 Initializes a new code editor dialog. More...
 
 ~CodeEditorDialog ()
 
void SetLanguage (QSourceHighlite::QSourceHighliter::Language language)
 Sets the language used for syntax highlighting. More...
 
void SetLanguage (std::string language_name)
 Sets the language used for syntax highlighting. More...
 
std::string GetText ()
 Retrieves the updated text. More...
 
bool IsCancelled ()
 Checks if the dialog was cancelled. More...
 
BlamDatarefValueHintType GetDatarefValueHintType ()
 

Detailed Description

A dialog used for general-purpose text and code editing.

Syntax highlighting is provided using the QSourceHighlite library.

Constructor & Destructor Documentation

◆ CodeEditorDialog()

CodeEditorDialog::CodeEditorDialog ( std::string  contents = "",
QWidget *  parent = Q_NULLPTR 
)

Initializes a new code editor dialog.

Parameters
contents- The initial contents of the file. Defaults to a blank string.
parent- The parent of this dialog. Defaults to nullptr.

◆ ~CodeEditorDialog()

CodeEditorDialog::~CodeEditorDialog ( )

Member Function Documentation

◆ GetDatarefValueHintType()

BlamDatarefValueHintType CodeEditorDialog::GetDatarefValueHintType ( )

◆ GetText()

std::string CodeEditorDialog::GetText ( )

Retrieves the updated text.

Returns
The modified text if the save button was clicked, otherwise this returns the original contents provided when the dialog was constructed. If no contents were provided and the dialog was cancelled, then this will return an empty string.

◆ IsCancelled()

bool CodeEditorDialog::IsCancelled ( )

Checks if the dialog was cancelled.

Returns
true if the user closed without saving, otherwise returns false.

◆ SetLanguage() [1/2]

void CodeEditorDialog::SetLanguage ( QSourceHighlite::QSourceHighliter::Language  language)

Sets the language used for syntax highlighting.

Parameters
language- The new language to use for syntax highlighting.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetLanguage() [2/2]

void CodeEditorDialog::SetLanguage ( std::string  language_name)

Sets the language used for syntax highlighting.

Parameters
language_name- The string representing the language name. If no matching language was found, then the language is left unchanged.
+ Here is the call graph for this function:

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