Prechádzať zdrojové kódy

Comparison: Modified Views, and Fields
modified: TurboBird.lpi
modified: TurboBird.lpr
modified: comparison.lfm
modified: comparison.pas
modified: main.pas
modified: permissionmanage.lfm
modified: permissionmanage.lrs
modified: permissionmanage.pas
modified: querywindow.pas

motaz 13 rokov pred
rodič
commit
880bb95621
13 zmenil súbory, kde vykonal 1125 pridanie a 411 odobranie
  1. 170 151
      TurboBird.lpi
  2. 1 1
      TurboBird.lpr
  3. 1 1
      comparison.lfm
  4. 415 16
      comparison.pas
  5. 7 5
      main.pas
  6. 222 60
      permissionmanage.lfm
  7. 115 77
      permissionmanage.lrs
  8. 103 10
      permissionmanage.pas
  9. 3 0
      querywindow.pas
  10. 4 4
      systables.pas
  11. 47 47
      tablemanage.lfm
  12. 36 36
      tablemanage.lrs
  13. 1 3
      tablemanage.pas

+ 170 - 151
TurboBird.lpi

@@ -55,11 +55,12 @@
         <PackageName Value="LCL"/>
       </Item5>
     </RequiredPackages>
-    <Units Count="103">
+    <Units Count="105">
       <Unit0>
         <Filename Value="TurboBird.lpr"/>
         <IsPartOfProject Value="True"/>
         <UnitName Value="TurboBird"/>
+        <IsVisibleTab Value="True"/>
         <EditorIndex Value="1"/>
         <WindowIndex Value="0"/>
         <TopLine Value="1"/>
@@ -73,10 +74,10 @@
         <ComponentName Value="fmMain"/>
         <ResourceBaseClass Value="Form"/>
         <UnitName Value="main"/>
-        <EditorIndex Value="5"/>
+        <EditorIndex Value="7"/>
         <WindowIndex Value="0"/>
-        <TopLine Value="3714"/>
-        <CursorPos X="1" Y="3728"/>
+        <TopLine Value="2232"/>
+        <CursorPos X="22" Y="2251"/>
         <UsageCount Value="200"/>
         <Loaded Value="True"/>
         <LoadedDesigner Value="True"/>
@@ -108,7 +109,7 @@
         <UnitName Value="Buttons"/>
         <TopLine Value="125"/>
         <CursorPos X="25" Y="141"/>
-        <UsageCount Value="30"/>
+        <UsageCount Value="29"/>
       </Unit4>
       <Unit5>
         <Filename Value="querywindow.pas"/>
@@ -116,11 +117,10 @@
         <ComponentName Value="fmQueryWindow"/>
         <ResourceBaseClass Value="Form"/>
         <UnitName Value="QueryWindow"/>
-        <IsVisibleTab Value="True"/>
-        <EditorIndex Value="6"/>
+        <EditorIndex Value="8"/>
         <WindowIndex Value="0"/>
-        <TopLine Value="182"/>
-        <CursorPos X="3" Y="184"/>
+        <TopLine Value="669"/>
+        <CursorPos X="17" Y="677"/>
         <UsageCount Value="200"/>
         <Loaded Value="True"/>
         <LoadedDesigner Value="True"/>
@@ -130,13 +130,13 @@
         <UnitName Value="Dialogs"/>
         <TopLine Value="530"/>
         <CursorPos X="10" Y="489"/>
-        <UsageCount Value="1"/>
+        <UsageCount Value="10"/>
       </Unit6>
       <Unit7>
         <Filename Value="/usr/lib/lazarus/0.9.28.2/lcl/include/messagedialogs.inc"/>
         <TopLine Value="152"/>
         <CursorPos X="6" Y="159"/>
-        <UsageCount Value="1"/>
+        <UsageCount Value="10"/>
       </Unit7>
       <Unit8>
         <Filename Value="tableinfo.pas"/>
@@ -146,7 +146,7 @@
         <WindowIndex Value="0"/>
         <TopLine Value="67"/>
         <CursorPos X="6" Y="97"/>
-        <UsageCount Value="191"/>
+        <UsageCount Value="190"/>
       </Unit8>
       <Unit9>
         <Filename Value="viewview.pas"/>
@@ -244,19 +244,19 @@
         <UnitName Value="Interfaces"/>
         <TopLine Value="1"/>
         <CursorPos X="1" Y="1"/>
-        <UsageCount Value="9"/>
+        <UsageCount Value="8"/>
       </Unit17>
       <Unit18>
         <Filename Value="/usr/share/fpcsrc/2.2.4/rtl/objpas/sysutils/datih.inc"/>
         <TopLine Value="101"/>
         <CursorPos X="10" Y="130"/>
-        <UsageCount Value="7"/>
+        <UsageCount Value="6"/>
       </Unit18>
       <Unit19>
         <Filename Value="/usr/share/fpcsrc/2.2.4/rtl/objpas/sysutils/dati.inc"/>
         <TopLine Value="53"/>
         <CursorPos X="1" Y="1"/>
-        <UsageCount Value="5"/>
+        <UsageCount Value="4"/>
       </Unit19>
       <Unit20>
         <Filename Value="createtrigger.pas"/>
@@ -274,33 +274,33 @@
         <UnitName Value="sqldb"/>
         <TopLine Value="1643"/>
         <CursorPos X="17" Y="1647"/>
-        <UsageCount Value="6"/>
+        <UsageCount Value="5"/>
       </Unit21>
       <Unit22>
         <Filename Value="/usr/share/fpcsrc/2.2.4/packages/fcl-db/src/base/sqlscript.pp"/>
         <UnitName Value="sqlscript"/>
         <TopLine Value="472"/>
         <CursorPos X="23" Y="401"/>
-        <UsageCount Value="6"/>
+        <UsageCount Value="5"/>
       </Unit22>
       <Unit23>
         <Filename Value="/usr/share/fpcsrc/2.2.4/packages/fcl-db/src/base/db.pas"/>
         <UnitName Value="db"/>
         <TopLine Value="1759"/>
         <CursorPos X="15" Y="1783"/>
-        <UsageCount Value="1"/>
+        <UsageCount Value="10"/>
       </Unit23>
       <Unit24>
         <Filename Value="/usr/share/fpcsrc/2.2.4/packages/fcl-db/src/base/datasource.inc"/>
         <TopLine Value="467"/>
         <CursorPos X="26" Y="471"/>
-        <UsageCount Value="1"/>
+        <UsageCount Value="10"/>
       </Unit24>
       <Unit25>
         <Filename Value="/usr/share/fpcsrc/2.2.4/packages/fcl-db/src/base/dsparams.inc"/>
         <TopLine Value="1"/>
         <CursorPos X="1" Y="1"/>
-        <UsageCount Value="1"/>
+        <UsageCount Value="10"/>
       </Unit25>
       <Unit26>
         <Filename Value="indices.pas"/>
@@ -310,14 +310,14 @@
         <WindowIndex Value="0"/>
         <TopLine Value="27"/>
         <CursorPos X="1" Y="127"/>
-        <UsageCount Value="147"/>
+        <UsageCount Value="146"/>
       </Unit26>
       <Unit27>
         <Filename Value="/usr/lib/lazarus/0.9.28.2/components/cgi/ide/cgilazideintf.pas"/>
         <UnitName Value="CGILazIDEIntf"/>
         <TopLine Value="131"/>
         <CursorPos X="13" Y="138"/>
-        <UsageCount Value="10"/>
+        <UsageCount Value="9"/>
       </Unit27>
       <Unit28>
         <Filename Value="../spidercgi/freespiderideintf.pas"/>
@@ -325,14 +325,14 @@
         <WindowIndex Value="0"/>
         <TopLine Value="1"/>
         <CursorPos X="18" Y="21"/>
-        <UsageCount Value="86"/>
+        <UsageCount Value="85"/>
       </Unit28>
       <Unit29>
         <Filename Value="/usr/lib/lazarus/0.9.28.2/components/cgi/cgimodules.pas"/>
         <UnitName Value="cgiModules"/>
         <TopLine Value="1"/>
         <CursorPos X="1" Y="1"/>
-        <UsageCount Value="10"/>
+        <UsageCount Value="9"/>
       </Unit29>
       <Unit30>
         <Filename Value="/usr/lib/lazarus/0.9.28.2/ideintf/actionseditor.pas"/>
@@ -342,28 +342,28 @@
         <UnitName Value="ActionsEditor"/>
         <TopLine Value="1"/>
         <CursorPos X="30" Y="7"/>
-        <UsageCount Value="4"/>
+        <UsageCount Value="3"/>
       </Unit30>
       <Unit31>
         <Filename Value="/usr/lib/lazarus/0.9.28.2/ideintf/formeditingintf.pas"/>
         <UnitName Value="FormEditingIntf"/>
         <TopLine Value="14"/>
         <CursorPos X="55" Y="25"/>
-        <UsageCount Value="4"/>
+        <UsageCount Value="3"/>
       </Unit31>
       <Unit32>
         <Filename Value="/usr/lib/lazarus/0.9.28.2/ideintf/projectintf.pas"/>
         <UnitName Value="ProjectIntf"/>
         <TopLine Value="1"/>
         <CursorPos X="1" Y="1"/>
-        <UsageCount Value="4"/>
+        <UsageCount Value="3"/>
       </Unit32>
       <Unit33>
         <Filename Value="/usr/lib/lazarus/0.9.28.2/ideintf/lazideintf.pas"/>
         <UnitName Value="LazIDEIntf"/>
         <TopLine Value="14"/>
         <CursorPos X="24" Y="26"/>
-        <UsageCount Value="4"/>
+        <UsageCount Value="3"/>
       </Unit33>
       <Unit34>
         <Filename Value="edittable.pas"/>
@@ -381,7 +381,7 @@
         <UnitName Value="CustApp"/>
         <TopLine Value="231"/>
         <CursorPos X="11" Y="234"/>
-        <UsageCount Value="27"/>
+        <UsageCount Value="26"/>
       </Unit35>
       <Unit36>
         <Filename Value="callproc.pas"/>
@@ -443,7 +443,7 @@
         <UnitName Value="SynEdit"/>
         <TopLine Value="1075"/>
         <CursorPos X="14" Y="1097"/>
-        <UsageCount Value="14"/>
+        <UsageCount Value="13"/>
       </Unit41>
       <Unit42>
         <Filename Value="systables.pas"/>
@@ -453,8 +453,8 @@
         <UnitName Value="SysTables"/>
         <EditorIndex Value="2"/>
         <WindowIndex Value="0"/>
-        <TopLine Value="571"/>
-        <CursorPos X="32" Y="573"/>
+        <TopLine Value="502"/>
+        <CursorPos X="20" Y="513"/>
         <UsageCount Value="200"/>
         <Loaded Value="True"/>
         <LoadedDesigner Value="True"/>
@@ -464,7 +464,7 @@
         <UnitName Value="SynEditMiscClasses"/>
         <TopLine Value="89"/>
         <CursorPos X="14" Y="111"/>
-        <UsageCount Value="7"/>
+        <UsageCount Value="6"/>
       </Unit43>
       <Unit44>
         <Filename Value="constraints.pas"/>
@@ -474,7 +474,7 @@
         <WindowIndex Value="0"/>
         <TopLine Value="73"/>
         <CursorPos X="1" Y="95"/>
-        <UsageCount Value="99"/>
+        <UsageCount Value="98"/>
       </Unit44>
       <Unit45>
         <Filename Value="newconstraint.pas"/>
@@ -493,33 +493,30 @@
         <ComponentName Value="fmNewEditField"/>
         <ResourceBaseClass Value="Form"/>
         <UnitName Value="NewEditField"/>
-        <EditorIndex Value="4"/>
         <WindowIndex Value="0"/>
-        <TopLine Value="65"/>
-        <CursorPos X="1" Y="94"/>
+        <TopLine Value="125"/>
+        <CursorPos X="3" Y="68"/>
         <UsageCount Value="202"/>
-        <Loaded Value="True"/>
-        <LoadedDesigner Value="True"/>
       </Unit46>
       <Unit47>
         <Filename Value="/usr/lib/lazarus/0.9.28.2/lcl/dbgrids.pas"/>
         <UnitName Value="DBGrids"/>
         <TopLine Value="510"/>
         <CursorPos X="16" Y="526"/>
-        <UsageCount Value="17"/>
+        <UsageCount Value="16"/>
       </Unit47>
       <Unit48>
         <Filename Value="/usr/lib/lazarus/0.9.28.2/lcl/controls.pp"/>
         <UnitName Value="Controls"/>
         <TopLine Value="859"/>
         <CursorPos X="5" Y="875"/>
-        <UsageCount Value="17"/>
+        <UsageCount Value="16"/>
       </Unit48>
       <Unit49>
         <Filename Value="/usr/share/fpcsrc/2.2.4/rtl/objpas/classes/classesh.inc"/>
         <TopLine Value="104"/>
         <CursorPos X="3" Y="120"/>
-        <UsageCount Value="17"/>
+        <UsageCount Value="16"/>
       </Unit49>
       <Unit50>
         <Filename Value="calen.pas"/>
@@ -536,10 +533,10 @@
         <Filename Value="scriptdb.pas"/>
         <IsPartOfProject Value="True"/>
         <UnitName Value="Scriptdb"/>
-        <EditorIndex Value="8"/>
+        <EditorIndex Value="10"/>
         <WindowIndex Value="0"/>
-        <TopLine Value="393"/>
-        <CursorPos X="41" Y="399"/>
+        <TopLine Value="149"/>
+        <CursorPos X="3" Y="148"/>
         <UsageCount Value="200"/>
         <Loaded Value="True"/>
       </Unit51>
@@ -550,7 +547,7 @@
         <UnitName Value="ConnectAs"/>
         <TopLine Value="1"/>
         <CursorPos X="1" Y="1"/>
-        <UsageCount Value="16"/>
+        <UsageCount Value="15"/>
       </Unit52>
       <Unit53>
         <Filename Value="userpermissions.pas"/>
@@ -561,7 +558,7 @@
         <WindowIndex Value="0"/>
         <TopLine Value="6"/>
         <CursorPos X="8" Y="34"/>
-        <UsageCount Value="192"/>
+        <UsageCount Value="200"/>
       </Unit53>
       <Unit54>
         <Filename Value="/usr/lib/lazarus/0.9.29/ide/lazarus.pp"/>
@@ -569,7 +566,7 @@
         <WindowIndex Value="0"/>
         <TopLine Value="1"/>
         <CursorPos X="40" Y="18"/>
-        <UsageCount Value="15"/>
+        <UsageCount Value="14"/>
       </Unit54>
       <Unit55>
         <Filename Value="tablemanage.pas"/>
@@ -577,10 +574,13 @@
         <ComponentName Value="fmTableManage"/>
         <ResourceBaseClass Value="Form"/>
         <UnitName Value="TableManage"/>
+        <EditorIndex Value="5"/>
         <WindowIndex Value="0"/>
-        <TopLine Value="303"/>
-        <CursorPos X="20" Y="311"/>
-        <UsageCount Value="175"/>
+        <TopLine Value="67"/>
+        <CursorPos X="7" Y="15"/>
+        <UsageCount Value="186"/>
+        <Loaded Value="True"/>
+        <LoadedDesigner Value="True"/>
       </Unit55>
       <Unit56>
         <Filename Value="/usr/lib/lazarus/0.9.29/lcl/grids.pas"/>
@@ -588,7 +588,7 @@
         <WindowIndex Value="0"/>
         <TopLine Value="1"/>
         <CursorPos X="1" Y="1"/>
-        <UsageCount Value="12"/>
+        <UsageCount Value="11"/>
       </Unit56>
       <Unit57>
         <Filename Value="/usr/lib/lazarus/0.9.29/components/synedit/synedit.pp"/>
@@ -596,7 +596,7 @@
         <WindowIndex Value="0"/>
         <TopLine Value="783"/>
         <CursorPos X="30" Y="804"/>
-        <UsageCount Value="7"/>
+        <UsageCount Value="6"/>
       </Unit57>
       <Unit58>
         <Filename Value="/usr/lib/lazarus/0.9.29/components/synedit/synedittypes.pp"/>
@@ -604,7 +604,7 @@
         <WindowIndex Value="0"/>
         <TopLine Value="1"/>
         <CursorPos X="18" Y="38"/>
-        <UsageCount Value="7"/>
+        <UsageCount Value="6"/>
       </Unit58>
       <Unit59>
         <Filename Value="/usr/lib/lazarus/0.9.29/lcl/dialogs.pp"/>
@@ -612,7 +612,7 @@
         <WindowIndex Value="0"/>
         <TopLine Value="346"/>
         <CursorPos X="33" Y="369"/>
-        <UsageCount Value="7"/>
+        <UsageCount Value="6"/>
       </Unit59>
       <Unit60>
         <Filename Value="backuprestore.pas"/>
@@ -623,7 +623,7 @@
         <WindowIndex Value="0"/>
         <TopLine Value="13"/>
         <CursorPos X="22" Y="54"/>
-        <UsageCount Value="161"/>
+        <UsageCount Value="172"/>
       </Unit60>
       <Unit61>
         <Filename Value="unitfirebirdservices.pas"/>
@@ -631,7 +631,7 @@
         <WindowIndex Value="0"/>
         <TopLine Value="1"/>
         <CursorPos X="1" Y="1"/>
-        <UsageCount Value="25"/>
+        <UsageCount Value="24"/>
       </Unit61>
       <Unit62>
         <Filename Value="/usr/share/fpcsrc/2.4.0/packages/fcl-db/src/sqldb/interbase/ibconnection.pp"/>
@@ -639,7 +639,7 @@
         <WindowIndex Value="0"/>
         <TopLine Value="435"/>
         <CursorPos X="19" Y="447"/>
-        <UsageCount Value="5"/>
+        <UsageCount Value="4"/>
       </Unit62>
       <Unit63>
         <Filename Value="ibconnection.pp"/>
@@ -647,7 +647,7 @@
         <WindowIndex Value="0"/>
         <TopLine Value="141"/>
         <CursorPos X="71" Y="165"/>
-        <UsageCount Value="28"/>
+        <UsageCount Value="27"/>
       </Unit63>
       <Unit64>
         <Filename Value="/usr/share/fpcsrc/2.4.0/packages/fcl-db/src/sqldb/sqldb.pp"/>
@@ -655,7 +655,7 @@
         <WindowIndex Value="0"/>
         <TopLine Value="1"/>
         <CursorPos X="44" Y="23"/>
-        <UsageCount Value="9"/>
+        <UsageCount Value="8"/>
       </Unit64>
       <Unit65>
         <Filename Value="/usr/share/fpcsrc/2.4.0/packages/fcl-db/src/base/db.pas"/>
@@ -663,7 +663,7 @@
         <WindowIndex Value="0"/>
         <TopLine Value="1293"/>
         <CursorPos X="15" Y="1310"/>
-        <UsageCount Value="9"/>
+        <UsageCount Value="8"/>
       </Unit65>
       <Unit66>
         <Filename Value="/usr/share/fpcsrc/2.4.0/packages/fcl-db/src/base/sqlscript.pp"/>
