Go to the documentation of this file.
32#include <tqapplication.h>
39#include <tqtextstream.h>
42#include <KDFrameProfileSection.h>
87class KDCHART_EXPORT KDFrame : public TQObject
141 if( string == "Centered" )
143 else if( string == "Scaled" )
145 else if( string == "Stretched" )
178 FrameBoxRaized, FrameBoxSunken,
179 FramePanelRaized, FramePanelSunken,
218 void setSimpleFrame( SimpleFrame frame,
222 TQBrush background = TQBrush(),
223 const TQPixmap* backPixmap = 0,
224 BackPixmapMode backPixmapMode = PixStretched );
242 ProfileBottom, ProfileLeft };
259 void clearProfile( ProfileName name );
277 void addProfileSection( ProfileName name,
320 void setProfile( ProfileName name, const KDFrameProfile& profile );
331 const KDFrameProfile& profile( ProfileName name ) const;
372 case CornerBottomLeft:
374 case CornerBottomRight:
375 return "BottomRight";
395 if( string == "TopLeft" )
396 return CornerTopLeft;
397 else if( string == "TopRight" )
398 return CornerTopRight;
399 else if( string == "BottomLeft" )
400 return CornerBottomLeft;
401 else if( string == "BottomRight" )
402 return CornerBottomRight;
403 else if( string == "UNKNOWN" )
404 return CornerUNKNOWN;
406 return CornerUNKNOWN;
465 if( string == "Normal" )
467 else if( string == "Round" )
469 else if( string == "Oblique" )
470 return CornerOblique;
497 KDFrameProfile* const profile = 0 )
524 static void createFrameCornerNode( TQDomDocument& document,
526 const TQString& elementName,
540 static bool readFrameCornerNode( const TQDomElement& element,
546 KDFrameProfile* const profile = 0 )
563 const KDFrameProfile& profile() const
570 KDFrameProfile _profile;
589 KDFrameProfile* const profile = 0 )
592 case CornerTopLeft: _cornerTL.setAll( style, width, profile );
594 case CornerTopRight: _cornerTR.setAll( style, width, profile );
596 case CornerBottomLeft: _cornerBL.setAll( style, width, profile );
598 case CornerBottomRight: _cornerBR.setAll( style, width, profile );
617 KDFrameProfile* const profile = 0 )
619 _cornerTL.setAll( style, width, profile );
620 _cornerTR.setAll( style, width, profile );
621 _cornerBL.setAll( style, width, profile );
622 _cornerBR.setAll( style, width, profile );
638 case CornerTopLeft: return _cornerTL.style();
639 case CornerTopRight: return _cornerTR.style();
640 case CornerBottomLeft: return _cornerBL.style();
641 case CornerBottomRight: return _cornerBR.style();
643 default: return CornerNormal;
659 case CornerTopLeft: return _cornerTL.width();
660 case CornerTopRight: return _cornerTR.width();
661 case CornerBottomLeft: return _cornerBL.width();
662 case CornerBottomRight: return _cornerBR.width();
681 case CornerTopLeft: return _cornerTL.profile();
682 case CornerTopRight: return _cornerTR.profile();
683 case CornerBottomLeft: return _cornerBL.profile();
684 case CornerBottomRight: return _cornerBR.profile();
685 default: return _cornerTL.profile();
732 _background = background;
747 _backPixmap = backPixmap ? *backPixmap : TQPixmap();
748 _backPixmapMode = backPixmapMode;
766 backPixmap = &_backPixmap;
767 backPixmapMode = _backPixmapMode;
784 _innerRect = innerRect;
810 virtual void paintBackground( TQPainter& painter, const TQRect& innerRect ) const;
818 virtual void paintEdges( TQPainter& painter, const TQRect& innerRect ) const;
826 virtual void paintCorners( TQPainter& painter, const TQRect& innerRect ) const;
871 virtual void paint( TQPainter* painter,
872 KDFramePaintSteps steps = PaintAll,
873 TQRect innerRect = TQRect(0,0,0,0) ) const;
881 _background = TQBrush();
882 _backPixmap = TQPixmap();
883 _backPixmapMode = PixStretched;
885 _sunPos = CornerTopLeft;
886 _innerRect = TQRect( 0,0, 0,0 );
888 _rightProfile.clear();
889 _bottomProfile.clear();
890 _leftProfile.clear();
891 _cornerTL.setAll( CornerNormal, 0, 0 );
892 _cornerTR.setAll( CornerNormal, 0, 0 );
893 _cornerBL.setAll( CornerNormal, 0, 0 );
894 _cornerBR.setAll( CornerNormal, 0, 0 );
920 int midLineWidth = 0,
922 TQBrush background = TQBrush(),
923 const TQPixmap* backPixmap = 0,
928 _profileSections.setAutoDelete( true );
929 _innerRect = innerRect;
930 setSimpleFrame( frame,
937 _shadowWidth = shadowWidth;
987 D._shadowWidth = R._shadowWidth;
988 D._sunPos = R._sunPos;
989 D._background = R._background;
990 D._backPixmap = R._backPixmap;
991 D._backPixmapMode = R._backPixmapMode;
992 D._innerRect = R._innerRect;
993 D._topProfile = R._topProfile;
994 D._rightProfile = R._rightProfile;
995 D._bottomProfile = R._bottomProfile;
996 D._leftProfile = R._leftProfile;
997 D._cornerTL = R._cornerTL;
998 D._cornerTR = R._cornerTR;
999 D._cornerBL = R._cornerBL;
1000 D._cornerBR = R._cornerBR;
1001 D._profileSections= R._profileSections;
1002 D._profileSections.setAutoDelete( true );
1003 R.setProfileSectionsAutoDelete( false );
1018 static void createFrameNode( TQDomDocument& document, TQDomNode& parent,
1019 const TQString& elementName,
1031 static void createFrameProfileNode( TQDomDocument& document,
1033 const TQString& elementName,
1034 KDFrameProfile profile );
1043 static bool readFrameNode( const TQDomElement& element,
1053 static bool readFrameProfileNode( const TQDomElement& element,
1054 KDFrameProfile& profile );
1063 void setProfileSectionsAutoDelete( bool on ) const
1065 (( KDFrame*) this)->_profileSections.setAutoDelete( on );
1081 TQBrush _background;
1086 TQPixmap _backPixmap;
1092 BackPixmapMode _backPixmapMode;
1109 KDFrameProfile _profileSections;
1114 KDFrameProfile _topProfile;
1118 KDFrameProfile _rightProfile;
1122 KDFrameProfile _bottomProfile;
1126 KDFrameProfile _leftProfile;
1131 KDFrameCorner _cornerTL;
1135 KDFrameCorner _cornerTR;
1139 KDFrameCorner _cornerBL;
1143 KDFrameCorner _cornerBR;
TQTextStream & operator>>(TQTextStream &s, KDFrame &p) Reads the an XML document from the text stream s into the KDFrame object p.
TQTextStream & operator<<(TQTextStream &s, const KDFrame &p) Writes the KDFrame object p as an XML document to the text stream s.
Curvature Profile Curvature Mode: specifying the shape of a frame profile section.
Direction Profile Direction Mode: specifying whether a part of a profile looks embossed or engraved in comparis...
The main class of KDFrame.
static BackPixmapMode stringToBackPixmapMode(const TQString &string) Converts the specified string to a background pixmap mode enum value.
void setBackPixmap(const TQPixmap *backPixmap=0, BackPixmapMode backPixmapMode=PixStretched) Specifies a pixmap to be used to fill the inner area of this frame, calling this methode without pass...
BackPixmapMode These are ways how to display a pixmap that might be painted into the inner area.
friend TQTextStream & operator>>(TQTextStream &s, KDFrame &p) Reads the an XML document from the text stream s into the KDFrame object p.
const KDFrameProfile & cornerProfile(CornerName name) const
KDFramePaintSteps The different steps taken to paint the frame: first paint the background then the edges then the corn...
TQRect innerRect() const Returns the position and the size of the frame.
KDFrame(TQRect innerRect=TQRect(0, 0, 0, 0), SimpleFrame frame=FrameFlat, int lineWidth=1, int midLineWidth=0, TQPen pen=TQPen(), TQBrush background=TQBrush(), const TQPixmap *backPixmap=0, BackPixmapMode backPixmapMode=PixStretched, int shadowWidth=0, CornerName sunPos=CornerTopLeft) Default Constructor.
void setBackground(TQBrush background=TQBrush(TQt::NoBrush)) Specifies the brush to be used to fill the inner area of this frame, calling this methode without pas...
CornerName sunPos() const
SimpleFrame These simple frames are pre-defined for your convenience.
static CornerName stringToCornerName(const TQString &string)
static TQString cornerStyleToString(CornerStyle type)
int cornerWidth(CornerName name) const
void changed() This signal is emitted when any of the frame parameters has changed.
void setInnerRect(TQRect innerRect) Specifies the position and the size of area that is surrounded by the frame.
void clearAll() Remove all settings and specify no border, no edges, no background.
void setCorner(CornerName name, CornerStyle style, int width, KDFrameProfile *const profile=0)
static TQString cornerNameToString(CornerName type)
CornerStyle cornerStyle(CornerName name) const
void setSunPos(CornerName sunPos)
static TQString backPixmapModeToString(BackPixmapMode type) Converts the specified background pixmap mode enum to a string representation.
void setCorners(CornerStyle style, int width, KDFrameProfile *const profile=0)
static CornerStyle stringToCornerStyle(const TQString &string)
friend TQTextStream & operator<<(TQTextStream &s, const KDFrame &p) Writes the KDFrame object p as an XML document to the text stream s.
const TQBrush & background(const TQPixmap *&backPixmap, BackPixmapMode &backPixmapMode) const Returns the brush that is used to fill the inner area of this frame, or a TQBrush( \cNoBrush ) if no ...
|