#include <LightApp_Dialog.h>
Classes | |
struct | Object |
Public Types | |
enum | ObjectWg { Label = 0x00000001, Btn = 0x00000002, Control = 0x00000004 } |
enum | NameIndication { OneName, OneNameOrCount, ListOfNames, Count } |
typedef QList< int > | TypesList |
typedef QMap< int, QStringList > | SelectedObjects |
Public Types inherited from QtxDialog | |
enum | PlacePolicy { Position, Expand, Uniform } |
Buttons alignment type. More... | |
enum | ButtonArea { TopArea, BottomArea, LeftArea, RightArea } |
Buttons area. More... | |
enum | ButtonPosition { Left, Right, Center, Top = Left, Bottom = Right } |
Button position. More... | |
enum | ButtonFlags { None = 0x00000000, OK = 0x00000001, Apply = 0x00000002, Cancel = 0x00000004, Yes = 0x00000008, No = 0x00000010, Close = 0x00000020, Help = 0x00000040, OKCancel = OK | Cancel, YesNo = Yes | No, Standard = OK | Cancel | Help, All = Standard | YesNo | Apply | Close } |
Button ID flags. More... | |
enum | DialogFlags { Accept = 0x000001, Reject = 0x000002, AlignOnce = 0x000004, SetFocus = 0x000008 } |
Dialog box flags. More... | |
Signals | |
void | selectionChanged (int) |
selection in certain widget is changed More... | |
void | objectActivated (int) |
selection in certain widget is on More... | |
void | objectDeactivated (int) |
selection in certain widget is off More... | |
void | objectChanged (int, const QStringList &) |
Signals inherited from QtxDialog | |
void | dlgButton (int) |
Emitted when the user button is clicked. More... | |
void | dlgParamChanged () |
This signal can be used in successor classes to signalize about some dialog parameter changing. More... | |
void | dlgHelp () |
Emitted when the "Help" button is clicked. More... | |
void | dlgApply () |
Emitted when the "Apply" button is clicked. More... | |
void | dlgOk () |
Emitted when the "OK" button is clicked. More... | |
void | dlgNo () |
Emitted when the "No" button is clicked. More... | |
void | dlgYes () |
Emitted when the "Yes" button is clicked. More... | |
void | dlgClose () |
Emitted when the "Close" button is clicked. More... | |
void | dlgCancel () |
Emitted when the "Cancel" button is clicked. More... | |
Public Member Functions | |
LightApp_Dialog (QWidget *=0, const char *=0, bool=false, bool=false, const int=Standard, Qt::WindowFlags=0) | |
The enumeration describing how names of selected objects will be shown in line edit For more details see above. More... | |
virtual | ~LightApp_Dialog () |
virtual void | show () |
bool | isExclusive () const |
Check if buttons is exclusive (as radiobuttons) More... | |
void | setExclusive (const bool) |
Set exclusive state. More... | |
bool | isAutoResumed () const |
Check if operation according to dialog will be resumed automatically when mouse enter the dialog. More... | |
void | setAutoResumed (const bool) |
Set auto resumed state. More... | |
void | showObject (const int) |
Show widgets corresponding to id. More... | |
void | hideObject (const int) |
Hide widgets corresponding to id. More... | |
void | setObjectShown (const int, const bool) |
Change the shown state of widgets corresponding to id. More... | |
bool | isObjectShown (const int) const |
Check the shown state. More... | |
void | setObjectEnabled (const int, const bool) |
Change the enabled state of widgets corresponding to id. More... | |
bool | isObjectEnabled (const int) const |
Check the enabled state. More... | |
QWidget * | objectWg (const int theId, const int theWgId) const |
Get widget of object (see ObjectWg enumeration) More... | |
void | selectObject (const QString &, const int, const QString &, const bool=true) |
Pass to all active widgets name, type and id of selected object. More... | |
void | selectObject (const QStringList &, const TypesList &, const QStringList &, const bool=true) |
QString | objectText (const int) const |
Get text of object's control. More... | |
void | setObjectText (const int, const QString &) |
Set text of object's control. More... | |
void | selectObject (const int, const QString &, const int, const QString &, const bool=true) |
Select in certain widget avoiding check if there is active widget. More... | |
void | selectObject (const int, const QStringList &, const TypesList &, const QStringList &, const bool=true) |
bool | hasSelection (const int) const |
Check if certain widget has selection. More... | |
void | clearSelection (const int=-1) |
Clear selection in widgets. If parameter is -1, then selection in all widgets will be cleared. More... | |
void | selectedObject (const int, QStringList &) const |
Get ids list of object selected in certain widget. More... | |
QString | selectedObject (const int) const |
Get ids list of object selected in certain widget. More... | |
void | objectSelection (SelectedObjects &) const |
Get map "widget id -> ids list". More... | |
void | activateObject (const int) |
Activate object selection button. More... | |
void | deactivateAll () |
Set all object selection buttons to inactive state. More... | |
Public Member Functions inherited from QtxDialog | |
QtxDialog (QWidget *=0, bool=false, bool=false, const int=Standard, Qt::WindowFlags=0) | |
Constructor. More... | |
virtual | ~QtxDialog () |
Destructor. More... | |
void | setDialogFlags (const int) |
Set specified dialog box flags. More... | |
void | clearDialogFlags (const int) |
Clear specified the dialog flags. More... | |
bool | testDialogFlags (const int) const |
Test specified dialog flags. More... | |
void | setButtonFlags (const int) |
Add specified control button(s) to the dialog box. More... | |
void | clearButtonFlags (const int) |
Remove specified control button(s) from the dialog box. More... | |
bool | testButtonFlags (const int) const |
Test specified buttons. More... | |
int | buttonPosition (const int) const |
Get specified control button position. More... | |
void | setButtonPosition (const int, const int=-1) |
Set the specified control button(s) position. More... | |
void | setPlacePosition (const int, const int) |
Set button position for all buttons in specified area. More... | |
int | placePolicy (const int) const |
Get buttons layouting policy for the specified area. More... | |
void | setPlacePolicy (const int, const int) |
set buttons layouting policy for the specified area. More... | |
void | setButtonPlace (const int, const int) |
Move specified button(s) into specified area. More... | |
QString | buttonText (const int) |
Get specified button's text. More... | |
void | setButtonText (const int, const QString &text) |
Set specified button's text. More... | |
void | setButtonFocus (const int) |
Sets the keyboard focus to the specified button. More... | |
bool | hasButtonFocus (const int) const |
Check if specified button has keyboard focus. More... | |
bool | isButtonEnabled (const int) const |
Get "enabled" status of the specified button(s). More... | |
void | setButtonEnabled (const bool, const int) |
Enable/disable specified button(s). More... | |
bool | isBorderEnabled (const int) const |
Check if border is enabled. More... | |
void | setBorderEnabled (const bool, const int) |
Show/hide border for the specified button area. More... | |
void | removeButton (const int) |
Remove user button. More... | |
int | insertButton (const QString &, const int=BottomArea) |
Add user button to the dialog box. More... | |
QIntList | userButtonIds () const |
Get all user button IDs. More... | |
QAbstractButton * | userButton (const int) const |
Get user button by the specified id. More... | |
uint | setAlignment (uint align) |
Sets alignment policy. More... | |
Protected Member Functions | |
SUIT_ResourceMgr * | resMgr () const |
Finds and returns resource manager. More... | |
int | createObject (const QString &, QWidget *, const int=-1) |
void | setObjectPixmap (const QPixmap &) |
Set pixmap as icon for all selection buttons. More... | |
void | setObjectPixmap (const QString &, const QString &) |
Load pixmap with section, name using resource manager and set as icon for all selection buttons. More... | |
void | renameObject (const int, const QString &) |
Change label. More... | |
void | setObjectType (const int, const int,...) |
Set possible types for certain id. The list of arguments must be finished by negative integer. More... | |
void | setObjectType (const int, const TypesList &) |
Set list as possible types for object selection. More... | |
void | addObjectType (const int, const int, const int,...) |
void | addObjectType (const int, const TypesList &) |
Add types to list of possible types. More... | |
void | addObjectType (const int, const int) |
Add type to list of possible types. More... | |
void | removeObjectType (const int) |
Clear list of possible types (it means, that all types are welcome) More... | |
void | removeObjectType (const int, const TypesList &) |
Remove types in list from list of possible types. More... | |
void | removeObjectType (const int, const int) |
Remove a type from list of possible types. More... | |
bool | hasObjectType (const int, const int) const |
Check if list of possible types contains this one. More... | |
void | objectTypes (const int, TypesList &) const |
Return list of possible types. More... | |
QString & | typeName (const int) |
Change and get type name for indicating in selection widget. More... | |
const QString | typeName (const int) const |
virtual QString | selectionDescription (const QStringList &, const TypesList &, const NameIndication) const |
Create string contains selection list by list of names, list of types and current name indication state. More... | |
virtual QString | countOfTypes (const TypesList &) const |
Create string by pattern "<count> <type>" for current list of types. More... | |
NameIndication | nameIndication (const int) const |
Get and set name indication for certain widget. More... | |
void | setNameIndication (const int, const NameIndication) |
bool | multipleSelection (const int) const |
Check using name indication if multiple selection in possible. More... | |
void | setReadOnly (const int, const bool) |
Set the "read only" state of object selection line edit The "read only" will be false only if name indication is ListOfNames. More... | |
bool | isReadOnly (const int) const |
Check the "read only" state of object selection line edit. More... | |
Protected Member Functions inherited from QtxDialog | |
QFrame * | mainFrame () const |
Get dialog box main frame widget. More... | |
virtual bool | acceptData () const |
Check if data entered by the user is valid. More... | |
virtual bool | rejectData () const |
Check if dialog box can be cancelled. More... | |
virtual QAbstractButton * | createButton (QWidget *) |
Create new user button. More... | |
QAbstractButton * | button (const int) const |
Get button by the specified ID. More... | |
ButtonMap | buttons (const int=All) const |
Get buttons by the specified IDs. More... | |
int | buttonId (const QAbstractButton *) const |
Get specified button's identifier. More... | |
int | buttonPosition (QAbstractButton *) const |
Get position of specified button. More... | |
virtual void | showEvent (QShowEvent *) |
Align this dialog according to the parent widget and alignment policy before the dialog box is shown. More... | |
virtual void | hideEvent (QHideEvent *) |
Process all existing events when dialog box is hidden. More... | |
virtual void | closeEvent (QCloseEvent *) |
Called when user closes dialog box. More... | |
virtual void | childEvent (QChildEvent *) |
Update dialog box layout when the size grip is added. More... | |
virtual void | keyPressEvent (QKeyEvent *) |
Process key pressing event. More... | |
Private Types | |
typedef QMap< int, Object > | ObjectMap |
Private Slots | |
void | onToggled (bool) |
emits if the object selection button changes state More... | |
void | onTextChanged (const QString &) |
text in some line edit is changed More... | |
Private Member Functions | |
void | updateButtons (const int=-1) |
void | updateObject (const int, bool=true) |
void | filterTypes (const int, QStringList &, TypesList &, QStringList &) const |
Remove from list not possible types and remove from names and ids lists the corresponding items. More... | |
Private Attributes | |
ObjectMap | myObjects |
QMap< int, QString > | myTypeNames |
bool | myIsExclusive |
bool | myIsBusy |
QPixmap | myPixmap |
Additional Inherited Members | |
Public Slots inherited from QtxDialog | |
void | update () |
Update dialog box. More... | |
virtual void | setVisible (bool) |
Show/hide dialog box, set keyboard focus to the dialog. More... | |
Static Public Member Functions inherited from QtxDialog | |
static void | setUnits (QLabel *, const QString &) |
Set measure units to the specified label. More... | |
Protected Types inherited from QtxDialog | |
typedef QMap< int, QAbstractButton * > | ButtonMap |
button map More... | |
Protected Slots inherited from QtxDialog | |
virtual void | accept () |
Accept the dialog box. More... | |
virtual void | reject () |
Reject the dialog box. More... | |
Base class for all LightApp dialogs. Provides standard widget for object selection: line edit, button; it is necessary to call corresponding methods on selection change. Standard dialog provides filtering, selection string representation, possibility to indicate necessary selection by text with list of ids.
|
private |
typedef QMap<int,QStringList> LightApp_Dialog::SelectedObjects |
typedef QList<int> LightApp_Dialog::TypesList |
LightApp_Dialog::LightApp_Dialog | ( | QWidget * | parent = 0 , |
const char * | name = 0 , |
||
bool | modal = false , |
||
bool | allowResize = false , |
||
const int | f = Standard , |
||
Qt::WindowFlags | wf = 0 |
||
) |
Constructor
References setObjectPixmap().
|
virtual |
Destructor
void LightApp_Dialog::activateObject | ( | const int | theId | ) |
Activates object selection widget
id | - identificator of object selection widget |
References myObjects.
Add types to list of possible types The list of arguments must be finished by negative integer
Adds new possible types to object selection widget
id | - identificator of object selection widget |
type1,... | - new types |
References objectTypes(), and setObjectType().
Adds new possible types to object selection widget
id | - identificator of object selection widget |
list | - new types |
References objectTypes(), and setObjectType().
Adds new possible type to object selection widget
id | - identificator of object selection widget |
type | - new type |
References objectTypes(), and setObjectType().
void LightApp_Dialog::clearSelection | ( | const int | id = -1 | ) |
Clears selection of widget
id | - identificator of object selection widget |
References myObjects, and selectionChanged().
types | - list of types |
References typeName().
|
protected |
Create label, button and line edit for object selection If passed id is negative, then id will be calculated automatically (first free id) Returns the same id (if id>=0) or calculated
Creates object selection widget
References myObjects, myPixmap, OneNameOrCount, onTextChanged(), and onToggled().
void LightApp_Dialog::deactivateAll | ( | ) |
Deactivates all object selection widgets
References myObjects.
|
private |
Finds in list possible types
id | - identificator of object selection widget |
names | - list of selected objects names |
types | - list of selected objects types |
ids | - list of selected objects ids |
References multipleSelection(), myObjects, LightApp_Dialog::Object::myPossibleTypes, and obj.
id | - identificator of object selection widget |
type | - type to be checked |
References myObjects.
bool LightApp_Dialog::hasSelection | ( | const int | id | ) | const |
id | - identificator of object selection widget |
References myObjects.
void LightApp_Dialog::hideObject | ( | const int | id | ) |
Hides object selection widget
id | - identificator of object selection widget |
References setObjectShown().
bool LightApp_Dialog::isAutoResumed | ( | ) | const |
bool LightApp_Dialog::isExclusive | ( | ) | const |
References myIsExclusive.
bool LightApp_Dialog::isObjectEnabled | ( | const int | id | ) | const |
id | - identificator of object selection widget |
References myObjects.
bool LightApp_Dialog::isObjectShown | ( | const int | id | ) | const |
id | - identificator of object selection widget |
References myObjects.
|
protected |
id | - identificator of object selection widget |
References myObjects.
|
protected |
id | - identificator of object selection widget |
References nameIndication(), and OneName.
|
protected |
id | - identificator of object selection widget |
References myObjects, and OneNameOrCount.
|
signal |
|
signal |
|
signal |
void LightApp_Dialog::objectSelection | ( | SelectedObjects & | objs | ) | const |
objs | - map: widget id -> string id to be filled with selected objects |
References myObjects, and selectedObject().
QString LightApp_Dialog::objectText | ( | const int | theId | ) | const |
theId | - identificator of object selection widget |
References myObjects.
Returns list of possible types for widget
id | - identificator of object selection widget |
list | - list to be filled with possible types |
References myObjects.
|
privateslot |
SLOT: called if text of object selection line edit is changed
References isReadOnly(), myIsBusy, myObjects, and objectChanged().
|
privateslot |
SLOT: called if selection button is clicked
References myObjects, objectActivated(), objectDeactivated(), and updateButtons().
|
protected |
Clears list of possibles types for object selection widget
id | - identificator of object selection widget |
References setObjectType().
Removes types from list of possibles for object selection widget
id | - identificator of object selection widget |
list | - list of types to be removed |
References myObjects, and updateObject().
Removes type from list of possibles for object selection widget
id | - identificator of object selection widget |
type | - type to be removed |
References removeObjectType().
Changes label of object selection widget
id | - identificator of object selection widget |
label | - new text of label |
References myObjects.
|
protected |
References SUIT_Session::resourceMgr(), and SUIT_Session::session().
void LightApp_Dialog::selectedObject | ( | const int | id, |
QStringList & | list | ||
) | const |
id | - identificator of object selection widget |
list | - list to be filled by selected objects |
References myObjects.
QString LightApp_Dialog::selectedObject | ( | const int | id | ) | const |
id | - identificator of object selection widget |
References myObjects.
|
signal |
|
protectedvirtual |
names | - list of selected objects names |
types | - list of selected objects types |
ni | - type of name indication |
References Count, countOfTypes(), ListOfNames, OneName, and OneNameOrCount.
void LightApp_Dialog::selectObject | ( | const QString & | name, |
const int | type, | ||
const QString & | id, | ||
const bool | update = true |
||
) |
Passes to all active widgets name, type and id of selected object
name | - name of selected object |
type | - type of selected object |
id | - id of selected object |
update | - is need to update selection description string |
void LightApp_Dialog::selectObject | ( | const QStringList & | _names, |
const TypesList & | _types, | ||
const QStringList & | _ids, | ||
const bool | update = true |
||
) |
Pass to all active widgets list of names, types and ids of selected objects Every active widget filters list and accept only objects with possible types
Passes to all active widgets names, types and ids of selected objects
_names | - names of selected objects |
_types | - types of selected objects |
_ids | - ids of selected objects |
update | - is need to update selection description string |
References myObjects, selectObject(), and QtxDialog::update().
void LightApp_Dialog::selectObject | ( | const int | id, |
const QString & | name, | ||
const int | type, | ||
const QString & | selid, | ||
const bool | update = true |
||
) |
Passes to widget name, type and id of selected object
id | - identificator of object selection widget |
name | - name of selected object |
type | - type of selected object |
selid | - id of selected object |
update | - is need to update selection description string |
References selectObject().
void LightApp_Dialog::selectObject | ( | const int | id, |
const QStringList & | _names, | ||
const TypesList & | _types, | ||
const QStringList & | _ids, | ||
const bool | update = true |
||
) |
Passes to widget names, types and ids of selected objects
id | - identificator of object selection widget |
_names | - names of selected object |
_types | - types of selected object |
_ids | - ids of selected object |
update | - is need to update selection description string |
References filterTypes(), LightApp_Dialog::Object::myEdit, LightApp_Dialog::Object::myIds, LightApp_Dialog::Object::myNames, LightApp_Dialog::Object::myNI, myObjects, LightApp_Dialog::Object::myTypes, obj, selectionChanged(), and selectionDescription().
void LightApp_Dialog::setAutoResumed | ( | const bool | ) |
void LightApp_Dialog::setExclusive | ( | const bool | ex | ) |
Sets isExclusive status of selection buttons
ex | - new value of isExclusive status |
References myIsExclusive, and updateButtons().
|
protected |
Sets type of name indication
id | - identificator of object selection widget |
ni | - new type of name indication |
References isReadOnly(), myObjects, setReadOnly(), and updateObject().
Change enable state of object selection widget
id | - identificator of object selection widget |
en | - new value of enable state |
References isObjectEnabled(), LightApp_Dialog::Object::myBtn, LightApp_Dialog::Object::myEdit, myObjects, and obj.
|
protected |
Sets pixmap all for object selection button
section | - name of section of resource manager |
file | - name of file |
References QtxResourceMgr::loadPixmap(), resMgr(), and setObjectPixmap().
Shows/hides object selection widget
id | - identificator of object selection widget |
shown | - if it is true, widget will be shown |
References isObjectShown(), LightApp_Dialog::Object::myBtn, LightApp_Dialog::Object::myEdit, LightApp_Dialog::Object::myLabel, myObjects, and obj.
Sets object selection widget text
theId | - identificator of object selection widget |
theText | - new text |
References myObjects.
Sets possible types for widget
id | - identificator of object selection widget |
type1,... | - type |
Sets possible types for widget
id | - identificator of object selection widget |
list | - list of possible types |
References myObjects, and updateObject().
Sets read only state of object selection line edit
id | - identificator of object selection widget |
ro | - new read only state |
References ListOfNames, myObjects, nameIndication(), and OneName.
|
virtual |
Show dialog
void LightApp_Dialog::showObject | ( | const int | id | ) |
Shows object selection widget
id | - identificator of object selection widget |
References setObjectShown().
|
protected |
|
private |
If buttons are exclusive, set to "off" all buttons except one with id If id=-1, then all buttons, except first with "on" state, will be set to "off"
Updates "on" state of buttons according to special button
_id | - id of special button (if it is -1, then first selected button will be treated as special) |
References myIsExclusive, and myObjects.
|
private |
Filter types and update selection string in line edit If bool is true, then signal is emitted
Updates selection description of widget
id | - identificator of object selection widget |
emit_signal | - if it is true, the signal "selection changed" is emitted |
References filterTypes(), hasSelection(), LightApp_Dialog::Object::myEdit, LightApp_Dialog::Object::myIds, LightApp_Dialog::Object::myNames, LightApp_Dialog::Object::myNI, myObjects, LightApp_Dialog::Object::myTypes, obj, selectionChanged(), and selectionDescription().
|
private |
|
private |
|
private |
|
private |
|
private |