Added Validator for field (test) and mark for NonZero fields.
authorDmintriy L. Kruglikov <master@shadow.breg.pl.ua>
Thu, 26 Jun 2008 14:58:34 +0000 (17:58 +0300)
committerDmintriy L. Kruglikov <master@shadow.breg.pl.ua>
Thu, 26 Jun 2008 14:58:34 +0000 (17:58 +0300)
src/designer/deditfield.ui
src/designer/deditfield.ui.h
src/designer/mdtree.cpp
src/plugins/wdbfield.cpp
src/plugins/wdbfield.h
src/plugins/wfield.cpp
src/plugins/wfield.h

index 774a618..5fe96fe 100644 (file)
@@ -8,16 +8,10 @@
         <rect>
             <x>0</x>
             <y>0</y>
-            <width>399</width>
-            <height>403</height>
+            <width>478</width>
+            <height>475</height>
         </rect>
     </property>
-    <property name="minimumSize">
-        <size>
-            <width>300</width>
-            <height>378</height>
-        </size>
-    </property>
     <property name="caption">
         <string>Field</string>
     </property>
@@ -48,9 +42,9 @@
                     <property name="name">
                         <cstring>unnamed</cstring>
                     </property>
-                    <widget class="QLabel" row="2" column="0">
+                    <widget class="QLabel" row="0" column="0" rowspan="1" colspan="2">
                         <property name="name">
-                            <cstring>tWidth</cstring>
+                            <cstring>textLabel1</cstring>
                         </property>
                         <property name="sizePolicy">
                             <sizepolicy>
                                 <verstretch>0</verstretch>
                             </sizepolicy>
                         </property>
-                        <property name="text">
-                            <string>Width</string>
+                        <property name="minimumSize">
+                            <size>
+                                <width>80</width>
+                                <height>0</height>
+                            </size>
                         </property>
-                    </widget>
-                    <widget class="QLayoutWidget" row="2" column="1">
-                        <property name="name">
-                            <cstring>layout12</cstring>
+                        <property name="font">
+                            <font>
+                            </font>
+                        </property>
+                        <property name="text">
+                            <string>Name</string>
                         </property>
-                        <hbox>
-                            <property name="name">
-                                <cstring>unnamed</cstring>
-                            </property>
-                            <widget class="QSpinBox">
-                                <property name="name">
-                                    <cstring>eWidth</cstring>
-                                </property>
-                                <property name="maxValue">
-                                    <number>254</number>
-                                </property>
-                                <property name="minValue">
-                                    <number>1</number>
-                                </property>
-                                <property name="value">
-                                    <number>10</number>
-                                </property>
-                            </widget>
-                            <widget class="QLabel">
-                                <property name="name">
-                                    <cstring>tDec</cstring>
-                                </property>
-                                <property name="sizePolicy">
-                                    <sizepolicy>
-                                        <hsizetype>1</hsizetype>
-                                        <vsizetype>5</vsizetype>
-                                        <horstretch>0</horstretch>
-                                        <verstretch>0</verstretch>
-                                    </sizepolicy>
-                                </property>
-                                <property name="text">
-                                    <string>Decimals</string>
-                                </property>
-                            </widget>
-                            <widget class="QSpinBox">
-                                <property name="name">
-                                    <cstring>eDec</cstring>
-                                </property>
-                            </widget>
-                            <spacer>
-                                <property name="name">
-                                    <cstring>spacer7</cstring>
-                                </property>
-                                <property name="orientation">
-                                    <enum>Horizontal</enum>
-                                </property>
-                                <property name="sizeType">
-                                    <enum>Expanding</enum>
-                                </property>
-                                <property name="sizeHint">
-                                    <size>
-                                        <width>230</width>
-                                        <height>20</height>
-                                    </size>
-                                </property>
-                            </spacer>
-                        </hbox>
                     </widget>
-                    <widget class="QLabel" row="1" column="0">
+                    <widget class="QLabel" row="2" column="0" rowspan="1" colspan="2">
                         <property name="name">
                             <cstring>textLabel4</cstring>
                         </property>
                                 <height>32767</height>
                             </size>
                         </property>
+                        <property name="font">
+                            <font>
+                            </font>
+                        </property>
                         <property name="text">
                             <string>Type</string>
                         </property>
                     </widget>
-                    <widget class="QLabel" row="0" column="0">
+                    <widget class="QLabel" row="1" column="0" rowspan="1" colspan="2">
                         <property name="name">
-                            <cstring>textLabel1</cstring>
+                            <cstring>textLabel1_2_2</cstring>
                         </property>
                         <property name="sizePolicy">
                             <sizepolicy>
                                 <height>0</height>
                             </size>
                         </property>
+                        <property name="font">
+                            <font>
+                            </font>
+                        </property>
                         <property name="text">
-                            <string>Name</string>
+                            <string>Comment</string>
                         </property>
                     </widget>
-                    <widget class="QLineEdit" row="0" column="1">
+                    <widget class="QLineEdit" row="1" column="2" rowspan="1" colspan="3">
+                        <property name="name">
+                            <cstring>eComment</cstring>
+                        </property>
+                        <property name="font">
+                            <font>
+                            </font>
+                        </property>
+                    </widget>
+                    <widget class="QComboBox" row="2" column="2" rowspan="1" colspan="3">
+                        <property name="name">
+                            <cstring>eType</cstring>
+                        </property>
+                        <property name="sizePolicy">
+                            <sizepolicy>
+                                <hsizetype>1</hsizetype>
+                                <vsizetype>0</vsizetype>
+                                <horstretch>1</horstretch>
+                                <verstretch>0</verstretch>
+                            </sizepolicy>
+                        </property>
+                        <property name="font">
+                            <font>
+                            </font>
+                        </property>
+                        <property name="duplicatesEnabled">
+                            <bool>false</bool>
+                        </property>
+                    </widget>
+                    <widget class="QLineEdit" row="0" column="4">
+                        <property name="name">
+                            <cstring>eCname</cstring>
+                        </property>
+                        <property name="sizePolicy">
+                            <sizepolicy>
+                                <hsizetype>7</hsizetype>
+                                <vsizetype>0</vsizetype>
+                                <horstretch>2</horstretch>
+                                <verstretch>0</verstretch>
+                            </sizepolicy>
+                        </property>
+                        <property name="font">
+                            <font>
+                            </font>
+                        </property>
+                    </widget>
+                    <widget class="QLabel" row="0" column="3">
+                        <property name="name">
+                            <cstring>textLabel1_2</cstring>
+                        </property>
+                        <property name="sizePolicy">
+                            <sizepolicy>
+                                <hsizetype>1</hsizetype>
+                                <vsizetype>5</vsizetype>
+                                <horstretch>0</horstretch>
+                                <verstretch>0</verstretch>
+                            </sizepolicy>
+                        </property>
+                        <property name="font">
+                            <font>
+                            </font>
+                        </property>
+                        <property name="text">
+                            <string>Cname</string>
+                        </property>
+                    </widget>
+                    <widget class="QLineEdit" row="0" column="2">
                         <property name="name">
                             <cstring>eName</cstring>
                         </property>
+                        <property name="sizePolicy">
+                            <sizepolicy>
+                                <hsizetype>7</hsizetype>
+                                <vsizetype>0</vsizetype>
+                                <horstretch>2</horstretch>
+                                <verstretch>0</verstretch>
+                            </sizepolicy>
+                        </property>
+                        <property name="font">
+                            <font>
+                            </font>
+                        </property>
+                    </widget>
+                    <widget class="QLabel" row="3" column="0" rowspan="1" colspan="2">
+                        <property name="name">
+                            <cstring>tWidth</cstring>
+                        </property>
+                        <property name="font">
+                            <font>
+                            </font>
+                        </property>
+                        <property name="text">
+                            <string>Width</string>
+                        </property>
+                    </widget>
+                    <widget class="QLabel" row="4" column="0" rowspan="1" colspan="2">
+                        <property name="name">
+                            <cstring>Num_Label</cstring>
+                        </property>
+                        <property name="text">
+                            <string>Numerator</string>
+                        </property>
+                    </widget>
+                    <widget class="QLabel" row="6" column="0">
+                        <property name="name">
+                            <cstring>exLabel</cstring>
+                        </property>
+                        <property name="text">
+                            <string>&lt;u&gt;&lt;i&gt;Example&lt;/i&gt;:&lt;/u&gt;</string>
+                        </property>
+                    </widget>
+                    <widget class="QLayoutWidget" row="6" column="1" rowspan="1" colspan="4">
+                        <property name="name">
+                            <cstring>layout27</cstring>
+                        </property>
+                        <hbox>
+                            <property name="name">
+                                <cstring>unnamed</cstring>
+                            </property>
+                            <spacer>
+                                <property name="name">
+                                    <cstring>spacer20</cstring>
+                                </property>
+                                <property name="orientation">
+                                    <enum>Horizontal</enum>
+                                </property>
+                                <property name="sizeType">
+                                    <enum>Expanding</enum>
+                                </property>
+                                <property name="sizeHint">
+                                    <size>
+                                        <width>144</width>
+                                        <height>16</height>
+                                    </size>
+                                </property>
+                            </spacer>
+                            <widget class="QLabel">
+                                <property name="name">
+                                    <cstring>eXample</cstring>
+                                </property>
+                                <property name="text">
+                                    <string>___</string>
+                                </property>
+                            </widget>
+                            <spacer>
+                                <property name="name">
+                                    <cstring>spacer19</cstring>
+                                </property>
+                                <property name="orientation">
+                                    <enum>Horizontal</enum>
+                                </property>
+                                <property name="sizeType">
+                                    <enum>Expanding</enum>
+                                </property>
+                                <property name="sizeHint">
+                                    <size>
+                                        <width>135</width>
+                                        <height>16</height>
+                                    </size>
+                                </property>
+                            </spacer>
+                        </hbox>
                     </widget>
-                    <widget class="QGroupBox" row="3" column="0" rowspan="1" colspan="2">
+                    <widget class="QLayoutWidget" row="4" column="2" rowspan="1" colspan="3">
                         <property name="name">
-                            <cstring>groupBox1</cstring>
+                            <cstring>layout19</cstring>
+                        </property>
+                        <property name="sizePolicy">
+                            <sizepolicy>
+                                <hsizetype>7</hsizetype>
+                                <vsizetype>0</vsizetype>
+                                <horstretch>0</horstretch>
+                                <verstretch>0</verstretch>
+                            </sizepolicy>
+                        </property>
+                        <hbox>
+                            <property name="name">
+                                <cstring>unnamed</cstring>
+                            </property>
+                            <widget class="QLabel">
+                                <property name="name">
+                                    <cstring>MinLabel</cstring>
+                                </property>
+                                <property name="text">
+                                    <string>Min:</string>
+                                </property>
+                            </widget>
+                            <widget class="QLineEdit">
+                                <property name="name">
+                                    <cstring>eMin</cstring>
+                                </property>
+                                <property name="sizePolicy">
+                                    <sizepolicy>
+                                        <hsizetype>7</hsizetype>
+                                        <vsizetype>0</vsizetype>
+                                        <horstretch>2</horstretch>
+                                        <verstretch>0</verstretch>
+                                    </sizepolicy>
+                                </property>
+                            </widget>
+                            <widget class="QLabel">
+                                <property name="name">
+                                    <cstring>MaxLabel</cstring>
+                                </property>
+                                <property name="text">
+                                    <string>Max:</string>
+                                </property>
+                            </widget>
+                            <widget class="QLineEdit">
+                                <property name="name">
+                                    <cstring>eMax</cstring>
+                                </property>
+                                <property name="sizePolicy">
+                                    <sizepolicy>
+                                        <hsizetype>7</hsizetype>
+                                        <vsizetype>0</vsizetype>
+                                        <horstretch>2</horstretch>
+                                        <verstretch>0</verstretch>
+                                    </sizepolicy>
+                                </property>
+                            </widget>
+                            <widget class="QLabel">
+                                <property name="name">
+                                    <cstring>PrLabel</cstring>
+                                </property>
+                                <property name="text">
+                                    <string>Prefix:</string>
+                                </property>
+                            </widget>
+                            <widget class="QLineEdit">
+                                <property name="name">
+                                    <cstring>ePrefix</cstring>
+                                </property>
+                                <property name="sizePolicy">
+                                    <sizepolicy>
+                                        <hsizetype>7</hsizetype>
+                                        <vsizetype>0</vsizetype>
+                                        <horstretch>1</horstretch>
+                                        <verstretch>0</verstretch>
+                                    </sizepolicy>
+                                </property>
+                            </widget>
+                            <widget class="QLabel">
+                                <property name="name">
+                                    <cstring>SfLabel</cstring>
+                                </property>
+                                <property name="text">
+                                    <string>Suffix:</string>
+                                </property>
+                            </widget>
+                            <widget class="QLineEdit">
+                                <property name="name">
+                                    <cstring>eSuffix</cstring>
+                                </property>
+                                <property name="sizePolicy">
+                                    <sizepolicy>
+                                        <hsizetype>7</hsizetype>
+                                        <vsizetype>0</vsizetype>
+                                        <horstretch>1</horstretch>
+                                        <verstretch>0</verstretch>
+                                    </sizepolicy>
+                                </property>
+                            </widget>
+                        </hbox>
+                    </widget>
+                    <widget class="QGroupBox" row="10" column="0" rowspan="1" colspan="5">
+                        <property name="name">
+                            <cstring>PropBox</cstring>
+                        </property>
+                        <property name="font">
+                            <font>
+                            </font>
                         </property>
                         <property name="title">
-                            <string>Flags</string>
+                            <string>Properties</string>
                         </property>
-                        <vbox>
+                        <hbox>
                             <property name="name">
                                 <cstring>unnamed</cstring>
                             </property>
                             <widget class="QCheckBox">
                                 <property name="name">
-                                    <cstring>efSort</cstring>
+                                    <cstring>efNZ</cstring>
+                                </property>
+                                <property name="font">
+                                    <font>
+                                    </font>
                                 </property>
                                 <property name="text">
-                                    <string>Sort</string>
+                                    <string>Not null</string>
                                 </property>
                             </widget>
                             <widget class="QCheckBox">
                                 <property name="name">
-                                    <cstring>efPlus</cstring>
+                                    <cstring>efPeriodic</cstring>
+                                </property>
+                                <property name="font">
+                                    <font>
+                                    </font>
                                 </property>
                                 <property name="text">
-                                    <string>Positive</string>
+                                    <string>Periodic</string>
                                 </property>
                             </widget>
                             <widget class="QCheckBox">
                                 <property name="name">
-                                    <cstring>efNZ</cstring>
+                                    <cstring>efSort</cstring>
+                                </property>
+                                <property name="font">
+                                    <font>
+                                    </font>
                                 </property>
                                 <property name="text">
-                                    <string>Not null</string>
+                                    <string>Sorted</string>
+                                </property>
+                            </widget>
+                            <widget class="QCheckBox">
+                                <property name="name">
+                                    <cstring>efPlus</cstring>
+                                </property>
+                                <property name="font">
+                                    <font>
+                                    </font>
+                                </property>
+                                <property name="text">
+                                    <string>Positive</string>
                                 </property>
                             </widget>
                             <widget class="QCheckBox">
                                 <property name="name">
                                     <cstring>efSum</cstring>
                                 </property>
+                                <property name="font">
+                                    <font>
+                                    </font>
+                                </property>
                                 <property name="text">
                                     <string>Sum</string>
                                 </property>
                             </widget>
-                        </vbox>
+                            <spacer>
+                                <property name="name">
+                                    <cstring>spacer14</cstring>
+                                </property>
+                                <property name="orientation">
+                                    <enum>Horizontal</enum>
+                                </property>
+                                <property name="sizeType">
+                                    <enum>Expanding</enum>
+                                </property>
+                                <property name="sizeHint">
+                                    <size>
+                                        <width>66</width>
+                                        <height>16</height>
+                                    </size>
+                                </property>
+                            </spacer>
+                        </hbox>
                     </widget>
-                    <widget class="QComboBox" row="1" column="1">
+                    <widget class="QLayoutWidget" row="9" column="2" rowspan="1" colspan="3">
                         <property name="name">
-                            <cstring>eType</cstring>
+                            <cstring>layout19</cstring>
                         </property>
-                        <property name="duplicatesEnabled">
-                            <bool>false</bool>
+                        <property name="font">
+                            <font>
+                            </font>
                         </property>
+                        <hbox>
+                            <property name="name">
+                                <cstring>unnamed</cstring>
+                            </property>
+                            <widget class="QLabel">
+                                <property name="name">
+                                    <cstring>saldoTextLabel</cstring>
+                                </property>
+                                <property name="sizePolicy">
+                                    <sizepolicy>
+                                        <hsizetype>5</hsizetype>
+                                        <vsizetype>0</vsizetype>
+                                        <horstretch>0</horstretch>
+                                        <verstretch>0</verstretch>
+                                    </sizepolicy>
+                                </property>
+                                <property name="font">
+                                    <font>
+                                    </font>
+                                </property>
+                                <property name="text">
+                                    <string>Saldo source</string>
+                                </property>
+                            </widget>
+                            <widget class="QComboBox">
+                                <property name="name">
+                                    <cstring>comboBox2</cstring>
+                                </property>
+                                <property name="sizePolicy">
+                                    <sizepolicy>
+                                        <hsizetype>7</hsizetype>
+                                        <vsizetype>0</vsizetype>
+                                        <horstretch>0</horstretch>
+                                        <verstretch>0</verstretch>
+                                    </sizepolicy>
+                                </property>
+                                <property name="font">
+                                    <font>
+                                    </font>
+                                </property>
+                            </widget>
+                        </hbox>
                     </widget>
-                    <widget class="QLabel" row="4" column="0">
+                    <widget class="QGroupBox" row="5" column="0" rowspan="1" colspan="5">
                         <property name="name">
-                            <cstring>saldoTextLabel</cstring>
+                            <cstring>DateMask</cstring>
                         </property>
-                        <property name="sizePolicy">
-                            <sizepolicy>
-                                <hsizetype>5</hsizetype>
-                                <vsizetype>0</vsizetype>
-                                <horstretch>0</horstretch>
-                                <verstretch>0</verstretch>
-                            </sizepolicy>
+                        <property name="title">
+                            <string>Use Date with Mask</string>
                         </property>
-                        <property name="text">
-                            <string>Saldo source</string>
+                        <property name="checkable">
+                            <bool>true</bool>
                         </property>
+                        <property name="checked">
+                            <bool>true</bool>
+                        </property>
+                        <grid>
+                            <property name="name">
+                                <cstring>unnamed</cstring>
+                            </property>
+                            <property name="margin">
+                                <number>3</number>
+                            </property>
+                            <property name="spacing">
+                                <number>3</number>
+                            </property>
+                            <widget class="QLabel" row="0" column="0">
+                                <property name="name">
+                                    <cstring>textLabel1_3</cstring>
+                                </property>
+                                <property name="text">
+                                    <string>Date format</string>
+                                </property>
+                            </widget>
+                            <widget class="AComboBox" row="0" column="1">
+                                <item>
+                                    <property name="text">
+                                        <string>yyyyMMdd</string>
+                                    </property>
+                                </item>
+                                <item>
+                                    <property name="text">
+                                        <string>yyMMdd</string>
+                                    </property>
+                                </item>
+                                <item>
+                                    <property name="text">
+                                        <string>dd MMMM yyyy</string>
+                                    </property>
+                                </item>
+                                <property name="name">
+                                    <cstring>aDFormatBox</cstring>
+                                </property>
+                                <property name="sizePolicy">
+                                    <sizepolicy>
+                                        <hsizetype>1</hsizetype>
+                                        <vsizetype>0</vsizetype>
+                                        <horstretch>2</horstretch>
+                                        <verstretch>0</verstretch>
+                                    </sizepolicy>
+                                </property>
+                            </widget>
+                            <widget class="QLabel" row="0" column="2">
+                                <property name="name">
+                                    <cstring>textLabel2</cstring>
+                                </property>
+                                <property name="text">
+                                    <string>or</string>
+                                </property>
+                            </widget>
+                            <spacer row="0" column="5">
+                                <property name="name">
+                                    <cstring>spacer21</cstring>
+                                </property>
+                                <property name="orientation">
+                                    <enum>Horizontal</enum>
+                                </property>
+                                <property name="sizeType">
+                                    <enum>Expanding</enum>
+                                </property>
+                                <property name="sizeHint">
+                                    <size>
+                                        <width>20</width>
+                                        <height>16</height>
+                                    </size>
+                                </property>
+                            </spacer>
+                            <widget class="QLineEdit" row="0" column="4">
+                                <property name="name">
+                                    <cstring>eOwnFormat</cstring>
+                                </property>
+                                <property name="sizePolicy">
+                                    <sizepolicy>
+                                        <hsizetype>7</hsizetype>
+                                        <vsizetype>0</vsizetype>
+                                        <horstretch>1</horstretch>
+                                        <verstretch>0</verstretch>
+                                    </sizepolicy>
+                                </property>
+                            </widget>
+                            <widget class="QCheckBox" row="0" column="3">
+                                <property name="name">
+                                    <cstring>useOwnFofmat</cstring>
+                                </property>
+                                <property name="text">
+                                    <string>use own format</string>
+                                </property>
+                            </widget>
+                        </grid>
                     </widget>
-                    <widget class="QComboBox" row="5" column="0" rowspan="1" colspan="2">
+                    <widget class="QLayoutWidget" row="3" column="2" rowspan="1" colspan="3">
                         <property name="name">
-                            <cstring>comboBox2</cstring>
+                            <cstring>layout6</cstring>
                         </property>
+                        <hbox>
+                            <property name="name">
+                                <cstring>unnamed</cstring>
+                            </property>
+                            <widget class="QSpinBox">
+                                <property name="name">
+                                    <cstring>eWidth</cstring>
+                                </property>
+                                <property name="font">
+                                    <font>
+                                    </font>
+                                </property>
+                                <property name="maxValue">
+                                    <number>254</number>
+                                </property>
+                                <property name="minValue">
+                                    <number>1</number>
+                                </property>
+                                <property name="value">
+                                    <number>10</number>
+                                </property>
+                            </widget>
+                            <widget class="QLabel">
+                                <property name="name">
+                                    <cstring>tDec</cstring>
+                                </property>
+                                <property name="font">
+                                    <font>
+                                    </font>
+                                </property>
+                                <property name="text">
+                                    <string>,</string>
+                                </property>
+                            </widget>
+                            <widget class="QSpinBox">
+                                <property name="name">
+                                    <cstring>eDec</cstring>
+                                </property>
+                                <property name="font">
+                                    <font>
+                                    </font>
+                                </property>
+                            </widget>
+                            <widget class="QCheckBox">
+                                <property name="name">
+                                    <cstring>tNotBound</cstring>
+                                </property>
+                                <property name="font">
+                                    <font>
+                                    </font>
+                                </property>
+                                <property name="text">
+                                    <string>Max</string>
+                                </property>
+                            </widget>
+                            <widget class="QCheckBox">
+                                <property name="name">
+                                    <cstring>tSepTriads</cstring>
+                                </property>
+                                <property name="font">
+                                    <font>
+                                    </font>
+                                </property>
+                                <property name="text">
+                                    <string>As triads</string>
+                                </property>
+                            </widget>
+                            <widget class="QCheckBox">
+                                <property name="name">
+                                    <cstring>lzcheckBox</cstring>
+                                </property>
+                                <property name="text">
+                                    <string>LZ</string>
+                                </property>
+                            </widget>
+                            <widget class="QCheckBox">
+                                <property name="name">
+                                    <cstring>VdcheckBox</cstring>
+                                </property>
+                                <property name="text">
+                                    <string>Vd</string>
+                                </property>
+                                <property name="checked">
+                                    <bool>true</bool>
+                                </property>
+                            </widget>
+                            <spacer>
+                                <property name="name">
+                                    <cstring>spacer7</cstring>
+                                </property>
+                                <property name="orientation">
+                                    <enum>Horizontal</enum>
+                                </property>
+                                <property name="sizeType">
+                                    <enum>Expanding</enum>
+                                </property>
+                                <property name="sizeHint">
+                                    <size>
+                                        <width>15</width>
+                                        <height>20</height>
+                                    </size>
+                                </property>
+                            </spacer>
+                        </hbox>
+                    </widget>
+                    <spacer row="8" column="3">
+                        <property name="name">
+                            <cstring>spacer13</cstring>
+                        </property>
+                        <property name="orientation">
+                            <enum>Vertical</enum>
+                        </property>
+                        <property name="sizeType">
+                            <enum>Expanding</enum>
+                        </property>
+                        <property name="sizeHint">
+                            <size>
+                                <width>16</width>
+                                <height>40</height>
+                            </size>
+                        </property>
+                    </spacer>
+                    <widget class="QGroupBox" row="7" column="0" rowspan="1" colspan="5">
+                        <property name="name">
+                            <cstring>ValidateGroupBox</cstring>
+                        </property>
+                        <property name="title">
+                            <string>Validator</string>
+                        </property>
+                        <property name="checkable">
+                            <bool>false</bool>
+                        </property>
+                        <grid>
+                            <property name="name">
+                                <cstring>unnamed</cstring>
+                            </property>
+                            <widget class="QLayoutWidget" row="0" column="0">
+                                <property name="name">
+                                    <cstring>layout8</cstring>
+                                </property>
+                                <hbox>
+                                    <property name="name">
+                                        <cstring>unnamed</cstring>
+                                    </property>
+                                    <widget class="QLabel">
+                                        <property name="name">
+                                            <cstring>textLabel1_5</cstring>
+                                        </property>
+                                        <property name="text">
+                                            <string>RegExp</string>
+                                        </property>
+                                    </widget>
+                                    <widget class="QLineEdit">
+                                        <property name="name">
+                                            <cstring>VdRegEx</cstring>
+                                        </property>
+                                        <property name="toolTip" stdset="0">
+                                            <string>[ABCD], will match an A or a B or a C or a D.</string>
+                                        </property>
+                                    </widget>
+                                    <spacer>
+                                        <property name="name">
+                                            <cstring>spacer7_2</cstring>
+                                        </property>
+                                        <property name="orientation">
+                                            <enum>Horizontal</enum>
+                                        </property>
+                                        <property name="sizeType">
+                                            <enum>Expanding</enum>
+                                        </property>
+                                        <property name="sizeHint">
+                                            <size>
+                                                <width>20</width>
+                                                <height>21</height>
+                                            </size>
+                                        </property>
+                                    </spacer>
+                                    <widget class="QLabel">
+                                        <property name="name">
+                                            <cstring>textLabel2_3</cstring>
+                                        </property>
+                                        <property name="text">
+                                            <string>Test:</string>
+                                        </property>
+                                    </widget>
+                                    <widget class="QLineEdit">
+                                        <property name="name">
+                                            <cstring>Testline</cstring>
+                                        </property>
+                                    </widget>
+                                </hbox>
+                            </widget>
+                            <widget class="QLabel" row="1" column="0">
+                                <property name="name">
+                                    <cstring>textLabel3</cstring>
+                                </property>
+                                <property name="text">
+                                    <string>&lt;font size="-1"&gt;&lt;u&gt;Example:&lt;/u&gt; RegEx &lt;b&gt;&lt;i&gt;[A-C]\d{5}[W-Z]&lt;/b&gt;&lt;/i&gt; for string &lt;i&gt;&lt;b&gt;A12345Z&lt;/b&gt;&lt;/i&gt;&lt;/font&gt;</string>
+                                </property>
+                                <property name="alignment">
+                                    <set>WordBreak|AlignCenter</set>
+                                </property>
+                            </widget>
+                        </grid>
                     </widget>
                 </grid>
             </widget>
                     </widget>
                 </grid>
             </widget>
+            <widget class="QWidget">
+                <property name="name">
+                    <cstring>TabPage</cstring>
+                </property>
+                <attribute name="title">
+                    <string>Rights</string>
+                </attribute>
+                <grid>
+                    <property name="name">
+                        <cstring>unnamed</cstring>
+                    </property>
+                    <widget class="QLayoutWidget" row="0" column="0">
+                        <property name="name">
+                            <cstring>layout8</cstring>
+                        </property>
+                        <grid>
+                            <property name="name">
+                                <cstring>unnamed</cstring>
+                            </property>
+                            <widget class="QListView" row="0" column="0">
+                                <column>
+                                    <property name="text">
+                                        <string>Roles</string>
+                                    </property>
+                                    <property name="clickable">
+                                        <bool>true</bool>
+                                    </property>
+                                    <property name="resizable">
+                                        <bool>true</bool>
+                                    </property>
+                                </column>
+                                <property name="name">
+                                    <cstring>aUsersList</cstring>
+                                </property>
+                            </widget>
+                            <widget class="QListView" row="0" column="1">
+                                <column>
+                                    <property name="text">
+                                        <string>Rights</string>
+                                    </property>
+                                    <property name="clickable">
+                                        <bool>true</bool>
+                                    </property>
+                                    <property name="resizable">
+                                        <bool>true</bool>
+                                    </property>
+                                </column>
+                                <property name="name">
+                                    <cstring>aRightsList</cstring>
+                                </property>
+                            </widget>
+                        </grid>
+                    </widget>
+                </grid>
+            </widget>
         </widget>
     </grid>
 </widget>
 <toolbars>
 </toolbars>
+<customwidgets>
+</customwidgets>
 <connections>
     <connection>
         <sender>eType</sender>
         <receiver>dEditField</receiver>
         <slot>AARegSelect(int)</slot>
     </connection>
+    <connection>
+        <sender>eOwnFormat</sender>
+        <signal>textChanged(const QString&amp;)</signal>
+        <receiver>dEditField</receiver>
+        <slot>setExample()</slot>
+    </connection>
+    <connection>
+        <sender>aDFormatBox</sender>
+        <signal>activated(const QString&amp;)</signal>
+        <receiver>dEditField</receiver>
+        <slot>setExample()</slot>
+    </connection>
+    <connection>
+        <sender>DateMask</sender>
+        <signal>toggled(bool)</signal>
+        <receiver>dEditField</receiver>
+        <slot>setExample()</slot>
+    </connection>
+    <connection>
+        <sender>ePrefix</sender>
+        <signal>textChanged(const QString&amp;)</signal>
+        <receiver>dEditField</receiver>
+        <slot>setExample()</slot>
+    </connection>
+    <connection>
+        <sender>eSuffix</sender>
+        <signal>textChanged(const QString&amp;)</signal>
+        <receiver>dEditField</receiver>
+        <slot>setExample()</slot>
+    </connection>
+    <connection>
+        <sender>useOwnFofmat</sender>
+        <signal>toggled(bool)</signal>
+        <receiver>dEditField</receiver>
+        <slot>setExample()</slot>
+    </connection>
+    <connection>
+        <sender>eMin</sender>
+        <signal>textChanged(const QString&amp;)</signal>
+        <receiver>dEditField</receiver>
+        <slot>setExample()</slot>
+    </connection>
+    <connection>
+        <sender>eMax</sender>
+        <signal>textChanged(const QString&amp;)</signal>
+        <receiver>dEditField</receiver>
+        <slot>setExample()</slot>
+    </connection>
+    <connection>
+        <sender>lzcheckBox</sender>
+        <signal>toggled(bool)</signal>
+        <receiver>dEditField</receiver>
+        <slot>setExample()</slot>
+    </connection>
+    <connection>
+        <sender>tNotBound</sender>
+        <signal>stateChanged(int)</signal>
+        <receiver>dEditField</receiver>
+        <slot>tNotBound_stateChanged(int)</slot>
+    </connection>
+    <connection>
+        <sender>VdcheckBox</sender>
+        <signal>stateChanged(int)</signal>
+        <receiver>dEditField</receiver>
+        <slot>VdcheckBox_stateChanged(int)</slot>
+    </connection>
+    <connection>
+        <sender>VdRegEx</sender>
+        <signal>textChanged(const QString&amp;)</signal>
+        <receiver>dEditField</receiver>
+        <slot>VdRegEx_textChanged(const QString&amp;)</slot>
+    </connection>
+    <connection>
+        <sender>Testline</sender>
+        <signal>textChanged(const QString&amp;)</signal>
+        <receiver>dEditField</receiver>
+        <slot>Testline_textChanged(const QString&amp;)</slot>
+    </connection>
 </connections>
 <includes>
     <include location="local" impldecl="in declaration">acfg.h</include>
     <slot>typeSelect( int idx )</slot>
     <slot>nameChanged()</slot>
     <slot>AARegSelect( int i )</slot>
+    <slot>tNotBound_stateChanged( int )</slot>
+    <slot>aUsersList_clicked( QListViewItem * )</slot>
+    <slot>setExample()</slot>
+    <slot>VdcheckBox_stateChanged( int )</slot>
+    <slot>VdRegEx_textChanged( const QString &amp; )</slot>
+    <slot>Testline_textChanged( const QString &amp; )</slot>
 </slots>
 <functions>
-    <function access="private" specifier="non virtual">destroy()</function>
-    <function access="private" specifier="non virtual">init()</function>
-    <function access="public" specifier="non virtual">moveToTopLeftCorner()</function>
+    <function access="private">destroy()</function>
+    <function access="private">init()</function>
 </functions>
 <pixmapinproject/>
 <layoutdefaults spacing="5" margin="5"/>
+<includehints>
+    <includehint>acombobox.h</includehint>
+</includehints>
 </UI>
index 56df0b6..134edac 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
-** $Id: deditfield.ui.h,v 1.30 2008/06/09 11:47:59 app Exp $
+** $Id: deditfield.ui.h,v 1.29 2006/05/31 06:44:22 gr Exp $
 **
 ** Code file of the Edit Field window
 ** of Ananas Designer applications
 ** init() function in place of a constructor, and a destroy() function in
 ** place of a destructor.
 *****************************************************************************/
