kchart

#include <KDChartCustomBox.h>

Public Slots

float trueFontSize (double areaWidthP1000, double areaHeightP1000, int rectHeight) const
int trueFontLineSpacing (double areaWidthP1000, double areaHeightP1000, int rectHeight) const
int trueRectAlignX (const TQRect &rect) const
int trueRectAlignY (const TQRect &rect) const
void getTrueShift (double areaWidthP1000, double areaHeightP1000, int rectHeight, int &dX, int &dY) const
TQRect trueRect (TQPainter *painter, TQPoint anchor, double areaWidthP1000, double areaHeightP1000) const
virtual TQRect trueRect (TQPoint anchor, double areaWidthP1000, double areaHeightP1000) const
virtual void paint (TQPainter *painter, TQPoint anchor, double areaWidthP1000, double areaHeightP1000, const KDFrame *frame=0, const TQRect &frameRect=TQRect(), const TQColor *color=0, const TQBrush *paper=0) const
void setRotation (int rotation)
void setContent (const KDChartTextPiece &content)
void setFontSize (int fontSize, bool fontScaleGlobal)
void setAnchorArea (uint area)
void setAnchorPosition (KDChartEnums::PositionFlag position)
void setAnchorAlign (uint align)
void setDataRow (uint dataRow)
void setDataCol (uint dataCol)
void setData3rd (uint data3rd)
void setDistanceAndSize (int deltaX, int deltaY, int width, int height, uint deltaAlign=KDCHART_AlignAuto, bool deltaScaleGlobal=true)
void setDistance (int deltaX, int deltaY, uint align=KDCHART_AlignAuto, bool deltaScaleGlobal=true)
void setDeltaAlign (uint align, bool deltaScaleGlobal=true)
void setDeltaScale (bool deltaScaleGlobal)
void setSize (int width, int height)
void setColor (TQColor color)
void setPaper (const TQBrush &paper)
int rotation () const
const KDChartTextPiece & content () const
int fontSize () const
bool fontScaleGlobal () const
uint anchorArea () const
KDChartEnums::PositionFlag anchorPosition () const
uint anchorAlign () const
uint dataRow () const
uint dataCol () const
uint data3rd () const
int deltaX () const
int deltaY () const
uint deltaAlign () const
bool deltaScaleGlobal () const
int width () const
int height () const
TQColor color () const
const TQBrush & paper () const

Public Member Functions

 KDChartCustomBox ()
 KDChartCustomBox (const KDChartTextPiece &content, int fontSize, bool fontScaleGlobal=true)
 KDChartCustomBox (const KDChartTextPiece &content, int fontSize, bool fontScaleGlobal, int deltaX, int deltaY, int width, int height, const TQColor &color=TQColor(TQt::black), const TQBrush &paper=TQBrush(TQt::NoBrush), uint area=KDChartEnums::AreaInnermost, KDChartEnums::PositionFlag position=KDChartEnums::PosTopLeft, uint align=TQt::AlignTop+TQt::AlignLeft, uint dataRow=0, uint dataCol=0, uint data3rd=0, uint deltaAlign=KDCHART_AlignAuto, bool deltaScaleGlobal=true, int parentAxis=-1)
 KDChartCustomBox (int rotation, const KDChartTextPiece &content, int fontSize, bool fontScaleGlobal, int deltaX, int deltaY, int width, int height, const TQColor &color=TQColor(TQt::black), const TQBrush &paper=TQBrush(TQt::NoBrush), uint area=KDChartEnums::AreaInnermost, KDChartEnums::PositionFlag position=KDChartEnums::PosTopLeft, uint align=TQt::AlignTop+TQt::AlignLeft, uint dataRow=0, uint dataCol=0, uint data3rd=0, uint deltaAlign=KDCHART_AlignAuto, bool deltaScaleGlobal=true, int parentAxis=-1)
virtual ~KDChartCustomBox ()
void deepCopy (const KDChartCustomBox *source)
const KDChartCustomBox * clone () const

Static Public Member Functions

static void createCustomBoxNode (TQDomDocument &document, TQDomNode &parent, const TQString &elementName, const KDChartCustomBox *custombox)
static bool readCustomBoxNode (const TQDomElement &element, KDChartCustomBox &custombox)

Protected Member Functions

void setInternalFlagAnchorBeingCalculated (bool flag) const
bool anchorBeingCalculated () const
void setParentAxisArea (int parentAxis) const
int parentAxisArea () const

Friends

class KDChartPainter
class KDChartParams

