Public Member Functions

gui2::policy::minimum_selection::tone Struct Reference

Must select at least one item. More...

#include <generator_private.hpp>

Inheritance diagram for gui2::policy::minimum_selection::tone:
Inheritance graph
[legend]
Collaboration diagram for gui2::policy::minimum_selection::tone:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void set_item_shown (const unsigned index, const bool show)
 Called when an item is shown or hidden.
void create_item (const unsigned index)
 Called when an item is created.
bool deselect_item (const unsigned index)
 Called when the users wants to deselect an item.
void delete_item (const unsigned index)
 Called just before an item is deleted.

Detailed Description

Must select at least one item.

Definition at line 41 of file generator_private.hpp.


Member Function Documentation

void gui2::policy::minimum_selection::tone::create_item ( const unsigned  index  ) 

Called when an item is created.

Parameters:
index The index of the new item.

Definition at line 37 of file generator.cpp.

void gui2::policy::minimum_selection::tone::delete_item ( const unsigned  index  )  [virtual]

Called just before an item is deleted.

This function can if needed select another items to try to obey the policy.

Parameters:
index The index of the item to be deleted.

Todo:
do_select_item needs to test for shown flag.

Implements gui2::tgenerator_.

Definition at line 53 of file generator.cpp.

References gui2::tgenerator_::do_deselect_item(), and gui2::tgenerator_::get_selected_item_count().

Here is the call graph for this function:

bool gui2::policy::minimum_selection::tone::deselect_item ( const unsigned  index  ) 

Called when the users wants to deselect an item.

If the item can be deselected this function should call do_deselect_item() to make the deslection happen. If not allowed no action needs to be taken.

Parameters:
index The index of the item to deselect.
Returns:
Whether the item was deselected, some actions might happen automatically upon deselecting, so if this function returns false the caller should make sure the select state is restored.

Definition at line 44 of file generator.cpp.

void gui2::policy::minimum_selection::tone::set_item_shown ( const unsigned  index,
const bool  show 
) [virtual]

Called when an item is shown or hidden.

Parameters:
index The item to show or hide.
show If true shows the item, else hides it.

Implements gui2::tgenerator_.

Definition at line 21 of file generator.cpp.


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

Generated by doxygen 1.7.1 on Fri May 25 2012 01:23:42 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs