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

kstars

dmsBox Class Reference

A KLineEdit which is capable of displaying and parsing angle values flexibly and robustly. More...

#include <dmsbox.h>

Inheritance diagram for dmsBox:

Inheritance graph
[legend]

List of all members.


Public Member Functions

void clearFields (void)
dms createDms (bool deg=TRUE, bool *ok=0)
bool degType (void) const
 dmsBox (QWidget *parent, const char *ni=0, bool deg=TRUE)
void setDegType (bool t)
void setDMS (QString s)
void show (const dms *t, bool deg=TRUE)
void show (dms t, bool deg=TRUE)
void showInDegrees (const dms *t)
void showInDegrees (dms t)
void showInHours (const dms *t)
void showInHours (dms t)
 ~dmsBox ()

Protected Member Functions

void focusInEvent (QFocusEvent *e)
void focusOutEvent (QFocusEvent *e)

Properties

bool degType

Detailed Description

A KLineEdit which is capable of displaying and parsing angle values flexibly and robustly.

Angle values can be displayed and parsed as Degrees or Hours. When displaying a value, it uses a space-delimited triplet of integers representing the degrees, arcminutes, and arcseconds of the angle (or hours, minutes, seconds). For example, "-34 45 57". When parsing a value input by the user, it can also understand a number of other formats:

  • colon-delimited fields ("-34:45:57")
  • one or two fields ("-35"; "-34 46")
  • fields with unit-labels ("-34d 45m 57s")
  • floating-point numbers ("-34.76583")
Note:
Inherits KLineEdit.
Author:
Pablo de Vicente
Version:
1.0

Definition at line 43 of file dmsbox.h.


Constructor & Destructor Documentation

dmsBox::dmsBox ( QWidget *  parent,
const char *  ni = 0,
bool  deg = TRUE 
)

Constructor for the dmsBox object.

Parameters:
parent pointer to the parent QWidget
ni the name of the object
deg if TRUE use deg/arcmin/arcsec; otherwise use hours/min/sec.

Definition at line 29 of file dmsbox.cpp.

dmsBox::~dmsBox (  ) 

Destructor (empty).

Definition at line 140 of file dmsbox.cpp.


Member Function Documentation

void dmsBox::clearFields ( void   )  [inline]

Clears the KLineEdit.

Definition at line 128 of file dmsbox.h.

dms dmsBox::createDms ( bool  deg = TRUE,
bool *  ok = 0 
)

Parse the text in the dmsBox as an angle.

The text may be an integer or double value, or it may be a triplet of integer values (separated by spaces or colons) representing deg/hrs, min, sec. It is also possible to have two fields. In this case, if the second field is a double, it is converted to decimal min and double sec.

Parameters:
deg if TRUE use deg/arcmin/arcsec; otherwise use hours/min/sec.
ok set to true if a dms object was succedssfully created.
Returns:
a dms object constructed from the fields of the dmsbox

Definition at line 130 of file dmsbox.cpp.

bool dmsBox::degType ( void   )  const [inline]

Returns:
a boolean indicating if object contains degrees or hours

Definition at line 118 of file dmsbox.h.

void dmsBox::focusInEvent ( QFocusEvent *  e  )  [protected]

Definition at line 59 of file dmsbox.cpp.

void dmsBox::focusOutEvent ( QFocusEvent *  e  )  [protected]

Definition at line 69 of file dmsbox.cpp.

void dmsBox::setDegType ( bool  t  ) 

set the dmsBox to Degrees or Hours

Parameters:
t if true, the box expects angle values in degrees; otherwise it expects values in hours

Definition at line 90 of file dmsbox.cpp.

void dmsBox::setDMS ( QString  s  )  [inline]

Simply display a string.

Note:
JH: Why don't we just use KLineEdit::setText() instead?
Parameters:
s the string to display (it need not be a valid angle value).

Definition at line 102 of file dmsbox.h.

void dmsBox::show ( const dms *  t,
bool  deg = TRUE 
)

Display an angle.

Simply calls showInDegrees(t) or showInHours(t) depending on the value of deg. This behaves essentially like the above function. It differs only in the data type of its argument.

Parameters:
t the dms object which is to be displayed.
deg if TRUE, display Deg/Arcmin/Arcsec; otherwise display Hours/Min/Sec.

Definition at line 121 of file dmsbox.cpp.

void dmsBox::show ( dms  t,
bool  deg = TRUE 
)

Display an angle.

Simply calls showInDegrees(t) or showInHours(t) depending on the value of deg.

Parameters:
t the dms object which is to be displayed.
deg if TRUE, display Deg/Arcmin/Arcsec; otherwise display Hours/Min/Sec.

Definition at line 122 of file dmsbox.cpp.

void dmsBox::showInDegrees ( const dms *  t  ) 

Display an angle using Deg/Arcmin/Arcsec.

This behaves just like the above function. It differs only in the data type of the argument. t pointer to the dms object which is to be displayed

Definition at line 107 of file dmsbox.cpp.

void dmsBox::showInDegrees ( dms  t  ) 

Display an angle using Deg/Arcmin/Arcsec.

t the dms object which is to be displayed

Definition at line 108 of file dmsbox.cpp.

void dmsBox::showInHours ( const dms *  t  ) 

Display an angle using Hours/Min/Sec.

This behaves just like the above function. It differs only in the data type of the argument. t pointer to the dms object which is to be displayed

Definition at line 114 of file dmsbox.cpp.

void dmsBox::showInHours ( dms  t  ) 

Display an angle using Hours/Min/Sec.

t the dms object which is to be displayed

Definition at line 115 of file dmsbox.cpp.


Property Documentation

bool dmsBox::degType [read, write]

Definition at line 45 of file dmsbox.h.


The documentation for this class was generated from the following files:
  • dmsbox.h
  • dmsbox.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