Aimsun Next Scripting
22
|
Public Types | |
enum | ChooserMode { eOneObject = 0 , eManyObjects = 1 , eOneObjectList = 2 } |
Public Member Functions | |
GAnyObjectChooser (QWidget *parent=0) | |
~GAnyObjectChooser () | |
void | setType (GKModel *amodel, GKType *atype, const ChooserMode &amode, bool listSubTypes=true) |
void | setTypes (GKModel *amodel, const QStringList &someTypes, const ChooserMode &amode, bool listSubTypes=true) |
void | setConsidersEmptyAsNew (bool value) |
bool | considersEmptyAsNew () const |
GKObject * | getObject () const |
const QVector< GKObject * > | getSelectedObjects () const |
GKType * | getType () const |
QVector< GKType * > | getAvailableTypes () const |
bool | isEmpty () const |
The selector widget allows the application to ask either for one object (eOneObject or eOneObjectList) or for many (eManyObjects) from a particular type.
If you ask for one object, use the GAnyObjectChooser::getObject call to get the selected object (if any, can be None). If you ask for many, use the GAnyObjectChooser::getObjects call (if any, the list can be empty).
Example:
It is possible to set a filter to control which objects will be added. In the next example only objects with ID lower than the filterData will be considered:
And, to use the filter:
GAnyObjectChooser::GAnyObjectChooser | ( | QWidget * | parent = 0 | ) |
GAnyObjectChooser::~GAnyObjectChooser | ( | ) |
bool GAnyObjectChooser::considersEmptyAsNew | ( | ) | const |
See setConsidersEmptyAsNew.
QVector< GKType * > GAnyObjectChooser::getAvailableTypes | ( | ) | const |
Returns the available types.
GKObject * GAnyObjectChooser::getObject | ( | ) | const |
Returns the selected object or None if none was selected.
const QVector< GKObject * > GAnyObjectChooser::getSelectedObjects | ( | ) | const |
Returns the list of selected objects or an empty list if none was selected.
GKType * GAnyObjectChooser::getType | ( | ) | const |
Returns the type currently selected
bool GAnyObjectChooser::isEmpty | ( | ) | const |
Returns true if there's no available objects for the specified filter and type.
void GAnyObjectChooser::setConsidersEmptyAsNew | ( | bool | value | ) |
By default the None object is labelled as None. Pass true to label it as New
void GAnyObjectChooser::setType | ( | GKModel * | amodel, |
GKType * | atype, | ||
const ChooserMode & | amode, | ||
bool | listSubTypes = true |
||
) |
Sets the model from where objects will be read and the type of the objects to consider. If only objects of the specified type want to be listed (and not the ones inheriting from it) the listSubTypes should be False.
void GAnyObjectChooser::setTypes | ( | GKModel * | amodel, |
const QStringList & | someTypes, | ||
const ChooserMode & | amode, | ||
bool | listSubTypes = true |
||
) |
Sets the model from where objects will be read and only some types will be considered. Parameter someTypes must contain the internal type names. If someTypes QStringList is empty, then all possible types available in the model will be considered. If only objects of the specified types want to be listed (and not the ones inheriting from it) the listSubTypesm should be False.