-#include "acfg.h"
-#include "acfgrc.h"
 #include <qstatusbar.h>
+#include <qdatetime.h>
+#include <qvaluelist.h>
+#include <qlistview.h>
+#include <qvalidator.h> 
 #include "alog.h"
+#include "acfg.h"
+#include "acfgrc.h"
 
 /*
 #include <qsproject.h>
 #include <qseditor.h>
 #include <qsinterpreter.h>
 */
-  
+
 void
 setText(){
 
 }
 
-
 void dEditField::destroy()
 {
     updateMD();
@@ -69,8 +72,10 @@ void dEditField::init()
        artypes.clear();
        eType->clear();
        otypes.append(" ");
+       lzcheckBox->setText(tr("Add leading zeros"));
+       VdcheckBox->setText(tr("Validate"));
        eType->insertItem(tr("Unknown"), 0);
+
 }
 
 
@@ -79,7 +84,7 @@ void dEditField::setData( aListViewItem *o )
        item = o;
        aCfg *md = o->md;
        aCfgItem obj = o->obj;
-       
+
        QString ts;
        char t=' ';
        int w=0, d=0, oid, idx=0;
@@ -106,13 +111,13 @@ void dEditField::setData( aListViewItem *o )
                comboBox2->hide();
 //             layout()->remove(comboBox2);
 //             layout()->remove(saldoTextLabel);
-               
+
 //             updateGeometry();
        }
        // eType0->setText( ts );
        // eModule->setText( md->sText( obj, md_sourcecode ) );
        eDescription->setText( md->sText( obj, md_description ) );
-        
+
        if( md->attr( obj, mda_sort ) == "1" ) efSort->setChecked( true );
        else efSort->setChecked( false );
        if( md->attr( obj, mda_plus ) == "1" ) efPlus->setChecked( true );
@@ -120,12 +125,11 @@ void dEditField::setData( aListViewItem *o )
        if( md->attr( obj, mda_nz ) == "1" ) efNZ->setChecked( true );
        else efNZ->setChecked( false );
        efSum->setChecked(md->attr( obj, mda_sum ) == "1");
-        
+
        QStringList tlist;
        if(md->objClass(md->parent(obj))==md_resources)
        {
                tlist.append("\t"+QObject::tr("Unknown"));
-               tlist.append("N %d %d\t"+QObject::tr("Numberic"));
        }
        else
        {
@@ -160,18 +164,23 @@ void dEditField::setData( aListViewItem *o )
                }
        } else {
                 if ( t == ' ' ) eType->setCurrentItem( 0 );
-                if ( t == 'N' ) 
+                if ( t == 'N' )
                 {
                        eWidth->setMaxValue(20);
                        eDec->setMaxValue(99);
                        eType->setCurrentItem( 1 );
                 }
-                if ( t == 'C' ) 
+                if ( t == 'C' )
                 {
 
                        eWidth->setMaxValue(254);
                        eDec->setMaxValue(99);
                        eType->setCurrentItem( 2 );
+                       if ( w == 254 )
+                       {
+                         tNotBound->setChecked(TRUE);
+                         eWidth->setEnabled(FALSE);
+                       }
                 }
                 if ( t == 'D' ) eType->setCurrentItem( 3 );
                 if ( t == 'B' ) eType->setCurrentItem( 4 );
@@ -190,10 +199,10 @@ void dEditField::setData( aListViewItem *o )
        artypes.append(" ");
        n = md->count( context, md_aregister );
 // printf("n=%d name = %s\n",n, md->attr(context,mda_name).ascii());
-       for (i=0; i<n; i++) 
+       for (i=0; i<n; i++)
        {
                obj = md->find( context, md_aregister, i);
-               if ( !obj.isNull() ) 
+               if ( !obj.isNull() )
                {
                        aregid=md->attr(obj,mda_id).toInt();
                        str = tr(QString("AccumulationRegister."))+md->attr( obj, mda_name );
@@ -201,10 +210,10 @@ void dEditField::setData( aListViewItem *o )
                        obj = md->findChild(obj,md_resources);
                        n1 = md->count( obj, md_field);
 //   printf("n=%d name = %s\n",n, md->attr(obj,mda_name).ascii());
-                       for (uint j=0; j<n1; j++) 
+                       for (uint j=0; j<n1; j++)
                        {
                                obj2 = md->find( obj, md_field, j);
-                               if ( !obj2.isNull() ) 
+                               if ( !obj2.isNull() )
                                {
                                        aregfid = md->attr(obj2, mda_id).toInt();
                                        artypes.append(QString(" %1 %2").arg(aregid).arg(aregfid));
@@ -213,8 +222,52 @@ void dEditField::setData( aListViewItem *o )
                                }
                        }
                }
-       }       
+       }
        typeSelect( eType->currentItem() );
+       aUsersList->header()->hide();
+       QListViewItem * groupsItem = new QListViewItem( aUsersList, 0 );
+       groupsItem->setText( 0, tr( "Groups" ) );
+       groupsItem->setExpandable(TRUE);
+       groupsItem->setOpen( TRUE );
+
+       QListViewItem * admGroup = new QListViewItem( groupsItem, 0 );
+       admGroup->setText( 0, tr( "Administrators" ) );
+       admGroup->setExpandable(TRUE);
+       admGroup->setOpen( TRUE );
+
+       QListViewItem * operGroup = new QListViewItem( groupsItem, 0 );
+       operGroup->setText( 0, tr( "Operators" ) );
+       operGroup->setExpandable(TRUE);
+       admGroup->setOpen( TRUE );
+
+       QListViewItem * usersGroup = new QListViewItem( aUsersList, 0 );
+       usersGroup->setText( 0, tr( "Users" ) );
+       usersGroup->setExpandable(TRUE);
+       usersGroup->setOpen(TRUE);
+
+       QListViewItem * user1 = new QListViewItem( usersGroup, 0 );
+       user1->setText( 0, tr( "Tester" ) );
+
+       // Complete Right List
+       aRightsList->header()->hide();
+       QValueList<QListViewItem *> rightList;
+       rightList.append( new QCheckListItem( aRightsList, tr( "Reading" ), QCheckListItem::CheckBoxController ) );
+       rightList.append( new QCheckListItem( aRightsList, tr( "Writing" ), QCheckListItem::CheckBoxController ) );
+       rightList.append( new QCheckListItem( aRightsList, tr( "Modification" ), QCheckListItem::CheckBoxController ) );
+       rightList.append( new QCheckListItem( aRightsList, tr( "Deleting" ), QCheckListItem::CheckBoxController ) );
+
+       QListViewItem *ritem = 0;
+       unsigned int num = 1;
+       // go through the list of parent items...
+       for ( QValueList<QListViewItem*>::Iterator it = rightList.begin();
+       it != rightList.end();
+       ( *it )->setOpen( TRUE ), ++it, num++ )
+       {
+               ritem = *it;
+       }
+       //
+
+
 }
 
 void dEditField::updateMD()
@@ -223,7 +276,7 @@ void dEditField::updateMD()
 
  aCfg *md = item->md;
  aCfgItem obj = item->obj;
+
  al->updateMD();
  item->setText( 0, eName->text().stripWhiteSpace() );
  md->setAttr( obj, mda_name, eName->text().stripWhiteSpace() );
@@ -268,8 +321,29 @@ void dEditField::typeSelect( int idx )
                eDec->show();
                tWidth->show();
                tDec->show();
+               lzcheckBox->show();
                efSum->show();
+               tNotBound->hide();
+               tSepTriads->show();
                comboBox2->setEnabled(false);
+               comboBox2->hide();
+               VdcheckBox->show();
+               ValidateGroupBox->show();
+               DateMask->hide();
+               saldoTextLabel->hide();
+               //
+               Num_Label->hide();
+               MinLabel->hide();
+               eMin->hide();
+               MaxLabel->hide();
+               eMax->hide();
+               PrLabel->hide();
+               ePrefix->hide();
+               SfLabel->hide();
+               eSuffix->hide();
+               exLabel->hide();
+               eXample->hide();
+                //
        }
        else
        {
@@ -281,32 +355,92 @@ void dEditField::typeSelect( int idx )
                        tWidth->show();
                        tDec->hide();
                        efSum->hide();
+                       tSepTriads->hide();
+                       lzcheckBox->hide();
+                       tNotBound->show();
+                       DateMask->show();
+                       VdcheckBox->show();
+                       ValidateGroupBox->show();
                        efSum->setChecked(false);
                        comboBox2->setEnabled(false);
+                       comboBox2->hide();
+                       saldoTextLabel->hide();
+                           Num_Label->show();
+                           MinLabel->show();
+                           eMin->show();
+                           MaxLabel->show();
+                           eMax->show();
+                           PrLabel->show();
+                           ePrefix->show();
+                           SfLabel->show();
+                           eSuffix->show();
+                           exLabel->show();
+                           eXample->show();
                }
-               else 
+               else
                {
                        if( idx == 0)
                        {
-                               comboBox2->setEnabled(true);
-                               eWidth->hide();
-                               eDec->hide();
-                               tWidth->hide();
-                               tDec->hide();
-                               efSum->hide();
-                               efSum->setChecked(false);
+                           saldoTextLabel->show();
+                           comboBox2->show();
+                           comboBox2->setEnabled(true);
+                           eWidth->hide();
+                           lzcheckBox->hide();
+                           eDec->hide();
+                           tWidth->hide();
+                           tDec->hide();
+                           efSum->hide();
+                           tNotBound->hide();
+                           tSepTriads->hide();
+                           VdcheckBox->hide();
+                           ValidateGroupBox->hide();
+                           //
+                           Num_Label->hide();
+                           MinLabel->hide();
+                           eMin->hide();
+                           MaxLabel->hide();
+                           eMax->hide();
+                           PrLabel->hide();
+                           ePrefix->hide();
+                           SfLabel->hide();
+                           eSuffix->hide();
+                           exLabel->hide();
+                           eXample->hide();
+                           //
+                           efSum->setChecked(false);
                        }
                        else
                        {
                                comboBox2->setEnabled(false);
+                               comboBox2->hide();
+                               saldoTextLabel->hide();
+                               lzcheckBox->hide();
                                eWidth->hide();
                                eDec->hide();
                                tWidth->hide();
                                tDec->hide();
                                efSum->hide();
+                               tNotBound->hide();
+                               tSepTriads->hide();
+                               VdcheckBox->hide();
+                               DateMask->hide();
+                               ValidateGroupBox->hide();
+                                //
+                           Num_Label->hide();
+                           MinLabel->hide();
+                           eMin->hide();
+                           MaxLabel->hide();
+                           eMax->hide();
+                           PrLabel->hide();
+                           ePrefix->hide();
+                           SfLabel->hide();
+                           eSuffix->hide();
+                           exLabel->hide();
+                           eXample->hide();
+                           //
                                efSum->setChecked(false);
- // comboBox2->setEnabled(false);
-                       }       
+                               // comboBox2->setEnabled(false);
+                       }
                }
        }
 }
@@ -314,28 +448,104 @@ void dEditField::typeSelect( int idx )
 
 void dEditField::nameChanged()
 {
-       setCaption( tr("Field:") + eName->text() );
+       setCaption( tr("Field:  ") + eName->text() );
 }
 
 
 void dEditField::AARegSelect( int i )
 {
-       
+
 }
 
 
-/**
- * \ru
- *     \brief Сдвигает окно редактирования свойств в левый верхний угол родительского окна.
- * 
- *     Размеры перемещаемого окна остаются без изменений.
- * \_ru
- */
-void
-dEditField::moveToTopLeftCorner()
+void dEditField::tNotBound_stateChanged( int )
+{
+    if (tNotBound->isChecked() )
+    {
+       eWidth->setValue(254);
+       eWidth->setEnabled(FALSE);
+    } else {
+        eWidth->setEnabled(TRUE);
+    }
+}
+
+
+void dEditField::aUsersList_clicked( QListViewItem * )
+{
+// Read aRightsList for selected user
+}
+
+
+void dEditField::setExample()
+{
+     QDate date = QDate::currentDate();
+     QString curdate, dateformat, numerator;
+     if (DateMask->isChecked() )
+     {
+        if (useOwnFofmat->isChecked() )
+        {
+            aDFormatBox->setEnabled(FALSE);
+            eOwnFormat->setEnabled(TRUE);
+            dateformat =eOwnFormat->text();
+        }else{
+            aDFormatBox->setEnabled(TRUE);
+            eOwnFormat->setEnabled(FALSE);
+            dateformat =aDFormatBox->currentText();
+        }
+        curdate = date.toString(dateformat);
+     }
+
+     if (lzcheckBox->isChecked())
+     {
+       numerator = eMin->text().rightJustify( eWidth->value(), '0' );
+     }
+     else {
+       numerator = eMin->text();
+     }
+    eXample->setText(QString("%1%2%3%4").arg(ePrefix->text()).arg(numerator).arg(eSuffix->text()).arg(curdate));
+}
+
+
+
+
+void dEditField::VdcheckBox_stateChanged( int )
+{
+    if (VdcheckBox->isChecked() )
+    {
+       ValidateGroupBox->show();
+    } else {
+       ValidateGroupBox->hide();
+    }
+}
+
+
+void dEditField::VdRegEx_textChanged( const QString & )
+{
+
+}
+
+
+void dEditField::Testline_textChanged( const QString & )
 {
-       this->parentWidget()->setGeometry( 0, 0, 
-               this->parentWidget()->frameSize().width(),
-               this->parentWidget()->frameSize().height());
+    QRegExp rx( VdRegEx->text() );
+    QRegExpValidator v( rx, 0 );
+    int pos = 0;
+    QString s = Testline->text();
+    QPalette pal = Testline->palette();
 
+    if(v.validate(s, pos ) == QValidator::Invalid)
+    {
+       pal.setColor(QColorGroup::Highlight, Qt::red);
+       Testline->setPalette(pal);
+    }
+    if(v.validate(s, pos ) == QValidator::Intermediate)
+    {
+        pal.setColor(QColorGroup::Highlight, Qt::red);
+        Testline->setPalette(pal);
+    }
+     if(v.validate(s, pos ) == QValidator::Acceptable)
+    {
+        pal.setColor(QColorGroup::Highlight, Qt::green);
+        Testline->setPalette(pal);      
+    }
 }
index b3075e7..f50820b 100644 (file)
@@ -517,14 +517,14 @@ void
 aListViewItem::edit()
 {
     QWorkspace *ws = mainform->ws;
-    aWindowsList *wl = mainform->wl;    
+    aWindowsList *wl = mainform->wl;
     QString oclass = md->objClass( obj );
     int objid = md->id( obj );
     if ( wl->find( objid ) ) {
        wl->get( objid )->setFocus();
        return;
     }
-        
+
        if ( oclass == md_metadata )
        {
            dEditCfg *e = new dEditCfg( ws, 0, WDestructiveClose );
@@ -533,7 +533,8 @@ aListViewItem::edit()
            QObject::connect( mainform, SIGNAL( tosave() ), editor, SLOT( updateMD() ) );
            e->setData( this );
            e->show();
-           e->moveToTopLeftCorner();
+           e->parentWidget()->setGeometry(0,0,e->parentWidget()->frameSize().width(), e->parentWidget()->frameSize().height());
+           e->parentWidget()->setGeometry(0,0,e->parentWidget()->frameSize().width(), e->parentWidget()->frameSize().height());
            mainform->addTab(++mainform->lastTabId,e->name());
            return;
        }
@@ -546,7 +547,7 @@ aListViewItem::edit()
            QObject::connect( mainform, SIGNAL( tosave() ), editor, SLOT( updateMD() ) );
            e->setData( this );
            e->show();
-           e->moveToTopLeftCorner();
+           e->parentWidget()->setGeometry(0,0,e->parentWidget()->frameSize().width(), e->parentWidget()->frameSize().height());
            mainform->addTab(++mainform->lastTabId,e->name());
            return;
        };
@@ -558,7 +559,7 @@ aListViewItem::edit()
            QObject::connect( mainform, SIGNAL( tosave() ), editor, SLOT( updateMD() ) );
            e->setData( this );
            e->show();
-           e->moveToTopLeftCorner();
+           e->parentWidget()->setGeometry(0,0,e->parentWidget()->frameSize().width(), e->parentWidget()->frameSize().height());
            mainform->addTab(++mainform->lastTabId,e->name());
            return;
        };
@@ -570,7 +571,7 @@ aListViewItem::edit()
            QObject::connect( mainform, SIGNAL( tosave() ), editor, SLOT( updateMD() ) );
            e->setData( this );
            e->show();
-           e->moveToTopLeftCorner();
+           e->parentWidget()->setGeometry(0,0,e->parentWidget()->frameSize().width(), e->parentWidget()->frameSize().height());
            mainform->addTab(++mainform->lastTabId,e->name());
            return;
        };
@@ -582,7 +583,7 @@ aListViewItem::edit()
            QObject::connect( mainform, SIGNAL( tosave() ), editor, SLOT( updateMD() ) );
            e->setData( this );
            e->show();
-           e->moveToTopLeftCorner();
+           e->parentWidget()->setGeometry(0,0,e->parentWidget()->frameSize().width(), e->parentWidget()->frameSize().height());
            mainform->addTab(++mainform->lastTabId,e->name());
            return;
        };
@@ -594,7 +595,7 @@ aListViewItem::edit()
            QObject::connect( mainform, SIGNAL( tosave() ), editor, SLOT( updateMD() ) );
            e->setData( this );
            e->show();
-           e->moveToTopLeftCorner();
+           e->parentWidget()->setGeometry(0,0,e->parentWidget()->frameSize().width(), e->parentWidget()->frameSize().height());
            mainform->addTab(++mainform->lastTabId,e->name());
            return;
        };
@@ -606,7 +607,7 @@ aListViewItem::edit()
            QObject::connect( mainform, SIGNAL( tosave() ), editor, SLOT( updateMD() ) );
            e->setData( this );
            e->show();
-           e->moveToTopLeftCorner();
+     e->parentWidget()->setGeometry(0,0,e->parentWidget()->frameSize().width(), e->parentWidget()->frameSize().height());
            mainform->addTab(++mainform->lastTabId,e->name());
            return;
        };
@@ -618,7 +619,7 @@ aListViewItem::edit()
            QObject::connect( mainform, SIGNAL( tosave() ), editor, SLOT( updateMD() ) );
            e->setData( this );
            e->show();
-           e->moveToTopLeftCorner();
+     e->parentWidget()->setGeometry(0,0,e->parentWidget()->frameSize().width(), e->parentWidget()->frameSize().height());
            mainform->addTab(++mainform->lastTabId, e->name());
            return;
        };
@@ -630,7 +631,7 @@ aListViewItem::edit()
            e->setData( this );
            QObject::connect( mainform, SIGNAL( tosave() ), editor, SLOT( updateMD() ) );
            e->show();
-           e->moveToTopLeftCorner();
+     e->parentWidget()->setGeometry(0,0,e->parentWidget()->frameSize().width(), e->parentWidget()->frameSize().height());
            mainform->addTab(++mainform->lastTabId,e->name());
            return;
        };
@@ -642,7 +643,7 @@ aListViewItem::edit()
            QObject::connect( mainform, SIGNAL( tosave() ), editor, SLOT( updateMD() ) );
            e->setData( this );
            e->show();
-           e->moveToTopLeftCorner();
+     e->parentWidget()->setGeometry(0,0,e->parentWidget()->frameSize().width(), e->parentWidget()->frameSize().height());
            mainform->addTab(++mainform->lastTabId,e->name());
            return;
        };
@@ -654,7 +655,7 @@ aListViewItem::edit()
            QObject::connect( mainform, SIGNAL( tosave() ), editor, SLOT( updateMD() ) );
            e->setData( this );
            e->show();
-           e->moveToTopLeftCorner();
+     e->parentWidget()->setGeometry(0,0,e->parentWidget()->frameSize().width(), e->parentWidget()->frameSize().height());
            mainform->addTab(++mainform->lastTabId,e->name());
            return;
        }
@@ -686,7 +687,7 @@ void aListViewItem::saveItem()
 
        //md->saveOneObject()
        QString oclass = md->objClass( obj );
