MythTV  0.27pre
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
MythUISpinBox Class Reference

A widget for offering a range of numerical values where only the the bounding values and interval are known. More...

#include <mythuispinbox.h>

Inheritance diagram for MythUISpinBox:
Inheritance graph
[legend]
Collaboration diagram for MythUISpinBox:
Collaboration graph
[legend]

Public Member Functions

 MythUISpinBox (MythUIType *parent, const QString &name)
 ~MythUISpinBox ()
void SetRange (int low, int high, int step, uint pageMultiple=5)
 Set the lower and upper bounds of the spinbox, the interval and page amount.
void SetValue (int val)
void SetValue (const QString &val)
void AddSelection (int value, const QString &label="")
 Add a special label for a value of the spinbox, it does not need to be in the range.
QString GetValue (void) const
int GetIntValue (void) const
- Public Member Functions inherited from MythUIButtonList
 MythUIButtonList (MythUIType *parent, const QString &name)
 MythUIButtonList (MythUIType *parent, const QString &name, const QRect &area, bool showArrow=true, bool showScrollArrows=false, bool showScrollBar=false)
 ~MythUIButtonList ()
virtual bool keyPressEvent (QKeyEvent *)
 Key event handler.
virtual bool gestureEvent (MythGestureEvent *event)
 Mouse click/movement handler, receives mouse gesture events from the QCoreApplication event loop.
virtual void customEvent (QEvent *)
void SetDrawFromBottom (bool draw)
void Reset ()
 Reset the widget to it's original state, should not reset changes made by the theme.
void Update ()
void SetValueByData (QVariant data)
QVariant GetDataValue () const
MythRect GetButtonArea (void) const
void SetItemCurrent (MythUIButtonListItem *item)
void SetItemCurrent (int pos, int topPos=-1)
MythUIButtonListItemGetItemCurrent () const
MythUIButtonListItemGetItemFirst () const
MythUIButtonListItemGetItemNext (MythUIButtonListItem *item) const
MythUIButtonListItemGetItemAt (int pos) const
MythUIButtonListItemGetItemByData (QVariant data)
uint ItemWidth (void)
uint ItemHeight (void)
LayoutType GetLayout () const
bool MoveItemUpDown (MythUIButtonListItem *item, bool up)
void SetAllChecked (MythUIButtonListItem::CheckState state)
int GetCurrentPos () const
int GetItemPos (MythUIButtonListItem *item) const
int GetTopItemPos (void) const
int GetCount () const
uint GetVisibleCount ()
bool IsEmpty () const
bool MoveToNamedPosition (const QString &position_name)
void RemoveItem (MythUIButtonListItem *item)
void SetLCDTitles (const QString &title, const QString &columnList="")
void updateLCD (void)
void SetSearchFields (const QString &fields)
void ShowSearchDialog (void)
bool Find (const QString &searchStr, bool startsWith=false)
bool FindNext (void)
bool FindPrev (void)
void LoadInBackground (int start=0, int pageSize=20)
int StopLoad (void)
- Public Member Functions inherited from MythUIType
 MythUIType (QObject *parent, const QString &name)
void AddChild (MythUIType *child)
 Add a child UIType.
MythUITypeGetChild (const QString &name) const
 Get a named child of this UIType.
MythUITypeGetChildAt (const QPoint &p, bool recursive=true, bool focusable=true) const
 Return the first MythUIType which accepts focus found at the given coordinates.
QList< MythUIType * > * GetAllChildren (void)
 Return a list of all child widgets.
void DeleteChild (const QString &name)
 Delete a named child of this UIType.
void DeleteChild (MythUIType *child)
 Delete the given UIType if it is a child of this UIType.
void DeleteAllChildren (void)
 Delete all child widgets.
bool NeedsRedraw (void) const
void ResetNeedsRedraw (void)
void SetRedraw (void)
void SetChildNeedsRedraw (MythUIType *child)
bool CanTakeFocus (void) const
 Return if this widget can accept input focus.
