Kaynağa Gözat

New table editor enhancements, grant permission
modified: TurboBird.lpi
modified: TurboBird.lpr
modified: TurboBird.res
modified: dbinfo.lfm
modified: dbinfo.pas
modified: edittable.lfm
modified: edittable.lrs
modified: edittable.pas
modified: main.pas

motaz 13 yıl önce
ebeveyn
işleme
38db25736b
18 değiştirilmiş dosya ile 480 ekleme ve 277 silme
  1. 109 90
      TurboBird.lpi
  2. 3 3
      TurboBird.lpr
  3. BIN
      TurboBird.res
  4. 28 6
      dbinfo.lfm
  5. 10 0
      dbinfo.pas
  6. 6 5
      edittable.lfm
  7. 18 18
      edittable.lrs
  8. 2 2
      edittable.pas
  9. 1 0
      main.pas
  10. 65 14
      newtable.lfm
  11. 42 30
      newtable.lrs
  12. 100 14
      newtable.pas
  13. 6 4
      permissionmanage.lfm
  14. 81 81
      permissionmanage.lrs
  15. 1 0
      systables.pas
  16. 4 4
      tablemanage.lfm
  17. 4 4
      tablemanage.lrs
  18. 0 2
      tablemanage.pas

+ 109 - 90
TurboBird.lpi

@@ -17,8 +17,8 @@
       <UseVersionInfo Value="True"/>
       <AutoIncrementBuild Value="True"/>
       <MinorVersionNr Value="9"/>
-      <RevisionNr Value="3"/>
-      <BuildNr Value="1072"/>
+      <RevisionNr Value="4"/>
+      <BuildNr Value="1073"/>
       <StringTable ProductVersion="0.9"/>
     </VersionInfo>
     <BuildModes Count="1">
@@ -62,8 +62,8 @@
         <UnitName Value="TurboBird"/>
         <EditorIndex Value="0"/>
         <WindowIndex Value="0"/>
-        <TopLine Value="5"/>
-        <CursorPos X="26" Y="5"/>
+        <TopLine Value="1"/>
+        <CursorPos X="30" Y="7"/>
         <UsageCount Value="200"/>
         <Loaded Value="True"/>
       </Unit0>
@@ -71,12 +71,13 @@
         <Filename Value="main.pas"/>
         <IsPartOfProject Value="True"/>
         <ComponentName Value="fmMain"/>
+        <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <UnitName Value="main"/>
-        <EditorIndex Value="7"/>
+        <EditorIndex Value="10"/>
         <WindowIndex Value="0"/>
-        <TopLine Value="3734"/>
-        <CursorPos X="1" Y="3738"/>
+        <TopLine Value="407"/>
+        <CursorPos X="20" Y="419"/>
         <UsageCount Value="200"/>
         <Loaded Value="True"/>
         <LoadedDesigner Value="True"/>
@@ -114,11 +115,12 @@
         <Filename Value="querywindow.pas"/>
         <IsPartOfProject Value="True"/>
         <ComponentName Value="fmQueryWindow"/>
+        <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <UnitName Value="QueryWindow"/>
-        <EditorIndex Value="5"/>
+        <EditorIndex Value="8"/>
         <WindowIndex Value="0"/>
-        <TopLine Value="542"/>
+        <TopLine Value="1"/>
         <CursorPos X="42" Y="556"/>
         <UsageCount Value="200"/>
         <Loaded Value="True"/>
@@ -195,13 +197,14 @@
         <Filename Value="newtable.pas"/>
         <IsPartOfProject Value="True"/>
         <ComponentName Value="fmNewTable"/>
+        <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <UnitName Value="NewTable"/>
         <IsVisibleTab Value="True"/>
-        <EditorIndex Value="3"/>
+        <EditorIndex Value="5"/>
         <WindowIndex Value="0"/>
-        <TopLine Value="145"/>
-        <CursorPos X="24" Y="151"/>
+        <TopLine Value="98"/>
+        <CursorPos X="1" Y="122"/>
         <UsageCount Value="200"/>
         <Loaded Value="True"/>
         <LoadedDesigner Value="True"/>
@@ -221,9 +224,10 @@
         <Filename Value="enterpass.pas"/>
         <IsPartOfProject Value="True"/>
         <ComponentName Value="fmEnterPass"/>
+        <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <UnitName Value="EnterPass"/>
-        <EditorIndex Value="8"/>
+        <EditorIndex Value="11"/>
         <WindowIndex Value="0"/>
         <TopLine Value="22"/>
         <CursorPos X="17" Y="46"/>
@@ -372,12 +376,16 @@
         <Filename Value="edittable.pas"/>
         <IsPartOfProject Value="True"/>
         <ComponentName Value="fmEditTable"/>
+        <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <UnitName Value="EditTable"/>
+        <EditorIndex Value="1"/>
         <WindowIndex Value="0"/>
-        <TopLine Value="78"/>
-        <CursorPos X="33" Y="109"/>
+        <TopLine Value="1"/>
+        <CursorPos X="58" Y="90"/>
         <UsageCount Value="200"/>
+        <Loaded Value="True"/>
+        <LoadedDesigner Value="True"/>
       </Unit34>
       <Unit35>
         <Filename Value="/usr/share/fpcsrc/2.2.4/packages/fcl-base/src/custapp.pp"/>
@@ -452,12 +460,13 @@
         <Filename Value="systables.pas"/>
         <IsPartOfProject Value="True"/>
         <ComponentName Value="dmSysTables"/>
+        <HasResources Value="True"/>
         <ResourceBaseClass Value="DataModule"/>
         <UnitName Value="SysTables"/>
-        <EditorIndex Value="1"/>
+        <EditorIndex Value="3"/>
         <WindowIndex Value="0"/>
-        <TopLine Value="420"/>
-        <CursorPos X="24" Y="427"/>
+        <TopLine Value="571"/>
+        <CursorPos X="3" Y="573"/>
         <UsageCount Value="200"/>
         <Loaded Value="True"/>
         <LoadedDesigner Value="True"/>
@@ -536,7 +545,7 @@
         <Filename Value="scriptdb.pas"/>
         <IsPartOfProject Value="True"/>
         <UnitName Value="Scriptdb"/>
-        <EditorIndex Value="6"/>
+        <EditorIndex Value="9"/>
         <WindowIndex Value="0"/>
         <TopLine Value="1"/>
         <CursorPos X="1" Y="1"/>
@@ -575,12 +584,13 @@
         <Filename Value="tablemanage.pas"/>
         <IsPartOfProject Value="True"/>
         <ComponentName Value="fmTableManage"/>
+        <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <UnitName Value="TableManage"/>
-        <EditorIndex Value="4"/>
+        <EditorIndex Value="7"/>
         <WindowIndex Value="0"/>
-        <TopLine Value="402"/>
-        <CursorPos X="3" Y="406"/>
+        <TopLine Value="384"/>
+        <CursorPos X="1" Y="405"/>
         <UsageCount Value="200"/>
         <Loaded Value="True"/>
         <LoadedDesigner Value="True"/>
@@ -626,7 +636,7 @@
         <WindowIndex Value="0"/>
         <TopLine Value="13"/>
         <CursorPos X="22" Y="54"/>
-        <UsageCount Value="192"/>
+        <UsageCount Value="196"/>
       </Unit60>
       <Unit61>
         <Filename Value="unitfirebirdservices.pas"/>
@@ -692,7 +702,7 @@
         <WindowIndex Value="0"/>
         <TopLine Value="3"/>
         <CursorPos X="71" Y="7"/>
-        <UsageCount Value="162"/>
+        <UsageCount Value="166"/>
       </Unit68>
       <Unit69>
         <Filename Value="changepass.pas"/>
@@ -703,18 +713,22 @@
         <WindowIndex Value="0"/>
         <TopLine Value="3"/>
         <CursorPos X="88" Y="14"/>