-       if (    oclass == md_field || 
+       if (    oclass == md_field ||
                oclass == md_document ||
                oclass == md_catalogue ||
                oclass == md_journal ||
@@ -694,10 +695,10 @@ void aListViewItem::saveItem()
                oclass == md_aregister ||
                oclass == md_report ||
                oclass == md_webform ||
-               oclass == md_form || 
+               oclass == md_form ||
                oclass == md_table)
        {
-                       
+
                QString fname;
                QFileDialog fd( QString::null,
                        QObject::tr("any files (*)"),
@@ -715,17 +716,17 @@ void aListViewItem::saveItem()
 
 void aListViewItem::loadItem()
 {
-       
+
        QString oclass = md->objClass( obj );
-       
+
        if (    oclass == md_header ||
                oclass == md_table ||
-               oclass == md_element || 
+               oclass == md_element ||
                oclass == md_group ||
                oclass == md_resources ||
                oclass == md_dimensions ||
                oclass == md_information ||
-               oclass == md_columns || 
+               oclass == md_columns ||
                oclass == md_documents ||
                oclass == md_catalogues ||
                oclass == md_journals ||
@@ -755,7 +756,7 @@ void aListViewItem::loadItem()
                        // c.setAttr(loadObj, mda_name, "CATALOGUE1 COPY!!!");
                        // append to cfg
                        // c.importCfgItem( c.find(c.find(0), md_catalogues) , loadObj);
-                       //                                      
+                       //
                        loadObj = md->loadOneObject(fname);
                        if(loadObj.isNull())
                        {
@@ -765,7 +766,7 @@ void aListViewItem::loadItem()
                        {
                                md->setAttr(loadObj, mda_name, QString("%1_copy").arg(md->attr(loadObj, mda_name)));
                                QString loclass = md->objClass(loadObj);
-                               if ( loclass==md_field  && 
+                               if ( loclass==md_field  &&
                                                (oclass == md_header || oclass == md_table ||
                                                oclass == md_element || oclass == md_group ||
                                                oclass == md_resources || oclass == md_dimensions ||
@@ -782,12 +783,12 @@ void aListViewItem::loadItem()
                                        aListViewItem *newitem = new aListViewItem( this, getLastChild(), md, newobj );
                                }
                                if ( loclass==md_catalogue && oclass == md_catalogues )
-                               {       
+                               {
                                        aCfgItem newobj = md->importCfgItem( obj, loadObj );
                                        aListViewItem *newitem = new aListViewItem( this, getLastChild(), md, newobj );
                                }
                                if ( loclass==md_journal && oclass == md_journals )
-                               {       
+                               {
                                        aCfgItem newobj = md->importCfgItem( obj, loadObj );
                                        aListViewItem *newitem = new aListViewItem( this, getLastChild(), md, newobj );
                                }
@@ -801,7 +802,7 @@ void aListViewItem::loadItem()
                                        aCfgItem newobj = md->importCfgItem( obj, loadObj );
                                        aListViewItem *newitem = new aListViewItem( this, getLastChild(), md, newobj );
                                }
-                               if ( loclass==md_report && oclass == md_reports ) 
+                               if ( loclass==md_report && oclass == md_reports )
                                {
                                        aCfgItem newobj = md->importCfgItem( obj, loadObj );
                                        aListViewItem *newitem = new aListViewItem( this, getLastChild(), md, newobj );
@@ -982,7 +983,7 @@ aListViewItem::newForm()
 #ifdef Q_OS_WIN32
        tpldir = qApp->applicationDirPath()+"/templates/";
 #else
-       BrInitError error; 
+       BrInitError error;
        if (br_init_lib(&error) == 0 && error != BR_INIT_ERROR_DISABLED)
        {
                aLog::print(aLog::MT_INFO, QObject::tr("Warning: BinReloc failed to initialize (error code %1)\n").arg(error));
@@ -1007,7 +1008,7 @@ aListViewItem::newForm()
                else
                {
                        aLog::print(aLog::MT_ERROR,QObject::tr("dEditDoc file %1 not exists in templates directory %2").arg(tpl_name).arg(tpldir));
-               }               
+               }
                newitem = new aListViewItem( this, getLastChild(), md, newobj );
 //             newitem->setSelected( TRUE );
                newitem->setOpen( TRUE );
@@ -1072,14 +1073,14 @@ aListViewItem::newColumn()
  * \en
  *     \brief Search on a mdtree
  *
- *     \param mdItem - The index on a mdtree 
+ *     \param mdItem - The index on a mdtree
  *     \param parentObjClass - Class of an parent element in a mdtree
- *     \param parentObjName - Heading of an element in a mdtree 
+ *     \param parentObjName - Heading of an element in a mdtree
  *     \param objClass - Class of an element in a mdtree
  *     \param objName - Heading of an element in a mdtree
  * \_en
  * \ru
- *     \brief Поиск по дереву метаданных.  
+ *     \brief Поиск по дереву метаданных.
  *
  *     Указываем тег-класс узла, тег-класс его родительского узла и строковые значения
  *     для узла и его родителя.
@@ -1089,7 +1090,7 @@ aListViewItem::newColumn()
  *     последний параметр objName указывать не нужно.
  *     \param mdItem - Указатель на дерево
  *     \param parentObjClass - Класс родительского элемента в дереве
- *     \param parentObjName - Заголовок родительского элемента в дереве  
+ *     \param parentObjName - Заголовок родительского элемента в дереве
  *     \param objClass - Класс элемента в дереве
  *     \param objName - Заголовок элемента в дереве
  * \_ru
@@ -1105,7 +1106,7 @@ aListViewItem::findItemInMD(aListViewItem *mdItem, const QString &parentObjClass
        bool                    parentFound = false;
        QString                 oName = "";
        QString                 oClass = "";
-       
+
        qitem = mdItem;
        qlist = qitem->listView();
        QListViewItemIterator it( qlist );
@@ -1141,7 +1142,7 @@ aMetadataTreeView::aMetadataTreeView(  QWidget *parent, aCfg *cfgmd )
        connect( this, SIGNAL( collapsed( QListViewItem* ) ), this, SLOT( on_collapsed( QListViewItem* ) ) );
 }
 
-void 
+void
 aMetadataTreeView::on_collapsed( QListViewItem * item )
 {
        aListViewItem *i = (aListViewItem *) item;
index 902ae73..a2812a1 100644 (file)
@@ -37,7 +37,7 @@
 #include "wdbfield.h"
 #include "addfdialog.h"
 //#include "mainform.h"
-
+#include "acfg.h"
 
 
 /*!
@@ -139,7 +139,7 @@ wDBField::setFieldName( QString n )
 /*!
  * \en         Gets field name in metadata. \_en
  * \ru Получение имени поля в метаданных, на которое настроен виджет. \_ru
- * return - \en Field name. \_en \ru Имя поля в метаданных.\_ru 
+ * return - \en Field name. \_en \ru Имя поля в метаданных.\_ru
  */
 /*
 QString
@@ -168,12 +168,14 @@ wDBField::init()
        id=0;
        //get copy of metadata
        md = getMd();
+
        if(md)
        {
                // get id of container object - catalogue or document
                id = aWidget::parentContainer(this)->getId();
                head = md->find(id);
        }
+
 }
 
 
@@ -199,12 +201,12 @@ wDBField::getFields()
   defFields.clear();
   defDisplayFields.clear();
   if(!head.isNull())
-  { 
+  {
        if(md->objClass(head) == md_catalogue)
        {
 //             printf("getting fields from metadata\n");
-               o = md->findChild(head,md_element); //object element 
-               res = md->countChild(o,md_field); 
+               o = md->findChild(head,md_element); //object element
+               res = md->countChild(o,md_field);
 //             printf("find elements\n");
                for( i = 0; i < res; i++ )
                {
@@ -223,7 +225,7 @@ wDBField::getFields()
                        }
                }
                o = md->findChild(head,md_group); // object group
-               res = md->countChild(o,md_field); 
+               res = md->countChild(o,md_field);
 //             printf("find groups\n");
                for( i = 0; i < res; i++ )
                {
@@ -314,8 +316,14 @@ void
 wDBField::initObject(aDatabase *adb )
 {
   wField::initObject( adb );
-  //aCfgItem o;
-  //o = md->find( getId() );
+  aCfgItem o;
+  o = md->find( getId() );
+  if ( md->attr(o,mda_nz) == "1")
+  {
+       wField::SetNonZero(true);
+  }else{
+       wField::SetNonZero(false);
+  }
   //aObject* obj = new aObject(o,adb);
   //tableInsert( aDatabase::tableDbName( *md, o ), o );
 //  debug_message("init dbfield  \n");
@@ -331,12 +339,13 @@ void
 wDBField::setEditorType ()
 {
     aCfgItem o_head,o;
-    QString str, type;
+    QString str, type, nz;
     int id;
        if(!head.isNull())
        {
                id = property("Id").toInt();
                o_head = md->find(id);
+
                if(!o_head.isNull())
                {
                        type = md->attr(o_head,mda_type);
index 4e94c97..51eda22 100644 (file)
  * \ru
  *     \brief Универсальный Плагин -- виджет, предназначен для редактирования атрибутов бизнес объектов Ананаса.
  *     Наследует wField.
- *     
+ *
  *     Основным полезным свойством этого визуального класса является возможность его привязки к атрибуту persistence бизнес объекта
  *     Ананаса. Как только привязка задана - логика заполнения объекта значением соответствующего атрибута бизнес объекта, логика
- *     сохранения заданного пользователем значения в соответствующем атрибуте бизнес объекта выполняется автоматически runtime 
+ *     сохранения заданного пользователем значения в соответствующем атрибуте бизнес объекта выполняется автоматически runtime
  *     подсистемой Ананаса. То есть мы используем прием, который имеет общепринятое название data bindings.
- *     
+ *
  * \_ru
  */
 class QT_WIDGET_PLUGIN_EXPORT wDBField : public wField
@@ -67,7 +67,7 @@ class QT_WIDGET_PLUGIN_EXPORT wDBField : public wField
 
 friend class addfdialog;
 
-       
+
 public:
 
        wDBField( QWidget *parent, WFlags fl );
@@ -81,7 +81,7 @@ public:
        virtual QString getFieldName()  const   { return FieldName;     };
        void            setOpenEditor(bool b)   { if(b) openEditor();   };
        void            setFieldName(QString n);
-protected:     
+protected:
        QStringList     getFields();
        void            init();
        QValueList<Q_ULLONG> getBindList();
index 4416049..89642d8 100644 (file)
@@ -51,8 +51,7 @@
 #include "wcatalogeditor.h"
 #include "efield.h"
 #include "acalendar.h"
-
-
+#include "acfg.h"
 
 /*!
  * \en Constructs object with parent=parent, name=name and flags=fl \_en
@@ -67,6 +66,10 @@ wField::wField( QWidget *parent, const char *name, WFlags fl )
        setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed ) );
        setFocusPolicy(StrongFocus);
        new QHBoxLayout( this, 0, 0 );
+       nzLabel = new QLabel(this);
+       nzLabel->setText(" ");
+       nzLabel->setPaletteForegroundColor(Qt::red);
+       nzLabel->show();
        lineEdit = new QLineEdit(this);
        lineEdit->hide();
        dateEdit = new wDateEdit(this);
@@ -129,6 +132,7 @@ wField::widgetInit()
        disconnect( lineEdit, SIGNAL( lostFocus() ), this, SLOT( focusOutEvent()) );
   //  lineEdit->disconnect();
     lineEdit->setReadOnly(false);
+    layout()->add( nzLabel );
     layout()->remove(lineEdit);
     dateEdit->hide();// = new QDateEdit(this);
     disconnect(dateEdit, SIGNAL( valueChanged ( const QDate&) ),
@@ -629,6 +633,22 @@ wField::SetReadOnly(bool fl)
 }
 
 /*!
+ * \en Mark field by red asterisk if it is Non Zero. \_en
+ * \ru         Помечает поле красной звездочкой, если поле не нулевое.\_ru
+ */
+void
+wField::SetNonZero(bool fl)
+{
+
+   if( fl == true )
+   {
+          nzLabel->setText("*");
+   }else{
+          nzLabel->setText(" ");
+   }
+}
+
+/*!
  *\~english
  *     Proces value changed.
  *     Proces value changed in fields diferent types.
index 0f88c04..edf6b96 100644 (file)
@@ -41,6 +41,7 @@
 #include "wdateedit.h"
 #include "adatabase.h"
 #include "ananas.h"
+#include "acalendar.h"
 
 class wCatButton;
 class wCheckBox;
@@ -54,7 +55,7 @@ class wCheckBox;
  *     Наследует aWidget.
  *
  *     В отличие от wDBField класс wField не биндится к атрибутам persistent бизнес объектов. То есть время жизни
- *     хранимых в нем значений равно времени жизни родительской экранной формы. Прикладной программист сам должен 
+ *     хранимых в нем значений равно времени жизни родительской экранной формы. Прикладной программист сам должен
  *     решить вопрос обработки и хранения значений задаваемых пользователем.
  * \_ru
  */
@@ -99,6 +100,7 @@ public slots:
        virtual void            focusOutEvent();
        void                    selectAll();
        virtual void            SetReadOnly(bool);
+       virtual void            SetNonZero(bool);
 
 private slots:
        void on_selected( Q_ULLONG uid );
@@ -108,6 +110,7 @@ protected:
        QLineEdit       *lineEdit;
        wDateEdit       *dateEdit;
        QLabel          *objLabel;
+       QLabel          *nzLabel;
        wCatButton      *objButton;
        wCheckBox       *checkBox;
        tEditorType     vEditorType;