tbx  0.7.3
Public Member Functions | List of all members
tbx::view::SelectionChangedEvent Class Reference

Class with the details of a select, deselect or toggle operation. More...

#include <selection.h>

Public Member Functions

 SelectionChangedEvent (unsigned int first, unsigned int last, bool selected, bool final=true)
 Construct a selection changed event. More...
 
 SelectionChangedEvent ()
 Default constructor creates a selection of item 0.
 
unsigned int first () const
 Returns the first selected/deselected item in the range.
 
void first (unsigned int value)
 Set first selected.
 
unsigned int last () const
 Returns the last selected/deselected item in the range.
 
void last (unsigned int value)
 Set last selected.
 
bool selected () const
 Returns the type of the event. More...
 
void selected (bool value)
 Set selected flag.
 
bool final () const
 Returns true if this is the last event in a group of events triggered by a single action. More...
 
void final (bool value)
 Set final flag.
 

Detailed Description

Class with the details of a select, deselect or toggle operation.

Constructor & Destructor Documentation

tbx::view::SelectionChangedEvent::SelectionChangedEvent ( unsigned int  first,
unsigned int  last,
bool  selected,
bool  final = true 
)
inline

Construct a selection changed event.

Parameters
firstindex of first item in selection
lastindex of last item in selection
selectedtrue if items are being selected, false if they are being deselected
finaltrue if last event generated in one action.

Member Function Documentation

bool tbx::view::SelectionChangedEvent::final ( ) const
inline

Returns true if this is the last event in a group of events triggered by a single action.

In a single selection model you would get an event with selected = false, final = false if there was an existing selection, before an event with selected = true, final = true

In a multiple selection model you get final = false for all the events generated by a method that changes the selection except the last which has final = true

bool tbx::view::SelectionChangedEvent::selected ( ) const
inline

Returns the type of the event.

Returns
true if items in range were selected false if items in range were deselected

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