@@ -671,14 +671,14 @@
         <WindowIndex Value="0"/>
         <TopLine Value="1"/>
         <CursorPos X="1" Y="1"/>
-        <UsageCount Value="5"/>
+        <UsageCount Value="4"/>
       </Unit66>
       <Unit67>
         <Filename Value="/usr/share/fpcsrc/2.4.0/packages/fcl-db/src/base/dataset.inc"/>
         <WindowIndex Value="0"/>
         <TopLine Value="21"/>
         <CursorPos X="1" Y="1"/>
-        <UsageCount Value="5"/>
+        <UsageCount Value="4"/>
       </Unit67>
       <Unit68>
         <Filename Value="createuser.pas"/>
@@ -689,7 +689,7 @@
         <WindowIndex Value="0"/>
         <TopLine Value="3"/>
         <CursorPos X="71" Y="7"/>
-        <UsageCount Value="131"/>
+        <UsageCount Value="142"/>
       </Unit68>
       <Unit69>
         <Filename Value="changepass.pas"/>
@@ -700,7 +700,7 @@
         <WindowIndex Value="0"/>
         <TopLine Value="3"/>
         <CursorPos X="88" Y="14"/>
-        <UsageCount Value="130"/>
+        <UsageCount Value="141"/>
       </Unit69>
       <Unit70>
         <Filename Value="permissionmanage.pas"/>
@@ -708,10 +708,13 @@
         <ComponentName Value="fmPermissionManage"/>
         <ResourceBaseClass Value="Form"/>
         <UnitName Value="PermissionManage"/>
+        <EditorIndex Value="4"/>
         <WindowIndex Value="0"/>
-        <TopLine Value="61"/>
-        <CursorPos X="44" Y="83"/>
-        <UsageCount Value="128"/>
+        <TopLine Value="440"/>
+        <CursorPos X="5" Y="442"/>
+        <UsageCount Value="139"/>
+        <Loaded Value="True"/>
+        <LoadedDesigner Value="True"/>
       </Unit70>
       <Unit71>
         <Filename Value="sqlhistory.pas"/>
@@ -719,11 +722,11 @@
         <ComponentName Value="fmSQLHistory"/>
         <ResourceBaseClass Value="Form"/>
         <UnitName Value="SQLHistory"/>
-        <EditorIndex Value="7"/>
+        <EditorIndex Value="9"/>
         <WindowIndex Value="0"/>
-        <TopLine Value="61"/>
+        <TopLine Value="1"/>
         <CursorPos X="35" Y="66"/>
-        <UsageCount Value="113"/>
+        <UsageCount Value="124"/>
         <Loaded Value="True"/>
         <LoadedDesigner Value="True"/>
       </Unit71>
@@ -732,14 +735,14 @@
         <WindowIndex Value="0"/>
         <TopLine Value="57"/>
         <CursorPos X="1" Y="77"/>
-        <UsageCount Value="10"/>
+        <UsageCount Value="9"/>
       </Unit72>
       <Unit73>
         <Filename Value="../../lazarus/lazarus/lcl/include/menu.inc"/>
         <WindowIndex Value="0"/>
         <TopLine Value="241"/>
         <CursorPos X="1" Y="273"/>
-        <UsageCount Value="10"/>
+        <UsageCount Value="9"/>
       </Unit73>
       <Unit74>
         <Filename Value="copytable.pas"/>
@@ -750,7 +753,7 @@
         <WindowIndex Value="0"/>
         <TopLine Value="18"/>
         <CursorPos X="1" Y="44"/>
-        <UsageCount Value="84"/>
+        <UsageCount Value="95"/>
       </Unit74>
       <Unit75>
         <Filename Value="/usr/lib/lazarus/0.9.30/lcl/comctrls.pp"/>
@@ -758,14 +761,14 @@
         <WindowIndex Value="0"/>
         <TopLine Value="2685"/>
         <CursorPos X="3" Y="2707"/>
-        <UsageCount Value="8"/>
+        <UsageCount Value="7"/>
       </Unit75>
       <Unit76>
         <Filename Value="/usr/lib/lazarus/0.9.30/lcl/include/menuitem.inc"/>
         <WindowIndex Value="0"/>
         <TopLine Value="53"/>
         <CursorPos X="1" Y="75"/>
-        <UsageCount Value="8"/>
+        <UsageCount Value="7"/>
       </Unit76>
       <Unit77>
         <Filename Value="/usr/lib/lazarus/0.9.30/ide/lazconf.pp"/>
@@ -773,7 +776,7 @@
         <WindowIndex Value="0"/>
         <TopLine Value="1"/>
         <CursorPos X="1" Y="1"/>
-        <UsageCount Value="9"/>
+        <UsageCount Value="8"/>
       </Unit77>
       <Unit78>
         <Filename Value="/usr/lib/lazarus/0.9.30/ide/definetemplates.pas"/>
@@ -781,7 +784,7 @@
         <WindowIndex Value="0"/>
         <TopLine Value="1"/>
         <CursorPos X="1" Y="1"/>
-        <UsageCount Value="9"/>
+        <UsageCount Value="8"/>
       </Unit78>
       <Unit79>
         <Filename Value="/usr/lib/lazarus/0.9.30/ide/codetoolsstrconsts.pas"/>
@@ -789,7 +792,7 @@
         <WindowIndex Value="0"/>
         <TopLine Value="1"/>
         <CursorPos X="1" Y="1"/>
-        <UsageCount Value="9"/>
+        <UsageCount Value="8"/>
       </Unit79>
       <Unit80>
         <Filename Value="/usr/lib/lazarus/0.9.30/ide/expreval.pas"/>
@@ -797,7 +800,7 @@
         <WindowIndex Value="0"/>
         <TopLine Value="1"/>
         <CursorPos X="1" Y="1"/>
-        <UsageCount Value="9"/>
+        <UsageCount Value="8"/>
       </Unit80>
       <Unit81>
         <Filename Value="/usr/lib/lazarus/0.9.30/ide/buildlazdialog.pas"/>
@@ -805,7 +808,7 @@
         <WindowIndex Value="0"/>
         <TopLine Value="1"/>
         <CursorPos X="1" Y="1"/>
-        <UsageCount Value="9"/>
+        <UsageCount Value="8"/>
       </Unit81>
       <Unit82>
         <Filename Value="/usr/lib/lazarus/0.9.30/ide/laz2_xmlread.pas"/>
@@ -813,7 +816,7 @@
         <WindowIndex Value="0"/>
         <TopLine Value="1"/>
         <CursorPos X="1" Y="1"/>
-        <UsageCount Value="9"/>
+        <UsageCount Value="8"/>
       </Unit82>
       <Unit83>
         <Filename Value="/usr/lib/lazarus/0.9.30/ide/registersdf.pas"/>
@@ -821,7 +824,7 @@
         <WindowIndex Value="0"/>
         <TopLine Value="1"/>
         <CursorPos X="1" Y="1"/>
-        <UsageCount Value="9"/>
+        <UsageCount Value="8"/>
       </Unit83>
       <Unit84>
         <Filename Value="/usr/lib/lazarus/0.9.30/ide/printer4lazarus.pas"/>
@@ -829,7 +832,7 @@
         <WindowIndex Value="0"/>
         <TopLine Value="1"/>
         <CursorPos X="1" Y="1"/>
-        <UsageCount Value="9"/>
+        <UsageCount Value="8"/>
       </Unit84>
       <Unit85>
         <Filename Value="/usr/lib/lazarus/0.9.30/ide/printersdlgs.pp"/>
@@ -837,7 +840,7 @@
         <WindowIndex Value="0"/>
         <TopLine Value="1"/>
         <CursorPos X="1" Y="1"/>
-        <UsageCount Value="9"/>
+        <UsageCount Value="8"/>
       </Unit85>
       <Unit86>
         <Filename Value="/usr/lib/lazarus/0.9.30/ide/osprinters.pas"/>
@@ -845,7 +848,7 @@
         <WindowIndex Value="0"/>
         <TopLine Value="29"/>
         <CursorPos X="8" Y="49"/>
-        <UsageCount Value="9"/>
+        <UsageCount Value="8"/>
       </Unit86>
       <Unit87>
         <Filename Value="/usr/lib/lazarus/0.9.30/ide/lazcontrols.pas"/>
@@ -853,7 +856,7 @@
         <WindowIndex Value="0"/>
         <TopLine Value="1"/>
         <CursorPos X="1" Y="1"/>
-        <UsageCount Value="9"/>
+        <UsageCount Value="8"/>
       </Unit87>
       <Unit88>
         <Filename Value="/usr/lib/lazarus/0.9.30/ide/runtimetypeinfocontrols.pas"/>
@@ -861,7 +864,7 @@
         <WindowIndex Value="0"/>
         <TopLine Value="1"/>
         <CursorPos X="1" Y="1"/>
-        <UsageCount Value="9"/>
+        <UsageCount Value="8"/>
       </Unit88>
       <Unit89>
         <Filename Value="/usr/lib/lazarus/0.9.30/ide/rttictrls.pas"/>
@@ -869,7 +872,7 @@
         <WindowIndex Value="0"/>
         <TopLine Value="1"/>
         <CursorPos X="1" Y="1"/>
-        <UsageCount Value="8"/>
+        <UsageCount Value="7"/>
       </Unit89>
       <Unit90>
         <Filename Value="/usr/lib/lazarus/0.9.30/ide/rttigrids.pas"/>
@@ -877,7 +880,7 @@
         <WindowIndex Value="0"/>
         <TopLine Value="1"/>
         <CursorPos X="1" Y="1"/>
-        <UsageCount Value="8"/>
+        <UsageCount Value="7"/>
       </Unit90>
       <Unit91>
         <Filename Value="/usr/lib/lazarus/0.9.30/ide/sourceprinter.pas"/>
@@ -885,7 +888,7 @@
         <WindowIndex Value="0"/>
         <TopLine Value="1"/>
         <CursorPos X="1" Y="1"/>
-        <UsageCount Value="8"/>
+        <UsageCount Value="7"/>
       </Unit91>
       <Unit92>
         <Filename Value="/usr/lib/lazarus/0.9.30/ide/memdslaz.pas"/>
@@ -893,7 +896,7 @@
         <WindowIndex Value="0"/>
         <TopLine Value="1"/>
         <CursorPos X="1" Y="1"/>
-        <UsageCount Value="8"/>
+        <UsageCount Value="7"/>
       </Unit92>
       <Unit93>
         <Filename Value="/usr/lib/lazarus/0.9.30/ide/frmselectdataset.pp"/>
@@ -901,7 +904,7 @@
         <WindowIndex Value="0"/>
         <TopLine Value="156"/>
         <CursorPos X="4" Y="193"/>
-        <UsageCount Value="8"/>
+        <UsageCount Value="7"/>
       </Unit93>
       <Unit94>
         <Filename Value="../../lazarus/lazarus/lcl/controls.pp"/>
@@ -909,14 +912,14 @@
         <WindowIndex Value="0"/>
         <TopLine Value="139"/>
         <CursorPos X="23" Y="163"/>
-        <UsageCount Value="8"/>
+        <UsageCount Value="7"/>
       </Unit94>
       <Unit95>
         <Filename Value="../../lazarus/lazarus/lcl/include/control.inc"/>
         <WindowIndex Value="0"/>
         <TopLine Value="2262"/>
         <CursorPos X="1" Y="2286"/>
-        <UsageCount Value="13"/>
+        <UsageCount Value="12"/>
       </Unit95>
       <Unit96>
         <Filename Value="../../lazarus/lazarus/lcl/forms.pp"/>
@@ -924,14 +927,14 @@
         <WindowIndex Value="0"/>
         <TopLine Value="559"/>
         <CursorPos X="23" Y="600"/>
-        <UsageCount Value="9"/>
+        <UsageCount Value="8"/>
       </Unit96>
       <Unit97>
         <Filename Value="../../lazarus/lazarus/lcl/include/customform.inc"/>
         <WindowIndex Value="0"/>
         <TopLine Value="359"/>
         <CursorPos X="3" Y="381"/>
-        <UsageCount Value="9"/>
+        <UsageCount Value="8"/>
       </Unit97>
       <Unit98>
         <Filename Value="dbinfo.pas"/>
@@ -942,7 +945,7 @@
         <WindowIndex Value="0"/>
         <TopLine Value="20"/>
         <CursorPos X="22" Y="41"/>
-        <UsageCount Value="52"/>
+        <UsageCount Value="63"/>
       </Unit98>
       <Unit99>
         <Filename Value="../../FromInternet/fpc2.4/fpc-2.4.4/packages/ibase/src/ibase60dyn.pp"/>
@@ -950,14 +953,14 @@
         <WindowIndex Value="0"/>
         <TopLine Value="1"/>
         <CursorPos X="1" Y="1"/>
-        <UsageCount Value="11"/>
+        <UsageCount Value="10"/>
       </Unit99>
       <Unit100>
         <Filename Value="../../FromInternet/fpc2.4/fpc-2.4.4/packages/ibase/src/ibase60.inc"/>
         <WindowIndex Value="0"/>
         <TopLine Value="1"/>
         <CursorPos X="50" Y="6"/>
-        <UsageCount Value="11"/>
+        <UsageCount Value="10"/>
       </Unit100>
       <Unit101>
         <Filename Value="../FreeSpider/spiderutils.pas"/>
@@ -965,7 +968,7 @@
         <WindowIndex Value="0"/>
         <TopLine Value="1"/>
         <CursorPos X="1" Y="1"/>
-        <UsageCount Value="14"/>
+        <UsageCount Value="13"/>
       </Unit101>
       <Unit102>
         <Filename Value="comparison.pas"/>
@@ -975,93 +978,109 @@
         <UnitName Value="Comparison"/>
         <EditorIndex Value="3"/>
         <WindowIndex Value="0"/>
-        <TopLine Value="392"/>
-        <CursorPos X="22" Y="397"/>
-        <UsageCount Value="39"/>
+        <TopLine Value="535"/>
+        <CursorPos X="27" Y="551"/>
+        <UsageCount Value="50"/>
         <Loaded Value="True"/>
         <LoadedDesigner Value="True"/>
       </Unit102>
+      <Unit103>
+        <Filename Value="/usr/share/fpcsrc/2.6.0/rtl/inc/systemh.inc"/>
+        <EditorIndex Value="6"/>
+        <WindowIndex Value="0"/>
+        <TopLine Value="815"/>
+        <CursorPos X="11" Y="832"/>
+        <UsageCount Value="13"/>
+        <Loaded Value="True"/>
+      </Unit103>
+      <Unit104>
+        <Filename Value="/usr/share/fpcsrc/2.6.0/rtl/inc/sstrings.inc"/>
+        <WindowIndex Value="0"/>
+        <TopLine Value="350"/>
+        <CursorPos X="3" Y="352"/>
+        <UsageCount Value="12"/>
+      </Unit104>
     </Units>
     <JumpHistory Count="30" HistoryIndex="29">
       <Position1>
-        <Filename Value="neweditfield.pas"/>
-        <Caret Line="169" Column="3" TopLine="168"/>
+        <Filename Value="main.pas"/>
+        <Caret Line="2994" Column="1" TopLine="2966"/>
       </Position1>
       <Position2>
-        <Filename Value="comparison.pas"/>
-        <Caret Line="408" Column="18" TopLine="379"/>
+        <Filename Value="main.pas"/>
+        <Caret Line="1" Column="1" TopLine="1"/>
       </Position2>
       <Position3>
         <Filename Value="main.pas"/>
-        <Caret Line="2366" Column="1" TopLine="2308"/>
+        <Caret Line="94" Column="18" TopLine="66"/>
       </Position3>
       <Position4>
         <Filename Value="main.pas"/>
-        <Caret Line="1" Column="1" TopLine="1"/>
+        <Caret Line="95" Column="22" TopLine="67"/>
       </Position4>
       <Position5>
-        <Filename Value="comparison.pas"/>
-        <Caret Line="416" Column="35" TopLine="383"/>
+        <Filename Value="main.pas"/>
+        <Caret Line="143" Column="28" TopLine="115"/>
       </Position5>
       <Position6>
-        <Filename Value="comparison.pas"/>
-        <Caret Line="230" Column="7" TopLine="230"/>
+        <Filename Value="main.pas"/>
+        <Caret Line="148" Column="32" TopLine="120"/>
       </Position6>
       <Position7>
-        <Filename Value="comparison.pas"/>
-        <Caret Line="275" Column="10" TopLine="257"/>
+        <Filename Value="main.pas"/>
+        <Caret Line="236" Column="53" TopLine="208"/>
       </Position7>
       <Position8>
-        <Filename Value="comparison.pas"/>
-        <Caret Line="285" Column="4" TopLine="268"/>
+        <Filename Value="main.pas"/>
+        <Caret Line="361" Column="38" TopLine="333"/>
       </Position8>
       <Position9>
-        <Filename Value="comparison.pas"/>
-        <Caret Line="398" Column="45" TopLine="381"/>
+        <Filename Value="main.pas"/>
+        <Caret Line="362" Column="57" TopLine="334"/>
       </Position9>
       <Position10>
-        <Filename Value="comparison.pas"/>
-        <Caret Line="410" Column="9" TopLine="402"/>
+        <Filename Value="main.pas"/>
+        <Caret Line="1540" Column="32" TopLine="1563"/>
       </Position10>
       <Position11>
-        <Filename Value="comparison.pas"/>
-        <Caret Line="130" Column="23" TopLine="116"/>
+        <Filename Value="main.pas"/>
+        <Caret Line="1655" Column="34" TopLine="1629"/>
       </Position11>
       <Position12>
-        <Filename Value="comparison.pas"/>
-        <Caret Line="114" Column="20" TopLine="107"/>
+        <Filename Value="permissionmanage.pas"/>
+        <Caret Line="524" Column="3" TopLine="501"/>
       </Position12>
       <Position13>
-        <Filename Value="querywindow.pas"/>
-        <Caret Line="161" Column="32" TopLine="155"/>
+        <Filename Value="permissionmanage.pas"/>
+        <Caret Line="161" Column="47" TopLine="152"/>
       </Position13>
       <Position14>
-        <Filename Value="main.pas"/>
-        <Caret Line="496" Column="29" TopLine="469"/>
+        <Filename Value="permissionmanage.pas"/>
+        <Caret Line="159" Column="78" TopLine="152"/>
       </Position14>
       <Position15>
-        <Filename Value="main.pas"/>
-        <Caret Line="1" Column="1" TopLine="1"/>
+        <Filename Value="permissionmanage.pas"/>
+        <Caret Line="529" Column="1" TopLine="500"/>
       </Position15>
       <Position16>
-        <Filename Value="main.pas"/>
-        <Caret Line="8" Column="34" TopLine="1"/>
+        <Filename Value="permissionmanage.pas"/>
+        <Caret Line="451" Column="13" TopLine="439"/>
       </Position16>
       <Position17>
-        <Filename Value="main.pas"/>
-        <Caret Line="18" Column="32" TopLine="1"/>
+        <Filename Value="permissionmanage.pas"/>
+        <Caret Line="436" Column="3" TopLine="434"/>
       </Position17>
       <Position18>
-        <Filename Value="main.pas"/>
-        <Caret Line="179" Column="32" TopLine="151"/>
+        <Filename Value="permissionmanage.pas"/>
+        <Caret Line="447" Column="3" TopLine="445"/>
       </Position18>
       <Position19>
         <Filename Value="main.pas"/>
-        <Caret Line="463" Column="44" TopLine="435"/>
+        <Caret Line="1655" Column="34" TopLine="1629"/>
       </Position19>
       <Position20>
         <Filename Value="main.pas"/>
-        <Caret Line="1058" Column="69" TopLine="1039"/>
+        <Caret Line="2248" Column="7" TopLine="2240"/>
       </Position20>
       <Position21>
         <Filename Value="main.pas"/>
@@ -1069,39 +1088,39 @@
       </Position21>
       <Position22>
         <Filename Value="main.pas"/>
-        <Caret Line="8" Column="34" TopLine="1"/>
+        <Caret Line="1632" Column="37" TopLine="1625"/>
       </Position22>
       <Position23>
-        <Filename Value="querywindow.pas"/>
-        <Caret Line="234" Column="3" TopLine="232"/>
+        <Filename Value="comparison.pas"/>
+        <Caret Line="799" Column="37" TopLine="782"/>
       </Position23>
       <Position24>
         <Filename Value="querywindow.pas"/>
-        <Caret Line="162" Column="18" TopLine="155"/>
+        <Caret Line="12" Column="24" TopLine="1"/>
       </Position24>
       <Position25>
         <Filename Value="querywindow.pas"/>
-        <Caret Line="164" Column="18" TopLine="157"/>
+        <Caret Line="239" Column="3" TopLine="237"/>
       </Position25>
       <Position26>
         <Filename Value="querywindow.pas"/>
-        <Caret Line="178" Column="15" TopLine="175"/>
+        <Caret Line="420" Column="3" TopLine="474"/>
       </Position26>
       <Position27>
         <Filename Value="querywindow.pas"/>
-        <Caret Line="180" Column="15" TopLine="177"/>
+        <Caret Line="638" Column="3" TopLine="636"/>
       </Position27>
       <Position28>
         <Filename Value="querywindow.pas"/>
-        <Caret Line="237" Column="14" TopLine="229"/>
+        <Caret Line="239" Column="3" TopLine="237"/>
       </Position28>
       <Position29>
         <Filename Value="querywindow.pas"/>
-        <Caret Line="184" Column="3" TopLine="182"/>
+        <Caret Line="420" Column="3" TopLine="438"/>
       </Position29>
       <Position30>
-        <Filename Value="sqlhistory.pas"/>
-        <Caret Line="39" Column="15" TopLine="22"/>
+        <Filename Value="comparison.pas"/>
+        <Caret Line="799" Column="39" TopLine="782"/>
       </Position30>
     </JumpHistory>
   </ProjectOptions>

+ 1 - 1
TurboBird.lpr

