rwlogo

Rogue Wave Views
Gadgets Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
List of all members | Public Member Functions
IlvCodeEditor::StyleSheet Class Reference

A style sheet is a container with several styles that holds palettes for the decorations and options like syntax highlighting, auto-indent mode, brace highlighting, tabulations shown has blank characters. More...

#include <ilviews/gadgets/codeedit.h>

Public Member Functions

 StyleSheet (IlvDisplay *display, IlBoolean syntaxHighlight=IlTrue, IlBoolean colorizeErrorLine=IlTrue, IlvTextField *miniBuff=0)
 Constructor. More...
 
 StyleSheet (const StyleSheet &original)
 Copy contructor. More...
 
virtual ~StyleSheet ()
 Destructor.
 
void add (int id, const Style &style)
 Add a style to the sheet. More...
 
IlBoolean exist (int id) const
 Does a style have a given identifier. More...
 
const Style & get (int id) const
 Retrieve a style using its identifier. More...
 
Style & get (int id)
 Retrieve a style using its identifier. More...
 
Decorator * getDecorator (int id)
 Retrieves the decorator from a style identifier. More...
 
void insertStyle (int id, Style style)
 Add a style to the style sheet. More...
 
int operator= (const StyleSheet &original)
 Assignment operator. More...
 

Detailed Description

A style sheet is a container with several styles that holds palettes for the decorations and options like syntax highlighting, auto-indent mode, brace highlighting, tabulations shown has blank characters.

Library: ilvadvgdt

Constructor & Destructor Documentation

IlvCodeEditor::StyleSheet::StyleSheet ( IlvDisplay display,
IlBoolean  syntaxHighlight = IlTrue,
IlBoolean  colorizeErrorLine = IlTrue,
IlvTextField miniBuff = 0 
)

Constructor.

By default, the syntax is highlighted, the lines in error are emphasized, and there is no text field to print command texts. Upon creation an StyleSheet uses the following default values:

  • The colors for text are:
    • Black on white for the standard text.
    • Red on white for errors.
    • White on black for selected text.
    • Black on grey for the margin.
  • The font is "monospace".
  • The indentation mode is set to automatic.
  • Tabulations are represented by space characters.
  • The tabulation size is set to 8.
Parameters
displayThe display to use.
syntaxHighlightShould syntax be highlighted.
colorizeErrorLineShould line in error be colorized.
miniBuffThe text field where to output extended command texts.
IlvCodeEditor::StyleSheet::StyleSheet ( const StyleSheet original)

Copy contructor.

This is a deep copy: the styles are also duplicated using their copy constructor.

Parameters
originalThe style sheet to duplicate.

Member Function Documentation

void IlvCodeEditor::StyleSheet::add ( int  id,
const Style &  style 
)

Add a style to the sheet.

Parameters
idThe style identifier
styleThe style to add.
See Also
insertStyle().
IlBoolean IlvCodeEditor::StyleSheet::exist ( int  id) const

Does a style have a given identifier.

Parameters
idThe identifier of the style to locate.
Returns
IlTrue if the sheet exists, IlFalse otherwise.
const Style& IlvCodeEditor::StyleSheet::get ( int  id) const

Retrieve a style using its identifier.

Parameters
idThe style identifier.
Returns
The style whose identifier was given.
Style& IlvCodeEditor::StyleSheet::get ( int  id)

Retrieve a style using its identifier.

Parameters
idThe style identifier.
Returns
The style whose identifier was given.
Decorator* IlvCodeEditor::StyleSheet::getDecorator ( int  id)

Retrieves the decorator from a style identifier.

Parameters
idThe style identifier.
Returns
The style decorator or null.
void IlvCodeEditor::StyleSheet::insertStyle ( int  id,
Style  style 
)

Add a style to the style sheet.

Parameters
idThe added style identifier.
styleThe style to add in the style sheet.
int IlvCodeEditor::StyleSheet::operator= ( const StyleSheet original)

Assignment operator.

Parameters
originalThe style sheet to assign.
Returns
Always 1. The caller is cleared and a deep copy of the argument is made.

© Copyright 2015, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.