Detailed Description

Class for specifying and drawing custom boxes.

Definition at line 54 of file KDChartCustomBox.h.

Constructor & Destructor Documentation

◆ KDChartCustomBox() [1/4]

KDChartCustomBox::KDChartCustomBox ( )
inline

Constructor.

Set default values.

Definition at line 67 of file KDChartCustomBox.h.

◆ KDChartCustomBox() [2/4]

KDChartCustomBox::KDChartCustomBox ( const KDChartTextPiece & content,
int fontSize,
bool fontScaleGlobal = true )
inline

Constructor.

Set content and font size but no position/size parameters.

Note
If fontScaleGlobal is set to true it is not necessary to specify the size of the box: if both width and height are zero and fontScaleGlobal is true the size of the box will be calculated automatically based upon the content size. In this case the content size is interpreted as rich text string - even if the text is NOT framed by <qt> and </qt>.
Parameters
contentThe string or rich text string to be written into the box.
fontSizeThe size of the font to be used, see explanation above.
fontScaleGlobalIf true the font size will be calculated based upon the the size of the drawing area, otherwise it will be calculated based upon the height of the box.

Definition at line 109 of file KDChartCustomBox.h.

◆ KDChartCustomBox() [3/4]

KDChartCustomBox::KDChartCustomBox ( const KDChartTextPiece & content,
int fontSize,
bool fontScaleGlobal,
int deltaX,
int deltaY,
int width,
int height,
const TQColor & color = TQColor( TQt::black   ),
const TQBrush & paper = TQBrush( TQt::NoBrush ),
uint area = KDChartEnums::AreaInnermost,
KDChartEnums::PositionFlag position = KDChartEnums::PosTopLeft,
uint align = TQt::AlignTop + TQt::AlignLeft,
uint dataRow = 0,
uint dataCol = 0,
uint data3rd = 0,
uint deltaAlign = KDCHART_AlignAuto,
bool deltaScaleGlobal = true,
int parentAxis = -1 )
inline

Constructor.

Set content and position/size parameters and the color and brush to be used.

Note
If fontScaleGlobal is set to true it is not necessary to specify the size of the box: if both width and height are zero and fontScaleGlobal is true the size of the box will be calculated automatically based upon the content size. In this case the content size is interpreted as rich text string - even if the text is NOT framed by <qt> and </qt>.
Parameters
contentThe text piece to be displayed.
fontSizeIf fontSize value is greater 0, the value is taken as exact size, if fontSize is less than 0 it is interpreted as being a per-mille value of the size of the drawing area (or of the height of the box in case fontScaleGlobal is set to false, resp.). Normally the actual font size is calculated dynamically in methode paint. However if fontSize is zero no calculating will take place but the size of the content font is used.
fontScaleGlobalIf true the font size will be calculated based upon the the size of the drawing area, otherwise it will be calculated based upon the height of the box.
deltaXThe X distance between the box and its anchor. Note: If greater 0, the value is taken as exact offset, if less than 0, it is interpreted as being a per-mille value of the size of the drawing area (or as percent value of the actual font size (as returned by TQFontMetrics::lineSpacing() ) if deltaScaleGlobal is false, resp.). Actual drawing position/size is calculated dynamically in methode trueRect.
deltaYThe Y distance between the box and its anchor.
widthThe width of the box.
heightThe height of the box.
colorThe text color.
paperThe brush to be used for the background.
areaThe area to which the box is to be aligned.
positionThe anchor position. This is the edge (or the corner, resp.) of the area to which the box is to be aligned.
alignThe way how the box is to be aligned to its anchor.
dataRowThe row number of the KDChart data region that is to be used as anchor area. This parameter is ignored if area is not AreaChartDataRegion.
dataColThe column number of the KDChart data region that is to be used as anchor area. This parameter is ignored if area is not AreaChartDataRegion.
data3rdThe third dimensions number of the KDChart data region that is to be used as anchor area. This parameter is ignored if area is not AreaChartDataRegion or if there is no 3-dimensional data structure.
deltaAlignThe way how deltaX and \deltaY affect the position of the box. Leave this parameter to its default value KDCHART_AlignAuto to have the delta values used according to the box's main align settings, otherwise specify your own alignment settings: e.g. right means there will be a gap between the right side of the box and its anchor point - if the main align parameter is set to right too the anchor point will to be outside of the box / if align is set to left (but the deltaAlign to right) the anchor point will be inside the box. Possible values for deltaAlign are:
  • KDCHART_AlignAuto
  • TQt::AlignLeft | TQt::AlignTop
  • TQt::AlignLeft | TQt::AlignBottom
  • TQt::AlignRight | TQt::AlignTop
  • TQt::AlignRight | TQt::AlignBottom Using AlignVCenter or AlignHCenter or AlignCenter does not make sense here: center delta alignment will cause KDChart to ignore the respective delta settings: deltaX or deltaY or both will become ineffective.