void SetCanTakeFocus (bool set=true)
 Set whether this widget can take focus.
void SetFocusOrder (int)
bool IsEnabled (void) const
void SetEnabled (bool enable)
bool MoveToTop (void)
bool MoveChildToTop (MythUIType *child)
void ActivateAnimations (MythUIAnimation::Trigger trigger)
QList< MythUIAnimation * > * GetAnimations (void)
virtual void Pulse (void)
 Pulse is called 70 times a second to trigger a single frame of an animation.
void Draw (MythPainter *p, int xoffset, int yoffset, int alphaMod=255, QRect clipRegion=QRect())
void SetPosition (int x, int y)
 Convenience method, calls SetPosition(const MythPoint&) Override that instead to change functionality.
virtual void SetPosition (const MythPoint &pos)
virtual MythPoint GetPosition (void) const
virtual void SetSize (const QSize &size)
virtual void SetMinSize (const MythPoint &size)
 Set the minimum size of this widget, for widgets which can be rescaled.
virtual QSize GetMinSize (void) const
virtual void SetArea (const MythRect &rect)
virtual void AdjustMinArea (int delta_x, int delta_y, int delta_w, int delta_h)
 Adjust the size of a sibling.
virtual void VanishSibling (void)
virtual void SetMinAreaParent (MythRect actual_area, MythRect full_area, MythUIType *child)
 Adjust the size of sibling objects within the button.
virtual void SetMinArea (const MythRect &rect)
 Set the minimum area based on the given size.
virtual MythRect GetArea (void) const
 If the object has a minimum area defined, return it, other wise return the default area.
virtual MythRect GetFullArea (void) const
virtual void RecalculateArea (bool recurse=true)
void ExpandArea (const MythRect &rect)
virtual QRegion GetDirtyArea (void) const
bool IsVisible (bool recurse=false) const
void SetVisible (bool visible)
void MoveTo (QPoint destXY, QPoint speedXY)
void AdjustAlpha (int mode, int alphachange, int minalpha=0, int maxalpha=255)
void SetAlpha (int newalpha)
int GetAlpha (void) const
virtual void mediaEvent (MythMediaEvent *)
 Media/Device status event handler, received from MythMediaMonitor.
MythFontPropertiesGetFont (const QString &text) const
bool AddFont (const QString &text, MythFontProperties *fontProp)
void SetHelpText (const QString &text)
QString GetHelpText (void) const
void SetXMLLocation (const QString &filename, int where)
QString GetXMLLocation (void) const
bool IsDeferredLoading (bool recurse=false) const
void SetDeferLoad (bool defer)
virtual void LoadNow (void)
 Cause images in this and child widgets to be loaded.
bool ContainsPoint (const QPoint &point) const
 Check if the given point falls within this widgets area.
virtual MythPainterGetPainter (void)
void SetPainter (MythPainter *painter)
void SetCentre (UIEffects::Centre centre)
void SetZoom (float zoom)
void SetHorizontalZoom (float zoom)
void SetVerticalZoom (float zoom)
void SetAngle (float angle)
void SetDependIsDefault (bool isDefault)
void SetReverseDependence (bool reverse)
void SetDependsMap (QMap< QString, QString > dependsMap)
QMap< QString, QString > GetDependsMap () const

Protected Member Functions

virtual bool ParseElement (const QString &filename, QDomElement &element, bool showWarnings)
 Parse the xml definition of this widget setting the state of the object accordingly.
virtual void CopyFrom (MythUIType *base)
 Copy this widgets state from another.
virtual void CreateCopy (MythUIType *parent)
 Copy the state of this widget to the one given, it must be of the same type.
virtual bool MoveDown (MovementUnit unit=MoveItem, uint amount=0)
 
virtual bool MoveUp (MovementUnit unit=MoveItem, uint amount=0)
 
