|
Ananas Library
0.9.5
|
#include <aform.h>
Public Slots | |
| void | done (int rc) |
| Deprecated. | |
| void | Show (bool modal=FALSE) |
| bool | Close () |
| void | show () |
| Deprecated. See Show() | |
| void | close () |
| Deprecated. | |
| void | maximize (bool m) |
| QVariant | Value (const QString &name) |
| QVariant | DBValue (const QString &name) |
| int | SetValue (const QString &name, QVariant value) |
| int | SetObjValue (const QString &name, aObject *value) |
| void | SetColumnReadOnly (const QString &tname, int numCol, bool ro) |
| int | ColIndex (const QString &tname, const QString &colname) |
| int | TabCount (const QString &tname) |
| QVariant | TabValue (const QString &tname, int row, int col) |
| QVariant | TabDBValue (const QString &tname, int row, int col) |
| void | TabNewLine (const QString &tname) |
| void | TabUpdate (const QString &tname) |
| void | SetTabValue (const QString &tname, const QString &colname, int row, QVariant value) |
| void | setfocus (QString fname) |
| Deprecated. | |
| void | SetFocus () |
| ERR_Code | UpdateDB () |
| ERR_Code | update () |
| Depticated. | |
| int | turn_on () |
| Deprecated. | |
| int | turn_off () |
| Deprecated. | |
| int | SignIn () |
| int | SignOut () |
| int | Update () |
| void | SetReadOnly (bool status) |
| bool | IsReadOnly () |
| int | GetMode () |
| QString | Propis (QString val, bool need_kopeyki=true, bool male=true, const QString &end1="рублей", const QString &end2="рубль", const QString &end3="рубля") |
| QString | MoneyToText (QString amount, QString currency) |
| QString | ConvertNumber2MoneyFormat (double number) |
| QString | ConvertDateFromIso (const QString &ISODate) |
| QString | EndOfDay (const QString &ISODate) |
| void | SelectByCurrent (aObject *doc) |
| void | SetCurrent (aObject *doc) |
| Deprecated. See SelectByCurrent() | |
| aObject * | Current () |
| QWidget * | Widget (QString name) |
| bool | FormHasFunction (const QString functionName) |
Signals | |
| void | selected (Q_ULLONG uid) |
| void | closeForm (Q_ULLONG) |
| void | changedData () |
| void | update (ANANAS_UID) |
Public Member Functions | |
| aForm (QWidget *parent, aEngine *eng) | |
| aForm (QWidget *parent, aEngine *eng, Q_ULONG form_mid=0, aWidget *caller=NULL) | |
| aForm (QWidget *parent, aEngine *eng, QString oftype, QObject *aobj=NULL) | |
| void | init () |
| QWidget * | aParent (QWidget *widget) |
| int | New () |
| int | Select (Q_ULLONG id) |
| int | SelectGroup (Q_ULLONG id) |
| Q_ULLONG | selectedCatId () |
| Q_ULLONG | selectedId () |
| QVariant | tabValue (const QString &tname, int row, int col, bool dbval=false) |
| void | setMode (int m) |
Public Attributes | |
| aEngine * | engine |
| aDatabase * | db |
| aCfg * | md |
| aCfgItem | mdObj |
| QWidget * | parentWidget |
| bool | closeAfterSelect |
| QWidget * | form |
Protected Member Functions | |
| virtual void | initWidget (QWidget *widget, aDatabase *adb) |
| virtual void | initContainer (aWidget *widget, aDatabase *adb) |
| aWidget * | parentContainer (QWidget *widget) |
Ananas form.
| aForm::aForm | ( | QWidget * | parent, |
| aEngine * | eng | ||
| ) |
| parent | |
| eng | |
| form_mid | |
| caller |
References aEngine::db, aCfg::find(), init(), and aEngine::md.
| aForm::aForm | ( | QWidget * | parent, |
| aEngine * | eng, | ||
| QString | oftype, | ||
| QObject * | aobj = NULL |
||
| ) |
| parent | |
| eng | |
| oftype | |
| aobj |
References aDatabase::cfg, aEngine::db, and init().
| QWidget * aForm::aParent | ( | QWidget * | widget | ) |
Return ananas contaner object for widget. Use for widget->init() function.
|
slot |
Close form. Delete this pointer after close.
References aLog::print(), aWindowsList::remove(), and aEngine::wl.
|
slot |
Return column index in table \param tname.
| tname | - Table name. |
| colname | - Column name. |
References wDBTable::getDefFields(), aLog::print(), and Widget().
|
slot |
Convert date to local format.
| ISODate | - date in ISO format |
References aService::Date2Print().
|
slot |
Get value of attribute
| name | - Name of attribute. aDataField* aForm::getAttribute(const QString &name) { QString oname, aname; aWidget *w = mainWidget; QVariant v; aDataField *f = 0; |
oname = name.section(".",0,0); aname = name.section(".",1); if ( oname.isEmpty() ) aname = oname; else { } v = w->value( aname ); f = new aDataField( this, aname ); return f; }
Sets attribute value *Not implemented*
| name | - Name of attribute. int aForm::setAttribute(const QString &name, aDataField *value) { return 1; } |
Convert number to currensy format.
| number | - number to convert |
References aService::convertNumber2MoneyFormat().
|
slot |
Return current data object of form.
|
slot |
Getting widgets value, inherited aWidget.
| name | - Widget name. For wDBField this parameter must be name field of metadata. |
Пример кода для размещения в модуле экранной формы. Экранная форма содержит одну кнопку с именем Button1. При нажатии на кнопку в окно сообщений будет выведено значение атрибута "Покупатель" редактируемого бизнес объекта.
References aLog::print(), and Widget().
|
slot |
Date of end day.
|
slot |
Get form mode. 0 - new, 1- edit, 2- browse
| void aForm::init | ( | ) |
Init form, reparent central widget of form, if it needed. Evaluate script module.
References aCfg::attr(), aWidget::createToolBar(), aWindowsList::find(), initContainer(), aWindowsList::insert(), aCfg::objClass(), aCfg::parent(), aLog::print(), aEngine::project, aWindowsList::remove(), SetReadOnly(), aCfg::sText(), and aEngine::wl.
Referenced by aForm().
Recursive init all form containers and widgets.
References aWidget::createToolBar(), initWidget(), and parentContainer().
Referenced by init().
|
protectedvirtual |
Init container object, that not inherits from aWidget.
Referenced by initContainer().
|
slot |
Geting form readonly flag.
|
slot |
Maximize window
| int aForm::New | ( | ) |
References aWindowsList::get(), aWindowsList::insert(), aWidget::New(), aWindowsList::remove(), aWidget::uid(), and aEngine::wl.
Referenced by aEngine::openForm().
|
protected |
|
slot |
Convert number to russian language text format.
| val | - number to convert |
| need_kopeyki | - wtite to output decimal part |
| male | - male |
| end1 | - end1 |
| end2 | - end2 |
| end3 | - end3 |
References aService::number2money().
| int aForm::Select | ( | Q_ULLONG | id | ) |
| id |
References aWindowsList::get(), aWindowsList::insert(), aWindowsList::remove(), aWidget::Select(), and aEngine::wl.
Referenced by aEngine::openForm().
|
slot |
Setting column readonly flag.
When column readonly, user can't edit value of this column.
| tname | - Table name. |
| numCol | - Column number. |
| ro | - `Readonly' flag value. |
References aLog::print(), and Widget().
| void aForm::setMode | ( | int | m | ) |
|
slot |
Setting form widgets value of object type.
\see SetValue(...)
| tname | - Widget name. |
References aWidget::setObjValue().
|
slot |
Seting form readonly flag.
When form readonly we can't edit database fields, and make updatе action
| status | - New readonly flag. |
References aLog::print(), and aWidget::SetReadOnly().
Referenced by init(), and aEngine::openForm().
|
slot |
Setting form widgets value.
\see aWidget::setValue()
| name | - Widget name. |
| value | - Widget value. |
References aWidget::setValue().
|
slot |
Show form. Move it in left top corner of workspace. modal parameter determins is form modal or not.
References Close(), and aEngine::project.
Referenced by aEngine::openForm(), and show().
|
slot |
Turn on document.
References aObject::IsConducted(), aLog::print(), and aEngine::project.
Referenced by turn_on().
|
slot |
Turn off document. Do nothing.
Referenced by turn_off().
|
slot |
Count table row.
| tname | - Table name. |
References aLog::print(), and Widget().
|
slot |
| tname |
References aLog::print(), and Widget().
| QVariant aForm::tabValue | ( | const QString & | tname, |
| int | row, | ||
| int | col, | ||
| bool | dbval = false |
||
| ) |
| tname | |
| row | |
| col | |
| dbval |
References wDBTable::getDefIdList(), wDBTable::getFieldType(), aLog::print(), and Widget().
|
slot |
|
slot |
do nothing.
char* aForm::formMetaObjectId(QString filename){ if (filename==""){ } return aot_doc; return ""; }
Return form widget pointer by name.
References aWidget::Widget().
Referenced by ColIndex(), DBValue(), SetColumnReadOnly(), TabCount(), TabUpdate(), and tabValue().
1.8.5