wex v24.10.0
Public Member Functions | List of all members
wex::style Class Reference

This class defines our scintilla styles. More...

#include <wex/syntax/style.h>

Public Member Functions

 style ()=default
 Default constructor.
 
 style (const pugi::xml_node &node, const std::string &macro)
 Constructor using xml node (sets no from the no attribute).
 
 style (const std::string &no, const std::string &value, const std::string &macro="global")
 Constructor using no, value, and macro.
 
bool apply (wxStyledTextCtrl *stc) const
 Applies this style to stc component.
 
void clear ()
 Clears style.
 
bool contains_default_style () const
 Is the default style part of these styles.
 
const auto & define () const
 Returns the original define.
 
bool is_ok () const
 Returns true if this style is valid.
 
int number () const
 Returns a single lexer number (the first in the set), or -1 if no number if present.
 
const auto & numbers () const
 Returns the lexer numbers.
 
const auto & value () const
 Returns the value.
 

Detailed Description

This class defines our scintilla styles.

The no as in xml or in the string can be a single style, or several styles separated by a comma. E.g. 1,2,3=fore:light steel blue,italic,size:8 1,2,3 are the scintilla styles numbers, and the rest is spec

Member Function Documentation

◆ apply()

bool wex::style::apply ( wxStyledTextCtrl * stc) const

Applies this style to stc component.

If no style is present, stc StyleResetDefault is invoked. If stc is not valid, or style could not be set, false is returned.