@@ -2,7 +2,7 @@
 {  TurboBird: FireBird database administration and management tool          }
 {  Developed by: Motaz Abdel Azeem http://code.sd/                          }
 {  Start development :  5.Dec.2009                                          }
-{  Last updated      : 16.May.2012                                          }
+{  Last updated      : 19.May.2012                                          }
 {  License           : GPL for GUI, LGPL for Units                          }
 {***************************************************************************}
 

+ 1 - 1
comparison.lfm

@@ -56,7 +56,7 @@ object fmComparison: TfmComparison
     ParentFont = False
   end
   object bbStart: TBitBtn
-    Left = 15
+    Left = 13
     Height = 30
     Top = 184
     Width = 154

+ 415 - 16
comparison.pas

@@ -44,13 +44,35 @@ type
     dbObjectsList: array [1 .. 13] of TStringList;
     dbExistingObjectsList: array [1 .. 13] of TStringList;
     MissingFieldsList: TStringList;
+
+    ExistFieldsList: TStringList;
+    ModifiedFieldsList: TStringList;
+
+    ExistIndicesList: TStringList;
+    ModifiedIndicesList: TStringList;
+
+    ExistConstraintsList: TStringList;
+    ModifiedConstraintsList: TStringList;
+
+    ModifiedViewsList: TStringList;
+
     fQueryWindow: TfmQueryWindow;
+
     procedure CheckMissingIndices;
     procedure CheckMissingConstraints;
     procedure CheckMissingDBObjects;
     procedure CheckMissingFields;
+    procedure CheckModifiedFields;
+    procedure CheckModifiedIndices;
+    procedure CheckModifiedConstraints;
+    procedure CheckModifiedViews;
+
     procedure InitializeQueryWindow;
     procedure ScriptMissingFields;
+    procedure ScriptModifiedFields;
+    procedure ScriptModifiedIndices;
+    procedure ScriptModifiedConstraints;
+    procedure ScriptModifiedViews;
   public
     procedure Init(dbIndex: Integer);
     { public declarations }
@@ -82,13 +104,16 @@ begin
   CheckMissingDBObjects;
 
   if cxTables.Checked then
+  begin
     CheckMissingIndices;
-
-  if cxTables.Checked then
     CheckMissingConstraints;
-
-  if cxTables.Checked then
     CheckMissingFields;
+    CheckModifiedFields;
+    CheckModifiedIndices;
+    CheckModifiedConstraints;
+  end;
+  if cxViews.Checked then
+    CheckModifiedViews;
 end;
 
 procedure TfmComparison.FormClose(Sender: TObject; var CloseAction: TCloseAction);
@@ -102,6 +127,18 @@ begin
     dbExistingObjectsList[i].Free;
 
   MissingFieldsList.Free;
+
+  ExistFieldsList.Free;
+  ModifiedFieldsList.Free;
+
+  ExistIndicesList.Free;
+  ModifiedIndicesList.Free;
+
+  ExistConstraintsList.Free;
+  ModifiedConstraintsList.Free;
+
+  ModifiedViewsList.Free;
+
 end;
 
 procedure TfmComparison.laScriptClick(Sender: TObject);
@@ -127,7 +164,17 @@ begin
   ScriptList:= TStringList.Create;
   FieldsList:= TStringList.Create;
 
-  ScriptMissingFields;
+  if cxTables.Checked then
+  begin
+    ScriptMissingFields;
+    ScriptModifiedFields;
+    ScriptModifiedIndices;
+    ScriptModifiedConstraints;
+  end;
+
+  if cxViews.Checked then
+    ScriptModifiedViews;
+
 
   dmSysTables.Init(fdbIndex);
 
@@ -276,17 +323,15 @@ begin
         if Trim(DeleteRule) <> 'RESTRICT' then
           Line:= Line + ' on delete ' + Trim(DeleteRule);
 
-        fQueryWindow.meQuery.Lines.Add(Line);
+        fQueryWindow.meQuery.Lines.Add(Line + ';');
         fQueryWindow.meQuery.Lines.Add('');
       end;
 
 
     end;
 
-
   end;
 
-
   fQueryWindow.Show;
   ScriptList.Free;
   FieldsList.Free;
@@ -352,6 +397,7 @@ begin
   meLog.Lines.Add('');
   meLog.Lines.Add('Missing fields');
   MissingFieldsList.Clear;
+  ExistFieldsList.Clear;
   for i:= 0 to dbExistingObjectsList[1].Count - 1 do
   begin
     dmSysTables.GetTableFields(fdbIndex, dbExistingObjectsList[1].Strings[i], FieldsList);
@@ -359,11 +405,13 @@ begin
 
     // Get missing fields
     for j:= 0 to FieldsList.Count - 1 do
-      if ComparedList.IndexOf(FieldsList[j]) = -1 then
+      if ComparedList.IndexOf(FieldsList[j]) = -1 then // Add to missing list
       begin
         meLog.Lines.Add(' ' + dbExistingObjectsList[1].Strings[i] + ': ' + FieldsList[j]);
         MissingFieldsList.Add(dbExistingObjectsList[1].Strings[i] + ',' + FieldsList[j]);
-      end;
+      end
+      else                                             // Add to existing list
+        ExistFieldsList.Add(dbExistingObjectsList[1].Strings[i] + ',' + FieldsList[j]);
   end;
 
   FieldsList.Free;
@@ -371,6 +419,146 @@ begin
 
 end;
 
+procedure TfmComparison.CheckModifiedFields;
+var
+  i: Integer;
+  Line: string;
+  ATableName: string;
+  AFieldName: string;
+  FieldSize: Integer;
+  FieldType, DefaultValue, Description: string;
+  CFieldType, CDefaultValue, CDescription: string;
+  CFieldSize, CIsNull: Integer;
+  NotNull, CNotNull: Boolean;
+begin
+  meLog.Lines.Add('');
+  meLog.Lines.Add('Modified fields');
+  ModifiedFieldsList.Clear;
+
+  for i:= 0 to ExistFieldsList.Count - 1 do
+  begin
+    Line:= ExistFieldsList[i];
+    ATableName:= copy(Line, 1, Pos(',', Line) - 1);
+    System.Delete(Line, 1, Pos(',', Line));
+    AFieldName:= Line;
+
+    dmSysTables.GetFieldInfo(fdbIndex, ATableName, AFieldName, FieldType, FieldSize, NotNull, DefaultValue, Description);
+    dmSysTables.GetFieldInfo(cbComparedDatabase.ItemIndex, ATableName, AFieldName, CFieldType, CFieldSize, CNotNull,
+      CDefaultValue, CDescription);
+    if (FieldType <> CFieldType) or (FieldSize <> CFieldSize) or (NotNull <> CNotNull) or (DefaultValue <> CDefaultValue)
+       or (Description <> CDescription) then
+       begin
+         meLog.Lines.Add(' ' + ExistFieldsList[i]);
+         ModifiedFieldsList.Add(ExistFieldsList[i]);
+       end;
+
+  end;
+
+end;
+
+procedure TfmComparison.CheckModifiedIndices;
+var
+  i: Integer;
+  Line: string;
+  ATableName: string;
+  AIndexName: string;
+  FieldsList: TStringList;
+  Unique, Ascending: Boolean;
+  CFieldsList: TStringList;
+  CUnique, CAscending: Boolean;
+begin
+  meLog.Lines.Add('');
+  meLog.Lines.Add('Modified Indices');
+  ModifiedIndicesList.Clear;
+  FieldsList:= TStringList.Create;
+  CFieldsList:= TStringList.Create;
+
+  for i:= 0 to ExistIndicesList.Count - 1 do
+  begin
+    Line:= ExistIndicesList[i];
+    ATableName:= copy(Line, 1, Pos(',', Line) - 1);
+    System.Delete(Line, 1, Pos(',', Line));
+    AIndexName:= Line;
+
+    dmSysTables.GetIndexInfo(fdbIndex, ATableName, AIndexName, FieldsList, Unique, Ascending);
+    dmSysTables.GetIndexInfo(cbComparedDatabase.ItemIndex, ATableName, AIndexName, CFieldsList, CUnique, CAscending);
+    if (FieldsList.CommaText <> CFieldsList.CommaText) or (Unique <> CUnique) or (Ascending <> CAscending) then
+    begin
+      meLog.Lines.Add(' ' + ExistIndicesList[i]);
+      ModifiedIndicesList.Add(ExistIndicesList[i]);
+    end;
+
+  end;
+  FieldsList.Free;
+  CFieldsList.Free;
+
+end;
+
+procedure TfmComparison.CheckModifiedConstraints;
+var
+  i: Integer;
+  Line: string;
+  ATableName: string;
+  AConstraintName: string;
+  KeyName, CurrentTableName, CurrentFieldName,
+  OtherTablename, OtherFieldName, UpdateRole, DeleteRole: string;
+  CKeyName, CCurrentTableName, CCurrentFieldName,
+  COtherTablename, COtherFieldName, CUpdateRole, CDeleteRole: string;
+begin
+  meLog.Lines.Add('');
+  meLog.Lines.Add('Modified Constraints');
+  ModifiedIndicesList.Clear;
+
+  for i:= 0 to ExistConstraintsList.Count - 1 do
+  begin
+    Line:= ExistConstraintsList[i];
+    ATableName:= copy(Line, 1, Pos(',', Line) - 1);
+    System.Delete(Line, 1, Pos(',', Line));
+    AConstraintName:= Line;
+
+    dmSysTables.GetConstraintInfo(fdbIndex, ATableName, AConstraintName, KeyName, CurrentTableName, CurrentFieldName,
+      OtherTablename, OtherFieldName, UpdateRole, DeleteRole);
+    dmSysTables.GetConstraintInfo(cbComparedDatabase.ItemIndex, ATableName, AConstraintName, CKeyName,
+      CCurrentTableName, CCurrentFieldName, COtherTablename, COtherFieldName, CUpdateRole, CDeleteRole);
+    if (CurrentTableName <> CCurrentTableName) or (CurrentFieldName <> CCurrentFieldName) or
+       (OtherTablename <> COtherTablename) or (OtherFieldName <> COtherFieldName) or (UpdateRole <> CUpdateRole) or
+       (DeleteRole <> CDeleteRole) then
+    begin
+      meLog.Lines.Add(' ' + ExistConstraintsList[i]);
+      ModifiedConstraintsList.Add(ExistConstraintsList[i]);
+    end;
+
+  end;
+
+end;
+
+procedure TfmComparison.CheckModifiedViews;
+var
+  i: Integer;
+  ViewName: string;
+  Columns, Body: string;
+  CColumns, CBody: string;
+begin
+  meLog.Lines.Add('');
+  meLog.Lines.Add('Modified Views');
+  ModifiedViewsList.Clear;
+
+  for i:= 0 to dbExistingObjectsList[4].Count - 1 do
+  begin
+    ViewName:= dbExistingObjectsList[4][i];
+    fmMain.GetViewInfo(fdbIndex, ViewName, Columns, Body);
+    if fmMain.GetViewInfo(cbComparedDatabase.ItemIndex, ViewName, CColumns, CBody) then
+    if  (Trim(Body) <> Trim(CBody)) then
+    begin
+      meLog.Lines.Add(' ' + ViewName);
+      ModifiedViewsList.Add(ViewName);
+    end;
+
+  end;
+
+
+end;
+
 procedure TfmComparison.InitializeQueryWindow;
 begin
   fQueryWindow:= fmMain.ShowQueryWindow(cbComparedDatabase.ItemIndex, 'Database Differences');
@@ -378,14 +566,17 @@ begin
 end;
 
 procedure TfmComparison.ScriptMissingFields;
+
 var
   i: Integer;
   ATableName, AFieldName: string;
   Line: string;
   FieldSize: Integer;
-  IsNull: Integer;
+  NotNull: Boolean;
   DefaultValue, Description: string;
   FieldType: string;
+  TableSpaces: Integer;
+  FieldSpaces: Integer;
 begin
   fQueryWindow.meQuery.Lines.Add('');
   fQueryWindow.meQuery.Lines.Add('-- Missing fields');
@@ -395,13 +586,14 @@ begin
     ATableName:= copy(Line, 1, Pos(',', Line) - 1);
     System.Delete(Line, 1, Pos(',', Line));
     AFieldName:= Line;
-    dmSysTables.GetFieldInfo(fdbIndex, ATableName, AFieldName, FieldType, FieldSize, IsNull, DefaultValue, Description);
+    dmSysTables.GetFieldInfo(fdbIndex, ATableName, AFieldName, FieldType, FieldSize, NotNull, DefaultValue, Description);
 
     // Script new field
     Line:= FieldType;
     if Pos('CHAR', Line) > 0 then
       Line:= Line + '(' + IntToStr(FieldSize) + ')';
 
+
     // Default value
     if Trim(DefaultValue) <> '' then
     begin
@@ -412,15 +604,206 @@ begin
     end;
 
     // Null/Not null
-    if IsNull = 1 then
+    if NotNull then
       Line:= Line + ' not null';
 
-    fQueryWindow.meQuery.Lines.Add('ALTER TABLE ' + ATableName + ' ADD ' + AFieldName + ' ' + Line + ';');
+    TableSpaces:= 15 - Length(ATableName);
+    if TableSpaces < 0 then
+      TableSpaces:= 0;
+
+    FieldSpaces:= 15 - Length(AFieldName);
+    if FieldSpaces < 0 then
+      FieldSpaces:= 0;
+
+    fQueryWindow.meQuery.Lines.Add('ALTER TABLE ' + ATableName + Space(TableSpaces) +
+      ' ADD ' + AFieldName + Space(FieldSpaces) + ' ' + Line + ';');
 
   end;
 
 end;
 
+procedure TfmComparison.ScriptModifiedFields;
+var
+  i: Integer;
+  ATableName, AFieldName: string;
+  Line: string;
+  FieldType, DefaultValue, Description: string;
+  FieldSize: Integer;
+  CFieldType, CDefaultValue, CDescription: string;
+  CFieldSize: Integer;
+  NullFlag: string;
+  NotNull, CNotNull: Boolean;
+  ScriptList: TStringList;
+begin
+  ScriptList:= TStringList.Create;
+  try
+  fQueryWindow.meQuery.Lines.Add('');
+  fQueryWindow.meQuery.Lines.Add('-- Modified fields');
+  for i:= 0 to ModifiedFieldsList.Count - 1 do
+  begin
+    Line:= ModifiedFieldsList[i];
+    ATableName:= copy(Line, 1, Pos(',', Line) - 1);
+    System.Delete(Line, 1, Pos(',', Line));
+    AFieldName:= Line;
+
+    dmSysTables.GetFieldInfo(fdbIndex, ATableName, AFieldName, FieldType, FieldSize, NotNull, DefaultValue, Description);
+    dmSysTables.GetFieldInfo(cbComparedDatabase.ItemIndex, ATableName, AFieldName, CFieldType, CFieldSize, CNotNull,
+      cDefaultValue, cDescription);
+
+    ScriptList.Clear;
+    // check type/size change
+    if (FieldType <> CFieldType) or (FieldSize <> CFieldSize) then
+    begin
+      Line:= 'ALTER TABLE ' + ATableName + ' ALTER ' + AFieldName + ' TYPE ' + FieldType;
+
+      if Pos('CHAR', FieldType) > 0 then
+        Line:= Line + '(' + IntToStr(FieldSize) + ')';
+      Line:= Line + ';';
+      ScriptList.Add(Line);
+    end;
+
+    // Allow Null
+    if NotNull <> CNotNull then
+    begin
+      if NotNull then
+        NullFlag:= '1'
+      else
+        NullFlag:= 'NULL';
+      ScriptList.Add('UPDATE RDB$RELATION_FIELDS SET RDB$NULL_FLAG = ' + NullFlag);
+      ScriptList.Add('WHERE RDB$FIELD_NAME = ''' + AFieldName + ''' AND RDB$RELATION_NAME = ''' + ATableName + ''';');
+    end;
+
+    // Description
+    if Description <> CDescription then
+    begin
+      ScriptList.Add('UPDATE RDB$RELATION_FIELDS set RDB$DESCRIPTION = ''' + Description + '''');
+      ScriptList.Add('where RDB$FIELD_NAME = ''' + UpperCase(AFieldName) + '''');
+      ScriptList.Add('and RDB$RELATION_NAME = ''' + ATableName + ''';');
+    end;
+
+    // Default value
+    if DefaultValue <> cDefaultValue then
+    begin
+      ScriptList.Add('UPDATE RDB$RELATION_FIELDS set RDB$Default_Source = ''' + DefaultValue + ''' ');
+      ScriptList.Add('where RDB$FIELD_NAME = ''' + UpperCase(AFieldName) + '''');
+      ScriptList.Add('and RDB$RELATION_NAME = ''' + ATableName + ''';');
+    end;
+    fQueryWindow.meQuery.Lines.Add('');
+    fQueryWindow.meQuery.Lines.Add('-- ' + AFieldName + ' on ' + ATableName);
+    fQueryWindow.meQuery.Lines.AddStrings(ScriptList);
+
+  end;
+
+
+  finally
+    ScriptList.Free;
+  end;
+end;
+
+procedure TfmComparison.ScriptModifiedIndices;
+var
+  i: Integer;
+  ATableName, AIndexName: string;
+  FieldsList: TStringList;
+  Line: string;
+  Unique, Ascending: Boolean;
+begin
+  FieldsList:= TStringList.Create;
+  try
+    fQueryWindow.meQuery.Lines.Add('');
+    fQueryWindow.meQuery.Lines.Add('-- Modified Indices');
+    for i:= 0 to ModifiedIndicesList.Count - 1 do
+    begin
+      Line:= ModifiedIndicesList[i];
+      ATableName:= copy(Line, 1, Pos(',', Line) - 1);
+      System.Delete(Line, 1, Pos(',', Line));
+      AIndexName:= Line;
+      if dmSysTables.GetIndexInfo(fdbIndex, ATableName, AIndexName, FieldsList, Unique, Ascending) then
+      begin
+        fQueryWindow.meQuery.Lines.Add('drop index ' + AIndexName + ';');
+
+        Line:= 'create ';
+        if Unique then
+          Line:= Line + 'Unique ';
+        if not Ascending then
+          Line:= Line + 'Descending ';
+
+        Line:= Line + 'index ' + AIndexName + ' on ' + ATableName;
+
+        Line:= Line + ' (' + FieldsList.CommaText + ') ;';
+
+        fQueryWindow.meQuery.Lines.Add(Line);
+        fQueryWindow.meQuery.Lines.Add('');
+      end;
+
+    end;
+
+  finally
+    FieldsList.Free;
+  end;
+
+
+end;
+
+procedure TfmComparison.ScriptModifiedConstraints;
+var
+  i: Integer;
+  ATableName, AConstraintName: string;
+  Line: string;
+  KeyName, CurrentTableName, CurrentFieldName,
+  OtherTablename, OtherFieldName, UpdateRule, DeleteRule: string;
+begin
+    fQueryWindow.meQuery.Lines.Add('');
+    fQueryWindow.meQuery.Lines.Add('-- Modified Constraints');
+    for i:= 0 to ModifiedConstraintsList.Count - 1 do
+    begin
+      Line:= ModifiedConstraintsList[i];
+      ATableName:= copy(Line, 1, Pos(',', Line) - 1);
+      System.Delete(Line, 1, Pos(',', Line));
+      AConstraintName:= Line;
+      if dmSysTables.GetConstraintInfo(fdbIndex, ATableName, AConstraintName, KeyName, CurrentTableName, CurrentFieldName,
+          OtherTablename, OtherFieldName, UpdateRule, DeleteRule) then
+      begin
+        fQueryWindow.meQuery.Lines.Add('alter table ' + ATableName + ' drop constraint ' + AConstraintName + ';');
+
+        Line:= 'alter table ' + ATableName + ' add constraint ' + AConstraintName +
+          ' foreign key (' + CurrentFieldName + ') references ' +  OtherTableName  +
+          ' (' + dmSysTables.GetConstraintForiegnKeyFields(OtherFieldName, dmSysTables.sqQuery) + ') ';
+        if Trim(UpdateRule) <> 'RESTRICT' then
+          Line:= Line + ' on update ' + Trim(UpdateRule);
+        if Trim(DeleteRule) <> 'RESTRICT' then
+          Line:= Line + ' on delete ' + Trim(DeleteRule);
+
+        fQueryWindow.meQuery.Lines.Add(Line + ';');
+        fQueryWindow.meQuery.Lines.Add('');
+      end;
+
+    end;
+
+end;
+
+procedure TfmComparison.ScriptModifiedViews;
+var
+  i: Integer;
+  ViewName: string;
+  Columns, Body: string;
+begin
+  fQueryWindow.meQuery.Lines.Add('');
+  fQueryWindow.meQuery.Lines.Add('-- Modified Views');
+  for i:= 0 to ModifiedViewsList.Count - 1 do
+  begin
+    ViewName:= ModifiedViewsList[i];
+    fmMain.GetViewInfo(fdbIndex, ViewName, Columns, Body);
+    fQueryWindow.meQuery.Lines.Add('drop view "' + ViewName + '";');
+    fQueryWindow.meQuery.Lines.Add('create view "' + ViewName + '" (' + Columns + ')');
+    fQueryWindow.meQuery.Lines.Add('as');
+    fQueryWindow.meQuery.Lines.Add(Body);
+    fQueryWindow.meQuery.Lines.Add(';');
+    fQueryWindow.meQuery.Lines.Add('');
+  end;
+
+end;
+
 procedure TfmComparison.Init(dbIndex: Integer);
 var
   i: Integer;
@@ -457,6 +840,16 @@ begin
 
   MissingFieldsList:= TStringList.Create;
 
+  ExistFieldsList:= TStringList.Create;
+  ModifiedFieldsList:= TStringList.Create;
+
+  ExistIndicesList:= TStringList.Create;
+  ModifiedIndicesList:= TStringList.Create;
+
+  ExistConstraintsList:= TStringList.Create;
+  ModifiedConstraintsList:= TStringList.Create;
+
+  ModifiedViewsList:= TStringList.Create;
 end;
 
 procedure TfmComparison.CheckMissingIndices;
@@ -476,6 +869,7 @@ begin
   meLog.Lines.Add('');
   meLog.Lines.Add('Missing Indices:');
   dbObjectsList[12].Clear;
+  ExistIndicesList.Clear;
   try
     for i:= 0 to TablesList.Count - 1 do
     begin
@@ -486,11 +880,13 @@ begin
       if dmSysTables.GetIndices(cbComparedDatabase.ItemIndex, TablesList[i], PrimaryIndexName, ComparedList) then
       begin
         for j:= 0 to List.Count - 1 do
-          if ComparedList.IndexOf(List[j]) = -1 then
+          if ComparedList.IndexOf(List[j]) = -1 then // Add to missing indices
           begin
             meLog.Lines.Add(' ' + List[j]);
             dbObjectsList[12].Add(TablesList[i] + ',' + List[j]);
           end
+          else
+            ExistIndicesList.Add(TablesList[i] + ',' + List[j]); // Add to existing indices list
       end
       else // Table does not exist, all indices are missing
       if List.Count > 0 then
@@ -526,6 +922,7 @@ begin
   ComparedList:= TStringList.Create;
   TablesList:= TStringList.Create;
   TablesList.CommaText:= dmSysTables.GetDBObjectNames(fdbIndex, 1, Count);
+  ExistConstraintsList.Clear;
 
   meLog.Lines.Add('');
   meLog.Lines.Add('Missing Constraints:');
@@ -545,11 +942,13 @@ begin
       begin
         dmSysTables.sqQuery.Close;
         for j:= 0 to List.Count - 1 do
-          if ComparedList.IndexOf(List[j]) = -1 then
+          if ComparedList.IndexOf(List[j]) = -1 then // Add to missing constraints
           begin
             meLog.Lines.Add(' ' + List[j]);
             dbObjectsList[13].Add(TablesList[i] + ',' + List[j]);
           end
+          else
+            ExistConstraintsList.Add(TablesList[i] + ',' + List[j]);
       end
       else // Table does not exist, all constraints are missing
       if List.Count > 0 then

+ 7 - 5
main.pas

@@ -482,18 +482,19 @@ var
   dbIndex: Integer;
   FieldName: string;
   FieldType, DefaultValue: string;
-  FSize, IsNull: Integer;
+  FSize: Integer;
   Description: string;
+  NotNull: Boolean;
 begin
   SelNode:= tvMain.Selected;
   dbIndex:= SelNode.Parent.Parent.Parent.OverlayIndex;
   FieldName:= Copy(SelNode.Text, 1, Pos(' ', SelNode.Text) - 1);
-  if dmSysTables.GetFieldInfo(dbIndex, SelNode.Parent.Text, FieldName, FieldType, FSize, IsNull,
+  if dmSysTables.GetFieldInfo(dbIndex, SelNode.Parent.Text, FieldName, FieldType, FSize, NotNull,
     DefaultValue, Description) then
   begin
     fmNewEditField:= TfmNewEditField.Create(nil);
     fmNewEditField.Init(dbIndex, SelNode.Parent.Text, foEdit, FieldName, FieldType, DefaultValue, Description, FSize,
-      SelNode.OverlayIndex, (IsNull <> 1),  nil);
+      SelNode.OverlayIndex, not NotNull,  nil);
 
     fmNewEditField.Show;
   end
@@ -1299,7 +1300,7 @@ begin
       else
         Result:= Result + IntToStr(FieldLength) + ',';
     end;
-    Result:= Result + IntToStr(Abs(Scale)) + ')';
+    Result:= Result + IntToStr(Abs(Scale)) + ') ';
   end;
 end;
 
@@ -2244,6 +2245,7 @@ procedure TfmMain.lmUserPermManagementClick(Sender: TObject);
 var
   fmPermissions: TfmPermissionManage;
 begin
+  lmRolePerManagementClick(nil);
   fmPermissions:= TfmPermissionManage.Create(nil);
   fmPermissions.Init(tvMain.Selected.Parent.Parent.OverlayIndex, '', tvMain.Selected.Text, 1);
   fmPermissions.Show;
@@ -2954,7 +2956,7 @@ begin
 end;
 
 
-(*************   Display View  *******************)
+(*************   Display View DDL *******************)
 
 procedure TfmMain.lmDisplayViewClick(Sender: TObject);
 var

+ 222 - 60
permissionmanage.lfm

@@ -1,31 +1,31 @@
 object fmPermissionManage: TfmPermissionManage
   Left = 474
-  Height = 361
+  Height = 368
   Top = 204
-  Width = 523
+  Width = 518
   Caption = 'Permission Management'
-  ClientHeight = 361
-  ClientWidth = 523
+  ClientHeight = 368
+  ClientWidth = 518
   OnClose = FormClose
   Position = poScreenCenter
   LCLVersion = '0.9.31'
   object PageControl1: TPageControl
     Left = 0
-    Height = 361
+    Height = 368
     Top = 0
-    Width = 501
+    Width = 496
     ActivePage = tsTables
     Anchors = [akTop, akLeft, akRight, akBottom]
     TabIndex = 0
     TabOrder = 0
     object tsTables: TTabSheet
       Caption = 'Tables'
-      ClientHeight = 330
-      ClientWidth = 497
+      ClientHeight = 337
+      ClientWidth = 492
       object Label1: TLabel
-        Left = 12
+        Left = 14
         Height = 18
-        Top = 10
+        Top = 11
         Width = 67
         Caption = 'User/Role'
         ParentColor = False
@@ -42,14 +42,14 @@ object fmPermissionManage: TfmPermissionManage
         Left = 18
         Height = 31
         Top = 124
-        Width = 156
+        Width = 236
         ItemHeight = 0
         OnChange = cbTablesChange
         Style = csDropDownList
         TabOrder = 0
       end
       object Label3: TLabel
-        Left = 308
+        Left = 310
         Height = 18
         Top = 10
         Width = 83
@@ -58,49 +58,50 @@ object fmPermissionManage: TfmPermissionManage
       end
       object cxSelect: TCheckBox
         Left = 317
-        Height = 22
+        Height = 24
         Top = 86
-        Width = 65
+        Width = 67
         Caption = 'Select'
         TabOrder = 1
       end
       object cxInsert: TCheckBox
         Left = 318
-        Height = 22
+        Height = 24
         Top = 138
-        Width = 63
+        Width = 65
         Caption = 'Insert'
         TabOrder = 2
       end
       object cxUpdate: TCheckBox
         Left = 317
-        Height = 22
+        Height = 24
         Top = 183
-        Width = 74
+        Width = 76
         Caption = 'Update'
         TabOrder = 3
       end
       object cxDelete: TCheckBox
         Left = 317
-        Height = 22
+        Height = 24
         Top = 236
-        Width = 68
+        Width = 70
         Caption = 'Delete'
         TabOrder = 4
       end
       object cxReferences: TCheckBox
         Left = 318
-        Height = 22
+        Height = 24
         Top = 287
-        Width = 99
+        Width = 101
         Caption = 'References'
         TabOrder = 5
       end
       object bbApplyTable: TBitBtn
         Left = 6
         Height = 30
-        Top = 287
+        Top = 299
         Width = 75
+        Anchors = [akLeft, akBottom]
         Caption = 'Apply'
         Kind = bkOK
         OnClick = bbApplyTableClick
@@ -110,56 +111,56 @@ object fmPermissionManage: TfmPermissionManage
         Left = 18
         Height = 29
         Top = 34
-        Width = 156
+        Width = 236
         ItemHeight = 0
         OnChange = cbTablesChange
         TabOrder = 7
       end
       object cxSelectGrant: TCheckBox
         Left = 345
-        Height = 22
+        Height = 24
         Top = 102
-        Width = 97
+        Width = 99
         Caption = 'With Grant'
         TabOrder = 8
       end
       object cxInsertGrant: TCheckBox
         Left = 345
-        Height = 22
+        Height = 24
         Top = 154
-        Width = 97
+        Width = 99
         Caption = 'With Grant'
         TabOrder = 9
       end
       object cxUpdateGrant: TCheckBox
         Left = 345
-        Height = 22
+        Height = 24
         Top = 202
-        Width = 97
+        Width = 99
         Caption = 'With Grant'
         TabOrder = 10
       end
       object cxDeleteGrant: TCheckBox
         Left = 342
-        Height = 22
+        Height = 24
         Top = 253
-        Width = 97
+        Width = 99
         Caption = 'With Grant'
         TabOrder = 11
       end
       object cxReferencesGrant: TCheckBox
         Left = 345
-        Height = 22
-        Top = 305
-        Width = 97
+        Height = 24
+        Top = 307
+        Width = 99
         Caption = 'With Grant'
         TabOrder = 12
       end
       object cxAll: TCheckBox
         Left = 318
-        Height = 22
+        Height = 24
         Top = 34
-        Width = 45
+        Width = 47
         Caption = 'All'
         Font.Style = [fsBold]
         ParentFont = False
@@ -167,19 +168,178 @@ object fmPermissionManage: TfmPermissionManage
       end
       object cxAllGrant: TCheckBox
         Left = 345
-        Height = 22
+        Height = 24
         Top = 49
-        Width = 102
+        Width = 104
         Caption = 'With Grant'
         Font.Style = [fsBold]
         ParentFont = False
         TabOrder = 14
       end
     end
+    object tsViews: TTabSheet
+      Caption = 'Views'
+      ClientHeight = 337
+      ClientWidth = 492
+      object Label8: TLabel
+        Left = 14
+        Height = 18
+        Top = 11
+        Width = 67
+        Caption = 'User/Role'
+        ParentColor = False
+      end
+      object cbViewsUsers: TComboBox
+        Left = 18
+        Height = 29
+        Top = 34
+        Width = 220
+        ItemHeight = 0
+        OnChange = cbViewsUsersChange
+        TabOrder = 0
+      end
+      object Label9: TLabel
+        Left = 14
+        Height = 18
+        Top = 95
+        Width = 34
+        Caption = 'View'
+        ParentColor = False
+      end
+      object cbViews: TComboBox
+        Left = 18
+        Height = 31
+        Top = 124
+        Width = 220
+        ItemHeight = 0
+        OnChange = cbViewsChange
+        Style = csDropDownList
+        TabOrder = 1
+      end
+      object bbApplyView: TBitBtn
+        Left = 6
+        Height = 30
+        Top = 299
+        Width = 75
+        Anchors = [akLeft, akBottom]
+        Caption = 'Apply'
+        Kind = bkOK
+        OnClick = bbApplyViewClick
+        TabOrder = 2
+      end
+      object Label10: TLabel
+        Left = 310
+        Height = 18
+        Top = 10
+        Width = 83
+        Caption = 'Permissions'
+        ParentColor = False
+      end
+      object cxViewAll: TCheckBox
+        Left = 318
+        Height = 24
+        Top = 34
+        Width = 44
+        Caption = 'All'
+        Font.Style = [fsBold]
+        ParentFont = False
+        TabOrder = 3
+      end
+      object cxViewAllGrant: TCheckBox
+        Left = 345
+        Height = 24
+        Top = 49
+        Width = 99
+        Caption = 'With Grant'
+        Font.Style = [fsBold]
+        ParentFont = False
+        TabOrder = 4
+      end
+      object cxViewSelect: TCheckBox
+        Left = 317
+        Height = 24
+        Top = 86
+        Width = 67
+        Caption = 'Select'
+        TabOrder = 5
+      end
+      object cxViewSelectGrant: TCheckBox
+        Left = 345
+        Height = 24
+        Top = 102
+        Width = 99
+        Caption = 'With Grant'
+        TabOrder = 6
+      end
+      object cxViewInsert: TCheckBox
+        Left = 318
+        Height = 24
+        Top = 138
+        Width = 65
+        Caption = 'Insert'
+        TabOrder = 7
+      end
+      object cxViewInsertGrant: TCheckBox
+        Left = 345
+        Height = 24
+        Top = 154
+        Width = 99
+        Caption = 'With Grant'
+        TabOrder = 8
+      end
+      object cxViewUpdate: TCheckBox
+        Left = 317
+        Height = 24
+        Top = 183
+        Width = 76
+        Caption = 'Update'
+        TabOrder = 9
+      end
+      object cxViewUpdateGrant: TCheckBox
+        Left = 345
+        Height = 24
+        Top = 202
+        Width = 99
+        Caption = 'With Grant'
+        TabOrder = 10
+      end
+      object cxViewDelete: TCheckBox
+        Left = 317
+        Height = 24
+        Top = 236
+        Width = 70
+        Caption = 'Delete'
+        TabOrder = 11
+      end
+      object cxViewDeleteGrant: TCheckBox
+        Left = 342
+        Height = 24
+        Top = 253
+        Width = 99
+        Caption = 'With Grant'
+        TabOrder = 12
+      end
+      object cxViewReferences: TCheckBox
+        Left = 318
+        Height = 24
+        Top = 287
+        Width = 101
+        Caption = 'References'
+        TabOrder = 13
+      end
+      object cxViewReferencesGrant: TCheckBox
+        Left = 345
+        Height = 24
+        Top = 307
+        Width = 99
+        Caption = 'With Grant'
+        TabOrder = 14
+      end
+    end
     object tsProcedures: TTabSheet
       Caption = 'Procedures'
-      ClientHeight = 330
-      ClientWidth = 497
+      ClientHeight = 337
+      ClientWidth = 492
       object Label4: TLabel
         Left = 12
         Height = 18
@@ -192,7 +352,7 @@ object fmPermissionManage: TfmPermissionManage
         Left = 18
         Height = 29
         Top = 34
-        Width = 156
+        Width = 196
         ItemHeight = 0
         OnChange = cbProcUsersChange
         TabOrder = 0
@@ -207,7 +367,7 @@ object fmPermissionManage: TfmPermissionManage
       end
       object clbProcedures: TCheckListBox
         Left = 246
-        Height = 232
+        Height = 257
         Top = 39
         Width = 211
         Anchors = [akTop, akLeft, akBottom]
@@ -218,10 +378,11 @@ object fmPermissionManage: TfmPermissionManage
         TopIndex = -1
       end
       object bbApplyProc: TBitBtn
-        Left = 13
+        Left = 6
         Height = 30
-        Top = 275
+        Top = 296
         Width = 75
+        Anchors = [akLeft, akBottom]
         Caption = 'Apply'
         Kind = bkOK
         OnClick = bbApplyProcClick
@@ -229,9 +390,9 @@ object fmPermissionManage: TfmPermissionManage
       end
       object cxProcGrant: TCheckBox
         Left = 246
-        Height = 22
-        Top = 283
-        Width = 97
+        Height = 24
+        Top = 299
+        Width = 99
         Anchors = [akLeft, akBottom]
         Caption = 'With Grant'
         OnChange = cxProcGrantChange
@@ -240,8 +401,8 @@ object fmPermissionManage: TfmPermissionManage
     end
     object tsRoles: TTabSheet
       Caption = 'Roles'
-      ClientHeight = 330
-      ClientWidth = 497
+      ClientHeight = 337
+      ClientWidth = 492
       object Label6: TLabel
         Left = 12
         Height = 18
@@ -254,7 +415,7 @@ object fmPermissionManage: TfmPermissionManage
         Left = 18
         Height = 29
         Top = 34
-        Width = 156
+        Width = 188
         ItemHeight = 0
         OnChange = cbRolesUserChange
         TabOrder = 0
@@ -270,17 +431,17 @@ object fmPermissionManage: TfmPermissionManage
       object bbApplyRoles: TBitBtn
         Left = 12
         Height = 30
-        Top = 283
+        Top = 298
         Width = 75
+        Anchors = [akLeft, akBottom]
         Caption = 'Apply'
-        Default = True
         Kind = bkOK
         OnClick = bbApplyRolesClick
         TabOrder = 1
       end
       object clbRoles: TCheckListBox
         Left = 246
-        Height = 237
+        Height = 257
         Top = 39
         Width = 211
         Anchors = [akTop, akLeft, akBottom]
@@ -291,19 +452,20 @@ object fmPermissionManage: TfmPermissionManage
         TopIndex = -1
       end
       object BitBtn1: TBitBtn
-        Left = 99
+        Left = 102
         Height = 30
-        Top = 283
+        Top = 298
         Width = 75
+        Anchors = [akLeft, akBottom]
         Caption = 'Refresh'
         OnClick = BitBtn1Click
         TabOrder = 3
       end
       object cxRoleGrant: TCheckBox
         Left = 246
-        Height = 22
-        Top = 291
-        Width = 103
+        Height = 24
+        Top = 304
+        Width = 105
         Anchors = [akLeft, akBottom]
         Caption = 'With Admin'
         OnChange = cxRoleGrantChange
@@ -312,7 +474,7 @@ object fmPermissionManage: TfmPermissionManage
     end
   end
   object bbClose: TBitBtn
-    Left = 496
+    Left = 491
     Height = 24
     Top = 0
     Width = 27

+ 115 - 77
permissionmanage.lrs

@@ -2,82 +2,120 @@
 
 LazarusResources.Add('TfmPermissionManage','FORMDATA',[
   'TPF0'#19'TfmPermissionManage'#18'fmPermissionManage'#4'Left'#3#218#1#6'Heigh'
-  +'t'#3'i'#1#3'Top'#3#204#0#5'Width'#3#11#2#7'Caption'#6#21'Permission Managem'
-  +'ent'#12'ClientHeight'#3'i'#1#11'ClientWidth'#3#11#2#7'OnClose'#7#9'FormClos'
-  +'e'#8'Position'#7#14'poScreenCenter'#10'LCLVersion'#6#6'0.9.31'#0#12'TPageCo'
-  +'ntrol'#12'PageControl1'#4'Left'#2#0#6'Height'#3'i'#1#3'Top'#2#0#5'Width'#3
-  +#245#1#10'ActivePage'#7#8'tsTables'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRig'
-  +'ht'#8'akBottom'#0#8'TabIndex'#2#0#8'TabOrder'#2#0#0#9'TTabSheet'#8'tsTables'
-  +#7'Caption'#6#6'Tables'#12'ClientHeight'#3'J'#1#11'ClientWidth'#3#241#1#0#6
-  +'TLabel'#6'Label1'#4'Left'#2#12#6'Height'#2#18#3'Top'#2#10#5'Width'#2'C'#7'C'
-  +'aption'#6#9'User/Role'#11'ParentColor'#8#0#0#6'TLabel'#6'Label2'#4'Left'#2
-  +#14#6'Height'#2#18#3'Top'#2'_'#5'Width'#2'%'#7'Caption'#6#5'Table'#11'Parent'
-  +'Color'#8#0#0#9'TComboBox'#8'cbTables'#4'Left'#2#18#6'Height'#2#31#3'Top'#2
-  +'|'#5'Width'#3#156#0#10'ItemHeight'#2#0#8'OnChange'#7#14'cbTablesChange'#5'S'
-  +'tyle'#7#14'csDropDownList'#8'TabOrder'#2#0#0#0#6'TLabel'#6'Label3'#4'Left'#3
-  +'4'#1#6'Height'#2#18#3'Top'#2#10#5'Width'#2'S'#7'Caption'#6#11'Permissions'
-  +#11'ParentColor'#8#0#0#9'TCheckBox'#8'cxSelect'#4'Left'#3'='#1#6'Height'#2#22
-  +#3'Top'#2'V'#5'Width'#2'A'#7'Caption'#6#6'Select'#8'TabOrder'#2#1#0#0#9'TChe'
-  +'ckBox'#8'cxInsert'#4'Left'#3'>'#1#6'Height'#2#22#3'Top'#3#138#0#5'Width'#2
-  +'?'#7'Caption'#6#6'Insert'#8'TabOrder'#2#2#0#0#9'TCheckBox'#8'cxUpdate'#4'Le'
-  +'ft'#3'='#1#6'Height'#2#22#3'Top'#3#183#0#5'Width'#2'J'#7'Caption'#6#6'Updat'
-  +'e'#8'TabOrder'#2#3#0#0#9'TCheckBox'#8'cxDelete'#4'Left'#3'='#1#6'Height'#2
-  +#22#3'Top'#3#236#0#5'Width'#2'D'#7'Caption'#6#6'Delete'#8'TabOrder'#2#4#0#0#9
-  +'TCheckBox'#12'cxReferences'#4'Left'#3'>'#1#6'Height'#2#22#3'Top'#3#31#1#5'W'
-  +'idth'#2'c'#7'Caption'#6#10'References'#8'TabOrder'#2#5#0#0#7'TBitBtn'#12'bb'
-  +'ApplyTable'#4'Left'#2#6#6'Height'#2#30#3'Top'#3#31#1#5'Width'#2'K'#7'Captio'
-  +'n'#6#5'Apply'#4'Kind'#7#4'bkOK'#7'OnClick'#7#17'bbApplyTableClick'#8'TabOrd'
-  +'er'#2#6#0#0#9'TComboBox'#7'cbUsers'#4'Left'#2#18#6'Height'#2#29#3'Top'#2'"'
-  +#5'Width'#3#156#0#10'ItemHeight'#2#0#8'OnChange'#7#14'cbTablesChange'#8'TabO'
-  +'rder'#2#7#0#0#9'TCheckBox'#13'cxSelectGrant'#4'Left'#3'Y'#1#6'Height'#2#22#3
-  +'Top'#2'f'#5'Width'#2'a'#7'Caption'#6#10'With Grant'#8'TabOrder'#2#8#0#0#9'T'
-  +'CheckBox'#13'cxInsertGrant'#4'Left'#3'Y'#1#6'Height'#2#22#3'Top'#3#154#0#5
-  +'Width'#2'a'#7'Caption'#6#10'With Grant'#8'TabOrder'#2#9#0#0#9'TCheckBox'#13
-  +'cxUpdateGrant'#4'Left'#3'Y'#1#6'Height'#2#22#3'Top'#3#202#0#5'Width'#2'a'#7
-  +'Caption'#6#10'With Grant'#8'TabOrder'#2#10#0#0#9'TCheckBox'#13'cxDeleteGran'
-  +'t'#4'Left'#3'V'#1#6'Height'#2#22#3'Top'#3#253#0#5'Width'#2'a'#7'Caption'#6
-  +#10'With Grant'#8'TabOrder'#2#11#0#0#9'TCheckBox'#17'cxReferencesGrant'#4'Le'
-  +'ft'#3'Y'#1#6'Height'#2#22#3'Top'#3'1'#1#5'Width'#2'a'#7'Caption'#6#10'With '
-  +'Grant'#8'TabOrder'#2#12#0#0#9'TCheckBox'#5'cxAll'#4'Left'#3'>'#1#6'Height'#2
-  +#22#3'Top'#2'"'#5'Width'#2'-'#7'Caption'#6#3'All'#10'Font.Style'#11#6'fsBold'
-  +#0#10'ParentFont'#8#8'TabOrder'#2#13#0#0#9'TCheckBox'#10'cxAllGrant'#4'Left'
-  +#3'Y'#1#6'Height'#2#22#3'Top'#2'1'#5'Width'#2'f'#7'Caption'#6#10'With Grant'
-  +#10'Font.Style'#11#6'fsBold'#0#10'ParentFont'#8#8'TabOrder'#2#14#0#0#0#9'TTa'
-  +'bSheet'#12'tsProcedures'#7'Caption'#6#10'Procedures'#12'ClientHeight'#3'J'#1
-  +#11'ClientWidth'#3#241#1#0#6'TLabel'#6'Label4'#4'Left'#2#12#6'Height'#2#18#3
-  +'Top'#2#10#5'Width'#2'C'#7'Caption'#6#9'User/Role'#11'ParentColor'#8#0#0#9'T'
-  +'ComboBox'#11'cbProcUsers'#4'Left'#2#18#6'Height'#2#29#3'Top'#2'"'#5'Width'#3
-  +#156#0#10'ItemHeight'#2#0#8'OnChange'#7#17'cbProcUsersChange'#8'TabOrder'#2#0
-  +#0#0#6'TLabel'#6'Label5'#4'Left'#3#230#0#6'Height'#2#18#3'Top'#2#11#5'Width'
-  +#2'S'#7'Caption'#6#11'Permissions'#11'ParentColor'#8#0#0#13'TCheckListBox'#13
-  +'clbProcedures'#4'Left'#3#246#0#6'Height'#3#232#0#3'Top'#2''''#5'Width'#3#211
-  +#0#7'Anchors'#11#5'akTop'#6'akLeft'#8'akBottom'#0#10'ItemHeight'#2#0#7'OnCli'
-  +'ck'#7#18'clbProceduresClick'#7'OnKeyUp'#7#18'clbProceduresKeyUp'#8'TabOrder'
-  +#2#1#8'TopIndex'#2#255#0#0#7'TBitBtn'#11'bbApplyProc'#4'Left'#2#13#6'Height'
-  +#2#30#3'Top'#3#19#1#5'Width'#2'K'#7'Caption'#6#5'Apply'#4'Kind'#7#4'bkOK'#7
-  +'OnClick'#7#16'bbApplyProcClick'#8'TabOrder'#2#2#0#0#9'TCheckBox'#11'cxProcG'
-  +'rant'#4'Left'#3#246#0#6'Height'#2#22#3'Top'#3#27#1#5'Width'#2'a'#7'Anchors'
-  +#11#6'akLeft'#8'akBottom'#0#7'Caption'#6#10'With Grant'#8'OnChange'#7#17'cxP'
-  +'rocGrantChange'#8'TabOrder'#2#3#0#0#0#9'TTabSheet'#7'tsRoles'#7'Caption'#6#5
-  +'Roles'#12'ClientHeight'#3'J'#1#11'ClientWidth'#3#241#1#0#6'TLabel'#6'Label6'
-  +#4'Left'#2#12#6'Height'#2#18#3'Top'#2#10#5'Width'#2' '#7'Caption'#6#4'User'
-  +#11'ParentColor'#8#0#0#9'TComboBox'#11'cbRolesUser'#4'Left'#2#18#6'Height'#2
-  +#29#3'Top'#2'"'#5'Width'#3#156#0#10'ItemHeight'#2#0#8'OnChange'#7#17'cbRoles'
-  +'UserChange'#8'TabOrder'#2#0#0#0#6'TLabel'#6'Label7'#4'Left'#3#230#0#6'Heigh'
-  +'t'#2#18#3'Top'#2#11#5'Width'#2'S'#7'Caption'#6#11'Permissions'#11'ParentCol'
-  ,'or'#8#0#0#7'TBitBtn'#12'bbApplyRoles'#4'Left'#2#12#6'Height'#2#30#3'Top'#3
-  +#27#1#5'Width'#2'K'#7'Caption'#6#5'Apply'#7'Default'#9#4'Kind'#7#4'bkOK'#7'O'
-  +'nClick'#7#17'bbApplyRolesClick'#8'TabOrder'#2#1#0#0#13'TCheckListBox'#8'clb'
-  +'Roles'#4'Left'#3#246#0#6'Height'#3#237#0#3'Top'#2''''#5'Width'#3#211#0#7'An'
+  +'t'#3'p'#1#3'Top'#3#204#0#5'Width'#3#6#2#7'Caption'#6#21'Permission Manageme'
+  +'nt'#12'ClientHeight'#3'p'#1#11'ClientWidth'#3#6#2#7'OnClose'#7#9'FormClose'
+  +#8'Position'#7#14'poScreenCenter'#10'LCLVersion'#6#6'0.9.31'#0#12'TPageContr'
+  +'ol'#12'PageControl1'#4'Left'#2#0#6'Height'#3'p'#1#3'Top'#2#0#5'Width'#3#240
+  +#1#10'ActivePage'#7#8'tsTables'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8
+  +'akBottom'#0#8'TabIndex'#2#0#8'TabOrder'#2#0#0#9'TTabSheet'#8'tsTables'#7'Ca'
+  +'ption'#6#6'Tables'#12'ClientHeight'#3'Q'#1#11'ClientWidth'#3#236#1#0#6'TLab'
+  +'el'#6'Label1'#4'Left'#2#14#6'Height'#2#18#3'Top'#2#11#5'Width'#2'C'#7'Capti'
+  +'on'#6#9'User/Role'#11'ParentColor'#8#0#0#6'TLabel'#6'Label2'#4'Left'#2#14#6
+  +'Height'#2#18#3'Top'#2'_'#5'Width'#2'%'#7'Caption'#6#5'Table'#11'ParentColor'
+  +#8#0#0#9'TComboBox'#8'cbTables'#4'Left'#2#18#6'Height'#2#31#3'Top'#2'|'#5'Wi'
+  +'dth'#3#236#0#10'ItemHeight'#2#0#8'OnChange'#7#14'cbTablesChange'#5'Style'#7
+  +#14'csDropDownList'#8'TabOrder'#2#0#0#0#6'TLabel'#6'Label3'#4'Left'#3'6'#1#6
+  +'Height'#2#18#3'Top'#2#10#5'Width'#2'S'#7'Caption'#6#11'Permissions'#11'Pare'
+  +'ntColor'#8#0#0#9'TCheckBox'#8'cxSelect'#4'Left'#3'='#1#6'Height'#2#24#3'Top'
+  +#2'V'#5'Width'#2'C'#7'Caption'#6#6'Select'#8'TabOrder'#2#1#0#0#9'TCheckBox'#8
+  +'cxInsert'#4'Left'#3'>'#1#6'Height'#2#24#3'Top'#3#138#0#5'Width'#2'A'#7'Capt'
+  +'ion'#6#6'Insert'#8'TabOrder'#2#2#0#0#9'TCheckBox'#8'cxUpdate'#4'Left'#3'='#1
+  +#6'Height'#2#24#3'Top'#3#183#0#5'Width'#2'L'#7'Caption'#6#6'Update'#8'TabOrd'
+  +'er'#2#3#0#0#9'TCheckBox'#8'cxDelete'#4'Left'#3'='#1#6'Height'#2#24#3'Top'#3
+  +#236#0#5'Width'#2'F'#7'Caption'#6#6'Delete'#8'TabOrder'#2#4#0#0#9'TCheckBox'
+  +#12'cxReferences'#4'Left'#3'>'#1#6'Height'#2#24#3'Top'#3#31#1#5'Width'#2'e'#7
+  +'Caption'#6#10'References'#8'TabOrder'#2#5#0#0#7'TBitBtn'#12'bbApplyTable'#4
+  +'Left'#2#6#6'Height'#2#30#3'Top'#3'+'#1#5'Width'#2'K'#7'Anchors'#11#6'akLeft'
+  +#8'akBottom'#0#7'Caption'#6#5'Apply'#4'Kind'#7#4'bkOK'#7'OnClick'#7#17'bbApp'
+  +'lyTableClick'#8'TabOrder'#2#6#0#0#9'TComboBox'#7'cbUsers'#4'Left'#2#18#6'He'
+  +'ight'#2#29#3'Top'#2'"'#5'Width'#3#236#0#10'ItemHeight'#2#0#8'OnChange'#7#14
+  +'cbTablesChange'#8'TabOrder'#2#7#0#0#9'TCheckBox'#13'cxSelectGrant'#4'Left'#3
+  +'Y'#1#6'Height'#2#24#3'Top'#2'f'#5'Width'#2'c'#7'Caption'#6#10'With Grant'#8
+  +'TabOrder'#2#8#0#0#9'TCheckBox'#13'cxInsertGrant'#4'Left'#3'Y'#1#6'Height'#2
+  +#24#3'Top'#3#154#0#5'Width'#2'c'#7'Caption'#6#10'With Grant'#8'TabOrder'#2#9
+  +#0#0#9'TCheckBox'#13'cxUpdateGrant'#4'Left'#3'Y'#1#6'Height'#2#24#3'Top'#3
+  +#202#0#5'Width'#2'c'#7'Caption'#6#10'With Grant'#8'TabOrder'#2#10#0#0#9'TChe'
+  +'ckBox'#13'cxDeleteGrant'#4'Left'#3'V'#1#6'Height'#2#24#3'Top'#3#253#0#5'Wid'
+  +'th'#2'c'#7'Caption'#6#10'With Grant'#8'TabOrder'#2#11#0#0#9'TCheckBox'#17'c'
+  +'xReferencesGrant'#4'Left'#3'Y'#1#6'Height'#2#24#3'Top'#3'3'#1#5'Width'#2'c'
+  +#7'Caption'#6#10'With Grant'#8'TabOrder'#2#12#0#0#9'TCheckBox'#5'cxAll'#4'Le'
+  +'ft'#3'>'#1#6'Height'#2#24#3'Top'#2'"'#5'Width'#2'/'#7'Caption'#6#3'All'#10
+  +'Font.Style'#11#6'fsBold'#0#10'ParentFont'#8#8'TabOrder'#2#13#0#0#9'TCheckBo'
+  +'x'#10'cxAllGrant'#4'Left'#3'Y'#1#6'Height'#2#24#3'Top'#2'1'#5'Width'#2'h'#7
+  +'Caption'#6#10'With Grant'#10'Font.Style'#11#6'fsBold'#0#10'ParentFont'#8#8
+  +'TabOrder'#2#14#0#0#0#9'TTabSheet'#7'tsViews'#7'Caption'#6#5'Views'#12'Clien'
+  +'tHeight'#3'Q'#1#11'ClientWidth'#3#236#1#0#6'TLabel'#6'Label8'#4'Left'#2#14#6
+  +'Height'#2#18#3'Top'#2#11#5'Width'#2'C'#7'Caption'#6#9'User/Role'#11'ParentC'
+  +'olor'#8#0#0#9'TComboBox'#12'cbViewsUsers'#4'Left'#2#18#6'Height'#2#29#3'Top'
+  +#2'"'#5'Width'#3#220#0#10'ItemHeight'#2#0#8'OnChange'#7#18'cbViewsUsersChang'
+  +'e'#8'TabOrder'#2#0#0#0#6'TLabel'#6'Label9'#4'Left'#2#14#6'Height'#2#18#3'To'
+  +'p'#2'_'#5'Width'#2'"'#7'Caption'#6#4'View'#11'ParentColor'#8#0#0#9'TComboBo'
+  +'x'#7'cbViews'#4'Left'#2#18#6'Height'#2#31#3'Top'#2'|'#5'Width'#3#220#0#10'I'
+  +'temHeight'#2#0#8'OnChange'#7#13'cbViewsChange'#5'Style'#7#14'csDropDownList'
+  +#8'TabOrder'#2#1#0#0#7'TBitBtn'#11'bbApplyView'#4'Left'#2#6#6'Height'#2#30#3
+  +'Top'#3'+'#1#5'Width'#2'K'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Caption'#6
+  +#5'Apply'#4'Kind'#7#4'bkOK'#7'OnClick'#7#16'bbApplyViewClick'#8'TabOrder'#2#2
+  +#0#0#6'TLabel'#7'Label10'#4'Left'#3'6'#1#6'Height'#2#18#3'Top'#2#10#5'Width'
+  +#2'S'#7'Caption'#6#11'Permissions'#11'ParentColor'#8#0#0#9'TCheckBox'#9'cxVi'
+  +'ewAll'#4'Left'#3'>'#1#6'Height'#2#24#3'Top'#2'"'#5'Width'#2','#7'Caption'#6
+  +#3'All'#10'Font.Style'#11#6'fsBold'#0#10'ParentFont'#8#8'TabOrder'#2#3#0#0#9
+  +'TCheckBox'#14'cxViewAllGrant'#4'Left'#3'Y'#1#6'Height'#2#24#3'Top'#2'1'#5'W'
+  +'idth'#2'c'#7'Caption'#6#10'With Grant'#10'Font.Style'#11#6'fsBold'#0#10'Par'
+  +'entFont'#8#8'TabOrder'#2#4#0#0#9'TCheckBox'#12'cxViewSelect'#4'Left'#3'='#1
+  +#6'Height'#2#24#3'Top'#2'V'#5'Width'#2'C'#7'Caption'#6#6'Select'#8'TabOrder'
+  +#2#5#0#0#9'TCheckBox'#17'cxViewSelectGrant'#4'Left'#3'Y'#1#6'Height'#2#24#3
+  +'Top'#2'f'#5'Width'#2'c'#7'Caption'#6#10'With Grant'#8'TabOrder'#2#6#0#0#9'T'
+  ,'CheckBox'#12'cxViewInsert'#4'Left'#3'>'#1#6'Height'#2#24#3'Top'#3#138#0#5'W'
+  +'idth'#2'A'#7'Caption'#6#6'Insert'#8'TabOrder'#2#7#0#0#9'TCheckBox'#17'cxVie'
+  +'wInsertGrant'#4'Left'#3'Y'#1#6'Height'#2#24#3'Top'#3#154#0#5'Width'#2'c'#7
+  +'Caption'#6#10'With Grant'#8'TabOrder'#2#8#0#0#9'TCheckBox'#12'cxViewUpdate'
+  +#4'Left'#3'='#1#6'Height'#2#24#3'Top'#3#183#0#5'Width'#2'L'#7'Caption'#6#6'U'
+  +'pdate'#8'TabOrder'#2#9#0#0#9'TCheckBox'#17'cxViewUpdateGrant'#4'Left'#3'Y'#1
+  +#6'Height'#2#24#3'Top'#3#202#0#5'Width'#2'c'#7'Caption'#6#10'With Grant'#8'T'
+  +'abOrder'#2#10#0#0#9'TCheckBox'#12'cxViewDelete'#4'Left'#3'='#1#6'Height'#2
+  +#24#3'Top'#3#236#0#5'Width'#2'F'#7'Caption'#6#6'Delete'#8'TabOrder'#2#11#0#0
+  +#9'TCheckBox'#17'cxViewDeleteGrant'#4'Left'#3'V'#1#6'Height'#2#24#3'Top'#3
+  +#253#0#5'Width'#2'c'#7'Caption'#6#10'With Grant'#8'TabOrder'#2#12#0#0#9'TChe'
+  +'ckBox'#16'cxViewReferences'#4'Left'#3'>'#1#6'Height'#2#24#3'Top'#3#31#1#5'W'
+  +'idth'#2'e'#7'Caption'#6#10'References'#8'TabOrder'#2#13#0#0#9'TCheckBox'#21
+  +'cxViewReferencesGrant'#4'Left'#3'Y'#1#6'Height'#2#24#3'Top'#3'3'#1#5'Width'
+  +#2'c'#7'Caption'#6#10'With Grant'#8'TabOrder'#2#14#0#0#0#9'TTabSheet'#12'tsP'
+  +'rocedures'#7'Caption'#6#10'Procedures'#12'ClientHeight'#3'Q'#1#11'ClientWid'
+  +'th'#3#236#1#0#6'TLabel'#6'Label4'#4'Left'#2#12#6'Height'#2#18#3'Top'#2#10#5
+  +'Width'#2'C'#7'Caption'#6#9'User/Role'#11'ParentColor'#8#0#0#9'TComboBox'#11
+  +'cbProcUsers'#4'Left'#2#18#6'Height'#2#29#3'Top'#2'"'#5'Width'#3#196#0#10'It'
+  +'emHeight'#2#0#8'OnChange'#7#17'cbProcUsersChange'#8'TabOrder'#2#0#0#0#6'TLa'
+  +'bel'#6'Label5'#4'Left'#3#230#0#6'Height'#2#18#3'Top'#2#11#5'Width'#2'S'#7'C'
+  +'aption'#6#11'Permissions'#11'ParentColor'#8#0#0#13'TCheckListBox'#13'clbPro'
+  +'cedures'#4'Left'#3#246#0#6'Height'#3#1#1#3'Top'#2''''#5'Width'#3#211#0#7'An'
   +'chors'#11#5'akTop'#6'akLeft'#8'akBottom'#0#10'ItemHeight'#2#0#7'OnClick'#7
-  +#13'clbRolesClick'#7'OnKeyUp'#7#13'clbRolesKeyUp'#8'TabOrder'#2#2#8'TopIndex'
-  +#2#255#0#0#7'TBitBtn'#7'BitBtn1'#4'Left'#2'c'#6'Height'#2#30#3'Top'#3#27#1#5
-  +'Width'#2'K'#7'Caption'#6#7'Refresh'#7'OnClick'#7#12'BitBtn1Click'#8'TabOrde'
-  +'r'#2#3#0#0#9'TCheckBox'#11'cxRoleGrant'#4'Left'#3#246#0#6'Height'#2#22#3'To'
-  +'p'#3'#'#1#5'Width'#2'g'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Caption'#6
-  +#10'With Admin'#8'OnChange'#7#17'cxRoleGrantChange'#8'TabOrder'#2#4#0#0#0#0#7
-  +'TBitBtn'#7'bbClose'#4'Left'#3#240#1#6'Height'#2#24#3'Top'#2#0#5'Width'#2#27
-  +#7'Anchors'#11#5'akTop'#7'akRight'#0#7'Caption'#6#4' X  '#5'Color'#4#219#242
-  +#247#0#10'Font.Style'#11#6'fsBold'#0#7'OnClick'#7#12'bbCloseClick'#10'Parent'
-  +'Font'#8#8'TabOrder'#2#1#0#0#0
+  +#18'clbProceduresClick'#7'OnKeyUp'#7#18'clbProceduresKeyUp'#8'TabOrder'#2#1#8
+  +'TopIndex'#2#255#0#0#7'TBitBtn'#11'bbApplyProc'#4'Left'#2#6#6'Height'#2#30#3
+  +'Top'#3'('#1#5'Width'#2'K'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Caption'#6
+  +#5'Apply'#4'Kind'#7#4'bkOK'#7'OnClick'#7#16'bbApplyProcClick'#8'TabOrder'#2#2
+  +#0#0#9'TCheckBox'#11'cxProcGrant'#4'Left'#3#246#0#6'Height'#2#24#3'Top'#3'+'
+  +#1#5'Width'#2'c'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Caption'#6#10'With '
+  +'Grant'#8'OnChange'#7#17'cxProcGrantChange'#8'TabOrder'#2#3#0#0#0#9'TTabShee'
+  +'t'#7'tsRoles'#7'Caption'#6#5'Roles'#12'ClientHeight'#3'Q'#1#11'ClientWidth'
+  +#3#236#1#0#6'TLabel'#6'Label6'#4'Left'#2#12#6'Height'#2#18#3'Top'#2#10#5'Wid'
+  +'th'#2' '#7'Caption'#6#4'User'#11'ParentColor'#8#0#0#9'TComboBox'#11'cbRoles'
+  +'User'#4'Left'#2#18#6'Height'#2#29#3'Top'#2'"'#5'Width'#3#188#0#10'ItemHeigh'
+  +'t'#2#0#8'OnChange'#7#17'cbRolesUserChange'#8'TabOrder'#2#0#0#0#6'TLabel'#6
+  +'Label7'#4'Left'#3#230#0#6'Height'#2#18#3'Top'#2#11#5'Width'#2'S'#7'Caption'
+  +#6#11'Permissions'#11'ParentColor'#8#0#0#7'TBitBtn'#12'bbApplyRoles'#4'Left'
+  +#2#12#6'Height'#2#30#3'Top'#3'*'#1#5'Width'#2'K'#7'Anchors'#11#6'akLeft'#8'a'
+  +'kBottom'#0#7'Caption'#6#5'Apply'#4'Kind'#7#4'bkOK'#7'OnClick'#7#17'bbApplyR'
+  +'olesClick'#8'TabOrder'#2#1#0#0#13'TCheckListBox'#8'clbRoles'#4'Left'#3#246#0
+  +#6'Height'#3#1#1#3'Top'#2''''#5'Width'#3#211#0#7'Anchors'#11#5'akTop'#6'akLe'
+  +'ft'#8'akBottom'#0#10'ItemHeight'#2#0#7'OnClick'#7#13'clbRolesClick'#7'OnKey'
+  +'Up'#7#13'clbRolesKeyUp'#8'TabOrder'#2#2#8'TopIndex'#2#255#0#0#7'TBitBtn'#7
+  +'BitBtn1'#4'Left'#2'f'#6'Height'#2#30#3'Top'#3'*'#1#5'Width'#2'K'#7'Anchors'
+  +#11#6'akLeft'#8'akBottom'#0#7'Caption'#6#7'Refresh'#7'OnClick'#7#12'BitBtn1C'
+  +'lick'#8'TabOrder'#2#3#0#0#9'TCheckBox'#11'cxRoleGrant'#4'Left'#3#246#0#6'He'
+  +'ight'#2#24#3'Top'#3'0'#1#5'Width'#2'i'#7'Anchors'#11#6'akLeft'#8'akBottom'#0
+  +#7'Caption'#6#10'With Admin'#8'OnChange'#7#17'cxRoleGrantChange'#8'TabOrder'
+  +#2#4#0#0#0#0#7'TBitBtn'#7'bbClose'#4'Left'#3#235#1#6'Height'#2#24#3'Top'#2#0
+  +#5'Width'#2#27#7'Anchors'#11#5'akTop'#7'akRight'#0#7'Caption'#6#4' X  '#5'Co'
+  +'lor'#4#219#242#247#0#10'Font.Style'#11#6'fsBold'#0#7'OnClick'#7#12'bbCloseC'
+  +'lick'#10'ParentFont'#8#8'TabOrder'#2#1#0#0#0
 ]);