- Protected Member Functions inherited from MythUIButtonList
virtual void DrawSelf (MythPainter *p, int xoffset, int yoffset, int alphaMod, QRect clipRect)
 
void Const ()
virtual void Init ()
void InsertItem (MythUIButtonListItem *item, int listPosition=-1)
int minButtonWidth (const MythRect &area)
int minButtonHeight (const MythRect &area)
void InitButton (int itemIdx, MythUIStateType *&realButton, MythUIButtonListItem *&buttonItem)
MythUIGroupPrepareButton (int buttonIdx, int itemIdx, int &selectedIdx, int &button_shift)
bool DistributeRow (int &first_button, int &last_button, int &first_item, int &last_item, int &selected_column, int &skip_cols, bool grow_left, bool grow_right, int **col_widths, int &row_height, int total_height, int split_height, int &col_cnt, bool &wrapped)
bool DistributeCols (int &first_button, int &last_button, int &first_item, int &last_item, int &selected_column, int &selected_row, int &skip_cols, int **col_widths, QList< int > &row_heights, int &top_height, int &bottom_height, bool &wrapped)
bool DistributeButtons (void)
void CalculateButtonPositions (void)
void CalculateArrowStates (void)
void SetScrollBarPosition (void)
void ItemVisible (MythUIButtonListItem *item)
void SetActive (bool active)
int PageUp (void)
int PageDown (void)
bool DoFind (bool doMove, bool searchForward)
virtual void CalculateVisibleItems (void)
virtual QPoint GetButtonPosition (int column, int row) const
void SetButtonArea (const MythRect &rect)
virtual void Finalize (void)
 Perform any post-xml parsing initialisation tasks.
void SanitizePosition (void)
- Protected Member Functions inherited from MythUIType
virtual ~MythUIType ()
void AddFocusableChildrenToList (QMap< int, MythUIType * > &focusList)
void HandleAlphaPulse ()
 Handle one frame of an alpha (transparency) change animation.
void HandleMovementPulse ()
 Handle one frame of a movement animation.
int CalcAlpha (int alphamod)
int NormX (const int width)
int NormY (const int height)
void ConnectDependants (bool recurse=false)

Protected Attributes

bool m_hasTemplate
QString m_negativeTemplate
QString m_zeroTemplate
QString m_positiveTemplate
uint m_moveAmount
- Protected Attributes inherited from MythUIButtonList
LayoutType m_layout
ArrangeType m_arrange
ScrollStyle m_scrollStyle
WrapStyle m_wrapStyle
int m_alignment
MythRect m_contentsRect
MythPoint m_searchPosition
QString m_searchFields
QString m_searchStr
bool m_searchStartsWith
int m_itemWidth
int m_itemHeight
int m_itemHorizSpacing
int m_itemVertSpacing
uint m_itemsVisible
int m_maxVisible
int m_rows
int m_columns
int m_leftColumns
int m_rightColumns
int m_topRows
int m_bottomRows
bool m_active
bool m_showArrow
bool m_showScrollBar
MythUIScrollBarm_scrollBar
MythUIStateTypem_upArrow
MythUIStateTypem_downArrow
MythUIStateTypem_buttontemplate
QVector< MythUIStateType * > m_ButtonList
QMap< int, MythUIButtonListItem * > m_ButtonToItem
QHash< QString, QString > m_actionRemap
bool m_initialized
bool m_needsUpdate
bool m_clearing
int m_selPosition
int m_topPosition
int m_itemCount
bool m_keepSelAtBottom
QList< MythUIButtonListItem * > m_itemList
int m_nextItemLoaded
bool m_drawFromBottom
QString m_lcdTitle
QStringList m_lcdColumns
- Protected Attributes inherited from MythUIType
QList< MythUIType * > m_ChildrenList
QMap< QString, QString > m_dependsMap
bool m_Visible
bool m_HasFocus
bool m_CanHaveFocus
bool m_Enabled
bool m_EnableInitiator
bool m_Initiator
bool m_Vanish
bool m_Vanished
bool m_IsDependDefault
bool m_ReverseDepend
int m_focusOrder
MythRect m_Area
MythRect m_MinArea
MythPoint m_MinSize
QRegion m_DirtyRegion
bool m_NeedsRedraw
UIEffects m_Effects
int m_AlphaChangeMode
int m_AlphaChange
int m_AlphaMin
int m_AlphaMax
bool m_Moving
QPoint m_XYDestination
QPoint m_XYSpeed
FontMapm_Fonts
MythUITypem_Parent
MythPainterm_Painter
QList< MythUIAnimation * > m_animations
QString m_helptext
QString m_xmlLocation
bool m_deferload
QColor m_BorderColor