deltaScaleGlobalIf true the actual delta X and delta Y values will be calculated by deltaX and deltaY based upon the size of the drawing area, otherwise they will be calculated based upon the actual font size.

Definition at line 202 of file KDChartCustomBox.h.

◆ KDChartCustomBox() [4/4]

KDChartCustomBox::KDChartCustomBox ( int rotation,
const KDChartTextPiece & content,
int fontSize,
bool fontScaleGlobal,
int deltaX,
int deltaY,
int width,
int height,
const TQColor & color = TQColor( TQt::black   ),
const TQBrush & paper = TQBrush( TQt::NoBrush ),
uint area = KDChartEnums::AreaInnermost,
KDChartEnums::PositionFlag position = KDChartEnums::PosTopLeft,
uint align = TQt::AlignTop + TQt::AlignLeft,
uint dataRow = 0,
uint dataCol = 0,
uint data3rd = 0,
uint deltaAlign = KDCHART_AlignAuto,
bool deltaScaleGlobal = true,
int parentAxis = -1 )
inline

Constructor.

Use this special constructor to specify a rotated box, reference point of the rotation is the anchor specified by the area and the position parameters.

Note
If fontScaleGlobal is set to true it is not necessary to specify the size of the box: if both width and height are zero and fontScaleGlobal is true the size of the box will be calculated automatically based upon the content size. In this case the content size is interpreted as rich text string - even if the text is NOT framed by <qt> and </qt>.
Parameters
rotationThe box's rotation angle in degrees (0 .. 360).
contentThe text piece to be displayed.
fontSizeIf fontSize value is greater 0, the value is taken as exact size, if fontSize is less than 0 it is interpreted as being a per-mille value of the size of the drawing area (or of the height of the box in case fontScaleGlobal is set to false, resp.). Normally the actual font size is calculated dynamically in methode paint. However if fontSize is zero no calculating will take place but the size of the content font is used.
fontScaleGlobalIf true the font size will be calculated based upon the the size of the drawing area, otherwise it will be calculated based upon the height of the box.
deltaXThe X distance between the box and its anchor. Note: If greater 0, the value is taken as exact offset, if less than 0, it is interpreted as being a per-mille value of the width of the drawing area (or as percent value of the actual font size (as returned by TQFontMetrics::lineSpacing() ) if deltaScaleGlobal is false, resp.). Actual drawing position/size is calculated dynamically in method trueRect.
deltaYThe Y distance between the box and its anchor. Note: If greater 0, the value is taken as exact offset, if less than 0, it is interpreted as being a per-mille value of the height of the drawing area (or as percent value of the actual font size (as returned by TQFontMetrics::lineSpacing() ) if deltaScaleGlobal is false, resp.). Actual drawing position/size is calculated dynamically in method trueRect.
widthThe width of the box.
heightThe height of the box.
colorThe text color.
paperThe brush to be used for the background.
areaThe area to which the box is to be aligned.
positionThe anchor position. This is the edge (or the corner, resp.) of the area to which the box is to be aligned and it is also used as the reference point of the rotation.
alignThe way how the box is to be aligned to its anchor.
dataRowThe row number of the KDChart data region that is to be used as anchor area. This parameter is ignored if area is not AreaChartDataRegion.
dataColThe column number of the KDChart data region that is to be used as anchor area. This parameter is ignored if area is not AreaChartDataRegion.
data3rdThe third dimensions number of the KDChart data region that is to be used as anchor area. This parameter is ignored if area is not AreaChartDataRegion or if there is no 3-dimensional data structure.
deltaAlignThe way how deltaX and \deltaY affect the position of the box. Leave this parameter to its default value KDCHART_AlignAuto to have the delta values used according to the box's main align settings, otherwise specify your own alignment settings: e.g. TQt::AlignRight means the box will be moved to the left (by the amount calculated using the deltaX value), so there will be a gap between the right side of the box and its anchor point IF the main align flag is set to TQt::AlignRight too, so the anchor point will to be outside of the box then. However if the main align flag is set to TQt::AlignLeft the anchor point will be inside the box. Possible values for deltaAlign are:
  • KDCHART_AlignAuto
  • TQt::AlignLeft | TQt::AlignTop
  • TQt::AlignLeft | TQt::AlignBottom
  • TQt::AlignRight | TQt::AlignTop
  • TQt::AlignRight | TQt::AlignBottom Using AlignVCenter or AlignHCenter or AlignCenter does not make sense here: center delta alignment will cause KDChart to ignore the respective delta settings: deltaX or deltaY or both will become ineffective.