+ 103 - 10
permissionmanage.pas

@@ -16,47 +16,69 @@ type
     bbApplyRoles: TBitBtn;
     bbApplyTable: TBitBtn;
     bbApplyProc: TBitBtn;
+    bbApplyView: TBitBtn;
     bbClose: TBitBtn;
     BitBtn1: TBitBtn;
     cbRolesUser: TComboBox;
     cbTables: TComboBox;
+    cbViews: TComboBox;
     cbUsers: TComboBox;
     cbProcUsers: TComboBox;
+    cbViewsUsers: TComboBox;
+    cxViewAll: TCheckBox;
+    cxViewAllGrant: TCheckBox;
+    cxViewDelete: TCheckBox;
+    cxViewDeleteGrant: TCheckBox;
+    cxViewInsert: TCheckBox;
+    cxViewInsertGrant: TCheckBox;
     cxProcGrant: TCheckBox;
     clbProcedures: TCheckListBox;
     clbRoles: TCheckListBox;
+    cxViewReferences: TCheckBox;
+    cxViewReferencesGrant: TCheckBox;
     cxRoleGrant: TCheckBox;
     cxSelect: TCheckBox;
     cxInsert: TCheckBox;
     cxDelete: TCheckBox;
     cxReferences: TCheckBox;
     cxAll: TCheckBox;
+    cxViewSelect: TCheckBox;
     cxSelectGrant: TCheckBox;
     cxInsertGrant: TCheckBox;
     cxAllGrant: TCheckBox;
+    cxViewSelectGrant: TCheckBox;
+    cxViewUpdate: TCheckBox;
     cxUpdateGrant: TCheckBox;
     cxDeleteGrant: TCheckBox;
     cxReferencesGrant: TCheckBox;
     cxUpdate: TCheckBox;
+    cxViewUpdateGrant: TCheckBox;
     Label1: TLabel;
+    Label10: TLabel;
     Label2: TLabel;
     Label3: TLabel;
     Label4: TLabel;
     Label5: TLabel;
     Label6: TLabel;
     Label7: TLabel;
+    Label8: TLabel;
+    Label9: TLabel;
     PageControl1: TPageControl;
+    tsViews: TTabSheet;
     tsRoles: TTabSheet;
     tsProcedures: TTabSheet;
     tsTables: TTabSheet;
     procedure bbApplyProcClick(Sender: TObject);
     procedure bbApplyRolesClick(Sender: TObject);
     procedure bbApplyTableClick(Sender: TObject);
+    procedure bbApplyViewClick(Sender: TObject);
     procedure bbCloseClick(Sender: TObject);
     procedure BitBtn1Click(Sender: TObject);
     procedure cbProcUsersChange(Sender: TObject);
     procedure cbRolesUserChange(Sender: TObject);
     procedure cbTablesChange(Sender: TObject);
+    procedure cbViewsChange(Sender: TObject);
+    procedure cbViewsUsersChange(Sender: TObject);
     procedure clbProceduresClick(Sender: TObject);
     procedure clbProceduresKeyUp(Sender: TObject; var Key: Word;
       Shift: TShiftState);
@@ -75,11 +97,12 @@ type
     OrigRoleGrant: array of Boolean;
     fOnCommitProcedure: TNotifyEvent;
     procedure UpdatePermissions;
+    procedure UpdateViewsPermissions;
     procedure UpdateProcPermissions;
     procedure UpdateRolePermissions;
-    procedure ComposeTablePermissionSQL(OptionName: string; Grant, WithGrant: Boolean; var List: TStringList);
+    procedure ComposeTablePermissionSQL(ATableName: string; OptionName: string; Grant, WithGrant: Boolean; var List: TStringList);
   public
-    procedure Init(dbIndex: integer; ATableName, AUserName: string; UserType: Integer;
+    procedure Init(dbIndex: Integer; ATableName, AUserName: string; UserType: Integer;
       OnCommitProcedure: TNotifyEvent = nil);
     { public declarations }
   end;
@@ -128,6 +151,32 @@ begin
 
 end;
 
+procedure TfmPermissionManage.UpdateViewsPermissions;
+var
+  Permissions: string;
+  ObjType: Integer;
+begin
+  if (cbViewsUsers.Text <> '') and (cbViews.Text <> '') then
+  begin;
+    Permissions := dmSysTables.GetObjectUserPermission(fdbIndex, cbViews.Text, cbViewsUsers.Text, ObjType);
+    cxViewAll.Checked:= False;
+    cxViewAllGrant.Checked:= False;
+
+    cxViewSelect.Checked := Pos('S', Permissions) > 0;
+    cxViewInsert.Checked := Pos('I', Permissions) > 0;
+    cxViewUpdate.Checked := Pos('U', Permissions) > 0;
+    cxViewDelete.Checked := Pos('D', Permissions) > 0;
+    cxViewReferences.Checked:= Pos('R', Permissions) > 0;
+
+    cxViewSelectGrant.Checked:= Pos('SG', Permissions) > 0;;
+    cxViewInsertGrant.Checked:= Pos('IG', Permissions) > 0;;
+    cxViewUpdateGrant.Checked:= Pos('UG', Permissions) > 0;;
+    cxViewDeleteGrant.Checked:= Pos('DG', Permissions) > 0;;
+    cxViewReferencesGrant.Checked:= Pos('RG', Permissions) > 0;;
+  end;
+
+end;
+
 procedure TfmPermissionManage.UpdateProcPermissions;
 var
   i: Integer;
@@ -205,7 +254,7 @@ begin
 
 end;
 
-procedure TfmPermissionManage.ComposeTablePermissionSQL(OptionName: string; Grant, WithGrant: Boolean;
+procedure TfmPermissionManage.ComposeTablePermissionSQL(ATableName: string; OptionName: string; Grant, WithGrant: Boolean;
   var List: TStringList);
 var
   Line: string;
@@ -223,7 +272,7 @@ begin
     Command:= 'revoke ';
   end;
 
-  Line:= Command +  OptionName + ' on ' + cbTables.Text + ToFrom + cbUsers.Text;
+  Line:= Command +  OptionName + ' on ' + ATableName + ToFrom + cbUsers.Text;
   if Grant and WithGrant then
       Line:= Line + ' with grant option';
 
@@ -241,14 +290,14 @@ begin
     List:= TStringList.Create;
 
     if cxAll.Checked then
-      ComposeTablePermissionSQL('All', cxAll.Checked, cxAllGrant.Checked, List)
+      ComposeTablePermissionSQL(cbTables.Text, 'All', cxAll.Checked, cxAllGrant.Checked, List)
     else
     begin
-      ComposeTablePermissionSQL('Select', cxSelect.Checked, cxSelectGrant.Checked, List);
-      ComposeTablePermissionSQL('Insert', cxInsert.Checked, cxInsertGrant.Checked, List);
-      ComposeTablePermissionSQL('Update', cxUpdate.Checked, cxUpdateGrant.Checked, List);
-      ComposeTablePermissionSQL('Delete', cxDelete.Checked, cxDeleteGrant.Checked, List);
-      ComposeTablePermissionSQL('References', cxReferences.Checked, cxReferencesGrant.Checked, List);
+      ComposeTablePermissionSQL(cbTables.Text, 'Select', cxSelect.Checked, cxSelectGrant.Checked, List);
+      ComposeTablePermissionSQL(cbTables.Text, 'Insert', cxInsert.Checked, cxInsertGrant.Checked, List);
+      ComposeTablePermissionSQL(cbTables.Text, 'Update', cxUpdate.Checked, cxUpdateGrant.Checked, List);
+      ComposeTablePermissionSQL(cbTables.Text, 'Delete', cxDelete.Checked, cxDeleteGrant.Checked, List);
+      ComposeTablePermissionSQL(cbTables.Text, 'References', cxReferences.Checked, cxReferencesGrant.Checked, List);
     end;
 
     fmMain.ShowCompleteQueryWindow(fdbIndex, 'Edit Permission for: ' + cbTables.Text, List.Text, fOnCommitProcedure);
@@ -260,6 +309,35 @@ begin
     ShowMessage('You should enter user/role and a table');
 end;
 
+procedure TfmPermissionManage.bbApplyViewClick(Sender: TObject);
+var
+    List: TStringList;
+begin
+  if (cbViewsUsers.Text <> '') and (cbViews.ItemIndex <> -1) then
+  begin
+    List:= TStringList.Create;
+
+    if cxViewAll.Checked then
+      ComposeTablePermissionSQL('"' + cbViews.Text + '"', 'All', cxViewAll.Checked, cxViewAllGrant.Checked, List)
+    else
+    begin
+      ComposeTablePermissionSQL('"' + cbViews.Text + '"', 'Select', cxViewSelect.Checked, cxViewSelectGrant.Checked, List);
+      ComposeTablePermissionSQL('"' + cbViews.Text + '"', 'Insert', cxViewInsert.Checked, cxViewInsertGrant.Checked, List);
+      ComposeTablePermissionSQL('"' + cbViews.Text + '"', 'Update', cxViewUpdate.Checked, cxViewUpdateGrant.Checked, List);
+      ComposeTablePermissionSQL('"' + cbViews.Text + '"', 'Delete', cxViewDelete.Checked, cxViewDeleteGrant.Checked, List);
+      ComposeTablePermissionSQL('"' + cbViews.Text + '"', 'References', cxViewReferences.Checked, cxViewReferencesGrant.Checked, List);
+    end;
+
+    fmMain.ShowCompleteQueryWindow(fdbIndex, 'Edit Permission for: ' + cbViews.Text, List.Text, fOnCommitProcedure);
+    List.Free;
+    Close;
+    Parent.Free;
+  end
+  else
+    ShowMessage('You should enter user/role and a table');
+
+end;
+
 procedure TfmPermissionManage.bbCloseClick(Sender: TObject);
 begin
   Close;
@@ -359,6 +437,16 @@ begin
   UpdatePermissions;
 end;
 
+procedure TfmPermissionManage.cbViewsChange(Sender: TObject);
+begin
+  UpdateViewsPermissions;
+end;
+
+procedure TfmPermissionManage.cbViewsUsersChange(Sender: TObject);
+begin
+  UpdateViewsPermissions;
+end;
+
 procedure TfmPermissionManage.clbProceduresClick(Sender: TObject);
 var
   Index: Integer;
@@ -429,12 +517,17 @@ begin
   fdbIndex := dbIndex;
   cbUsers.Text := AUserName;
   cbTables.Items.CommaText:= dmSysTables.GetDBObjectNames(dbIndex, 1, Count);
+  cbViews.Items.CommaText:= dmSysTables.GetDBObjectNames(dbIndex, 4, Count);
   cbTables.Text:= ATableName;
   cbProcUsers.Text:= AUserName;
+  cbViewsUsers.Text:= AUserName;
 
   cbUsers.Items.CommaText:= dmSysTables.GetDBObjectNames(dbIndex, 9, Count) + ',' +
     dmSysTables.GetDBObjectNames(dbIndex, 11, Count);
   cbProcUsers.Items.CommaText:= cbUsers.Items.CommaText;
+  cbViewsUsers.Items.CommaText:= cbUsers.Items.CommaText;
+
+
 
   // Update table permissions
   UpdatePermissions;

+ 3 - 0
querywindow.pas

@@ -177,6 +177,9 @@ end;
 procedure TfmQueryWindow.tbCommitRetainingClick(Sender: TObject);
 begin
   SqlTrans.CommitRetaining;
+  if OnCommit <> nil then
+    OnCommit(self);
+  OnCommit:= nil;
 end;
 
 procedure TfmQueryWindow.tbHistoryClick(Sender: TObject);

+ 4 - 4
systables.pas

@@ -49,7 +49,7 @@ type
     function GetDomainTypeSize(dbIndex: Integer; DomainTypeName: string): Integer;
 
     function GetFieldInfo(dbIndex: Integer; TableName, FieldName: string; var FieldType: string;
-      var Size, IsNull: Integer; var DefaultValue, Description : string): Boolean;
+      var FieldSize: Integer; var NotNull: Boolean; var DefaultValue, Description : string): Boolean;
 
     function GetDatabaseInfo(dbIndex: Integer; var DatabaseName, CharSet, CreationDate: string;
       var ODSVerMajor, ODSVerMinor, Pages, PageSize: Integer; var ProcessList: TStringList): Boolean;
@@ -584,7 +584,7 @@ end;
 
 
 function TdmSysTables.GetFieldInfo(dbIndex: Integer; TableName, FieldName: string; var FieldType: string;
-  var Size, IsNull: Integer; var DefaultValue, Description: string): Boolean;
+  var FieldSize: Integer; var NotNull: Boolean; var DefaultValue, Description: string): Boolean;
 begin
   Init(dbIndex);
   sqQuery.SQL.Text:= 'SELECT r.RDB$FIELD_NAME AS field_name, ' +
@@ -628,8 +628,8 @@ begin
   with sqQuery do
   begin
     FieldType:= Trim(FieldByName('Field_Type_Str').AsString);
-    Size:= FieldByName('Field_Length').AsInteger;
-    IsNull:= FieldByName('Field_not_null_constraint').AsInteger;
+    FieldSize:= FieldByName('Field_Length').AsInteger;
+    NotNull:= FieldByName('Field_not_null_constraint').AsString = '1';
     DefaultValue:= FieldByName('Field_Default_Value').AsString;
     Description:= FieldByName('Field_Description').AsString;
   end;

+ 47 - 47
tablemanage.lfm

@@ -16,20 +16,20 @@ object fmTableManage: TfmTableManage
     Height = 413
     Top = 29
     Width = 817
-    ActivePage = tsFields
+    ActivePage = tsIndices
     Anchors = [akTop, akLeft, akRight, akBottom]
     Images = ImageList1
-    TabIndex = 0
+    TabIndex = 1
     TabOrder = 0
     object tsFields: TTabSheet
       Caption = 'Fields'
-      ClientHeight = 378
-      ClientWidth = 811
+      ClientHeight = 382
+      ClientWidth = 813
       object sgFields: TStringGrid
         Left = 0
-        Height = 335
+        Height = 339
         Top = 0
-        Width = 811
+        Width = 813
         Align = alTop
         Anchors = [akTop, akLeft, akRight, akBottom]
         ColCount = 7
@@ -82,7 +82,7 @@ object fmTableManage: TfmTableManage
       object bbEdit: TBitBtn
         Left = 14
         Height = 30
-        Top = 340
+        Top = 344
         Width = 75
         Anchors = [akLeft, akBottom]
         Caption = 'Edit'
@@ -93,7 +93,7 @@ object fmTableManage: TfmTableManage
       object bbNew: TBitBtn
         Left = 104
         Height = 30
-        Top = 340
+        Top = 344
         Width = 75
         Anchors = [akLeft, akBottom]
         Caption = 'New'
@@ -104,7 +104,7 @@ object fmTableManage: TfmTableManage
       object edDrop: TBitBtn
         Left = 240
         Height = 30
-        Top = 340
+        Top = 344
         Width = 75
         Anchors = [akLeft, akBottom]
         Caption = 'Drop'
@@ -114,9 +114,9 @@ object fmTableManage: TfmTableManage
         TabOrder = 3
       end
       object bbRefresh: TBitBtn
-        Left = 717
+        Left = 719
         Height = 30
-        Top = 340
+        Top = 344
         Width = 94
         Anchors = [akRight, akBottom]
         Caption = 'Refresh'
@@ -128,11 +128,11 @@ object fmTableManage: TfmTableManage
     end
     object tsIndices: TTabSheet
       Caption = 'Indices'
-      ClientHeight = 378
-      ClientWidth = 811
+      ClientHeight = 382
+      ClientWidth = 813
       ImageIndex = 2
       object bbRefreshIndices: TBitBtn
-        Left = 614
+        Left = 616
         Height = 30
         Top = 11
         Width = 88
@@ -147,7 +147,7 @@ object fmTableManage: TfmTableManage
         Left = -1
         Height = 139
         Top = -2
-        Width = 604
+        Width = 606
         Anchors = [akTop, akLeft, akRight]
         Columns = <        
           item
@@ -195,13 +195,13 @@ object fmTableManage: TfmTableManage
       end
       object GroupBox1: TGroupBox
         Left = -2
-        Height = 232
+        Height = 236
         Top = 139
-        Width = 605
+        Width = 607
         Anchors = [akTop, akLeft, akRight, akBottom]
         Caption = 'Manage'
-        ClientHeight = 213
-        ClientWidth = 601
+        ClientHeight = 217
+        ClientWidth = 603
         TabOrder = 3
         object Label2: TLabel
           Left = 6
@@ -230,9 +230,9 @@ object fmTableManage: TfmTableManage
         end
         object cxUnique: TCheckBox
           Left = 254
-          Height = 22
+          Height = 24
           Top = 95
-          Width = 71
+          Width = 73
           Caption = 'Unique'
           TabOrder = 1
         end
@@ -294,13 +294,13 @@ object fmTableManage: TfmTableManage
     end
     object tsConstraints: TTabSheet
       Caption = 'Constraints'
-      ClientHeight = 378
-      ClientWidth = 811
+      ClientHeight = 382
+      ClientWidth = 813
       ImageIndex = 3
       object bbRefreshConstraint: TBitBtn
-        Left = 695
+        Left = 697
         Height = 30
-        Top = 339
+        Top = 343
         Width = 99
         Anchors = [akRight, akBottom]
         Caption = 'Refresh'
@@ -311,9 +311,9 @@ object fmTableManage: TfmTableManage
       end
       object sgConstraints: TStringGrid
         Left = -1
-        Height = 329
+        Height = 333
         Top = -1
-        Width = 813
+        Width = 815
         Anchors = [akTop, akLeft, akRight, akBottom]
         ColCount = 7
         Columns = <        
@@ -354,7 +354,7 @@ object fmTableManage: TfmTableManage
       object bbNewConstraint: TBitBtn
         Left = 6
         Height = 30
-        Top = 339
+        Top = 343
         Width = 119
         Anchors = [akLeft, akBottom]
         Caption = 'New Constraint'
@@ -365,7 +365,7 @@ object fmTableManage: TfmTableManage
       object bbDropConstraint: TBitBtn
         Left = 144
         Height = 30
-        Top = 339
+        Top = 343
         Width = 75
         Anchors = [akLeft, akBottom]
         Caption = 'Drop'
@@ -377,14 +377,14 @@ object fmTableManage: TfmTableManage
     end
     object tsTriggers: TTabSheet
       Caption = 'Triggers'
-      ClientHeight = 378
-      ClientWidth = 811
+      ClientHeight = 382
+      ClientWidth = 813
       ImageIndex = 1
       object sgTriggers: TStringGrid
         Left = 0
-        Height = 320
+        Height = 324
         Top = -1
-        Width = 793
+        Width = 795
         Anchors = [akTop, akLeft, akRight, akBottom]
         ColCount = 2
         Columns = <        
@@ -404,9 +404,9 @@ object fmTableManage: TfmTableManage
         TabOrder = 0
       end
       object bbRefreshTriggers: TBitBtn
-        Left = 697
+        Left = 699
         Height = 30
-        Top = 333
+        Top = 337
         Width = 87
         Anchors = [akRight, akBottom]
         Caption = 'Refresh'
@@ -416,9 +416,9 @@ object fmTableManage: TfmTableManage
         TabOrder = 1
       end
       object bbNewTrigger: TBitBtn
-        Left = 7
+        Left = 6
         Height = 30
-        Top = 331
+        Top = 334
         Width = 87
         Anchors = [akLeft, akBottom]
         Caption = 'Add New'
@@ -429,7 +429,7 @@ object fmTableManage: TfmTableManage
       object bbEditTrigger: TBitBtn
         Left = 110
         Height = 30
-        Top = 331
+        Top = 334
         Width = 75
         Anchors = [akLeft, akBottom]
         Caption = 'Edit'
@@ -440,7 +440,7 @@ object fmTableManage: TfmTableManage
       object bbDropTrigger: TBitBtn
         Left = 200
         Height = 30
-        Top = 331
+        Top = 335
         Width = 75
         Anchors = [akLeft, akBottom]
         Caption = 'Drop'
@@ -452,14 +452,14 @@ object fmTableManage: TfmTableManage
     end
     object tsPermissions: TTabSheet
       Caption = 'Permissions'
-      ClientHeight = 378
-      ClientWidth = 811
+      ClientHeight = 382
+      ClientWidth = 813
       ImageIndex = 4
       object sgPermissions: TStringGrid
         Left = 0
-        Height = 320
+        Height = 324
         Top = -3
-        Width = 810
+        Width = 812
         Anchors = [akTop, akLeft, akRight, akBottom]
         ColCount = 12
         Columns = <        
@@ -527,7 +527,7 @@ object fmTableManage: TfmTableManage
       object edEditPermission: TBitBtn
         Left = 6
         Height = 30
-        Top = 335
+        Top = 339
         Width = 75
         Anchors = [akLeft, akBottom]
         Caption = 'Edit'
@@ -536,9 +536,9 @@ object fmTableManage: TfmTableManage
         TabOrder = 1
       end
       object bbRefreshPermissions: TBitBtn
-        Left = 697
+        Left = 699
         Height = 30
-        Top = 335
+        Top = 339
         Width = 87
         Anchors = [akRight, akBottom]
         Caption = 'Refresh'
@@ -550,7 +550,7 @@ object fmTableManage: TfmTableManage
       object bbAddUser: TBitBtn
         Left = 90
         Height = 30
-        Top = 335
+        Top = 339
         Width = 125
         Anchors = [akLeft, akBottom]
         Caption = 'Add User / Role'

+ 36 - 36
tablemanage.lrs

