MythUIButtonTree Class Reference
[MythUI Widget and theme handling]

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().

MythUIButtonTree::~MythUIButtonTree (  ) 

Definition at line 36 of file mythuibuttontree.cpp.


Member Function Documentation

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

Key event handler.

Parameters:
event Keypress event

Reimplemented from MythUIType.

Definition at line 591 of file mythuibuttontree.cpp.

bool MythUIButtonTree::AssignTree ( MythGenericTree tree  ) 

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:
tree The 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(), VideoDialog::loadData(), and NetTree::loadData().

void MythUIButtonTree::Reset ( void   )  [virtual]

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:
route List 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:
route List defining the path using node IDs starting at the root node
Returns:
True if successful

Definition at line 270 of file mythuibuttontree.cpp.

bool MythUIButtonTree::SetCurrentNode ( MythGenericTree node  ) 

Set the currently selected node.

Parameters:
node The 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 VideoDialog::searchComplete(), GameUI::searchComplete(), and GameUI::updateChangedNode().

void MythUIButtonTree::ShowSearchDialog ( void   ) 

Definition at line 370 of file mythuibuttontree.cpp.

Referenced by MusicCommon::searchButtonList().

MythGenericTree* MythUIButtonTree::GetCurrentNode ( void   )  const [inline]
void MythUIButtonTree::SetActive ( bool  active  ) 

Set the widget active/inactive.

Parameters:
active 

Definition at line 449 of file mythuibuttontree.cpp.

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

MythUIButtonListItem * MythUIButtonTree::GetItemCurrent ( void   )  const

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().

void MythUIButtonTree::RemoveItem ( MythUIButtonListItem item,
bool  deleteNode = false 
)

Remove the item from the tree.

Parameters:
item Item to be removed
deleteNode Also 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().

void MythUIButtonTree::RemoveCurrentItem ( bool  deleteNode = false  ) 

Remove the currently selected item from the tree.

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

Definition at line 439 of file mythuibuttontree.cpp.

void MythUIButtonTree::handleSelect ( MythUIButtonListItem item  )  [slot]

Handle a list item receiving focus.

Parameters:
item The list item

Definition at line 524 of file mythuibuttontree.cpp.

Referenced by UpdateList().

void MythUIButtonTree::handleClick ( MythUIButtonListItem item  )  [slot]

Handle a list item being clicked.

Parameters:
item The list item

Definition at line 551 of file mythuibuttontree.cpp.

Referenced by UpdateList().

void MythUIButtonTree::handleVisible ( MythUIButtonListItem item  )  [slot]

Handle a list item becoming visible.

Parameters:
item The list item

Definition at line 580 of file mythuibuttontree.cpp.

Referenced by UpdateList().

void MythUIButtonTree::Select (  )  [slot]

Definition at line 457 of file mythuibuttontree.cpp.

Referenced by MythUIButtonTree().

void MythUIButtonTree::Deselect (  )  [slot]

Definition at line 462 of file mythuibuttontree.cpp.

Referenced by MythUIButtonTree().

void MythUIButtonTree::itemSelected ( MythUIButtonListItem item  )  [signal]

Referenced by SetTreeState(), and UpdateList().

void MythUIButtonTree::itemClicked ( MythUIButtonListItem item  )  [signal]

Referenced by handleClick(), and UpdateList().

void MythUIButtonTree::itemVisible ( MythUIButtonListItem item  )  [signal]

Referenced by handleVisible(), and UpdateList().

void MythUIButtonTree::nodeChanged ( MythGenericTree node  )  [signal]

Referenced by DoSetCurrentNode().

void MythUIButtonTree::rootChanged ( MythGenericTree node  )  [signal]

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().

bool MythUIButtonTree::UpdateList ( MythUIButtonList list,
MythGenericTree node 
) [private]

Update a list with children of the tree node.

Parameters:
list List to refill
node Parent 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().

bool MythUIButtonTree::DoSetCurrentNode ( MythGenericTree node  )  [private]
void MythUIButtonTree::SwitchList ( bool  right  )  [private]

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

Parameters:
right If 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
Generated on Mon May 28 06:42:18 2012 for MythTV by  doxygen 1.6.3