Note
Moving of the box due to deltaAlign settings is applied after the box is rotated: e.g. this means a gap specified by deltaAlign = TQt::AlignTop gap will actually result in a left gap if the box is rotated by 90 degrees.
Parameters
deltaScaleGlobalIf true the actual delta X and delta Y values will be calculated by deltaX and deltaY based upon the size of the drawing area, otherwise they will be calculated based upon the actual font size.

Definition at line 323 of file KDChartCustomBox.h.

◆ ~KDChartCustomBox()

KDChartCustomBox::~KDChartCustomBox ( )
virtual

Destructor.

Only defined to have it virtual.

Definition at line 42 of file KDChartCustomBox.cpp.

Member Function Documentation

◆ anchorAlign

uint KDChartCustomBox::anchorAlign ( ) const
inlineslot

Returns the way how the box is to be aligned to its anchor.

Definition at line 800 of file KDChartCustomBox.h.

◆ anchorArea

uint KDChartCustomBox::anchorArea ( ) const
inlineslot

Returns the area to which the box is to be aligned.

Definition at line 782 of file KDChartCustomBox.h.

◆ anchorBeingCalculated()

bool KDChartCustomBox::anchorBeingCalculated ( ) const
inlineprotected

Internal routine for recursion handling.

Definition at line 972 of file KDChartCustomBox.h.

◆ anchorPosition

KDChartEnums::PositionFlag KDChartCustomBox::anchorPosition ( ) const
inlineslot

Returns the anchor position.

This is the edge (or the corner, resp.) of the area to which the box is to be aligned.

Definition at line 792 of file KDChartCustomBox.h.

◆ clone()

const KDChartCustomBox * KDChartCustomBox::clone ( ) const

Create a new box on the heap, copy the settings stored by this box into the newly created box and return the pointer to the new box.

Note
Use this method instead of using the copy constructor.
See also
deepCopy

Definition at line 74 of file KDChartCustomBox.cpp.

◆ color

TQColor KDChartCustomBox::color ( ) const
inlineslot

Returns the text color.

Definition at line 915 of file KDChartCustomBox.h.

◆ content

const KDChartTextPiece & KDChartCustomBox::content ( ) const
inlineslot

Returns the text piece content that is to be drawn.

Definition at line 748 of file KDChartCustomBox.h.

◆ createCustomBoxNode()

void KDChartCustomBox::createCustomBoxNode ( TQDomDocument & document,
TQDomNode & parent,
const TQString & elementName,
const KDChartCustomBox * custombox )
static

Creates a DOM element node that represents a custom box for use in a DOM document.

Parameters
documentthe DOM document to which the node will belong
parentthe parent node to which the new node will be appended
elementNamethe name of the new node
customboxthe custom box to be represented

Definition at line 349 of file KDChartCustomBox.cpp.

◆ data3rd

uint KDChartCustomBox::data3rd ( ) const
inlineslot

Returns the third dimensions number of the KDChart data region that is to be used as anchor area.

You should use this if anchorArea is AreaChartDataRegion and if there is a 3-dimensional data structure to find out the data region which the box is to be aligned to.

Definition at line 831 of file KDChartCustomBox.h.

◆ dataCol

uint KDChartCustomBox::dataCol ( ) const
inlineslot

Returns the column number of the KDChart data region that is to be used as anchor area.

You should use this if anchorArea is AreaChartDataRegion to find out the data region which the box is to be aligned to.

Definition at line 820 of file KDChartCustomBox.h.

◆ dataRow

uint KDChartCustomBox::dataRow ( ) const
inlineslot

Returns the row number of the KDChart data region that is to be used as anchor area.

You should use this if anchorArea is AreaChartDataRegion to find out the data region which the box is to be aligned to.

Definition at line 810 of file KDChartCustomBox.h.

◆ deepCopy()

void KDChartCustomBox::deepCopy ( const KDChartCustomBox * source)

Copy the settings of box source into this box.

Note
Use this method instead of using the assignment operator.
See also
clone

Definition at line 48 of file KDChartCustomBox.cpp.