@@ -7,11 +7,11 @@ LazarusResources.Add('TfmTableManage','FORMDATA',[
   +'ClientHeight'#3#192#1#11'ClientWidth'#3'3'#3#7'OnClose'#7#9'FormClose'#8'Po'
   +'sition'#7#14'poScreenCenter'#10'LCLVersion'#6#6'0.9.31'#0#12'TPageControl'
   +#12'PageControl1'#4'Left'#2#0#6'Height'#3#157#1#3'Top'#2#29#5'Width'#3'1'#3
-  +#10'ActivePage'#7#8'tsFields'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8
-  +'akBottom'#0#6'Images'#7#10'ImageList1'#8'TabIndex'#2#0#8'TabOrder'#2#0#0#9
-  +'TTabSheet'#8'tsFields'#7'Caption'#6#6'Fields'#12'ClientHeight'#3'z'#1#11'Cl'
-  +'ientWidth'#3'+'#3#0#11'TStringGrid'#8'sgFields'#4'Left'#2#0#6'Height'#3'O'#1
-  +#3'Top'#2#0#5'Width'#3'+'#3#5'Align'#7#5'alTop'#7'Anchors'#11#5'akTop'#6'akL'
+  +#10'ActivePage'#7#9'tsIndices'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8
+  +'akBottom'#0#6'Images'#7#10'ImageList1'#8'TabIndex'#2#1#8'TabOrder'#2#0#0#9
+  +'TTabSheet'#8'tsFields'#7'Caption'#6#6'Fields'#12'ClientHeight'#3'~'#1#11'Cl'
+  +'ientWidth'#3'-'#3#0#11'TStringGrid'#8'sgFields'#4'Left'#2#0#6'Height'#3'S'#1
+  +#3'Top'#2#0#5'Width'#3'-'#3#5'Align'#7#5'alTop'#7'Anchors'#11#5'akTop'#6'akL'
   +'eft'#7'akRight'#8'akBottom'#0#8'ColCount'#2#7#7'Columns'#14#1#11'ButtonStyl'
   +'e'#7#17'cbsCheckboxColumn'#5'Color'#4#234#219#219#0#7'MaxSize'#2'2'#8'ReadO'
   +'nly'#9#13'Title.Caption'#6#5'P-Key'#16'Title.Font.Color'#4#229'TT'#0#17'Tit'
@@ -26,24 +26,24 @@ LazarusResources.Add('TfmTableManage','FORMDATA',[
   +'ne'#10'goHorzLine'#11'goColSizing'#11'goColMoving'#11'goRowSelect'#14'goSmo'
   +'othScroll'#0#8'RowCount'#2#4#8'TabOrder'#2#0#15'TitleFont.Style'#11#6'fsBol'
   +'d'#0#14'UseXORFeatures'#9#0#0#7'TBitBtn'#6'bbEdit'#4'Left'#2#14#6'Height'#2
-  +#30#3'Top'#3'T'#1#5'Width'#2'K'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Capt'
+  +#30#3'Top'#3'X'#1#5'Width'#2'K'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Capt'
   +'ion'#6#4'Edit'#5'Color'#4#219#242#247#0#7'OnClick'#7#11'bbEditClick'#8'TabO'
-  +'rder'#2#1#0#0#7'TBitBtn'#5'bbNew'#4'Left'#2'h'#6'Height'#2#30#3'Top'#3'T'#1
+  +'rder'#2#1#0#0#7'TBitBtn'#5'bbNew'#4'Left'#2'h'#6'Height'#2#30#3'Top'#3'X'#1
   +#5'Width'#2'K'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Caption'#6#3'New'#5'C'
   +'olor'#4#219#242#247#0#7'OnClick'#7#10'bbNewClick'#8'TabOrder'#2#2#0#0#7'TBi'
-  +'tBtn'#6'edDrop'#4'Left'#3#240#0#6'Height'#2#30#3'Top'#3'T'#1#5'Width'#2'K'#7
+  +'tBtn'#6'edDrop'#4'Left'#3#240#0#6'Height'#2#30#3'Top'#3'X'#1#5'Width'#2'K'#7
   +'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Caption'#6#4'Drop'#5'Color'#4#219#242
   +#247#0#4'Kind'#7#8'bkIgnore'#7'OnClick'#7#11'edDropClick'#8'TabOrder'#2#3#0#0
-  +#7'TBitBtn'#9'bbRefresh'#4'Left'#3#205#2#6'Height'#2#30#3'Top'#3'T'#1#5'Widt'
+  +#7'TBitBtn'#9'bbRefresh'#4'Left'#3#207#2#6'Height'#2#30#3'Top'#3'X'#1#5'Widt'
   +'h'#2'^'#7'Anchors'#11#7'akRight'#8'akBottom'#0#7'Caption'#6#7'Refresh'#5'Co'
   +'lor'#4#219#242#247#0#4'Kind'#7#7'bkRetry'#7'OnClick'#7#14'bbRefreshClick'#8
   +'TabOrder'#2#4#0#0#0#9'TTabSheet'#9'tsIndices'#7'Caption'#6#7'Indices'#12'Cl'
-  +'ientHeight'#3'z'#1#11'ClientWidth'#3'+'#3#10'ImageIndex'#2#2#0#7'TBitBtn'#16
-  +'bbRefreshIndices'#4'Left'#3'f'#2#6'Height'#2#30#3'Top'#2#11#5'Width'#2'X'#7
+  +'ientHeight'#3'~'#1#11'ClientWidth'#3'-'#3#10'ImageIndex'#2#2#0#7'TBitBtn'#16
+  +'bbRefreshIndices'#4'Left'#3'h'#2#6'Height'#2#30#3'Top'#2#11#5'Width'#2'X'#7
   +'Anchors'#11#5'akTop'#7'akRight'#0#7'Caption'#6#7'Refresh'#5'Color'#4#219#242
   +#247#0#4'Kind'#7#7'bkRetry'#7'OnClick'#7#21'bbRefreshIndicesClick'#8'TabOrde'
   +'r'#2#0#0#0#11'TStringGrid'#9'sgIndices'#4'Left'#2#255#6'Height'#3#139#0#3'T'
-  +'op'#2#254#5'Width'#3'\'#2#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#7'C'
+  +'op'#2#254#5'Width'#3'^'#2#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#7'C'
   +'olumns'#14#1#13'Title.Caption'#6#10'Index Name'#5'Width'#3#140#0#0#1#11'But'
   +'tonStyle'#7#17'cbsCheckboxColumn'#13'Title.Caption'#6#6'Unique'#0#1#11'Butt'
   +'onStyle'#7#11'cbsPickList'#16'PickList.Strings'#1#6#3'Asc'#6#4'Desc'#0#13'T'
@@ -56,16 +56,16 @@ LazarusResources.Add('TfmTableManage','FORMDATA',[
   +'Btn'#6'bbDrop'#4'Left'#3'f'#2#6'Height'#2#30#3'Top'#2'3'#5'Width'#2'X'#7'An'
   +'chors'#11#5'akTop'#7'akRight'#0#7'Caption'#6#4'Drop'#5'Color'#4#219#242#247
   +#0#7'OnClick'#7#11'bbDropClick'#8'TabOrder'#2#2#0#0#9'TGroupBox'#9'GroupBox1'
-  +#4'Left'#2#254#6'Height'#3#232#0#3'Top'#3#139#0#5'Width'#3']'#2#7'Anchors'#11
+  +#4'Left'#2#254#6'Height'#3#236#0#3'Top'#3#139#0#5'Width'#3'_'#2#7'Anchors'#11
   +#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#7'Caption'#6#6'Manage'#12'Clien'
-  +'tHeight'#3#213#0#11'ClientWidth'#3'Y'#2#8'TabOrder'#2#3#0#6'TLabel'#6'Label'
+  +'tHeight'#3#217#0#11'ClientWidth'#3'['#2#8'TabOrder'#2#3#0#6'TLabel'#6'Label'
   +'2'#4'Left'#2#6#6'Height'#2#18#3'Top'#2#14#5'Width'#3#176#0#7'Caption'#6#26
   +'Create new index on fields'#11'ParentColor'#8#0#0#6'TLabel'#6'Label3'#4'Lef'
   +'t'#3#254#0#6'Height'#2#18#3'Top'#2''''#5'Width'#2'o'#7'Caption'#6#14'New in'
   +'dex name'#11'ParentColor'#8#0#0#13'TCheckListBox'#9'clbFields'#4'Left'#2#6#6
   +'Height'#3#152#0#3'Top'#2'/'#5'Width'#3#232#0#10'ItemHeight'#2#0#8'TabOrder'
   +#2#0#8'TopIndex'#2#255#0#0#9'TCheckBox'#8'cxUnique'#4'Left'#3#254#0#6'Height'
-  ,#2#22#3'Top'#2'_'#5'Width'#2'G'#7'Caption'#6#6'Unique'#8'TabOrder'#2#1#0#0#7
+  ,#2#24#3'Top'#2'_'#5'Width'#2'I'#7'Caption'#6#6'Unique'#8'TabOrder'#2#1#0#0#7
   +'TBitBtn'#13'bbCreateIndex'#4'Left'#3#254#0#6'Height'#2#30#3'Top'#3#167#0#5
   +'Width'#2'|'#7'Caption'#6#12'Create Index'#5'Color'#4#219#242#247#0#7'Defaul'
   +'t'#9#4'Kind'#7#4'bkOK'#11'ModalResult'#2#1#7'OnClick'#7#18'bbCreateIndexCli'
@@ -79,13 +79,13 @@ LazarusResources.Add('TfmTableManage','FORMDATA',[
   +'ight'#2#0#9'ItemIndex'#2#1#13'Items.Strings'#1#6#11'Primary Key'#6#15'Secon'
   +'dary Index'#0#8'OnChange'#7#17'cbIndexTypeChange'#5'Style'#7#14'csDropDownL'
   +'ist'#8'TabOrder'#2#5#4'Text'#6#15'Secondary Index'#0#0#0#0#9'TTabSheet'#13
-  +'tsConstraints'#7'Caption'#6#11'Constraints'#12'ClientHeight'#3'z'#1#11'Clie'
-  +'ntWidth'#3'+'#3#10'ImageIndex'#2#3#0#7'TBitBtn'#19'bbRefreshConstraint'#4'L'
-  +'eft'#3#183#2#6'Height'#2#30#3'Top'#3'S'#1#5'Width'#2'c'#7'Anchors'#11#7'akR'
+  +'tsConstraints'#7'Caption'#6#11'Constraints'#12'ClientHeight'#3'~'#1#11'Clie'
+  +'ntWidth'#3'-'#3#10'ImageIndex'#2#3#0#7'TBitBtn'#19'bbRefreshConstraint'#4'L'
+  +'eft'#3#185#2#6'Height'#2#30#3'Top'#3'W'#1#5'Width'#2'c'#7'Anchors'#11#7'akR'
   +'ight'#8'akBottom'#0#7'Caption'#6#7'Refresh'#5'Color'#4#219#242#247#0#4'Kind'
   +#7#7'bkRetry'#7'OnClick'#7#24'bbRefreshConstraintClick'#8'TabOrder'#2#0#0#0
-  +#11'TStringGrid'#13'sgConstraints'#4'Left'#2#255#6'Height'#3'I'#1#3'Top'#2
-  +#255#5'Width'#3'-'#3#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'
+  +#11'TStringGrid'#13'sgConstraints'#4'Left'#2#255#6'Height'#3'M'#1#3'Top'#2
+  +#255#5'Width'#3'/'#3#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'
   +#0#8'ColCount'#2#7#7'Columns'#14#1#13'Title.Caption'#6#15'Constraint Name'#5
   +'Width'#2'x'#0#1#13'Title.Caption'#6#8'Key name'#5'Width'#2'd'#0#1#13'Title.'
   +'Caption'#6#9'On Fields'#5'Width'#2'x'#0#1#13'Title.Caption'#6#13'Foreign Ta'
@@ -95,37 +95,37 @@ LazarusResources.Add('TfmTableManage','FORMDATA',[
   +#0#7'Options'#11#15'goFixedVertLine'#15'goFixedHorzLine'#10'goVertLine'#10'g'
   +'oHorzLine'#13'goRangeSelect'#11'goColSizing'#11'goRowSelect'#14'goSmoothScr'
   +'oll'#0#8'RowCount'#2#2#8'TabOrder'#2#1#0#0#7'TBitBtn'#15'bbNewConstraint'#4
-  +'Left'#2#6#6'Height'#2#30#3'Top'#3'S'#1#5'Width'#2'w'#7'Anchors'#11#6'akLeft'
+  +'Left'#2#6#6'Height'#2#30#3'Top'#3'W'#1#5'Width'#2'w'#7'Anchors'#11#6'akLeft'
   +#8'akBottom'#0#7'Caption'#6#14'New Constraint'#5'Color'#4#219#242#247#0#7'On'
   +'Click'#7#20'bbNewConstraintClick'#8'TabOrder'#2#2#0#0#7'TBitBtn'#16'bbDropC'
-  +'onstraint'#4'Left'#3#144#0#6'Height'#2#30#3'Top'#3'S'#1#5'Width'#2'K'#7'Anc'
+  +'onstraint'#4'Left'#3#144#0#6'Height'#2#30#3'Top'#3'W'#1#5'Width'#2'K'#7'Anc'
   +'hors'#11#6'akLeft'#8'akBottom'#0#7'Caption'#6#4'Drop'#5'Color'#4#219#242#247
   +#0#4'Kind'#7#8'bkIgnore'#7'OnClick'#7#21'bbDropConstraintClick'#8'TabOrder'#2
   +#3#0#0#0#9'TTabSheet'#10'tsTriggers'#7'Caption'#6#8'Triggers'#12'ClientHeigh'
-  +'t'#3'z'#1#11'ClientWidth'#3'+'#3#10'ImageIndex'#2#1#0#11'TStringGrid'#10'sg'
-  +'Triggers'#4'Left'#2#0#6'Height'#3'@'#1#3'Top'#2#255#5'Width'#3#25#3#7'Ancho'
+  +'t'#3'~'#1#11'ClientWidth'#3'-'#3#10'ImageIndex'#2#1#0#11'TStringGrid'#10'sg'
+  +'Triggers'#4'Left'#2#0#6'Height'#3'D'#1#3'Top'#2#255#5'Width'#3#27#3#7'Ancho'
   +'rs'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#8'ColCount'#2#2#7'Column'
   +'s'#14#1#13'Title.Caption'#6#12'Trigger Name'#5'Width'#3#160#0#0#1#11'Button'
   +'Style'#7#17'cbsCheckboxColumn'#13'Title.Caption'#6#6'Active'#5'Width'#2'd'#0
   +#0#10'FixedColor'#4#207#218#221#0#9'FixedCols'#2#0#7'Options'#11#15'goFixedV'
   +'ertLine'#15'goFixedHorzLine'#10'goVertLine'#10'goHorzLine'#13'goRangeSelect'
   +#11'goColSizing'#11'goRowSelect'#14'goSmoothScroll'#0#8'RowCount'#2#2#8'TabO'
-  +'rder'#2#0#0#0#7'TBitBtn'#17'bbRefreshTriggers'#4'Left'#3#185#2#6'Height'#2
-  +#30#3'Top'#3'M'#1#5'Width'#2'W'#7'Anchors'#11#7'akRight'#8'akBottom'#0#7'Cap'
+  +'rder'#2#0#0#0#7'TBitBtn'#17'bbRefreshTriggers'#4'Left'#3#187#2#6'Height'#2
+  +#30#3'Top'#3'Q'#1#5'Width'#2'W'#7'Anchors'#11#7'akRight'#8'akBottom'#0#7'Cap'
   +'tion'#6#7'Refresh'#5'Color'#4#219#242#247#0#4'Kind'#7#7'bkRetry'#7'OnClick'
   +#7#22'bbRefreshTriggersClick'#8'TabOrder'#2#1#0#0#7'TBitBtn'#12'bbNewTrigger'
-  +#4'Left'#2#7#6'Height'#2#30#3'Top'#3'K'#1#5'Width'#2'W'#7'Anchors'#11#6'akLe'
+  +#4'Left'#2#6#6'Height'#2#30#3'Top'#3'N'#1#5'Width'#2'W'#7'Anchors'#11#6'akLe'
   +'ft'#8'akBottom'#0#7'Caption'#6#7'Add New'#5'Color'#4#219#242#247#0#7'OnClic'
   +'k'#7#17'bbNewTriggerClick'#8'TabOrder'#2#2#0#0#7'TBitBtn'#13'bbEditTrigger'
-  +#4'Left'#2'n'#6'Height'#2#30#3'Top'#3'K'#1#5'Width'#2'K'#7'Anchors'#11#6'akL'
+  +#4'Left'#2'n'#6'Height'#2#30#3'Top'#3'N'#1#5'Width'#2'K'#7'Anchors'#11#6'akL'
   +'eft'#8'akBottom'#0#7'Caption'#6#4'Edit'#5'Color'#4#219#242#247#0#7'OnClick'
   +#7#18'bbEditTriggerClick'#8'TabOrder'#2#3#0#0#7'TBitBtn'#13'bbDropTrigger'#4
-  +'Left'#3#200#0#6'Height'#2#30#3'Top'#3'K'#1#5'Width'#2'K'#7'Anchors'#11#6'ak'
+  +'Left'#3#200#0#6'Height'#2#30#3'Top'#3'O'#1#5'Width'#2'K'#7'Anchors'#11#6'ak'
   +'Left'#8'akBottom'#0#7'Caption'#6#4'Drop'#5'Color'#4#219#242#247#0#4'Kind'#7
   +#8'bkIgnore'#7'OnClick'#7#18'bbDropTriggerClick'#8'TabOrder'#2#4#0#0#0#9'TTa'
-  +'bSheet'#13'tsPermissions'#7'Caption'#6#11'Permissions'#12'ClientHeight'#3'z'
-  +#1#11'ClientWidth'#3'+'#3#10'ImageIndex'#2#4#0#11'TStringGrid'#13'sgPermissi'
-  +'ons'#4'Left'#2#0#6'Height'#3'@'#1#3'Top'#2#253#5'Width'#3'*'#3#7'Anchors'#11
+  +'bSheet'#13'tsPermissions'#7'Caption'#6#11'Permissions'#12'ClientHeight'#3'~'
+  +#1#11'ClientWidth'#3'-'#3#10'ImageIndex'#2#4#0#11'TStringGrid'#13'sgPermissi'
+  +'ons'#4'Left'#2#0#6'Height'#3'D'#1#3'Top'#2#253#5'Width'#3','#3#7'Anchors'#11
   +#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#8'ColCount'#2#12#7'Columns'#14#1
   +#13'Title.Caption'#6#9'User/Role'#5'Width'#3#160#0#0#1#13'Title.Caption'#6#4
   +'Type'#0#1#11'ButtonStyle'#7#17'cbsCheckboxColumn'#8'ReadOnly'#9#13'Title.Ca'
@@ -144,13 +144,13 @@ LazarusResources.Add('TfmTableManage','FORMDATA',[
   +'tLine'#15'goFixedHorzLine'#10'goVertLine'#10'goHorzLine'#13'goRangeSelect'
   +#11'goColSizing'#11'goRowSelect'#14'goSmoothScroll'#0#8'RowCount'#2#2#8'TabO'
   +'rder'#2#0#0#0#7'TBitBtn'#16'edEditPermission'#4'Left'#2#6#6'Height'#2#30#3
-  +'Top'#3'O'#1#5'Width'#2'K'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Caption'#6
+  +'Top'#3'S'#1#5'Width'#2'K'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Caption'#6
   +#4'Edit'#5'Color'#4#219#242#247#0#7'OnClick'#7#21'edEditPermissionClick'#8'T'
-  +'abOrder'#2#1#0#0#7'TBitBtn'#20'bbRefreshPermissions'#4'Left'#3#185#2#6'Heig'
-  +'ht'#2#30#3'Top'#3'O'#1#5'Width'#2'W'#7'Anchors'#11#7'akRight'#8'akBottom'#0
+  +'abOrder'#2#1#0#0#7'TBitBtn'#20'bbRefreshPermissions'#4'Left'#3#187#2#6'Heig'
+  +'ht'#2#30#3'Top'#3'S'#1#5'Width'#2'W'#7'Anchors'#11#7'akRight'#8'akBottom'#0
   +#7'Caption'#6#7'Refresh'#5'Color'#4#219#242#247#0#4'Kind'#7#7'bkRetry'#7'OnC'
   +'lick'#7#25'bbRefreshPermissionsClick'#8'TabOrder'#2#2#0#0#7'TBitBtn'#9'bbAd'
-  +'dUser'#4'Left'#2'Z'#6'Height'#2#30#3'Top'#3'O'#1#5'Width'#2'}'#7'Anchors'#11
+  +'dUser'#4'Left'#2'Z'#6'Height'#2#30#3'Top'#3'S'#1#5'Width'#2'}'#7'Anchors'#11
   +#6'akLeft'#8'akBottom'#0#7'Caption'#6#15'Add User / Role'#5'Color'#4#219#242
   +#247#0#7'OnClick'#7#14'bbAddUserClick'#8'TabOrder'#2#3#0#0#0#0#7'TBitBtn'#7
   +'bbClose'#4'Left'#3#23#3#6'Height'#2#24#3'Top'#2#0#5'Width'#2#27#7'Anchors'

+ 1 - 3
tablemanage.pas

@@ -289,15 +289,13 @@ begin
   fmNewConstraint.Caption:= 'New Constraint for : ' + fTableName;
   if fmNewConstraint.ShowModal = mrOK then
   begin
-    Hide;
     fmNewConstraint.QWindow.OnCommit:= bbRefreshConstraint.OnClick;
   end;
 end;
 
 procedure TfmTableManage.bbNewTriggerClick(Sender: TObject);
 begin
-  if fmMain.CreateNewTrigger(fdbIndex, fTableName, bbRefreshTriggers.OnClick) then
-    Hide;
+  fmMain.CreateNewTrigger(fdbIndex, fTableName, bbRefreshTriggers.OnClick);
 end;
 
 procedure TfmTableManage.bbRefreshClick(Sender: TObject);