gui::AddItemDialog Class Reference

Dialog for adding items to Dictionaries or Arrays. More...

#include <additemdialog.h>

Inheritance diagram for gui::AddItemDialog:
gui::SelfDestructiveWidget

List of all members.

Public Slots

void itemDeleted (boost::shared_ptr< IProperty > it)

Public Member Functions

 ~AddItemDialog ()

Static Public Member Functions

static AddItemDialogcreate (QWidget *parent, boost::shared_ptr< CDict > cont)
static AddItemDialogcreate (QWidget *parent, boost::shared_ptr< CArray > cont)

Protected Slots

void posNumSet (bool on)
void posEndSet (bool on)
void buttonSelected (int id)
bool commit ()
void commitClose ()

Protected Member Functions

void message (const QString &message)
void error (const QString &message)
 AddItemDialog (QWidget *parent=0, const char *name=0)
void setItem (boost::shared_ptr< IProperty > it)

Private Attributes

boost::shared_ptr< IPropertyitem
Propertyprops [addDialogPropertyTypes]
QRadioButton * labels [addDialogPropertyTypes]
QFrame * target
int selectedItem
QLineEdit * propertyName
bool usingArray
QBoxLayout * layout
QFrame * qbox
Q_ButtonGroup * items
QLabel * msg
QString settingName
boost::shared_ptr< CPdfpdf
QRadioButton * posNum
QRadioButton * posEnd
QLineEdit * arrayPos

Detailed Description

Dialog for adding items to Dictionaries or Arrays.

Class representing dialog for adding new item to Dictionary/array
Dialog does not block focus of main window and you can have multiple of them opened simultaneously (even for same Dict / Array)
Dialog closes itself, when the relevant document is closed


Constructor & Destructor Documentation

gui::AddItemDialog::~AddItemDialog (  ) 

default destructor

gui::AddItemDialog::AddItemDialog ( QWidget *  parent = 0,
const char *  name = 0 
) [protected]

constructor of AddItemDialog, creates window and fills it with elements, parameters are ignored

Parameters:
parent Parent window of this dialog
name Name of this window (used only for debugging

References gui::addDialogPropertyTypes, util::getTypeName(), gui::globalSettings, pdfobjects::pArray, pdfobjects::pBool, pdfobjects::pDict, pdfobjects::pInt, pdfobjects::pName, pdfobjects::pReal, pdfobjects::pRef, pdfobjects::pString, Q_ButtonGroup, and gui::Settings::restoreWindow().

Referenced by message().


Member Function Documentation

void gui::AddItemDialog::buttonSelected ( int  id  )  [protected, slot]

Set given radiobutton as selected

Parameters:
id Number of button
bool gui::AddItemDialog::commit (  )  [protected, slot]

Adds the item, but keep the window open, so user can easily modify value and add another similar item.

Returns:
true if successfull, false if cannot commit because of some errors in user-entered data
void gui::AddItemDialog::commitClose (  )  [protected, slot]

Adds the item and closes window

AddItemDialog * gui::AddItemDialog::create ( QWidget *  parent,
boost::shared_ptr< CArray cont 
) [static]

Create dialog for adding objects (IProperty) to specified Array Returns immediately, but the dialog will remain opened.

Parameters:
parent Parent window of this dialog
cont Array into which to add properties
Returns:
pointer to newly opened dialog instance
AddItemDialog * gui::AddItemDialog::create ( QWidget *  parent,
boost::shared_ptr< CDict cont 
) [static]

Create dialog for adding objects (IProperty) to specified Dictionary
Returns immediately, but the dialog will remain opened.

Parameters:
parent Parent window of this dialog
cont Dict into which to add properties
Returns:
pointer to newly opened dialog instance
void gui::AddItemDialog::error ( const QString &  message  )  [protected]

Show error message for this window

Parameters:
message message to show
void gui::AddItemDialog::itemDeleted ( boost::shared_ptr< IProperty it  )  [slot]

Called whenever item in main window is deleted. If the item matches the item in which we are adding, close the dialog

Parameters:
it deleted item

Referenced by message().

void gui::AddItemDialog::message ( const QString &  message  )  [protected]

Show informational message for this window

Parameters:
message message to show

References AddItemDialog(), itemDeleted(), and setItem().

void gui::AddItemDialog::posEndSet ( bool  on  )  [protected, slot]

This slot is called when state of the "insert at end" radiobox is changed

Parameters:
on True of it was checked as "on"
void gui::AddItemDialog::posNumSet ( bool  on  )  [protected, slot]

This slot is called when state of the "insert at position" radiobox is changed

Parameters:
on True of it was checked as "on"
void gui::AddItemDialog::setItem ( boost::shared_ptr< IProperty it  )  [protected]

Set item into which newly created objects will be added and also initialize items in this control
Must be called exactly once before showing the control and must not be called after that

Parameters:
it Dict or Array into which properties will be added

Referenced by message().


Member Data Documentation

QLineEdit* gui::AddItemDialog::arrayPos [private]

Edit box for editing array position at which the element should be inserted

boost::shared_ptr<IProperty> gui::AddItemDialog::item [private]

Object (Dict or Array) into which any subitems will be added

Q_ButtonGroup* gui::AddItemDialog::items [private]

Group with content items

Array with property names (selectors)

QBoxLayout* gui::AddItemDialog::layout [private]

General layout of this widget

QLabel* gui::AddItemDialog::msg [private]

Label used to show message

boost::shared_ptr<CPdf> gui::AddItemDialog::pdf [private]

Pdf document (for validating reference)

QRadioButton* gui::AddItemDialog::posEnd [private]

Radiobutton for appending at end of array

QRadioButton* gui::AddItemDialog::posNum [private]

Radiobutton for inserting at arbitrary position in array

QLineEdit* gui::AddItemDialog::propertyName [private]

Name of new property, if adding to Dict

Array with properties

QFrame* gui::AddItemDialog::qbox [private]

Box holding buttons

Index of item that is selected for editing

Settings used to save dialog position (dict/array) - this is useful, as these can have different sizes

QFrame* gui::AddItemDialog::target [private]

Frame containing controls to select name of new property (Dict) or end of array for appending (Array)

Adding to array?


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