◆ deltaAlign

uint KDChartCustomBox::deltaAlign ( ) const
inlineslot

Returns the way how the values specified for deltaX and/or deltaY affect the position of the box.

See also
setDeltaAlign, deltaX, deltaY, deltaScaleGlobal

Definition at line 872 of file KDChartCustomBox.h.

◆ deltaScaleGlobal

bool KDChartCustomBox::deltaScaleGlobal ( ) const
inlineslot

Returns the way how the distance between the box and its anchor is calculated.

See also
setDeltaScaleGlobal, deltaX, deltaY, deltaAlign

Definition at line 883 of file KDChartCustomBox.h.

◆ deltaX

int KDChartCustomBox::deltaX ( ) const
inlineslot

Returns the X distance between the box and its anchor.

Note: If greater 0, the value is taken as exact offset, if less than 0, it is interpreted as being a per-mille value of the size of the drawing area (or as percent value of the actual font size (as returned by TQFontMetrics::lineSpacing() ) if deltaScaleGlobal is false, resp.). Actual drawing position/size is calculated dynamically in methode trueRect.

See also
deltaY, deltaAlign, deltaScaleGlobal

Definition at line 846 of file KDChartCustomBox.h.

◆ deltaY

int KDChartCustomBox::deltaY ( ) const
inlineslot

Returns the Y distance between the box and its anchor.

Note: If greater 0, the value is taken as exact offset, if less than 0, it is interpreted as being a per-mille value of the size of the drawing area (or as percent value of the actual font size (as returned by TQFontMetrics::lineSpacing() ) if deltaScaleGlobal is false, resp.). Actual drawing position/size is calculated dynamically in methode trueRect.

See also
deltaX, deltaAlign, deltaScaleGlobal

Definition at line 861 of file KDChartCustomBox.h.

◆ fontScaleGlobal

bool KDChartCustomBox::fontScaleGlobal ( ) const
inlineslot

Returns the way how the font size is calculated if fontSize() is negative.

If true the font size will be calculated based upon the the size of the drawing area, otherwise it will be calculated based upon the height of the box.

Definition at line 774 of file KDChartCustomBox.h.

◆ fontSize

int KDChartCustomBox::fontSize ( ) const
inlineslot

Returns the font size to be used.

Note
If fontSize value is greater 0, the value is taken as exact size, if less than 0, it is interpreted as being a per-mille value of the logical height (or width, resp.) of the area to be used for drawing. Normally the actual font size is calculated dynamically in methode paint. However if fontSize is zero no calculating will take place but the size of the content font is used.

Definition at line 763 of file KDChartCustomBox.h.

◆ getTrueShift

void KDChartCustomBox::getTrueShift ( double areaWidthP1000,
double areaHeightP1000,
int rectHeight,
int & dX,
int & dY ) const
slot

Definition at line 142 of file KDChartCustomBox.cpp.

◆ height

int KDChartCustomBox::height ( ) const
inlineslot

Returns the height of the region where to draw the box.

Note: If greater 0, the value is the exact offset, if less than 0, it is interpreted as being a per-mille value of the logical height (or width, resp.) of the area to be used for drawing. Actual drawing position/size is calculated dynamically in methode trueRect.

Definition at line 907 of file KDChartCustomBox.h.

◆ paint

void KDChartCustomBox::paint ( TQPainter * painter,
TQPoint anchor,
double areaWidthP1000,
double areaHeightP1000,
const KDFrame * frame = 0,
const TQRect & frameRect = TQRect(),
const TQColor * color = 0,
const TQBrush * paper = 0 ) const
virtualslot

Paints the box.

Parameters
painterThe TQPainter to be used for drawing.
anchorThe anchor point which the box is to be aligned to. This can be any point within the painter drawing area but you will probably compute a point using anchorArea(), anchorPosition(), anchorAlign() (and dataRow(), dataCol(), data3rd() when dealing with KDChart data regions, resp.)
areaWidthP1000The thousands part of the drawing area width.
areaHeightP1000The thousands part of the drawing area height.
colorThe text color to be used.
paperThe brush to be used for the background.
rectThe rectangle to be drawn into. If empty the rectangle will be calculated dynamically based upon the x, y, width, height values (that were set via Constructor or via setPosAndSize) and based upon the logical height (or width, resp.) of the painters drawing area.

Definition at line 268 of file KDChartCustomBox.cpp.

◆ paper

const TQBrush & KDChartCustomBox::paper ( ) const
inlineslot

Returns the background brush.