-        <UsageCount Value="161"/>
+        <UsageCount Value="165"/>
       </Unit69>
       <Unit70>
         <Filename Value="permissionmanage.pas"/>
         <IsPartOfProject Value="True"/>
         <ComponentName Value="fmPermissionManage"/>
+        <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <UnitName Value="PermissionManage"/>
+        <EditorIndex Value="6"/>
         <WindowIndex Value="0"/>
         <TopLine Value="341"/>
-        <CursorPos X="54" Y="343"/>
-        <UsageCount Value="159"/>
+        <CursorPos X="17" Y="342"/>
+        <UsageCount Value="163"/>
+        <Loaded Value="True"/>
+        <LoadedDesigner Value="True"/>
       </Unit70>
       <Unit71>
         <Filename Value="sqlhistory.pas"/>
@@ -725,7 +739,7 @@
         <WindowIndex Value="0"/>
         <TopLine Value="1"/>
         <CursorPos X="35" Y="66"/>
-        <UsageCount Value="144"/>
+        <UsageCount Value="148"/>
       </Unit71>
       <Unit72>
         <Filename Value="../../lazarus/lazarus/lcl/include/menuitem.inc"/>
@@ -750,7 +764,7 @@
         <WindowIndex Value="0"/>
         <TopLine Value="18"/>
         <CursorPos X="1" Y="44"/>
-        <UsageCount Value="115"/>
+        <UsageCount Value="119"/>
       </Unit74>
       <Unit75>
         <Filename Value="/usr/lib/lazarus/0.9.30/lcl/comctrls.pp"/>
@@ -937,12 +951,16 @@
         <Filename Value="dbinfo.pas"/>
         <IsPartOfProject Value="True"/>
         <ComponentName Value="fmDBInfo"/>
+        <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <UnitName Value="dbInfo"/>
+        <EditorIndex Value="2"/>
         <WindowIndex Value="0"/>
-        <TopLine Value="20"/>
-        <CursorPos X="22" Y="41"/>
-        <UsageCount Value="83"/>
+        <TopLine Value="31"/>
+        <CursorPos X="19" Y="39"/>
+        <UsageCount Value="87"/>
+        <Loaded Value="True"/>
+        <LoadedDesigner Value="True"/>
       </Unit98>
       <Unit99>
         <Filename Value="../../FromInternet/fpc2.4/fpc-2.4.4/packages/ibase/src/ibase60dyn.pp"/>
@@ -971,13 +989,14 @@
         <Filename Value="comparison.pas"/>
         <IsPartOfProject Value="True"/>
         <ComponentName Value="fmComparison"/>
+        <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <UnitName Value="Comparison"/>
-        <EditorIndex Value="2"/>
+        <EditorIndex Value="4"/>
         <WindowIndex Value="0"/>
         <TopLine Value="666"/>
         <CursorPos X="3" Y="668"/>
-        <UsageCount Value="70"/>
+        <UsageCount Value="74"/>
         <Loaded Value="True"/>
         <LoadedDesigner Value="True"/>
       </Unit102>
@@ -1006,124 +1025,124 @@
     </Units>
     <JumpHistory Count="30" HistoryIndex="29">
       <Position1>
-        <Filename Value="querywindow.pas"/>
-        <Caret Line="240" Column="3" TopLine="238"/>
+        <Filename Value="newtable.pas"/>
+        <Caret Line="259" Column="7" TopLine="250"/>
       </Position1>
       <Position2>
-        <Filename Value="querywindow.pas"/>
-        <Caret Line="118" Column="26" TopLine="109"/>
+        <Filename Value="newtable.pas"/>
+        <Caret Line="41" Column="56" TopLine="28"/>
       </Position2>
       <Position3>
-        <Filename Value="querywindow.pas"/>
-        <Caret Line="241" Column="3" TopLine="239"/>
+        <Filename Value="newtable.pas"/>
+        <Caret Line="304" Column="15" TopLine="296"/>
       </Position3>
       <Position4>
-        <Filename Value="querywindow.pas"/>
-        <Caret Line="433" Column="24" TopLine="421"/>
+        <Filename Value="newtable.pas"/>
+        <Caret Line="1" Column="1" TopLine="1"/>
       </Position4>
       <Position5>
-        <Filename Value="querywindow.pas"/>
-        <Caret Line="110" Column="22" TopLine="89"/>
+        <Filename Value="newtable.pas"/>
+        <Caret Line="36" Column="34" TopLine="18"/>
       </Position5>
       <Position6>
-        <Filename Value="querywindow.pas"/>
-        <Caret Line="240" Column="3" TopLine="238"/>
+        <Filename Value="newtable.pas"/>
+        <Caret Line="121" Column="34" TopLine="103"/>
       </Position6>
       <Position7>
-        <Filename Value="querywindow.pas"/>
-        <Caret Line="561" Column="1" TopLine="549"/>
+        <Filename Value="newtable.pas"/>
+        <Caret Line="201" Column="48" TopLine="189"/>
       </Position7>
       <Position8>
-        <Filename Value="querywindow.pas"/>
-        <Caret Line="562" Column="28" TopLine="531"/>
+        <Filename Value="newtable.pas"/>
+        <Caret Line="204" Column="15" TopLine="190"/>
       </Position8>
       <Position9>
-        <Filename Value="comparison.pas"/>
-        <Caret Line="1009" Column="22" TopLine="993"/>
+        <Filename Value="newtable.pas"/>
+        <Caret Line="303" Column="15" TopLine="283"/>
       </Position9>
       <Position10>
-        <Filename Value="comparison.pas"/>
-        <Caret Line="468" Column="1" TopLine="451"/>
+        <Filename Value="newtable.pas"/>
+        <Caret Line="299" Column="36" TopLine="292"/>
       </Position10>
       <Position11>
-        <Filename Value="comparison.pas"/>
-        <Caret Line="703" Column="25" TopLine="693"/>
+        <Filename Value="newtable.pas"/>
+        <Caret Line="140" Column="3" TopLine="136"/>
       </Position11>
       <Position12>
-        <Filename Value="main.pas"/>
-        <Caret Line="1098" Column="1" TopLine="1061"/>
+        <Filename Value="newtable.pas"/>
+        <Caret Line="301" Column="32" TopLine="291"/>
       </Position12>
       <Position13>
-        <Filename Value="main.pas"/>
-        <Caret Line="1" Column="1" TopLine="1"/>
+        <Filename Value="newtable.pas"/>
+        <Caret Line="203" Column="8" TopLine="189"/>
       </Position13>
       <Position14>
-        <Filename Value="main.pas"/>
-        <Caret Line="699" Column="3" TopLine="697"/>
+        <Filename Value="newtable.pas"/>
+        <Caret Line="140" Column="1" TopLine="136"/>
       </Position14>
       <Position15>
-        <Filename Value="comparison.pas"/>
-        <Caret Line="720" Column="41" TopLine="699"/>
+        <Filename Value="newtable.pas"/>
+        <Caret Line="296" Column="22" TopLine="277"/>
       </Position15>
       <Position16>
-        <Filename Value="main.pas"/>
-        <Caret Line="699" Column="3" TopLine="697"/>
+        <Filename Value="newtable.pas"/>
+        <Caret Line="142" Column="23" TopLine="136"/>
       </Position16>
       <Position17>
-        <Filename Value="tablemanage.pas"/>
-        <Caret Line="406" Column="3" TopLine="402"/>
+        <Filename Value="newtable.pas"/>
+        <Caret Line="208" Column="53" TopLine="200"/>
       </Position17>
       <Position18>
-        <Filename Value="comparison.pas"/>
-        <Caret Line="706" Column="22" TopLine="701"/>
+        <Filename Value="newtable.pas"/>
+        <Caret Line="214" Column="9" TopLine="194"/>
       </Position18>
       <Position19>
