hydrogen 1.2.3
WidgetWithHighlightedList Class Reference

Widget has a list of items associated with a popup which in turn can open dialog windows. More...

#include <WidgetWithHighlightedList.h>

Inheritance diagram for WidgetWithHighlightedList:
InstrumentLine SongEditorPatternList

Public Types

enum class  RowSelection { None , Popup , Dialog }
 Specifies whether the row corresponding to m_nRowClicked should be highlighted and determines the lifecycle of the highlighting. More...
 

Protected Member Functions

 WidgetWithHighlightedList ()
 

Protected Attributes

int m_nRowClicked
 Helper variable remembering for row was clicked last.
 
RowSelection m_rowSelection
 Determines the highlighting of the row associated with m_nRowClicked.
 

Detailed Description

Widget has a list of items associated with a popup which in turn can open dialog windows.

Definition at line 30 of file WidgetWithHighlightedList.h.

Member Enumeration Documentation

◆ RowSelection

enum class RowSelection
strong

Specifies whether the row corresponding to m_nRowClicked should be highlighted and determines the lifecycle of the highlighting.

The highlighting starts when the user right-clicks a row and the associated popup window is shown. This will set m_rowSelection to RowSelection::Popup. As soon as the popup get's hidden (by clicking at an arbitrary position), it will be reset to RowSelection::None by a callback. If the user clicks an action of the popup, m_rowSelection will be upgraded to RowSelection::Dialog and set the RowSelection::None once the associated dialog is closed.

This slightly intricate state handling was introduced to ensure the associated row is highlighted whenever a popup and the corresponding dialog is opened. Else, one might very quickly forget whether "Pattern 6" or "Pattern 7" is the target of the delete operation.

Enumerator
None 

No highlighting will be drawn for the row last clicked.

Popup 

The m_nRowClicked row was right-clicked and a popup dialog did open and is still shown.

Dialog 

The popup dialog is already closed but the user clicked an associated action and its dialog is still opened.

Definition at line 52 of file WidgetWithHighlightedList.h.

Constructor & Destructor Documentation

◆ WidgetWithHighlightedList()

WidgetWithHighlightedList ( )
inlineprotected

Definition at line 70 of file WidgetWithHighlightedList.h.

Field Documentation

◆ m_nRowClicked

int m_nRowClicked
protected

Helper variable remembering for row was clicked last.

Definition at line 76 of file WidgetWithHighlightedList.h.

◆ m_rowSelection

RowSelection m_rowSelection
protected

Determines the highlighting of the row associated with m_nRowClicked.

Definition at line 80 of file WidgetWithHighlightedList.h.