Additional Inherited Members

- Public Types inherited from MythUIButtonList
enum  MovementUnit {
  MoveItem, MoveColumn, MoveRow, MovePage,
  MoveMax, MoveMid, MoveByAmount
}
enum  LayoutType { LayoutVertical, LayoutHorizontal, LayoutGrid }
- Public Slots inherited from MythUIButtonList
void Select ()
void Deselect ()
- Signals inherited from MythUIButtonList
void itemSelected (MythUIButtonListItem *item)
void itemClicked (MythUIButtonListItem *item)
void itemVisible (MythUIButtonListItem *item)
void itemLoaded (MythUIButtonListItem *item)
- Static Public Member Functions inherited from XMLParseBase
static QString getFirstText (QDomElement &element)
static bool parseBool (const QString &text)
static bool parseBool (QDomElement &element)
static MythPoint parsePoint (const QString &text, bool normalize=true)
static MythPoint parsePoint (QDomElement &element, bool normalize=true)
static QSize parseSize (const QString &text, bool normalize=true)
static QSize parseSize (QDomElement &element, bool normalize=true)
static MythRect parseRect (const QString &text, bool normalize=true)
static MythRect parseRect (QDomElement &element, bool normalize=true)
static int parseAlignment (const QString &text)
static int parseAlignment (QDomElement &element)
static QBrush parseGradient (const QDomElement &element)
static QString parseText (QDomElement &element)
static MythUITypeGetGlobalObjectStore (void)
static void ClearGlobalObjectStore (void)
static void ParseChildren (const QString &filename, QDomElement &element, MythUIType *parent, bool showWarnings)
static MythUITypeParseUIType (const QString &filename, QDomElement &element, const QString &type, MythUIType *parent, MythScreenType *screen, bool showWarnings, QMap< QString, QString > &parentDependsMap)
static bool WindowExists (const QString &xmlfile, const QString &windowname)
static bool LoadWindowFromXML (const QString &xmlfile, const QString &windowname, MythUIType *parent)
static bool LoadBaseTheme (void)
static bool LoadBaseTheme (const QString &baseTheme)
static bool CopyWindowFromBase (const QString &windowname, MythScreenType *win)
- Protected Types inherited from MythUIButtonList
enum  ScrollStyle { ScrollFree, ScrollCenter, ScrollGroupCenter }
enum  ArrangeType { ArrangeFixed, ArrangeFill, ArrangeSpread, ArrangeStack }
enum  WrapStyle {
  WrapCaptive = -1, WrapNone = 0, WrapSelect, WrapItems,
  WrapFlowing
}

Detailed Description

A widget for offering a range of numerical values where only the the bounding values and interval are known.

Where a list of specific values is required instead, then use MythUIButtonList instead.

Definition at line 16 of file mythuispinbox.h.

Constructor & Destructor Documentation

MythUISpinBox::MythUISpinBox ( MythUIType parent,
const QString &  name 
)

Definition at line 8 of file mythuispinbox.cpp.

Referenced by CreateCopy().

MythUISpinBox::~MythUISpinBox ( )

Definition at line 14 of file mythuispinbox.cpp.

Member Function Documentation

void MythUISpinBox::SetRange ( int  low,
int  high,
int  step,
uint  pageMultiple = 5 
)

Set the lower and upper bounds of the spinbox, the interval and page amount.

Parameters
lowThe lowest value
highThe highest value
stepThe interval between displayed values e.g. sequence 0,5,10,15 would have have step value of 5
pageMultipleThe number of list items to move by when PAGEUP and PAGEDOWN input actions are used

Definition at line 29 of file mythuispinbox.cpp.

Referenced by RatingSettings::Create(), VisualizationSettings::Create(), MetadataSettings::Create(), ManualSchedule::Create(), SourceSetup::Create(), SmartPLDateDialog::Create(), MetadataOptions::Create(), RecMetadataEdit::Create(), EditMetadataDialog::fillWidgets(), SchedOptMixin::Load(), StoreOptMixin::Load(), CustomPriority::loadData(), and CriteriaRowEditor::operatorChanged().

void MythUISpinBox::SetValue ( int  val)
inlinevirtual
void MythUISpinBox::SetValue ( const QString &  val)
inlinevirtual

Reimplemented from MythUIButtonList.

Definition at line 26 of file mythuispinbox.h.

void MythUISpinBox::AddSelection ( int  value,
const QString &  label = "" 
)

Add a special label for a value of the spinbox, it does not need to be in the range.

Parameters
labelThe text displayed
valueThe value associated to this label

Definition at line 93 of file mythuispinbox.cpp.

QString MythUISpinBox::GetValue ( void  ) const
inlinevirtual
int MythUISpinBox::GetIntValue ( void  ) const
inlinevirtual
bool MythUISpinBox::ParseElement ( const QString &  filename,
QDomElement &  element,
bool  showWarnings 
)
protectedvirtual

Parse the xml definition of this widget setting the state of the object accordingly.

Reimplemented from MythUIButtonList.

Definition at line 125 of file mythuispinbox.cpp.

void MythUISpinBox::CopyFrom ( MythUIType base)
protectedvirtual

Copy this widgets state from another.

Reimplemented from MythUIButtonList.

Definition at line 191 of file mythuispinbox.cpp.

Referenced by CreateCopy().

void MythUISpinBox::CreateCopy ( MythUIType parent)
protectedvirtual

Copy the state of this widget to the one given, it must be of the same type.

Reimplemented from MythUIButtonList.

Definition at line 182 of file mythuispinbox.cpp.

bool MythUISpinBox::MoveDown ( MovementUnit  unit = MoveItem,
uint  amount = 0 
)
protectedvirtual

Reimplemented from MythUIButtonList.

Definition at line 152 of file mythuispinbox.cpp.

bool MythUISpinBox::MoveUp ( MovementUnit  unit = MoveItem,
uint  amount = 0 
)
protectedvirtual

Reimplemented from MythUIButtonList.

Definition at line 167 of file mythuispinbox.cpp.

Member Data Documentation

bool MythUISpinBox::m_hasTemplate
protected

Definition at line 40 of file mythuispinbox.h.

Referenced by CopyFrom(), ParseElement(), and SetRange().

QString MythUISpinBox::m_negativeTemplate
protected

Definition at line 41 of file mythuispinbox.h.

Referenced by CopyFrom(), ParseElement(), and SetRange().

QString MythUISpinBox::m_zeroTemplate
protected

Definition at line 42 of file mythuispinbox.h.

Referenced by CopyFrom(), ParseElement(), and SetRange().

QString MythUISpinBox::m_positiveTemplate
protected

Definition at line 43 of file mythuispinbox.h.

Referenced by CopyFrom(), ParseElement(), and SetRange().

uint MythUISpinBox::m_moveAmount
protected

Definition at line 45 of file mythuispinbox.h.

Referenced by MoveDown(), MoveUp(), and SetRange().


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