-        <Filename Value="main.pas"/>
-        <Caret Line="699" Column="3" TopLine="697"/>
+        <Filename Value="newtable.pas"/>
+        <Caret Line="140" Column="3" TopLine="136"/>
       </Position19>
       <Position20>
-        <Filename Value="comparison.pas"/>
-        <Caret Line="1134" Column="32" TopLine="1131"/>
+        <Filename Value="newtable.pas"/>
+        <Caret Line="333" Column="3" TopLine="330"/>
       </Position20>
       <Position21>
-        <Filename Value="comparison.pas"/>
-        <Caret Line="1" Column="1" TopLine="1"/>
+        <Filename Value="newtable.pas"/>
+        <Caret Line="149" Column="9" TopLine="136"/>
       </Position21>
       <Position22>
-        <Filename Value="comparison.pas"/>
-        <Caret Line="99" Column="36" TopLine="71"/>
+        <Filename Value="newtable.pas"/>
+        <Caret Line="28" Column="15" TopLine="20"/>
       </Position22>
       <Position23>
-        <Filename Value="comparison.pas"/>
-        <Caret Line="279" Column="17" TopLine="257"/>
+        <Filename Value="newtable.pas"/>
+        <Caret Line="148" Column="5" TopLine="136"/>
       </Position23>
       <Position24>
-        <Filename Value="comparison.pas"/>
-        <Caret Line="1144" Column="6" TopLine="1134"/>
+        <Filename Value="newtable.pas"/>
+        <Caret Line="313" Column="1" TopLine="301"/>
       </Position24>
       <Position25>
-        <Filename Value="comparison.pas"/>
-        <Caret Line="1" Column="1" TopLine="1"/>
+        <Filename Value="newtable.pas"/>
+        <Caret Line="310" Column="18" TopLine="301"/>
       </Position25>
       <Position26>
-        <Filename Value="comparison.pas"/>
-        <Caret Line="652" Column="25" TopLine="633"/>
+        <Filename Value="newtable.pas"/>
+        <Caret Line="311" Column="18" TopLine="302"/>
       </Position26>
       <Position27>
         <Filename Value="newtable.pas"/>
-        <Caret Line="37" Column="31" TopLine="13"/>
+        <Caret Line="312" Column="18" TopLine="303"/>
       </Position27>
       <Position28>
         <Filename Value="newtable.pas"/>
-        <Caret Line="38" Column="38" TopLine="20"/>
+        <Caret Line="313" Column="18" TopLine="304"/>
       </Position28>
       <Position29>
         <Filename Value="newtable.pas"/>
-        <Caret Line="171" Column="1" TopLine="145"/>
+        <Caret Line="139" Column="108" TopLine="115"/>
       </Position29>
       <Position30>
         <Filename Value="newtable.pas"/>
-        <Caret Line="203" Column="27" TopLine="188"/>
+        <Caret Line="241" Column="3" TopLine="235"/>
       </Position30>
     </JumpHistory>
   </ProjectOptions>

+ 3 - 3
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      : 24.May.2012                                          }
+{  Last updated      : 22.Sep.2012                                          }
 {  License           : GPL for GUI, LGPL for Units                          }
 {***************************************************************************}
 
@@ -24,8 +24,8 @@ uses
   sysutils, Comparison;
 
 const
-  Version = '0.9.3';
-  VersionDate = '2010 - May 2012';
+  Version = '0.9.4';
+  VersionDate = '2010 - Sept 2012';
 {$IFDEF Unix}
 {$DEFINE extdecl:=cdecl}
     fbclib = 'libfbclient.' + sharedsuffix;

BIN
TurboBird.res


+ 28 - 6
dbinfo.lfm

@@ -18,7 +18,7 @@ object fmDBInfo: TfmDBInfo
     ParentColor = False
   end
   object edName: TEdit
-    Left = 136
+    Left = 144
     Height = 21
     Top = 33
     Width = 479
@@ -40,7 +40,7 @@ object fmDBInfo: TfmDBInfo
     ParentColor = False
   end
   object edODSVer: TEdit
-    Left = 136
+    Left = 144
     Height = 21
     Top = 69
     Width = 88
@@ -61,7 +61,7 @@ object fmDBInfo: TfmDBInfo
     ParentColor = False
   end
   object edCharset: TEdit
-    Left = 136
+    Left = 144
     Height = 21
     Top = 104
     Width = 88
@@ -82,7 +82,7 @@ object fmDBInfo: TfmDBInfo
     ParentColor = False
   end
   object edCreationDate: TEdit
-    Left = 136
+    Left = 144
     Height = 21
     Top = 136
     Width = 176
@@ -103,7 +103,7 @@ object fmDBInfo: TfmDBInfo
     ParentColor = False
   end
   object edPageSize: TEdit
-    Left = 136
+    Left = 144
     Height = 21
     Top = 168
     Width = 88
@@ -116,7 +116,7 @@ object fmDBInfo: TfmDBInfo
     Text = 'odsVersion'
   end
   object edDBSize: TEdit
-    Left = 136
+    Left = 144
     Height = 21
     Top = 200
     Width = 176
@@ -170,4 +170,26 @@ object fmDBInfo: TfmDBInfo
     ParentFont = False
     TabOrder = 7
   end
+  object edConnections: TEdit
+    Left = 144
+    Height = 21
+    Top = 231
+    Width = 112
+    AutoSelect = False
+    BorderStyle = bsNone
+    Font.Color = clNavy
+    ParentFont = False
+    ReadOnly = True
+    TabOrder = 8
+    Text = 'odsVersion'
+  end
+  object bbRefresh: TBitBtn
+    Left = 16
+    Height = 30
+    Top = 0
+    Width = 75
+    Caption = 'Refresh'
+    OnClick = bbRefreshClick
+    TabOrder = 9
+  end
 end

+ 10 - 0
dbinfo.pas

@@ -14,7 +14,9 @@ type
 
   TfmDBInfo = class(TForm)
     bbClose: TBitBtn;
+    bbRefresh: TBitBtn;
     edCreationDate: TEdit;
+    edConnections: TEdit;
     edPageSize: TEdit;
     edDBSize: TEdit;
     edName: TEdit;
@@ -29,6 +31,7 @@ type
     Label7: TLabel;
     meClients: TMemo;
     procedure bbCloseClick(Sender: TObject);
+    procedure bbRefreshClick(Sender: TObject);
     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
   private
     { private declarations }
@@ -45,12 +48,19 @@ implementation
 
 { TfmDBInfo }
 
+uses Main;
+
 procedure TfmDBInfo.bbCloseClick(Sender: TObject);
 begin
   Close;
   Parent.Free;
 end;
 
+procedure TfmDBInfo.bbRefreshClick(Sender: TObject);
+begin
+  fmMain.lmDBIndoClick(nil);
+end;
+
 procedure TfmDBInfo.FormClose(Sender: TObject; var CloseAction: TCloseAction);
 begin
   CloseAction:= caFree;

+ 6 - 5
edittable.lfm

@@ -17,8 +17,8 @@ object fmEditTable: TfmEditTable
     Top = 0
     Width = 568
     Align = alTop
-    ClientHeight = 46
-    ClientWidth = 564
+    ClientHeight = 50
+    ClientWidth = 568
     ParentColor = False
     TabOrder = 0
     OnClick = Panel1Click
@@ -52,10 +52,11 @@ object fmEditTable: TfmEditTable
       ChildSizing.ShrinkVertical = crsScaleChilds
       ChildSizing.Layout = cclLeftToRightThenTopToBottom
       ChildSizing.ControlsPerLine = 100
-      ClientHeight = 21
-      ClientWidth = 237
+      ClientHeight = 25
+      ClientWidth = 241
       Color = 14539471
       DataSource = Datasource1
+      Options = []
       ParentColor = False
       TabOrder = 0
     end
@@ -91,9 +92,9 @@ object fmEditTable: TfmEditTable
     top = 48
   end
   object sqEditTable: TSQLQuery
