• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

kstars

InfoBox Class Reference

InfoBoxencapsulates a lightweight floating "window" to be drawn directly on a pixmap. More...

#include <infobox.h>

Inheritance diagram for InfoBox:

Inheritance graph
[legend]

List of all members.


Public Types

enum  AnchorType { AnchorNone = 0x0000, AnchorRight = 0x0001, AnchorBottom = 0x0002, AnchorBoth = AnchorRight | AnchorBottom }

Signals

void moved (QPoint p)
void shaded (bool s)

Public Member Functions

bool anchorBottom () const
int anchorFlag () const
bool anchorRight () const
bool constrain (QRect r, bool inside=true)
void draw (QPainter &p, QColor BGColor, unsigned int BGMode)
int height () const
 InfoBox (QPoint p, bool shade, QString t1="", QString t2="", QString t3="")
 InfoBox (int x, int y, bool shade, QString t1="", QString t2="", QString t3="")
 InfoBox ()
bool isVisible () const
void move (QPoint p)
void move (int x, int y)
int padx () const
int pady () const
QPoint pos () const
QRect rect () const
void resize (QSize s)
void resize (int w, int h)
void setAnchorBottom (const bool ab)
void setAnchorFlag (const int af)
void setAnchorRight (const bool ar)
void setText1 (QString newt)
void setText2 (QString newt)
void setText3 (QString newt)
void setVisible (bool t)
QSize size () const
QString text1 () const
QString text2 () const
QString text3 () const
bool toggleShade ()
void updateSize ()
int width () const
int x () const
int y () const
 ~InfoBox ()

Detailed Description

InfoBoxencapsulates a lightweight floating "window" to be drawn directly on a pixmap.

The window contains three lines of text, and it can be "shaded" to show only the top line. The window resizes itself automatically to contain the text within it.

Author:
Jason Harris
Version:
1.0

Definition at line 38 of file infobox.h.


Member Enumeration Documentation

enum InfoBox::AnchorType

Enumerator:
AnchorNone 
AnchorRight 
AnchorBottom 
AnchorBoth 

Definition at line 193 of file infobox.h.


Constructor & Destructor Documentation

InfoBox::InfoBox (  ) 

default constructor.

Creates an infobox with empty text string and default geometry

Definition at line 23 of file infobox.cpp.

InfoBox::InfoBox ( int  x,
int  y,
bool  shade,
QString  t1 = "",
QString  t2 = "",
QString  t3 = "" 
)

General constructor.

Specify The text string, x,y position and size.

Parameters:
x the X-coordinate for the box
y the Y-coordinate for the box
shade if TRUE, apply text shading as well
t1 The first line of text
t2 The second line of text
t3 The third line of text

Definition at line 39 of file infobox.cpp.

InfoBox::InfoBox ( QPoint  p,
bool  shade,
QString  t1 = "",
QString  t2 = "",
QString  t3 = "" 
)

General constructor.

Specify The text string, x,y position and size. This behaves just like the above function. It differs only in the data types of its arguments.

Parameters:
p The (x,y) position of the box
shade if TRUE, apply text shading as well
t1 The first line of text
t2 The second line of text
t3 The third line of text

Definition at line 55 of file infobox.cpp.

InfoBox::~InfoBox (  ) 

Destructor (empty).

Definition at line 71 of file infobox.cpp.


Member Function Documentation

bool InfoBox::anchorBottom (  )  const [inline]

Returns:
TRUE if the box is anchored to the bottom window edge

Definition at line 179 of file infobox.h.

int InfoBox::anchorFlag (  )  const [inline]

Returns:
the box's anchor flag bitmask.

Definition at line 188 of file infobox.h.

bool InfoBox::anchorRight (  )  const [inline]

Returns:
TRUE if the box is anchored to the right window edge

Definition at line 176 of file infobox.h.

bool InfoBox::constrain ( QRect  r,
bool  inside = true 
)

Make sure the InfoBox is inside (or outside) the QRect r.

Returns:
true if the function was able to obey the constraint.
Parameters:
r the Rect which the box must lie completely inside/outside of.
inside if TRUE (the default), the box must lie inside the rect r. Otherwise, the box must lie *outside* rect r.

Definition at line 100 of file infobox.cpp.

void InfoBox::draw ( QPainter &  p,
QColor  BGColor,
unsigned int  BGMode 
)

Draw the InfoBox.

First calls updateSize() and constrain() to make sure the box is onscreen and the correct size.