Definition at line 923 of file KDChartCustomBox.h.

◆ parentAxisArea()

int KDChartCustomBox::parentAxisArea ( ) const
inlineprotected

Definition at line 983 of file KDChartCustomBox.h.

◆ readCustomBoxNode()

bool KDChartCustomBox::readCustomBoxNode ( const TQDomElement & element,
KDChartCustomBox & custombox )
static

Reads data from a DOM element node that represents a custom box object and fills a KDChartCustomBox object with the data.

Parameters
elementthe DOM element to read from
settingsthe custom box object to read the data into

Definition at line 391 of file KDChartCustomBox.cpp.

◆ rotation

int KDChartCustomBox::rotation ( ) const
inlineslot

Returns the rotation angle of the box in degrees (0..360).

Definition at line 740 of file KDChartCustomBox.h.

◆ setAnchorAlign

void KDChartCustomBox::setAnchorAlign ( uint align)
inlineslot

Specifies the way how the box is to be aligned to its anchor.

Definition at line 533 of file KDChartCustomBox.h.

◆ setAnchorArea

void KDChartCustomBox::setAnchorArea ( uint area)
inlineslot

Specifies the area to which the box is to be aligned.

Definition at line 514 of file KDChartCustomBox.h.

◆ setAnchorPosition

void KDChartCustomBox::setAnchorPosition ( KDChartEnums::PositionFlag position)
inlineslot

Specifies the anchor position.

This is the edge (or the corner, resp.) of the area to which the box is to be aligned.

Definition at line 524 of file KDChartCustomBox.h.

◆ setColor

void KDChartCustomBox::setColor ( TQColor color)
inlineslot

Specifies the text color to be used.

Parameters
colorThe text color.

Definition at line 722 of file KDChartCustomBox.h.

◆ setContent

void KDChartCustomBox::setContent ( const KDChartTextPiece & content)
inlineslot

Specifies the text piece content to be drawn.

Definition at line 479 of file KDChartCustomBox.h.

◆ setData3rd

void KDChartCustomBox::setData3rd ( uint data3rd)
inlineslot

Specifies the third dimensions number of the KDChart data region that is to be used as anchor area.

This value is ignored if anchorArea is not AreaChartDataRegion or if there is no 3-dimensional data structure.

Definition at line 561 of file KDChartCustomBox.h.

◆ setDataCol

void KDChartCustomBox::setDataCol ( uint dataCol)
inlineslot

Specifies the column number of the KDChart data region that is to be used as anchor area.

This value is ignored if anchorArea is not AreaChartDataRegion.

Definition at line 551 of file KDChartCustomBox.h.

◆ setDataRow

void KDChartCustomBox::setDataRow ( uint dataRow)
inlineslot

Specifies the row number of the KDChart data region that is to be used as anchor area.

This value is ignored if anchorArea is not AreaChartDataRegion.

Definition at line 542 of file KDChartCustomBox.h.

◆ setDeltaAlign

void KDChartCustomBox::setDeltaAlign ( uint align,
bool deltaScaleGlobal = true )
inlineslot

Specifies the way how the values specified for deltaX and/or deltaY affect the position of the box.

Set this to KDHART_KDCHART_AlignAuto to have the delta values used according to the box's main align settings, otherwise specify your own alignment settings: e.g. right means there will be a gap between the right side of the box and its anchor point - if the main align parameter is set to right too the anchor point will to be outside of the box / if align is set to left (but the deltaAlign to right) the anchor point will be inside the box. Possible values for deltaAlign are:

  • KDCHART_AlignAuto
  • TQt::AlignLeft | TQt::AlignTop
  • TQt::AlignLeft | TQt::AlignBottom
  • TQt::AlignRight | TQt::AlignTop
  • TQt::AlignRight | TQt::AlignBottom Using AlignVCenter or AlignHCenter or AlignCenter does not make sense here: center delta alignment will cause KDChart to ignore the respective delta settings: deltaX or deltaY or both will become ineffective.
    Note
    Moving of the box due to deltaAlign settings is applied after the box is rotated: e.g. this means a gap specified by deltaAlign = TQt::AlignTop gap will actually result in a left gap if the box is rotated by 90 degrees.
    Parameters
    deltaScaleGlobalIf true the actual delta X and delta Y values will be calculated by deltaX and deltaY based upon the size of the drawing area, otherwise they will be calculated based upon the actual font size.
    See also
    setDeltaScale, setDistance, setDistanceAndSize, deltaAlign

Definition at line 669 of file KDChartCustomBox.h.