+    FieldDefs = <>
     AutoCalcFields = False
     AfterScroll = sqEditTableAfterScroll
-    ReadOnly = False
     Params = <>
     left = 357
     top = 20

+ 18 - 18
edittable.lrs

@@ -6,8 +6,8 @@ LazarusResources.Add('TfmEditTable','FORMDATA',[
   +'tTable'#12'ClientHeight'#3','#1#11'ClientWidth'#3'8'#2#7'OnClose'#7#9'FormC'
   +'lose'#8'OnCreate'#7#10'FormCreate'#8'Position'#7#14'poScreenCenter'#10'LCLV'
   +'ersion'#6#6'0.9.31'#0#6'TPanel'#6'Panel1'#4'Left'#2#0#6'Height'#2'2'#3'Top'
-  +#2#0#5'Width'#3'8'#2#5'Align'#7#5'alTop'#12'ClientHeight'#2'.'#11'ClientWidt'
-  +'h'#3'4'#2#11'ParentColor'#8#8'TabOrder'#2#0#7'OnClick'#7#11'Panel1Click'#0#6
+  +#2#0#5'Width'#3'8'#2#5'Align'#7#5'alTop'#12'ClientHeight'#2'2'#11'ClientWidt'
+  +'h'#3'8'#2#11'ParentColor'#8#8'TabOrder'#2#0#7'OnClick'#7#11'Panel1Click'#0#6
   +'TLabel'#6'Label1'#4'Left'#3#2#1#6'Height'#2#18#3'Top'#2#27#5'Width'#2'>'#7
   +'Caption'#6#8'Record #'#11'ParentColor'#8#0#0#6'TLabel'#5'laPos'#4'Left'#3'F'
   +#1#6'Height'#2#18#3'Top'#2#27#5'Width'#2#9#7'Caption'#6#1'0'#10'Font.Color'#4
@@ -17,20 +17,20 @@ LazarusResources.Add('TfmEditTable','FORMDATA',[
   +'hildSizing.EnlargeVertical'#7#14'crsScaleChilds'#28'ChildSizing.ShrinkHoriz'
   +'ontal'#7#14'crsScaleChilds'#26'ChildSizing.ShrinkVertical'#7#14'crsScaleChi'
   +'lds'#18'ChildSizing.Layout'#7#29'cclLeftToRightThenTopToBottom'#27'ChildSiz'
-  +'ing.ControlsPerLine'#2'd'#12'ClientHeight'#2#21#11'ClientWidth'#3#237#0#5'C'
-  +'olor'#4#207#218#221#0#10'DataSource'#7#11'Datasource1'#11'ParentColor'#8#8
-  +'TabOrder'#2#0#0#0#7'TBitBtn'#6'bbSave'#4'Left'#3#224#1#6'Height'#2#30#3'Top'
-  +#2#15#5'Width'#2'K'#7'Caption'#6#4'Save'#7'OnClick'#7#11'bbSaveClick'#8'TabO'
-  +'rder'#2#1#0#0#0#7'TDBGrid'#7'DBGrid1'#4'Left'#2#0#6'Height'#3#250#0#3'Top'#2
-  +'2'#5'Width'#3'8'#2#5'Align'#7#8'alClient'#5'Color'#7#8'clWindow'#7'Columns'
-  +#14#0#10'DataSource'#7#11'Datasource1'#10'FixedColor'#4#207#218#221#0#7'Opti'
-  +'ons'#11#9'dgEditing'#8'dgTitles'#11'dgIndicator'#14'dgColumnResize'#12'dgCo'
-  +'lumnMove'#10'dgColLines'#10'dgRowLines'#6'dgTabs'#21'dgAlwaysShowSelection'
-  +#15'dgConfirmDelete'#14'dgCancelOnExit'#19'dgHeaderHotTracking'#18'dgHeaderP'
-  +'ushedLook'#17'dgAutoSizeColumns'#0#10'Scrollbars'#7#10'ssAutoBoth'#8'TabOrd'
-  +'er'#2#1#10'TitleStyle'#7#8'tsNative'#12'OnTitleClick'#7#17'DBGrid1TitleClic'
-  +'k'#0#0#11'TDatasource'#11'Datasource1'#7'DataSet'#7#11'sqEditTable'#4'left'
-  +#3#216#1#3'top'#2'0'#0#0#9'TSQLQuery'#11'sqEditTable'#14'AutoCalcFields'#8#11
-  +'AfterScroll'#7#22'sqEditTableAfterScroll'#8'ReadOnly'#8#6'Params'#14#0#4'le'
-  +'ft'#3'e'#1#3'top'#2#20#0#0#0
+  +'ing.ControlsPerLine'#2'd'#12'ClientHeight'#2#25#11'ClientWidth'#3#241#0#5'C'
+  +'olor'#4#207#218#221#0#10'DataSource'#7#11'Datasource1'#7'Options'#11#0#11'P'
+  +'arentColor'#8#8'TabOrder'#2#0#0#0#7'TBitBtn'#6'bbSave'#4'Left'#3#224#1#6'He'
+  +'ight'#2#30#3'Top'#2#15#5'Width'#2'K'#7'Caption'#6#4'Save'#7'OnClick'#7#11'b'
+  +'bSaveClick'#8'TabOrder'#2#1#0#0#0#7'TDBGrid'#7'DBGrid1'#4'Left'#2#0#6'Heigh'
+  +'t'#3#250#0#3'Top'#2'2'#5'Width'#3'8'#2#5'Align'#7#8'alClient'#5'Color'#7#8
+  +'clWindow'#7'Columns'#14#0#10'DataSource'#7#11'Datasource1'#10'FixedColor'#4
+  +#207#218#221#0#7'Options'#11#9'dgEditing'#8'dgTitles'#11'dgIndicator'#14'dgC'
+  +'olumnResize'#12'dgColumnMove'#10'dgColLines'#10'dgRowLines'#6'dgTabs'#21'dg'
+  +'AlwaysShowSelection'#15'dgConfirmDelete'#14'dgCancelOnExit'#19'dgHeaderHotT'
+  +'racking'#18'dgHeaderPushedLook'#17'dgAutoSizeColumns'#0#10'Scrollbars'#7#10
+  +'ssAutoBoth'#8'TabOrder'#2#1#10'TitleStyle'#7#8'tsNative'#12'OnTitleClick'#7
+  +#17'DBGrid1TitleClick'#0#0#11'TDatasource'#11'Datasource1'#7'DataSet'#7#11's'
+  +'qEditTable'#4'left'#3#216#1#3'top'#2'0'#0#0#9'TSQLQuery'#11'sqEditTable'#9
+  +'FieldDefs'#14#0#14'AutoCalcFields'#8#11'AfterScroll'#7#22'sqEditTableAfterS'
+  +'croll'#6'Params'#14#0#4'left'#3'e'#1#3'top'#2#20#0#0#0
 ]);

+ 2 - 2
edittable.pas

@@ -84,10 +84,10 @@ end;
 
 procedure TfmEditTable.DBGrid1TitleClick(Column: TColumn);
 begin
- if sqEditTable.IndexFieldNames = Column.Field.FieldName then
+{ if sqEditTable.IndexFieldNames = Column.Field.FieldName then
    sqEditTable.IndexFieldNames := Column.Field.FieldName //+ 'DESC'
  else
-   sqEditTable.IndexFieldNames := Column.Field.FieldName
+   sqEditTable.IndexFieldNames := Column.Field.FieldName}
 end;
 
 procedure TfmEditTable.sqEditTableAfterScroll(DataSet: TDataSet);

+ 1 - 0
main.pas

@@ -447,6 +447,7 @@ begin
     edCharset.Text:= ACharSet;
     edCreationDate.Text:= CreationDate;
     edPageSize.Text:= IntToStr(PageSize);
+    edConnections.Text:= IntToStr(ProcessList.Count);
     dbSize:= Pages * PageSize;
     if dbSize > 1000000000 then
     begin

+ 65 - 14
newtable.lfm

@@ -1,15 +1,15 @@
 object fmNewTable: TfmNewTable
-  Left = 532
-  Height = 535
-  Top = 302
+  Left = 535
+  Height = 564
+  Top = 192
   Width = 594
   ActiveControl = edNewTable
   Caption = 'New Table'
-  ClientHeight = 535
+  ClientHeight = 564
   ClientWidth = 594
   OnClose = FormClose
   Position = poScreenCenter
-  LCLVersion = '0.9.31'
+  LCLVersion = '1.0.1.3'
   object Label1: TLabel
     Left = 18
     Height = 15
@@ -25,11 +25,12 @@ object fmNewTable: TfmNewTable
     Height = 27
     Top = 28
     Width = 153
+    OnKeyUp = edNewTableKeyUp
     TabOrder = 0
   end
   object StringGrid1: TStringGrid
-    Left = 19
-    Height = 374
+    Left = 18
+    Height = 403
     Top = 59
     Width = 573
     Anchors = [akTop, akLeft, akRight, akBottom]
@@ -63,7 +64,7 @@ object fmNewTable: TfmNewTable
       end>
     FixedColor = 14539471
     FixedCols = 0
-    Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goEditing, goSmoothScroll]
+    Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goEditing, goTabs, goAlwaysShowEditor, goSmoothScroll]
     RowCount = 3
     TabOrder = 1
     OnEditingDone = StringGrid1PickListSelect
