casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Signals | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | Static Private Attributes
casa::TBFormatter Class Reference

Widget for entering format rules for a given field. More...

#include <TBFormat.qo.h>

List of all members.

Signals

void clearRequested (int index)
 This signal is emitted when the user clicks the "Clear Format" button.
void setRequested (int index, TBFormat *format)
 This signal is emitted when the user enters a format and then clicks the "Set Format" button.

Public Member Functions

 TBFormatter (String field, String type, int index, QFontColor font, QWidget *parent=NULL)
 Constructor that takes the field name, type, and index to be formatted, along with the default (unformatted) QFontColor and an optional pointer to the parent widget.
 ~TBFormatter ()
void setFormat (TBFormat *f)
 Sets the displayed format to the given format.

Private Slots

void changeColor ()
 Slot for when the user wants a color chooser.
void clearFormat ()
 Slot for when the user clicks the "Clear Format" button.
void setFormat ()
 Slot for when the user clicks the "Set Format" button.
void applyAllTurned (bool on)
 Slot for when the user clicks the "apply to all" checkbox.
void applySelectionChanged (int newIndex)
 Slot for when the user clicks in the value-dependent format list.
void valuesChanged ()
 Slot for when the user changes a font or color parameter.

Private Member Functions

QFontColorgetFont ()
 Collects the QFontColor information currently set in the GUI and returns it.
void setFontColor (QFontColor *color)
 Sets the displayed font and color information to the given QFontColor.

Private Attributes

String field
 Field being formatted.
String type
 Type of the field being formatted.
int index
 Index of the field being formatted.
vector< QFontColor * > fonts
 Vector of QFontColors for value-dependent formats.
bool update
 Flag indicating whether any GUI-generated events are "genuine.".

Static Private Attributes

static const int UNLIMITED_DECIMALS
 Unlimited decimals constant.

Detailed Description

Widget for entering format rules for a given field.

Synopsis

A TBFormatter is a dialog that can be used to get format rules from the user. The user can then command either to clear the format (and remove all formatting) or to set the format for a given field. Important: this behavior is implemented through the use of signals, which means that it is the caller's/parent's responsibility for handling the signals and applying the formats as needed.

Definition at line 191 of file TBFormat.qo.h.


Constructor & Destructor Documentation

casa::TBFormatter::TBFormatter ( String  field,
String  type,
int  index,
QFontColor  font,
QWidget *  parent = NULL 
)

Constructor that takes the field name, type, and index to be formatted, along with the default (unformatted) QFontColor and an optional pointer to the parent widget.

If the parent pointer is NULL, this will be displayed as a dialog; otherwise it can be displayed inside the parent.


Member Function Documentation

void casa::TBFormatter::applyAllTurned ( bool  on) [private, slot]

Slot for when the user clicks the "apply to all" checkbox.

If the all box is checked, the list of value-dependent formats is disabled.

void casa::TBFormatter::applySelectionChanged ( int  newIndex) [private, slot]

Slot for when the user clicks in the value-dependent format list.

The selected format is displayed in the widget.

void casa::TBFormatter::changeColor ( ) [private, slot]

Slot for when the user wants a color chooser.

Opens a QColorDialog.

void casa::TBFormatter::clearFormat ( ) [private, slot]

Slot for when the user clicks the "Clear Format" button.

Emits the clearFormat() signal and closes the window.

void casa::TBFormatter::clearRequested ( int  index) [signal]

This signal is emitted when the user clicks the "Clear Format" button.

The parent/caller should then remove the format for the field with the specified index.

Collects the QFontColor information currently set in the GUI and returns it.

void casa::TBFormatter::setFontColor ( QFontColor color) [private]

Sets the displayed font and color information to the given QFontColor.

Sets the displayed format to the given format.

void casa::TBFormatter::setFormat ( ) [private, slot]

Slot for when the user clicks the "Set Format" button.

Collects the format information from the widget, emits the setRequested() signal, and closes the window.

void casa::TBFormatter::setRequested ( int  index,
TBFormat format 
) [signal]

This signal is emitted when the user enters a format and then clicks the "Set Format" button.

The parent/caller should then set the format for the specified field to the specified format.

void casa::TBFormatter::valuesChanged ( ) [private, slot]

Slot for when the user changes a font or color parameter.

The QFontColor in the value-dependent vector is updated accordingly.


Member Data Documentation

Field being formatted.

Definition at line 221 of file TBFormat.qo.h.

Vector of QFontColors for value-dependent formats.

Definition at line 230 of file TBFormat.qo.h.

int casa::TBFormatter::index [private]

Index of the field being formatted.

Definition at line 227 of file TBFormat.qo.h.

Type of the field being formatted.

Definition at line 224 of file TBFormat.qo.h.

const int casa::TBFormatter::UNLIMITED_DECIMALS [static, private]

Unlimited decimals constant.

Definition at line 270 of file TBFormat.qo.h.

bool casa::TBFormatter::update [private]

Flag indicating whether any GUI-generated events are "genuine.".

Definition at line 233 of file TBFormat.qo.h.


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