◆ setDeltaScale

void KDChartCustomBox::setDeltaScale ( bool deltaScaleGlobal)
inlineslot

Specifies the way how the distance between the box and its anchor will be calculated.

Parameters
deltaScaleGlobalIf true the actual delta X and delta Y values will be calculated by deltaX and deltaY based upon the size of the drawing area, otherwise they will be calculated based upon the actual font size.
See also
setDeltaAlign, setDistance, setDistanceAndSize, deltaAlign

Definition at line 687 of file KDChartCustomBox.h.

◆ setDistance

void KDChartCustomBox::setDistance ( int deltaX,
int deltaY,
uint align = KDCHART_AlignAuto,
bool deltaScaleGlobal = true )
inlineslot

Specifies the distance between the box and the anchor point.

Note
If fontScaleGlobal is set to true it is not necessary to specify the size of the box: if both width and height are zero and fontScaleGlobal is true the size of the box will be calculated automatically based upon the content size. In this case the content size is interpreted as rich text string - even if the text is NOT framed by <qt> and </qt>.
Parameters
deltaXThe X distance between the box and its anchor. Note: If greater 0, the value is taken as exact offset, if less than 0, it is interpreted as being a per-mille value of the size of the drawing area (or as percent value of the actual font size (as returned by TQFontMetrics::lineSpacing() ) if deltaScaleGlobal is false, resp.). Actual drawing position/size is calculated dynamically in methode trueRect.
deltaYThe Y distance between the box and its anchor.
alignthe way how the values specified for deltaX and/or deltaY affect the position of the box.
deltaScaleGlobalIf true the actual delta X and delta Y values will be calculated by deltaX and deltaY based upon the size of the drawing area, otherwise they will be calculated based upon the actual font size.
See also
setDistanceAndSize, setSize, setDeltaAlign, setDeltaScale

Definition at line 629 of file KDChartCustomBox.h.

◆ setDistanceAndSize

void KDChartCustomBox::setDistanceAndSize ( int deltaX,
int deltaY,
int width,
int height,
uint deltaAlign = KDCHART_AlignAuto,
bool deltaScaleGlobal = true )
inlineslot

Specifies the distance between the box and the anchor point and specifies the size of the box.

Parameters
deltaXThe X distance between the box and its anchor. Note: If greater 0, the value is taken as exact offset, if less than 0, it is interpreted as being a per-mille value of the size of the drawing area (or as percent value of the actual font size (as returned by TQFontMetrics::lineSpacing() ) if deltaScaleGlobal is false, resp.). Actual drawing position/size is calculated dynamically in methode trueRect.
deltaYThe Y distance between the box and its anchor.
widthThe width of the drawing region.
heightThe height of the drawing region.
deltaAlignthe way how the values specified for deltaX and/or deltaY affect the position of the box.
deltaScaleGlobalIf true the actual delta X and delta Y values will be calculated by deltaX and deltaY based upon the size of the drawing area, otherwise they will be calculated based upon the actual font size.
See also
setDistance, setSize, setDeltaAlign, setDeltaScale

Definition at line 588 of file KDChartCustomBox.h.

◆ setFontSize

void KDChartCustomBox::setFontSize ( int fontSize,
bool fontScaleGlobal )
inlineslot

Specifies the font size to be used.

Note
If fontScaleGlobal is set to true it is not necessary to specify the size of the box: if both width and height are zero and fontScaleGlobal is true the size of the box will be calculated automatically based upon the content size. In this case the content size is interpreted as rich text string - even if the text is NOT framed by <qt> and </qt>.
Parameters
fontSizeIf fontSize value is greater 0, the value is taken as exact size, if fontSize is less than 0 it is interpreted as being a per-mille value of the size of the drawing area (or of the height of the box in case fontScaleGlobal is set to false, resp.). Normally the actual font size is calculated dynamically in methode paint. However if fontSize is zero no calculating will take place but the size of the content font is used.
fontScaleGlobalIf true the font size will be calculated based upon the the size of the drawing area, otherwise it will be calculated based upon the height of the box.

Definition at line 505 of file KDChartCustomBox.h.

◆ setInternalFlagAnchorBeingCalculated()

void KDChartCustomBox::setInternalFlagAnchorBeingCalculated ( bool flag) const
inlineprotected

Internal routine for recursion handling.

Note: This is a const methode changing NO VITAL information of the box but setting an internal, temporary flag.

Definition at line 964 of file KDChartCustomBox.h.

◆ setPaper