Parameters:
p reference to the QPainter on which to draw the box
BGColor the background color to be used
BGMode the background mode (0=none; 1=semi-transparent; 2=opaque)
See also:
InfoBox::updateSize()

InfoBox::constrain()

Definition at line 123 of file infobox.cpp.

int InfoBox::height (  )  const [inline]

Returns:
the height of the box

Definition at line 155 of file infobox.h.

bool InfoBox::isVisible (  )  const [inline]

Returns:
whether the box is visible

Definition at line 161 of file infobox.h.

void InfoBox::move ( QPoint  p  ) 

Reset the x,y position.

Check the edge anchors. This function behaves just like the above function. It differs only in the data type of its arguments.

Parameters:
p the new (X,Y) position

Definition at line 172 of file infobox.cpp.

void InfoBox::move ( int  x,
int  y 
)

Reset the x,y position.

Check the edge anchors.

Parameters:
x the new X-position
y the new Y-position

Definition at line 168 of file infobox.cpp.

void InfoBox::moved ( QPoint  p  )  [signal]

Signal emitted when the box is moved.

Parameters:
p the new (X,Y) position
See also:
InfoBox::move()

int InfoBox::padx (  )  const [inline]

Definition at line 136 of file infobox.h.

int InfoBox::pady (  )  const [inline]

Definition at line 137 of file infobox.h.

QPoint InfoBox::pos (  )  const [inline]

Returns:
the (X,Y) position of the box

Definition at line 149 of file infobox.h.

QRect InfoBox::rect (  )  const

Returns:
the geometry of the box

Definition at line 164 of file infobox.cpp.

void InfoBox::resize ( QSize  s  )  [inline]

Reset the width and height.

This function behaves just like the above function. It differs only in the data type of its arguments.

Parameters:
s the new size

Definition at line 107 of file infobox.h.

void InfoBox::resize ( int  w,
int  h 
) [inline]

Reset the width and height.

Parameters:
w the new width
h the new height

Definition at line 101 of file infobox.h.

void InfoBox::setAnchorBottom ( const bool  ab  ) 

Set the box to be anchored to the bottom window edge.

Definition at line 79 of file infobox.cpp.

void InfoBox::setAnchorFlag ( const int  af  )  [inline]

Set the box's anchor flag bitmask.

Definition at line 191 of file infobox.h.

void InfoBox::setAnchorRight ( const bool  ar  ) 

Set the box to be anchored to the right window edge.

Definition at line 74 of file infobox.cpp.

void InfoBox::setText1 ( QString  newt  )  [inline]

Reset the first text string.

Parameters:
newt the new text.

Definition at line 123 of file infobox.h.

void InfoBox::setText2 ( QString  newt  )  [inline]

Reset the second text string.

Parameters:
newt the new text.

Definition at line 128 of file infobox.h.

void InfoBox::setText3 ( QString  newt  )  [inline]

Reset the third text string.

Parameters:
newt the new text.

Definition at line 133 of file infobox.h.

void InfoBox::setVisible ( bool  t  )  [inline]

set the Visible flag according to the bool argument

Definition at line 140 of file infobox.h.

void InfoBox::shaded ( bool  s  )  [signal]

Signal emitted when the box's shaded-state is toggled.

Parameters:
s the new shaded state
See also:
InfoBox::toggleShade()

QSize InfoBox::size (  )  const [inline]

Returns:
the size of the box

Definition at line 158 of file infobox.h.

QString InfoBox::text1 (  )  const [inline]

Returns:
the first line of text

Definition at line 164 of file infobox.h.

QString InfoBox::text2 (  )  const [inline]

Returns:
the second line of text

Definition at line 167 of file infobox.h.

QString InfoBox::text3 (  )  const [inline]

Returns:
the third line of text

Definition at line 170 of file infobox.h.

bool InfoBox::toggleShade (  ) 

Toggle the Shaded state of the box.

Definition at line 84 of file infobox.cpp.

void InfoBox::updateSize (  ) 

Set the size of the box to fit the current displayed text.

Definition at line 92 of file infobox.cpp.

int InfoBox::width (  )  const [inline]

Returns:
the width of the box

Definition at line 152 of file infobox.h.

int InfoBox::x (  )  const [inline]

Returns:
the X-position of the box

Definition at line 143 of file infobox.h.

int InfoBox::y (  )  const [inline]

Returns:
the Y-position of the box

Definition at line 146 of file infobox.h.


The documentation for this class was generated from the following files:
  • infobox.h
  • infobox.cpp

kstars

Skip menu "kstars"
  • Main Page
  • Modules
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • keduca
  • kstars
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal