MythTV  0.26-pre
Public Slots | Signals | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
MythUIButtonTree Class Reference

A tree widget for displaying and navigating a MythGenericTree() More...

#include <mythuibuttontree.h>

Inheritance diagram for MythUIButtonTree:
MythUIType XMLParseBase

List of all members.

Public Slots

void handleSelect (MythUIButtonListItem *item)
 Handle a list item receiving focus.
void handleClick (MythUIButtonListItem *item)
 Handle a list item being clicked.
void handleVisible (MythUIButtonListItem *item)
 Handle a list item becoming visible.
void Select ()
void Deselect ()

Signals

void itemSelected (MythUIButtonListItem *item)
void itemClicked (MythUIButtonListItem *item)
void itemVisible (MythUIButtonListItem *item)
void nodeChanged (MythGenericTree *node)
void rootChanged (MythGenericTree *node)

Public Member Functions

 MythUIButtonTree (MythUIType *parent, const QString &name)
 ~MythUIButtonTree ()
virtual bool keyPressEvent (QKeyEvent *)
bool AssignTree (MythGenericTree *tree)
 Assign the root node of the tree to be displayed.
void Reset (void)
bool SetNodeByString (QStringList route)
 Using a path based on the node string, set the currently selected node.
bool SetNodeById (QList< int > route)
 Using a path based on the node IDs, set the currently selected node.
bool SetCurrentNode (MythGenericTree *node)
 Set the currently selected node.
void ShowSearchDialog (void)
MythGenericTreeGetCurrentNode (void) const
void SetActive (bool active)
 Set the widget active/inactive.
MythUIButtonListItemGetItemCurrent (void) const
 Return the currently selected list item.
void RemoveItem (MythUIButtonListItem *item, bool deleteNode=false)
 Remove the item from the tree.
void RemoveCurrentItem (bool deleteNode=false)
 Remove the currently selected item from the tree.

Protected Member Functions

virtual bool ParseElement (const QString &filename, QDomElement &element, bool showWarnings)
virtual void CopyFrom (MythUIType *base)
virtual void CreateCopy (MythUIType *parent)

Private Member Functions

void Init (void)
 Initialise the tree having loaded the formatting options from the theme.
void SetTreeState (bool refreshAll=false)
 Update the widget following a change.
bool UpdateList (MythUIButtonList *list, MythGenericTree *node)
 Update a list with children of the tree node.
bool DoSetCurrentNode (MythGenericTree *node)
void SwitchList (bool right)
 Move from list, or one level of the tree, to another.

Private Attributes

bool m_active
bool m_initialized
uint m_numLists
uint m_visibleLists
uint m_currentDepth
int m_depthOffset
uint m_oldDepth
QList< MythUIButtonList * > m_buttonlists
MythUIButtonListm_listTemplate
MythUIButtonListm_activeList
uint m_activeListID
MythGenericTreem_rootNode
MythGenericTreem_currentNode
uint m_listSpacing

Detailed Description

A tree widget for displaying and navigating a MythGenericTree()

Definition at line 16 of file mythuibuttontree.h.


Constructor & Destructor Documentation

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

Definition at line 14 of file mythuibuttontree.cpp.

Referenced by CreateCopy().

Definition at line 36 of file mythuibuttontree.cpp.


Member Function Documentation

bool MythUIButtonTree::keyPressEvent ( QKeyEvent *  event) [virtual]

Key event handler.

Parameters:
eventKeypress event

Reimplemented from MythUIType.

Definition at line 591 of file mythuibuttontree.cpp.

Assign the root node of the tree to be displayed.

MythUIButtonTree() is merely responsible for the display and navigation of a tree, the structure of that tree and the data it contains are the responsibility of MythGenericTree(). Generally MythUIButtonTree() will not modify the tree, for technical reason RemoteItem() is an exception to the rule.

You should operate directly on MythGenericTree() to change it's content.

Parameters:
treeThe node to make the root of the displayed tree
Returns:
True if successful

Definition at line 224 of file mythuibuttontree.cpp.

Referenced by GameUI::Load(), NetTree::loadData(), and VideoDialog::loadData().

Reset the widget to it's original state, should not reset changes made by the theme.

Reimplemented from MythUIType.

Definition at line 247 of file mythuibuttontree.cpp.

Referenced by AssignTree().

bool MythUIButtonTree::SetNodeByString ( QStringList  route)

Using a path based on the node string, set the currently selected node.

Parameters:
routeList defining the path using node strings starting at the root node
Returns:
True if successful

Definition at line 292 of file mythuibuttontree.cpp.

Referenced by VideoDialog::handleDynamicDirSelect(), VideoDialog::loadData(), and SetCurrentNode().

bool MythUIButtonTree::SetNodeById ( QList< int route)

Using a path based on the node IDs, set the currently selected node.

Parameters:
routeList defining the path using node IDs starting at the root node
Returns:
True if successful

Definition at line 270 of file mythuibuttontree.cpp.

Set the currently selected node.

Parameters:
nodeThe node, which must appear in this tree or behaviour is undefined
Returns:
True if successful

Definition at line 357 of file mythuibuttontree.cpp.

Referenced by GameUI::searchComplete(), VideoDialog::searchComplete(), and GameUI::updateChangedNode().

Definition at line 370 of file mythuibuttontree.cpp.

Referenced by MusicCommon::searchButtonList().

Set the widget active/inactive.

Parameters:
active

Definition at line 449 of file mythuibuttontree.cpp.

Referenced by Deselect(), VideoDialog::searchComplete(), and Select().

Return the currently selected list item.

Returns:
The list item

Definition at line 567 of file mythuibuttontree.cpp.

Referenced by VideoDialog::GetItemByMetadata(), VideoDialog::GetItemCurrent(), RemoveCurrentItem(), and NetTree::slotItemChanged().

Remove the item from the tree.

Parameters:
itemItem to be removed
deleteNodeAlso delete the node from the tree? Modifies the tree.
Returns:
True if successful

Definition at line 400 of file mythuibuttontree.cpp.

Referenced by VideoDialog::OnRemoveVideo(), and RemoveCurrentItem().

Remove the currently selected item from the tree.

Parameters:
deleteNodeAlso delete the node from the tree? Modifies the tree.
Returns:
True if successful

Definition at line 439 of file mythuibuttontree.cpp.

Handle a list item receiving focus.

Parameters:
itemThe list item

Definition at line 524 of file mythuibuttontree.cpp.

Referenced by UpdateList().

Handle a list item being clicked.

Parameters:
itemThe list item

Definition at line 551 of file mythuibuttontree.cpp.

Referenced by UpdateList().

Handle a list item becoming visible.

Parameters:
itemThe list item

Definition at line 580 of file mythuibuttontree.cpp.

Referenced by UpdateList().

Definition at line 457 of file mythuibuttontree.cpp.

Referenced by MythUIButtonTree().

Definition at line 462 of file mythuibuttontree.cpp.

Referenced by MythUIButtonTree().

Referenced by SetTreeState(), and UpdateList().

Referenced by handleClick(), and UpdateList().

Referenced by handleVisible(), and UpdateList().

Referenced by DoSetCurrentNode().

Referenced by AssignTree(), and Reset().

bool MythUIButtonTree::ParseElement ( const QString &  filename,
QDomElement &  element,
bool  showWarnings 
) [protected, virtual]

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

Reimplemented from MythUIType.

Definition at line 639 of file mythuibuttontree.cpp.

void MythUIButtonTree::CopyFrom ( MythUIType base) [protected, virtual]

Copy this widgets state from another.

Reimplemented from MythUIType.

Definition at line 670 of file mythuibuttontree.cpp.

Referenced by CreateCopy().

void MythUIButtonTree::CreateCopy ( MythUIType parent) [protected, virtual]

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

Reimplemented from MythUIType.

Definition at line 661 of file mythuibuttontree.cpp.

void MythUIButtonTree::Init ( void  ) [private]

Initialise the tree having loaded the formatting options from the theme.

Definition at line 44 of file mythuibuttontree.cpp.

Referenced by SetTreeState().

void MythUIButtonTree::SetTreeState ( bool  refreshAll = false) [private]

Update the widget following a change.

Definition at line 86 of file mythuibuttontree.cpp.

Referenced by AssignTree(), handleSelect(), RemoveItem(), Reset(), SetActive(), SetNodeById(), SetNodeByString(), and SwitchList().

Update a list with children of the tree node.

Parameters:
listList to refill
nodeParent node whose children will appear in the list
Returns:
True if successful, False if the node had no children or was invalid

Definition at line 162 of file mythuibuttontree.cpp.

Referenced by SetTreeState().

void MythUIButtonTree::SwitchList ( bool  right) [private]

Move from list, or one level of the tree, to another.

Parameters:
rightIf true move to the right or away from the root, if false move to the left or towards the root

Definition at line 474 of file mythuibuttontree.cpp.

Referenced by keyPressEvent().


Member Data Documentation

Definition at line 68 of file mythuibuttontree.h.

Referenced by CopyFrom(), MythUIButtonTree(), Reset(), SetActive(), and SetTreeState().

Definition at line 69 of file mythuibuttontree.h.

Referenced by CopyFrom(), Init(), MythUIButtonTree(), SetActive(), and SetTreeState().

Definition at line 70 of file mythuibuttontree.h.

Referenced by CopyFrom(), Init(), MythUIButtonTree(), ParseElement(), and SetNodeByString().

Definition at line 71 of file mythuibuttontree.h.

Referenced by MythUIButtonTree(), Reset(), SetTreeState(), and SwitchList().

Definition at line 73 of file mythuibuttontree.h.

Referenced by AssignTree(), MythUIButtonTree(), SetNodeByString(), and SetTreeState().

Definition at line 74 of file mythuibuttontree.h.

Referenced by MythUIButtonTree(), Reset(), and SetTreeState().

Definition at line 75 of file mythuibuttontree.h.

Referenced by Init(), SetTreeState(), and SwitchList().

Definition at line 76 of file mythuibuttontree.h.

Referenced by CopyFrom(), Init(), and MythUIButtonTree().

Definition at line 81 of file mythuibuttontree.h.

Referenced by CopyFrom(), Init(), MythUIButtonTree(), and ParseElement().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends