Krotos Modules 3
Loading...
Searching...
No Matches
krotos::KrotosLabel Class Reference

This class was initally created to add right-click edit functionality to labels. More...

#include <KrotosLabel.h>

Inheritance diagram for krotos::KrotosLabel:

Public Member Functions

void setEditable (bool editOnSingleClick, bool editOnDoubleClick=false, bool editOnRightClick=false, bool lossOfFocusDiscards=false)
 
void mouseDown (const MouseEvent &e) override
 
void mouseUp (const MouseEvent &e) override
 
void mouseDoubleClick (const MouseEvent &e) override
 

Private Attributes

bool m_editSingleClick = false
 
bool m_editDoubleClick = false
 
bool m_editRightClick = false
 
bool m_lossOfFocusDiscardsChanges = false
 

Detailed Description

This class was initally created to add right-click edit functionality to labels.

Member Function Documentation

◆ mouseDoubleClick()

void krotos::KrotosLabel::mouseDoubleClick ( const MouseEvent & e)
override

◆ mouseDown()

void krotos::KrotosLabel::mouseDown ( const MouseEvent & e)
override

◆ mouseUp()

void krotos::KrotosLabel::mouseUp ( const MouseEvent & e)
override

◆ setEditable()

void krotos::KrotosLabel::setEditable ( bool editOnSingleClick,
bool editOnDoubleClick = false,
bool editOnRightClick = false,
bool lossOfFocusDiscards = false )

Makes the label turn into a TextEditor when clicked.

Parameters
editOnSingleClickif true, just clicking once on the label will start editing the text
editOnDoubleClickif true, a double-click is needed to start editing
editOnRightClickif true, a right-click is needed to start editing
lossOfFocusDiscardsChangesif true, clicking somewhere else while the text is being edited will discard any changes; if false, then this will commit the changes.

Member Data Documentation

◆ m_editDoubleClick

bool krotos::KrotosLabel::m_editDoubleClick = false
private

◆ m_editRightClick

bool krotos::KrotosLabel::m_editRightClick = false
private

◆ m_editSingleClick

bool krotos::KrotosLabel::m_editSingleClick = false
private

◆ m_lossOfFocusDiscardsChanges

bool krotos::KrotosLabel::m_lossOfFocusDiscardsChanges = false
private

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