@@ -72,9 +73,9 @@ object fmNewTable: TfmNewTable
     OnPickListSelect = StringGrid1PickListSelect
   end
   object BitBtn2: TBitBtn
-    Left = 472
+    Left = 448
     Height = 32
-    Top = 488
+    Top = 529
     Width = 96
     Anchors = [akLeft, akBottom]
     Cancel = True
@@ -86,14 +87,13 @@ object fmNewTable: TfmNewTable
     TabOrder = 2
   end
   object bbScript: TBitBtn
-    Left = 19
+    Left = 18
     Height = 32
-    Top = 488
+    Top = 529
     Width = 118
     Anchors = [akLeft, akBottom]
     Caption = 'Script'
     Color = 16249563
-    Default = True
     Kind = bkYes
     OnClick = bbScriptClick
     TabOrder = 3
@@ -101,7 +101,7 @@ object fmNewTable: TfmNewTable
   object cxCreateGen: TCheckBox
     Left = 18
     Height = 24
-    Top = 447
+    Top = 473
     Width = 328
     Anchors = [akLeft, akBottom]
     Caption = 'Create Auto increment Generator and Trigger'
@@ -120,4 +120,55 @@ object fmNewTable: TfmNewTable
     ParentFont = False
     TabOrder = 5
   end
+  object cxGrantPermission: TCheckBox
+    Left = 18
+    Height = 24
+    Top = 501
+    Width = 64
+    Anchors = [akLeft, akBottom]
+    Caption = 'Grant'
+    TabOrder = 6
+  end
+  object cbPermission: TComboBox
+    Left = 96
+    Height = 27
+    Top = 498
+    Width = 145
+    Anchors = [akLeft, akBottom]
+    ItemHeight = 0
+    ItemIndex = 0
+    Items.Strings = (
+      'Full'
+      'Modify '
+      'Read'
+    )
+    Style = csDropDownList
+    TabOrder = 7
+    Text = 'Full'
+  end
+  object Label2: TLabel
+    Left = 256
+    Height = 18
+    Top = 507
+    Width = 16
+    Anchors = [akLeft, akBottom]
+    Caption = 'to'
+    ParentColor = False
+  end
+  object cbRolesUsers: TComboBox
+    Left = 296
+    Height = 29
+    Top = 496
+    Width = 161
+    Anchors = [akLeft, akBottom]
+    ItemHeight = 0
+    ItemIndex = 0
+    Items.Strings = (
+      'Full'
+      'Read '
+      'Insert'
+    )
+    TabOrder = 8
+    Text = 'Full'
+  end
 end

+ 42 - 30
newtable.lrs

@@ -1,38 +1,50 @@
 { This is an automatically generated lazarus resource file }
 
 LazarusResources.Add('TfmNewTable','FORMDATA',[
-  'TPF0'#11'TfmNewTable'#10'fmNewTable'#4'Left'#3#20#2#6'Height'#3#23#2#3'Top'#3
-  +'.'#1#5'Width'#3'R'#2#13'ActiveControl'#7#10'edNewTable'#7'Caption'#6#9'New '
-  +'Table'#12'ClientHeight'#3#23#2#11'ClientWidth'#3'R'#2#7'OnClose'#7#9'FormCl'
-  +'ose'#8'Position'#7#14'poScreenCenter'#10'LCLVersion'#6#6'0.9.31'#0#6'TLabel'
-  +#6'Label1'#4'Left'#2#18#6'Height'#2#15#3'Top'#2#9#5'Width'#2'T'#7'Caption'#6
-  +#14'New Table name'#11'Font.Height'#2#245#11'ParentColor'#8#10'ParentFont'#8
-  +#0#0#5'TEdit'#10'edNewTable'#4'Left'#2#18#6'Height'#2#27#3'Top'#2#28#5'Width'
-  +#3#153#0#8'TabOrder'#2#0#0#0#11'TStringGrid'#11'StringGrid1'#4'Left'#2#19#6
-  +'Height'#3'v'#1#3'Top'#2';'#5'Width'#3'='#2#7'Anchors'#11#5'akTop'#6'akLeft'
-  +#7'akRight'#8'akBottom'#0#8'ColCount'#2#6#7'Columns'#14#1#13'Title.Caption'#6
-  +#10'Field Name'#5'Width'#2'd'#0#1#13'Title.Caption'#6#9'Data Type'#5'Width'#2
-  +'x'#0#1#13'Title.Caption'#6#4'Size'#0#1#11'ButtonStyle'#7#17'cbsCheckboxColu'
-  +'mn'#13'Title.Caption'#6#10'Allow Null'#5'Width'#2'Z'#0#1#11'ButtonStyle'#7
-  +#17'cbsCheckboxColumn'#13'Title.Caption'#6#5'P-Key'#11'Title.Color'#4#219#216
-  +#174#0#16'Title.Font.Color'#4#12#8#253#0#0#1#13'Title.Caption'#6#13'Default '
-  +'Value'#5'Width'#2'x'#0#0#10'FixedColor'#4#207#218#221#0#9'FixedCols'#2#0#7
-  +'Options'#11#15'goFixedVertLine'#15'goFixedHorzLine'#10'goVertLine'#10'goHor'
-  +'zLine'#13'goRangeSelect'#9'goEditing'#14'goSmoothScroll'#0#8'RowCount'#2#3#8
+  'TPF0'#11'TfmNewTable'#10'fmNewTable'#4'Left'#3#23#2#6'Height'#3'4'#2#3'Top'#3
+  +#192#0#5'Width'#3'R'#2#13'ActiveControl'#7#10'edNewTable'#7'Caption'#6#9'New'
+  +' Table'#12'ClientHeight'#3'4'#2#11'ClientWidth'#3'R'#2#7'OnClose'#7#9'FormC'
+  +'lose'#8'Position'#7#14'poScreenCenter'#10'LCLVersion'#6#7'1.0.1.3'#0#6'TLab'
+  +'el'#6'Label1'#4'Left'#2#18#6'Height'#2#15#3'Top'#2#9#5'Width'#2'T'#7'Captio'
+  +'n'#6#14'New Table name'#11'Font.Height'#2#245#11'ParentColor'#8#10'ParentFo'
+  +'nt'#8#0#0#5'TEdit'#10'edNewTable'#4'Left'#2#18#6'Height'#2#27#3'Top'#2#28#5
+  +'Width'#3#153#0#7'OnKeyUp'#7#15'edNewTableKeyUp'#8'TabOrder'#2#0#0#0#11'TStr'
+  +'ingGrid'#11'StringGrid1'#4'Left'#2#18#6'Height'#3#147#1#3'Top'#2';'#5'Width'
+  +#3'='#2#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#8'ColCount'
+  +#2#6#7'Columns'#14#1#13'Title.Caption'#6#10'Field Name'#5'Width'#2'd'#0#1#13
+  +'Title.Caption'#6#9'Data Type'#5'Width'#2'x'#0#1#13'Title.Caption'#6#4'Size'
+  +#0#1#11'ButtonStyle'#7#17'cbsCheckboxColumn'#13'Title.Caption'#6#10'Allow Nu'
+  +'ll'#5'Width'#2'Z'#0#1#11'ButtonStyle'#7#17'cbsCheckboxColumn'#13'Title.Capt'
+  +'ion'#6#5'P-Key'#11'Title.Color'#4#219#216#174#0#16'Title.Font.Color'#4#12#8
+  +#253#0#0#1#13'Title.Caption'#6#13'Default Value'#5'Width'#2'x'#0#0#10'FixedC'
+  +'olor'#4#207#218#221#0#9'FixedCols'#2#0#7'Options'#11#15'goFixedVertLine'#15
+  +'goFixedHorzLine'#10'goVertLine'#10'goHorzLine'#13'goRangeSelect'#9'goEditin'
+  +'g'#6'goTabs'#18'goAlwaysShowEditor'#14'goSmoothScroll'#0#8'RowCount'#2#3#8
   +'TabOrder'#2#1#13'OnEditingDone'#7#25'StringGrid1PickListSelect'#7'OnKeyUp'#7
   +#16'StringGrid1KeyUp'#9'OnMouseUp'#7#18'StringGrid1MouseUp'#16'OnPickListSel'
-  +'ect'#7#25'StringGrid1PickListSelect'#0#0#7'TBitBtn'#7'BitBtn2'#4'Left'#3#216
-  +#1#6'Height'#2' '#3'Top'#3#232#1#5'Width'#2'`'#7'Anchors'#11#6'akLeft'#8'akB'
-  +'ottom'#0#6'Cancel'#9#7'Caption'#6#6'Cancel'#5'Color'#4#219#242#247#0#4'Kind'
+  +'ect'#7#25'StringGrid1PickListSelect'#0#0#7'TBitBtn'#7'BitBtn2'#4'Left'#3#192
+  +#1#6'Height'#2' '#3'Top'#3#17#2#5'Width'#2'`'#7'Anchors'#11#6'akLeft'#8'akBo'
+  +'ttom'#0#6'Cancel'#9#7'Caption'#6#6'Cancel'#5'Color'#4#219#242#247#0#4'Kind'
   +#7#8'bkCancel'#11'ModalResult'#2#2#7'OnClick'#7#12'BitBtn2Click'#8'TabOrder'
-  +#2#2#0#0#7'TBitBtn'#8'bbScript'#4'Left'#2#19#6'Height'#2' '#3'Top'#3#232#1#5
+  +#2#2#0#0#7'TBitBtn'#8'bbScript'#4'Left'#2#18#6'Height'#2' '#3'Top'#3#17#2#5
   +'Width'#2'v'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Caption'#6#6'Script'#5
-  +'Color'#4#219#242#247#0#7'Default'#9#4'Kind'#7#5'bkYes'#7'OnClick'#7#13'bbSc'
-  +'riptClick'#8'TabOrder'#2#3#0#0#9'TCheckBox'#11'cxCreateGen'#4'Left'#2#18#6
-  +'Height'#2#24#3'Top'#3#191#1#5'Width'#3'H'#1#7'Anchors'#11#6'akLeft'#8'akBot'
-  +'tom'#0#7'Caption'#6'+Create Auto increment Generator and Trigger'#8'TabOrde'
-  +'r'#2#4#0#0#7'TBitBtn'#7'bbClose'#4'Left'#3'0'#2#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'Colo'
-  +'r'#4#219#242#247#0#10'Font.Style'#11#6'fsBold'#0#7'OnClick'#7#12'bbCloseCli'
-  +'ck'#10'ParentFont'#8#8'TabOrder'#2#5#0#0#0
+  +'Color'#4#219#242#247#0#4'Kind'#7#5'bkYes'#7'OnClick'#7#13'bbScriptClick'#8
+  +'TabOrder'#2#3#0#0#9'TCheckBox'#11'cxCreateGen'#4'Left'#2#18#6'Height'#2#24#3
+  +'Top'#3#217#1#5'Width'#3'H'#1#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Captio'
+  +'n'#6'+Create Auto increment Generator and Trigger'#8'TabOrder'#2#4#0#0#7'TB'
+  +'itBtn'#7'bbClose'#4'Left'#3'0'#2#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#5#0#0#9'TCheckBox'#17'cxGrantPermission'#4'Left'#2#18
+  +#6'Height'#2#24#3'Top'#3#245#1#5'Width'#2'@'#7'Anchors'#11#6'akLeft'#8'akBot'
+  +'tom'#0#7'Caption'#6#5'Grant'#8'TabOrder'#2#6#0#0#9'TComboBox'#12'cbPermissi'
+  +'on'#4'Left'#2'`'#6'Height'#2#27#3'Top'#3#242#1#5'Width'#3#145#0#7'Anchors'
+  +#11#6'akLeft'#8'akBottom'#0#10'ItemHeight'#2#0#9'ItemIndex'#2#0#13'Items.Str'
+  +'ings'#1#6#4'Full'#6#7'Modify '#6#4'Read'#0#5'Style'#7#14'csDropDownList'#8
+  +'TabOrder'#2#7#4'Text'#6#4'Full'#0#0#6'TLabel'#6'Label2'#4'Left'#3#0#1#6'Hei'
+  +'ght'#2#18#3'Top'#3#251#1#5'Width'#2#16#7'Anchors'#11#6'akLeft'#8'akBottom'#0
+  +#7'Caption'#6#2'to'#11'ParentColor'#8#0#0#9'TComboBox'#12'cbRolesUsers'#4'Le'
+  +'ft'#3'('#1#6'Height'#2#29#3'Top'#3#240#1#5'Width'#3#161#0#7'Anchors'#11#6'a'
+  +'kLeft'#8'akBottom'#0#10'ItemHeight'#2#0#9'ItemIndex'#2#0#13'Items.Strings'#1
+  +#6#4'Full'#6#5'Read '#6#6'Insert'#0#8'TabOrder'#2#8#4'Text'#6#4'Full'#0#0#0
 ]);

+ 100 - 14
newtable.pas

@@ -17,13 +17,18 @@ type
     bbClose: TBitBtn;
     bbScript: TBitBtn;
     BitBtn2: TBitBtn;
+    cbPermission: TComboBox;
+    cbRolesUsers: TComboBox;
+    cxGrantPermission: TCheckBox;
     cxCreateGen: TCheckBox;
     edNewTable: TEdit;
     Label1: TLabel;
+    Label2: TLabel;
     StringGrid1: TStringGrid;
     procedure bbCloseClick(Sender: TObject);
     procedure bbScriptClick(Sender: TObject);
     procedure BitBtn2Click(Sender: TObject);
+    procedure edNewTableKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
     procedure StringGrid1KeyUp(Sender: TObject; var Key: Word;
       Shift: TShiftState);
@@ -36,6 +41,7 @@ type
     fdbIndex: Integer;
     function Validate: Boolean;
     function GetFieldsCount: Integer;
+    function GetClosestType(ATypePart: string): string;
     { private declarations }
   public
     { public declarations }
@@ -103,7 +109,18 @@ begin
     Delete(PKey, Length(PKey), 1);
     Result:= Result + ', ' + #10 + ' constraint ' + edNewTable.Text + '_pk_1 primary key (' + PKey + ') ' + #10;
   end;
-  Result:= Result + ');';
+  Result:= Result + ');' + #10;
+
+  // Permission
+  if cxGrantPermission.Checked then
+  begin
+    case cbPermission.ItemIndex of
+      0: Result:= Result + 'grant All on ' + edNewTable.Text + ' to ' + cbRolesUsers.Text + ';';
+      1: Result:= Result + 'grant Select, insert, update, references on ' + edNewTable.Text + ' to ' + cbRolesUsers.Text + ';';
+      2: Result:= Result + 'grant Select, references on ' + edNewTable.Text + ' to ' + cbRolesUsers.Text + ';';
+    end;
+
+  end;
 end;
 
 procedure TfmNewTable.Init(dbIndex: Integer);
@@ -129,16 +146,24 @@ begin
     StringGrid1.Cells[3, i]:= '1';
     StringGrid1.Cells[4, i]:= '0';
   end;
+
+  cbRolesUsers.Items.CommaText:= StringReplace(dmSysTables.GetDBUsers(fdbIndex), '<R>', '', [rfReplaceAll]);
 end;
 
 procedure TfmNewTable.StringGrid1PickListSelect(Sender: TObject);
 var
   SelType: string;
 begin
-  if (StringGrid1.Col = 1) then
+  with StringGrid1 do
+  if (Col = 1) then
   begin
-    SelType:= StringGrid1.Cells[1, StringGrid1.Row];
-    StringGrid1.Cells[2, StringGrid1.Row]:= IntToStr(dmSysTables.GetDefaultTypeSize(fdbIndex, SelType));
+    SelType:= Cells[1, Row];
+    SelType:= GetClosestType(SelType);
+    if SelType <> '' then
+    begin
+      Cells[1, Row]:= SelType;
+      Cells[2, Row]:= IntToStr(dmSysTables.GetDefaultTypeSize(fdbIndex, SelType));
+    end;
   end;
 end;
 
@@ -184,6 +209,39 @@ begin
 
 end;
 
+function TfmNewTable.GetClosestType(ATypePart: string): string;
+var
+  i: Integer;
+begin
+  Result:= '';
+  ATypePart:= UpperCase(ATypePart);
+  with StringGrid1 do
+  if Columns[1].PickList.IndexOf(ATypePart) <> -1 then
+    Result:= ATypePart
+  else
+  begin
+    for i:= 0 to Columns[1].PickList.Count -1 do
+    begin
+      if Pos(ATypePart, UpperCase(Columns[1].PickList[i])) = 1 then
+      begin
+        Result:= Columns[1].PickList[i];
+        Break;
+      end;
+    end;
+
+    if Result = '' then
+    for i:= 0 to Columns[1].PickList.Count -1 do
+    begin
+      if Pos(ATypePart, UpperCase(Columns[1].PickList[i])) > 0 then
+      begin
+        Result:= Columns[1].PickList[i];
+        Break;
+      end;
+    end;
+
+  end;
+end;
+
 
 procedure TfmNewTable.bbScriptClick(Sender: TObject);
 var
@@ -223,6 +281,13 @@ begin
   bbCloseClick(nil);
 end;
 
+procedure TfmNewTable.edNewTableKeyUp(Sender: TObject; var Key: Word;
+  Shift: TShiftState);
+begin
+  if key = 13 then
+    StringGrid1.SetFocus;
+end;
+
 procedure TfmNewTable.bbCloseClick(Sender: TObject);
 begin
   Close;
@@ -237,24 +302,45 @@ end;
 
 procedure TfmNewTable.StringGrid1KeyUp(Sender: TObject; var Key: Word;
   Shift: TShiftState);
+var
+  aType: string;
 begin
+  with StringGrid1 do
   if Key = 40 then // Key down
-    if Trim(StringGrid1.Cells[0, StringGrid1.RowCount - 1]) <> '' then
-    begin
-      StringGrid1.RowCount:= StringGrid1.RowCount + 1;
-      StringGrid1.Row:= StringGrid1.RowCount - 1;
-      StringGrid1.Cells[3, StringGrid1.Row]:= '1';
-      StringGrid1.Cells[4, StringGrid1.Row]:= '0';
-    end;
+  if Trim(Cells[0, RowCount - 1]) <> '' then
+  begin
+    RowCount:= RowCount + 1;
+    Row:= RowCount - 1;
+    Cells[3, Row]:= '1';
+    Cells[4, Row]:= '0';
+  end
+  else
   if Key = 45 then // Insert
   begin
-    StringGrid1.InsertColRow(False, StringGrid1.Row);
+    InsertColRow(False, Row);
   end
   else
   if Key = 46 then // Delete
   begin
-    if StringGrid1.RowCount > 1 then
-      StringGrid1.DeleteColRow(False, StringGrid1.Row);
+    if RowCount > 1 then
+      DeleteColRow(False, Row);
+  end
+  else
+  if key = 13 then // Enter
+  begin
+    if (Row + 1 = RowCount) and (Col > 1) then
+    begin
+      RowCount:= RowCount + 1;
+      Col:= 0;
+      Row:= Row + 1;
+    end
+    else
+    if Col > 1 then
+    begin
+      Col:= 0;
+      Row:= Row + 1;
+    end;
+    Key:= 0;
   end;
 end;
 

+ 6 - 4
permissionmanage.lfm

@@ -8,7 +8,7 @@ object fmPermissionManage: TfmPermissionManage
   ClientWidth = 518
   OnClose = FormClose
   Position = poScreenCenter
-  LCLVersion = '0.9.31'
+  LCLVersion = '1.0.1.3'
   object PageControl1: TPageControl
     Left = 0
     Height = 368
@@ -160,7 +160,8 @@ object fmPermissionManage: TfmPermissionManage
         Left = 318
         Height = 24
         Top = 34
-        Width = 47
+        Width = 58
+        AutoSize = False
         Caption = 'All'
         Font.Style = [fsBold]
         ParentFont = False
@@ -169,8 +170,9 @@ object fmPermissionManage: TfmPermissionManage
       object cxAllGrant: TCheckBox
         Left = 345
         Height = 24
-        Top = 49
-        Width = 104
+        Top = 51
+        Width = 110
+        AutoSize = False
         Caption = 'With Grant'
         Font.Style = [fsBold]
         ParentFont = False

+ 81 - 81
permissionmanage.lrs

@@ -4,8 +4,8 @@ LazarusResources.Add('TfmPermissionManage','FORMDATA',[
   'TPF0'#19'TfmPermissionManage'#18'fmPermissionManage'#4'Left'#3#218#1#6'Heigh'
   +'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
+  +#8'Position'#7#14'poScreenCenter'#10'LCLVersion'#6#7'1.0.1.3'#0#12'TPageCont'
+  +'rol'#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'
@@ -39,83 +39,83 @@ LazarusResources.Add('TfmPermissionManage','FORMDATA',[
   +'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
-  +#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#232#1#6'Height'#2#24#3'Top'#2
-  +#255#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'bbClos'
-  +'eClick'#10'ParentFont'#8#8'TabOrder'#2#1#0#0#0
+  +'ft'#3'>'#1#6'Height'#2#24#3'Top'#2'"'#5'Width'#2':'#8'AutoSize'#8#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#24#3'Top'#2'3'#5'Wid'
+  +'th'#2'n'#8'AutoSize'#8#7'Caption'#6#10'With Grant'#10'Font.Style'#11#6'fsBo'
+  +'ld'#0#10'ParentFont'#8#8'TabOrder'#2#14#0#0#0#9'TTabSheet'#7'tsViews'#7'Cap'
+  +'tion'#6#5'Views'#12'ClientHeight'#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'ParentColor'#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'OnChang'
+  +'e'#7#18'cbViewsUsersChange'#8'TabOrder'#2#0#0#0#6'TLabel'#6'Label9'#4'Left'
+  +#2#14#6'Height'#2#18#3'Top'#2'_'#5'Width'#2'"'#7'Caption'#6#4'View'#11'Paren'
+  +'tColor'#8#0#0#9'TComboBox'#7'cbViews'#4'Left'#2#18#6'Height'#2#31#3'Top'#2
+  +'|'#5'Width'#3#220#0#10'ItemHeight'#2#0#8'OnChange'#7#13'cbViewsChange'#5'St'
+  +'yle'#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'bbApp'
+  +'lyViewClick'#8'TabOrder'#2#2#0#0#6'TLabel'#7'Label10'#4'Left'#3'6'#1#6'Heig'
+  +'ht'#2#18#3'Top'#2#10#5'Width'#2'S'#7'Caption'#6#11'Permissions'#11'ParentCo'
+  +'lor'#8#0#0#9'TCheckBox'#9'cxViewAll'#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'Paren'
+  +'tFont'#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'Width'#2'c'#7'Caption'#6#10'With Grant'#10'Fon'
+  +'t.Style'#11#6'fsBold'#0#10'ParentFont'#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'Cap'
+  +'tion'#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'TCheckBox'#12'cxViewInsert'#4'Left'#3'>'#1#6'H'
+  +'eight'#2#24#3'Top'#3#138#0#5'Width'#2'A'#7'Caption'#6#6'Insert'#8'TabOrder'
+  +#2#7#0#0#9'TCheckBox'#17'cxViewInsertGrant'#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'Update'#8'TabOrder'#2#9#0#0#9'TCheckBox'#17'cxVi'
+  +'ewUpdateGrant'#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'TCheckBox'#12'cxViewDelete'
+  +#4'Left'#3'='#1#6'Height'#2#24#3'Top'#3#236#0#5'Width'#2'F'#7'Caption'#6#6'D'
+  +'elete'#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'TCheckBox'#16'cxViewReferences'#4'Left'#3'>'#1#6'Heigh'
+  +'t'#2#24#3'Top'#3#31#1#5'Width'#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'tsProcedures'#7'Caption'#6#10'Procedures'#12'ClientHe'
+  +'ight'#3'Q'#1#11'ClientWidth'#3#236#1#0#6'TLabel'#6'Label4'#4'Left'#2#12#6'H'
+  +'eight'#2#18#3'Top'#2#10#5'Width'#2'C'#7'Caption'#6#9'User/Role'#11'ParentCo'
+  +'lor'#8#0#0#9'TComboBox'#11'cbProcUsers'#4'Left'#2#18#6'Height'#2#29#3'Top'#2
+  +'"'#5'Width'#3#196#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'TC'
+  +'heckListBox'#13'clbProcedures'#4'Left'#3#246#0#6'Height'#3#1#1#3'Top'#2''''
+  +#5'Width'#3#211#0#7'Anchors'#11#5'akTop'#6'akLeft'#8'akBottom'#0#10'ItemHeig'
+  +'ht'#2#0#7'OnClick'#7#18'clbProceduresClick'#7'OnKeyUp'#7#18'clbProceduresKe'
+  +'yUp'#8'TabOrder'#2#1#8'TopIndex'#2#255#0#0#7'TBitBtn'#11'bbApplyProc'#4'Lef'
+  +'t'#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'bbApply'
+  +'ProcClick'#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'akBott'
+  +'om'#0#7'Caption'#6#10'With Grant'#8'OnChange'#7#17'cxProcGrantChange'#8'Tab'
+  +'Order'#2#3#0#0#0#9'TTabSheet'#7'tsRoles'#7'Caption'#6#5'Roles'#12'ClientHei'
+  +'ght'#3'Q'#1#11'ClientWidth'#3#236#1#0#6'TLabel'#6'Label6'#4'Left'#2#12#6'He'
+  +'ight'#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#188#0#10'ItemHeight'#2#0#8'OnChange'#7#17'cbRolesUserChange'#8'Tab'
+  +'Order'#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'TBitB'
+  +'tn'#12'bbApplyRoles'#4'Left'#2#12#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'bkO'
+  +'K'#7'OnClick'#7#17'bbApplyRolesClick'#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'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'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'BitBtn1Click'#8'TabOrder'#2#3#0#0#9'TCheckBox'#11'cxRoleGrant'
+  +#4'Left'#3#246#0#6'Height'#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'cxRoleGr'
+  +'antChange'#8'TabOrder'#2#4#0#0#0#0#7'TBitBtn'#7'bbClose'#4'Left'#3#232#1#6
+  +'Height'#2#24#3'Top'#2#255#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'ParentFont'#8#8'TabOrder'#2#1#0#0#0
 ]);

+ 1 - 0
systables.pas

@@ -684,6 +684,7 @@ function TdmSysTables.GetDatabaseInfo(dbIndex: Integer; var DatabaseName, CharSe
 begin
   try
     Init(dbIndex);
+    stTrans.Commit;
     sqQuery.SQL.Text:= 'select * from RDB$DATABASE';
     sqQuery.Open;
     CharSet:= sqQuery.fieldbyName('RDB$Character_Set_Name').AsString;

+ 4 - 4
tablemanage.lfm

@@ -10,7 +10,7 @@ object fmTableManage: TfmTableManage
   ClientWidth = 819
   OnClose = FormClose
   Position = poScreenCenter
-  LCLVersion = '0.9.31'
+  LCLVersion = '1.0.1.3'
   object PageControl1: TPageControl
     Left = 0
     Height = 413
@@ -207,7 +207,7 @@ object fmTableManage: TfmTableManage
           Left = 6
           Height = 18
           Top = 14
-          Width = 176
+          Width = 168
           Caption = 'Create new index on fields'
           ParentColor = False
         end
@@ -215,7 +215,7 @@ object fmTableManage: TfmTableManage
           Left = 254
           Height = 18
           Top = 39
-          Width = 111
+          Width = 107
           Caption = 'New index name'
           ParentColor = False
         end
@@ -232,7 +232,7 @@ object fmTableManage: TfmTableManage
           Left = 254
           Height = 24
           Top = 95
-          Width = 73
+          Width = 71
           Caption = 'Unique'
           TabOrder = 1
         end

+ 4 - 4
tablemanage.lrs

@@ -5,7 +5,7 @@ LazarusResources.Add('TfmTableManage','FORMDATA',[
   +'Top'#3#206#0#5'Width'#3'3'#3#13'ActiveControl'#7#12'PageControl1'#7'Anchors'
   +#11#5'akTop'#6'akLeft'#7'akRight'#0#7'Caption'#6#16'Table Management'#12'Cli'
   +'entHeight'#3#192#1#11'ClientWidth'#3'3'#3#7'OnClose'#7#9'FormClose'#8'Posit'
-  +'ion'#7#14'poScreenCenter'#10'LCLVersion'#6#6'0.9.31'#0#12'TPageControl'#12
+  +'ion'#7#14'poScreenCenter'#10'LCLVersion'#6#7'1.0.1.3'#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#9'tsIndices'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'ak'
   +'Bottom'#0#6'Images'#7#10'ImageList1'#8'TabIndex'#2#1#8'TabOrder'#2#0#0#9'TT'
@@ -59,13 +59,13 @@ LazarusResources.Add('TfmTableManage','FORMDATA',[
   +#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#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
+  +'2'#4'Left'#2#6#6'Height'#2#18#3'Top'#2#14#5'Width'#3#168#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'
+  +'t'#3#254#0#6'Height'#2#18#3'Top'#2''''#5'Width'#2'k'#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#24#3'Top'#2'_'#5'Width'#2'I'#7'Caption'#6#6'Unique'#8'TabOrder'#2#1#0#0#7
+  ,#2#24#3'Top'#2'_'#5'Width'#2'G'#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'

+ 0 - 2
tablemanage.pas

@@ -400,8 +400,6 @@ begin
 end;
 
 procedure TfmTableManage.FillConstraints(dbIndex: Integer);
-var
-  IndexFields: string;
 begin
   SQLQuery1.First;
   fdbIndex:= dbIndex;