void KDChartCustomBox::setPaper ( const TQBrush & paper)
inlineslot

Specifies the brush to be used for the background.

Parameters
paperThe brush to be used for the background.

Definition at line 732 of file KDChartCustomBox.h.

◆ setParentAxisArea()

void KDChartCustomBox::setParentAxisArea ( int parentAxis) const
inlineprotected

Definition at line 977 of file KDChartCustomBox.h.

◆ setRotation

void KDChartCustomBox::setRotation ( int rotation)
inlineslot

Specifies the rotation angle of the box in degrees (0..360).

Definition at line 471 of file KDChartCustomBox.h.

◆ setSize

void KDChartCustomBox::setSize ( int width,
int height )
inlineslot

Specifies the size of the box.

Note
If fontScaleGlobal is set to true it is not necessary to specify the size of the box: if both width and height are zero and fontScaleGlobal is true the size of the box will be calculated automatically based upon the content size. In this case the content size is interpreted as rich text string - even if the text is NOT framed by <qt> and </qt>.
Parameters
widthThe width of the box. Note: If greater 0, the value is taken as exact offset, if less than 0, it is interpreted as being a per-mille value of the logical height (or width, resp.) of the area to be used for drawing. Actual drawing position/size is calculated dynamically in methode trueRect.
heightThe height of the box.
See also
setDistance, setDistanceAndSize, setDeltaAlign

Definition at line 711 of file KDChartCustomBox.h.

◆ trueFontLineSpacing

int KDChartCustomBox::trueFontLineSpacing ( double areaWidthP1000,
double areaHeightP1000,
int rectHeight ) const
slot

Definition at line 131 of file KDChartCustomBox.cpp.

◆ trueFontSize

float KDChartCustomBox::trueFontSize ( double areaWidthP1000,
double areaHeightP1000,
int rectHeight ) const
slot

Definition at line 82 of file KDChartCustomBox.cpp.

◆ trueRect [1/2]

TQRect KDChartCustomBox::trueRect ( TQPainter * painter,
TQPoint anchor,
double areaWidthP1000,
double areaHeightP1000 ) const
slot

Return the actual rectangle which to draw box into.

Note
When ever possible, use this method, instead of the other trueRect(), that has no TQPainter parameter. Passing a TQPainter will give you more exact results.
Parameters
painterThe TQPainter to be used.
anchorThe anchor point which the box is to be aligned to. This can be any point within the painter drawing area but you will probably compute a point using anchorArea(), anchorPosition(), anchorAlign() (and dataRow(), dataCol(), data3rd() when dealing with KDChart data regions, resp.)
areaWidthP1000The thousands part of the logical width of the area to be used for drawing.
areaHeightP1000The thousands part of the logical height of the area to be used for drawing.

Definition at line 175 of file KDChartCustomBox.cpp.

◆ trueRect [2/2]

TQRect KDChartCustomBox::trueRect ( TQPoint anchor,
double areaWidthP1000,
double areaHeightP1000 ) const
virtualslot

Return the actual rectangle which to draw box into.

Parameters
anchorThe anchor point which the box is to be aligned to. This can be any point within the painter drawing area but you will probably compute a point using anchorArea(), anchorPosition(), anchorAlign() (and dataRow(), dataCol(), data3rd() when dealing with KDChart data regions, resp.)
areaWidthP1000The thousands part of the logical width of the area to be used for drawing.
areaHeightP1000The thousands part of the logical height of the area to be used for drawing.

Definition at line 186 of file KDChartCustomBox.cpp.

◆ trueRectAlignX

int KDChartCustomBox::trueRectAlignX ( const TQRect & rect) const
slot

Definition at line 249 of file KDChartCustomBox.cpp.

◆ trueRectAlignY

int KDChartCustomBox::trueRectAlignY ( const TQRect & rect) const
slot

Definition at line 258 of file KDChartCustomBox.cpp.

◆ width

int KDChartCustomBox::width ( ) const
inlineslot

Returns the width of the region where to draw the box.

Note: If greater 0, the value is the exact offset, if less than 0, it is interpreted as being a per-mille value of the logical height (or width, resp.) of the area to be used for drawing. Actual drawing position/size is calculated dynamically in methode trueRect.

Definition at line 895 of file KDChartCustomBox.h.

◆ KDChartPainter

friend class KDChartPainter
friend

Definition at line 58 of file KDChartCustomBox.h.

◆ KDChartParams

friend class KDChartParams
friend

Definition at line 59 of file KDChartCustomBox.h.


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