Browse Source

Merge branch 'master' of https://github.com/motaz/turbobird

motaz 11 years ago
parent
commit
0ca43f3bb2
57 changed files with 4659 additions and 4530 deletions
  1. 11 1
      TurboBird.lpi
  2. 12 2
      TurboBird.lpr
  3. 26 24
      backuprestore.pas
  4. 43 41
      comparison.lfm
  5. 526 512
      comparison.pas
  6. 35 31
      copytable.pas
  7. 27 25
      dbinfo.lfm
  8. 59 42
      dbinfo.pas
  9. 2 1
      main.lfm
  10. 195 195
      main.lrs
  11. 584 557
      main.pas
  12. 8 5
      newconstraint.pas
  13. 24 21
      newgen.pas
  14. 21 19
      newtable.lfm
  15. 160 157
      newtable.lrs
  16. 37 20
      newtable.pas
  17. 42 44
      permissionmanage.lfm
  18. 65 63
      permissionmanage.lrs
  19. 77 68
      permissionmanage.pas
  20. 0 6
      querycomplition.txt
  21. 16 3
      querywindow.lfm
  22. 570 564
      querywindow.lrs
  23. 174 142
      querywindow.pas
  24. 267 234
      scriptdb.pas
  25. 12 48
      sqlhistory.lfm
  26. 24 75
      sqlhistory.lrs
  27. 22 24
      sqlhistory.pas
  28. 1 1
      systables.lfm
  29. 3 1
      systables.lrs
  30. 26 21
      systables.pas
  31. 3 1
      tablemanage.lfm
  32. 477 476
      tablemanage.lrs
  33. 102 77
      tablemanage.pas
  34. 14 12
      udfinfo.lfm
  35. 28 26
      udfinfo.lrs
  36. 17 1
      udfinfo.pas
  37. 20 20
      update.lfm
  38. 21 19
      update.lrs
  39. 67 62
      update.pas
  40. 7 8
      userpermissions.lfm
  41. 19 18
      userpermissions.lrs
  42. 17 1
      userpermissions.pas
  43. 15 13
      viewdomain.lfm
  44. 26 23
      viewdomain.lrs
  45. 17 1
      viewdomain.pas
  46. 9 7
      viewgen.lfm
  47. 18 15
      viewgen.lrs
  48. 17 1
      viewgen.pas
  49. 52 105
      viewsproc.lfm
  50. 155 153
      viewsproc.lrs
  51. 17 1
      viewsproc.pas
  52. 68 121
      viewtrigger.lfm
  53. 171 169
      viewtrigger.lrs
  54. 17 1
      viewtrigger.pas
  55. 49 102
      viewview.lfm
  56. 150 149
      viewview.lrs
  57. 17 1
      viewview.pas

+ 11 - 1
TurboBird.lpi

@@ -42,12 +42,14 @@
               <OverflowChecks Value="True"/>
               <OverflowChecks Value="True"/>
               <StackChecks Value="True"/>
               <StackChecks Value="True"/>
             </Checks>
             </Checks>
-            <VerifyObjMethodCallValidity Value="True"/>
             <Optimizations>
             <Optimizations>
               <OptimizationLevel Value="0"/>
               <OptimizationLevel Value="0"/>
             </Optimizations>
             </Optimizations>
           </CodeGeneration>
           </CodeGeneration>
           <Linking>
           <Linking>
+            <Debugging>
+              <UseHeaptrc Value="True"/>
+            </Debugging>
             <Options>
             <Options>
               <Win32>
               <Win32>
                 <GraphicApplication Value="True"/>
                 <GraphicApplication Value="True"/>
@@ -58,6 +60,7 @@
             <CompilerMessages>
             <CompilerMessages>
               <UseMsgFile Value="True"/>
               <UseMsgFile Value="True"/>
             </CompilerMessages>
             </CompilerMessages>
+            <CustomOptions Value="-dDEBUG -O-1"/>
             <CompilerPath Value="$(CompPath)"/>
             <CompilerPath Value="$(CompPath)"/>
           </Other>
           </Other>
         </CompilerOptions>
         </CompilerOptions>
@@ -139,6 +142,7 @@
         <Filename Value="viewview.pas"/>
         <Filename Value="viewview.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
         <ComponentName Value="fmViewView"/>
         <ComponentName Value="fmViewView"/>
+        <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <ResourceBaseClass Value="Form"/>
         <UnitName Value="ViewView"/>
         <UnitName Value="ViewView"/>
       </Unit5>
       </Unit5>
@@ -146,6 +150,7 @@
         <Filename Value="viewtrigger.pas"/>
         <Filename Value="viewtrigger.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
         <ComponentName Value="fmViewTrigger"/>
         <ComponentName Value="fmViewTrigger"/>
+        <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <ResourceBaseClass Value="Form"/>
         <UnitName Value="ViewTrigger"/>
         <UnitName Value="ViewTrigger"/>
       </Unit6>
       </Unit6>
@@ -153,6 +158,7 @@
         <Filename Value="viewsproc.pas"/>
         <Filename Value="viewsproc.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
         <ComponentName Value="fmViewSProc"/>
         <ComponentName Value="fmViewSProc"/>
+        <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <ResourceBaseClass Value="Form"/>
         <UnitName Value="ViewSProc"/>
         <UnitName Value="ViewSProc"/>
       </Unit7>
       </Unit7>
@@ -160,6 +166,7 @@
         <Filename Value="viewgen.pas"/>
         <Filename Value="viewgen.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
         <ComponentName Value="fmViewGen"/>
         <ComponentName Value="fmViewGen"/>
+        <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <ResourceBaseClass Value="Form"/>
         <UnitName Value="ViewGen"/>
         <UnitName Value="ViewGen"/>
       </Unit8>
       </Unit8>
@@ -227,6 +234,7 @@
         <Filename Value="udfinfo.pas"/>
         <Filename Value="udfinfo.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
         <ComponentName Value="fmUDFInfo"/>
         <ComponentName Value="fmUDFInfo"/>
+        <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <ResourceBaseClass Value="Form"/>
         <UnitName Value="UDFInfo"/>
         <UnitName Value="UDFInfo"/>
       </Unit17>
       </Unit17>
@@ -234,6 +242,7 @@
         <Filename Value="viewdomain.pas"/>
         <Filename Value="viewdomain.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
         <ComponentName Value="fmViewDomain"/>
         <ComponentName Value="fmViewDomain"/>
+        <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <ResourceBaseClass Value="Form"/>
         <UnitName Value="ViewDomain"/>
         <UnitName Value="ViewDomain"/>
       </Unit18>
       </Unit18>
@@ -282,6 +291,7 @@
         <Filename Value="userpermissions.pas"/>
         <Filename Value="userpermissions.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
         <ComponentName Value="fmUserPermissions"/>
         <ComponentName Value="fmUserPermissions"/>
+        <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <ResourceBaseClass Value="Form"/>
         <UnitName Value="UserPermissions"/>
         <UnitName Value="UserPermissions"/>
       </Unit25>
       </Unit25>

+ 12 - 2
TurboBird.lpr

@@ -2,7 +2,7 @@
 {  TurboBird: FireBird database administration and management tool          }
 {  TurboBird: FireBird database administration and management tool          }
 {  Developed by: Motaz Abdel Azeem http://code.sd/                          }
 {  Developed by: Motaz Abdel Azeem http://code.sd/                          }
 {  Start development :  5.Dec.2009                                          }
 {  Start development :  5.Dec.2009                                          }
-{  Last updated      :  5.Apr.2014                                          }
+{  Last updated      : 12.Apr.2014                                          }
 {  License           : GPL for GUI, LGPL for Units                          }
 {  License           : GPL for GUI, LGPL for Units                          }
 {***************************************************************************}
 {***************************************************************************}
 
 
@@ -27,7 +27,7 @@ uses
 const
 const
   Major = 1;
   Major = 1;
   Minor = 0;
   Minor = 0;
-  Release = 2;
+  Release = 3;
 
 
   VersionDate = '2010 - April 2014';
   VersionDate = '2010 - April 2014';
 {$IFDEF Unix}
 {$IFDEF Unix}
@@ -48,6 +48,16 @@ var
   IBaseLibraryHandle : TLibHandle;
   IBaseLibraryHandle : TLibHandle;
 begin
 begin
   Application.Initialize;
   Application.Initialize;
+  {$IFDEF DEBUG}
+  // Requires the build mode to set -dDEBUG in Project Options/Other and
+  // defining -gh/heaptrace on
+  // This avoids interference when running a production/default build without -gh
+
+  // Set up -gh output for the Leakview package:
+  if FileExists('heap.trc') then
+    DeleteFile('heap.trc');
+  SetHeapTraceOutput('heap.trc');
+  {$ENDIF DEBUG}
   IBaseLibraryHandle:= LoadLibrary(fbclib);
   IBaseLibraryHandle:= LoadLibrary(fbclib);
 
 
   // search for all compatible FireBird libraries in Windows
   // search for all compatible FireBird libraries in Windows

+ 26 - 24
backuprestore.pas

@@ -96,33 +96,35 @@ var
   ADatabase: string;
   ADatabase: string;
 begin
 begin
   FireBirdServices:= TFirebirdServices.Create;
   FireBirdServices:= TFirebirdServices.Create;
-  FireBirdServices.VerboseOutput:= True;
-  meLog.Clear;
-  with FireBirdServices do
-  begin
-    HostName:= edHost.Text;
-    DBName:= edTargetDatabase.Text;
-    UserName := edUserName.Text;
-    Password := edPassword.Text;
-    BkpName := Trim(edBackup.Text);
-
-    try
-      AttachService;
-
-      if cbOperation.ItemIndex = 0 then
-        StartBackup
-      else
-        StartRestore;
-
-      while ServiceQuery(Res) do
-        meLog.Lines.Add(Res);
-    finally
-      DetachService;
+  try
+    FireBirdServices.VerboseOutput:= True;
+    meLog.Clear;
+    with FireBirdServices do
+    begin
+      HostName:= edHost.Text;
+      DBName:= edTargetDatabase.Text;
+      UserName := edUserName.Text;
+      Password := edPassword.Text;
+      BkpName := Trim(edBackup.Text);
+
+      try
+        AttachService;
+
+        if cbOperation.ItemIndex = 0 then
+          StartBackup
+        else
+          StartRestore;
+
+        while ServiceQuery(Res) do
+          meLog.Lines.Add(Res);
+      finally
+        DetachService;
+      end;
+      meLog.Lines.Add('');
     end;
     end;
-    meLog.Lines.Add('');
+  finally
     FireBirdServices.Free;
     FireBirdServices.Free;
   end;
   end;
-
 end;
 end;
 
 
 
 

+ 43 - 41
comparison.lfm

@@ -1,27 +1,29 @@
 object fmComparison: TfmComparison
 object fmComparison: TfmComparison
-  Left = 410
+  Left = 180
   Height = 658
   Height = 658
-  Top = 127
+  Top = 117
   Width = 820
   Width = 820
   Caption = 'Database comparison'
   Caption = 'Database comparison'
   ClientHeight = 658
   ClientHeight = 658
   ClientWidth = 820
   ClientWidth = 820
+  KeyPreview = True
   OnClose = FormClose
   OnClose = FormClose
+  OnKeyDown = FormKeyDown
   Position = poScreenCenter
   Position = poScreenCenter
-  LCLVersion = '1.0.4.0'
+  LCLVersion = '1.2.0.3'
   object Label1: TLabel
   object Label1: TLabel
     Left = 15
     Left = 15
-    Height = 18
+    Height = 13
     Top = 112
     Top = 112
-    Width = 125
-    Caption = 'Orgional database'
+    Width = 84
+    Caption = 'Original database'
     ParentColor = False
     ParentColor = False
   end
   end
   object laDatabase: TLabel
   object laDatabase: TLabel
     Left = 159
     Left = 159
-    Height = 18
+    Height = 13
     Top = 112
     Top = 112
-    Width = 81
+    Width = 64
     Caption = 'laDatabase'
     Caption = 'laDatabase'
     Font.Style = [fsBold]
     Font.Style = [fsBold]
     ParentColor = False
     ParentColor = False
@@ -29,27 +31,27 @@ object fmComparison: TfmComparison
   end
   end
   object Label2: TLabel
   object Label2: TLabel
     Left = 16
     Left = 16
-    Height = 18
+    Height = 13
     Top = 143
     Top = 143
-    Width = 138
+    Width = 97
     Caption = 'Compared database'
     Caption = 'Compared database'
     ParentColor = False
     ParentColor = False
   end
   end
   object cbComparedDatabase: TComboBox
   object cbComparedDatabase: TComboBox
     Left = 159
     Left = 159
-    Height = 31
+    Height = 21
     Top = 134
     Top = 134
     Width = 460
     Width = 460
-    ItemHeight = 0
+    ItemHeight = 13
     OnChange = cbComparedDatabaseChange
     OnChange = cbComparedDatabaseChange
     Style = csDropDownList
     Style = csDropDownList
     TabOrder = 0
     TabOrder = 0
   end
   end
   object laComparedDatabase: TLabel
   object laComparedDatabase: TLabel
     Left = 159
     Left = 159
-    Height = 18
+    Height = 13
     Top = 168
     Top = 168
-    Width = 12
+    Width = 10
     Caption = '[]'
     Caption = '[]'
     Font.Style = [fsBold]
     Font.Style = [fsBold]
     ParentColor = False
     ParentColor = False
@@ -115,9 +117,9 @@ object fmComparison: TfmComparison
   object laScript: TLabel
   object laScript: TLabel
     Cursor = crHandPoint
     Cursor = crHandPoint
     Left = 280
     Left = 280
-    Height = 18
+    Height = 13
     Top = 332
     Top = 332
-    Width = 273
+    Width = 193
     Caption = 'Script differences in compared database'
     Caption = 'Script differences in compared database'
     Font.Style = [fsUnderline]
     Font.Style = [fsUnderline]
     ParentColor = False
     ParentColor = False
@@ -130,55 +132,55 @@ object fmComparison: TfmComparison
     Top = 192
     Top = 192
     Width = 601
     Width = 601
     Caption = 'Compared objects'
     Caption = 'Compared objects'
-    ClientHeight = 60
+    ClientHeight = 61
     ClientWidth = 597
     ClientWidth = 597
     TabOrder = 3
     TabOrder = 3
     object cxTables: TCheckBox
     object cxTables: TCheckBox
       Left = 11
       Left = 11
-      Height = 24
+      Height = 17
       Top = 4
       Top = 4
-      Width = 69
+      Width = 51
       Caption = 'Tables'
       Caption = 'Tables'
       TabOrder = 0
       TabOrder = 0
     end
     end
     object cxGenerators: TCheckBox
     object cxGenerators: TCheckBox
       Left = 11
       Left = 11
-      Height = 24
+      Height = 17
       Top = 32
       Top = 32
-      Width = 102
+      Width = 74
       Caption = 'Generators'
       Caption = 'Generators'
       TabOrder = 1
       TabOrder = 1
     end
     end
     object cxTriggers: TCheckBox
     object cxTriggers: TCheckBox
       Left = 151
       Left = 151
-      Height = 24
+      Height = 17
       Top = 4
       Top = 4
-      Width = 80
+      Width = 59
       Caption = 'Triggers'
       Caption = 'Triggers'
       TabOrder = 2
       TabOrder = 2
     end
     end
     object cxViews: TCheckBox
     object cxViews: TCheckBox
       Left = 151
       Left = 151
-      Height = 24
+      Height = 17
       Top = 34
       Top = 34
-      Width = 66
+      Width = 47
       Caption = 'Views'
       Caption = 'Views'
       TabOrder = 3
       TabOrder = 3
     end
     end
     object cxStoredProcs: TCheckBox
     object cxStoredProcs: TCheckBox
       Left = 262
       Left = 262
-      Height = 24
+      Height = 17
       Top = 4
       Top = 4
-      Width = 113
+      Width = 81
       Caption = 'Stored Procs'
       Caption = 'Stored Procs'
       TabOrder = 4
       TabOrder = 4
     end
     end
     object cxUDFs: TCheckBox
     object cxUDFs: TCheckBox
       Left = 262
       Left = 262
-      Height = 24
+      Height = 17
       Hint = 'User Defined Functions'
       Hint = 'User Defined Functions'
       Top = 32
       Top = 32
-      Width = 61
+      Width = 45
       Caption = 'UDFs'
       Caption = 'UDFs'
       ParentShowHint = False
       ParentShowHint = False
       ShowHint = True
       ShowHint = True
@@ -186,25 +188,25 @@ object fmComparison: TfmComparison
     end
     end
     object cxDomains: TCheckBox
     object cxDomains: TCheckBox
       Left = 390
       Left = 390
-      Height = 24
+      Height = 17
       Top = 4
       Top = 4
-      Width = 85
+      Width = 60
       Caption = 'Domains'
       Caption = 'Domains'
       TabOrder = 6
       TabOrder = 6
     end
     end
     object cxRoles: TCheckBox
     object cxRoles: TCheckBox
       Left = 390
       Left = 390
-      Height = 24
+      Height = 17
       Top = 34
       Top = 34
-      Width = 63
+      Width = 46
       Caption = 'Roles'
       Caption = 'Roles'
       TabOrder = 7
       TabOrder = 7
     end
     end
   end
   end
   object StatusBar1: TStatusBar
   object StatusBar1: TStatusBar
     Left = 0
     Left = 0
-    Height = 21
-    Top = 637
+    Height = 20
+    Top = 638
     Width = 820
     Width = 820
     Panels = <    
     Panels = <    
       item
       item
@@ -214,9 +216,9 @@ object fmComparison: TfmComparison
   end
   end
   object cxRemovedObjects: TCheckBox
   object cxRemovedObjects: TCheckBox
     Left = 15
     Left = 15
-    Height = 24
+    Height = 17
     Top = 278
     Top = 278
-    Width = 185
+    Width = 135
     Caption = 'Check Removed objects'
     Caption = 'Check Removed objects'
     TabOrder = 5
     TabOrder = 5
   end
   end
@@ -240,7 +242,7 @@ object fmComparison: TfmComparison
     Width = 775
     Width = 775
     Anchors = [akTop, akLeft, akRight]
     Anchors = [akTop, akLeft, akRight]
     AutoSize = False
     AutoSize = False
-    Caption = 'Database comparison tool compares origional database structure to another database structure.'#10'It generates script to make compared database structure becomes like origional database.'#10'For instance, origional database could be a development database, and compared database is an old version that'#10'is deployed in customer side. This tool generates script to make customer database structure '#10'resembles developmenent database as much as possible.'
+    Caption = 'Database comparison tool compares original database structure to another database structure.'#13#10'It generates a script to make compared database structure become like the original database.'#13#10'For instance, original database could be a development database, and compared database is an old version that'#13#10'is deployed at a customer. This tool generates script to make customer database structure '#13#10'resemble the developmenent database as much as possible.'
     Color = clCream
     Color = clCream
     Font.Height = -11
     Font.Height = -11
     ParentColor = False
     ParentColor = False
@@ -254,14 +256,14 @@ object fmComparison: TfmComparison
     Top = 195
     Top = 195
     Width = 189
     Width = 189
     Caption = 'Options'
     Caption = 'Options'
-    ClientHeight = 57
+    ClientHeight = 58
     ClientWidth = 185
     ClientWidth = 185
     TabOrder = 7
     TabOrder = 7
     object cxIgnoreLength: TCheckBox
     object cxIgnoreLength: TCheckBox
       Left = 16
       Left = 16
-      Height = 24
+      Height = 17
       Top = 6
       Top = 6
-      Width = 154
+      Width = 113
       Caption = 'Ignore fields length'
       Caption = 'Ignore fields length'
       TabOrder = 0
       TabOrder = 0
     end
     end

File diff suppressed because it is too large
+ 526 - 512
comparison.pas


+ 35 - 31
copytable.pas

@@ -67,9 +67,12 @@ var
   Line: string;
   Line: string;
 begin
 begin
   List:= TStringList.Create;
   List:= TStringList.Create;
-  fmMain.GetFields(fSourceIndex, cbSourceTable.Text, List);
-  Line:= List.CommaText;
-  List.Free;
+  try
+    fmMain.GetFields(fSourceIndex, cbSourceTable.Text, List);
+    Line:= List.CommaText;
+  finally
+    List.Free;
+  end;
   syScript.Lines.Text:= 'select ' + Line;
   syScript.Lines.Text:= 'select ' + Line;
   syScript.Lines.Add(' from ' + cbSourceTable.Text);
   syScript.Lines.Add(' from ' + cbSourceTable.Text);
 
 
@@ -130,37 +133,38 @@ begin
     end;
     end;
 
 
     SQLTarget:= TSQLQuery.Create(nil);
     SQLTarget:= TSQLQuery.Create(nil);
-    SQLTarget.DataBase:= IBConnection;
-    SQLTarget.Transaction:= SQLTrans;
-    SQLTarget.SQL.Text:= Statement;
-
-    // Start copy
     try
     try
-      dmSysTables.sqQuery.First;
-      Num:= 0;
-      with dmSysTables.sqQuery do
-      while not EOF do
-      begin
-        for i:= 0 to Fields.Count - 1 do
-          SQLTarget.Params.ParamByName(Fields[i].FieldName).Value:= Fields[i].Value;
-        SQLTarget.ExecSQL;
-        Inc(Num);
-        Next;
+      SQLTarget.DataBase:= IBConnection;
+      SQLTarget.Transaction:= SQLTrans;
+      SQLTarget.SQL.Text:= Statement;
+
+      // Start copy
+      try
+        dmSysTables.sqQuery.First;
+        Num:= 0;
+        with dmSysTables.sqQuery do
+        while not EOF do
+        begin
+          for i:= 0 to Fields.Count - 1 do
+            SQLTarget.Params.ParamByName(Fields[i].FieldName).Value:= Fields[i].Value;
+          SQLTarget.ExecSQL;
+          Inc(Num);
+          Next;
+        end;
+        SQLTrans.Commit;
+        ShowMessage(IntToStr(Num) + ' record(s) has been copied' + #10 + 'Don''t forget to set the Generator to the new value, ' +
+          'if it does exists');
+        dmSysTables.sqQuery.Close;
+        Close;
+      except
+        on e: exception do
+        begin
+          MessageDlg('Error while copy: ' + e.Message, mtError, [mbOk], 0);
+          SQLTrans.Rollback;
+        end;
       end;
       end;
-      SQLTrans.Commit;
-      ShowMessage(IntToStr(Num) + ' record(s) has been copied' + #10 + 'Don''t forget to set the Generator to the new value, ' +
-        'if it does exists');
-      dmSysTables.sqQuery.Close;
+    finally
       SQLTarget.Free;
       SQLTarget.Free;
-      Close;
-
-    except
-      on e: exception do
-      begin
-        MessageDlg('Error while copy: ' + e.Message, mtError, [mbOk], 0);
-        SQLTrans.Rollback;
-        SQLTarget.Free;
-      end;
     end;
     end;
   end;
   end;
 
 

+ 27 - 25
dbinfo.lfm

@@ -6,20 +6,22 @@ object fmDBInfo: TfmDBInfo
   Caption = 'fmDBInfo'
   Caption = 'fmDBInfo'
   ClientHeight = 471
   ClientHeight = 471
   ClientWidth = 701
   ClientWidth = 701
+  KeyPreview = True
   OnClose = FormClose
   OnClose = FormClose
+  OnKeyDown = FormKeyDown
   Position = poScreenCenter
   Position = poScreenCenter
-  LCLVersion = '1.0.4.0'
+  LCLVersion = '1.2.0.3'
   object Label1: TLabel
   object Label1: TLabel
     Left = 15
     Left = 15
-    Height = 18
+    Height = 13
     Top = 49
     Top = 49
-    Width = 65
+    Width = 46
     Caption = 'Database'
     Caption = 'Database'
     ParentColor = False
     ParentColor = False
   end
   end
   object edName: TEdit
   object edName: TEdit
     Left = 144
     Left = 144
-    Height = 21
+    Height = 13
     Top = 46
     Top = 46
     Width = 479
     Width = 479
     Anchors = [akTop, akLeft, akRight]
     Anchors = [akTop, akLeft, akRight]
@@ -33,15 +35,15 @@ object fmDBInfo: TfmDBInfo
   end
   end
   object Label2: TLabel
   object Label2: TLabel
     Left = 15
     Left = 15
-    Height = 18
+    Height = 13
     Top = 79
     Top = 79
-    Width = 84
+    Width = 59
     Caption = 'ODS Version'
     Caption = 'ODS Version'
     ParentColor = False
     ParentColor = False
   end
   end
   object edODSVer: TEdit
   object edODSVer: TEdit
     Left = 144
     Left = 144
-    Height = 21
+    Height = 13
     Top = 76
     Top = 76
     Width = 88
     Width = 88
     AutoSelect = False
     AutoSelect = False
@@ -54,15 +56,15 @@ object fmDBInfo: TfmDBInfo
   end
   end
   object Label3: TLabel
   object Label3: TLabel
     Left = 15
     Left = 15
-    Height = 18
+    Height = 13
     Top = 110
     Top = 110
-    Width = 54
+    Width = 39
     Caption = 'CharSet'
     Caption = 'CharSet'
     ParentColor = False
     ParentColor = False
   end
   end
   object edCharset: TEdit
   object edCharset: TEdit
     Left = 144
     Left = 144
-    Height = 21
+    Height = 13
     Top = 107
     Top = 107
     Width = 88
     Width = 88
     AutoSelect = False
     AutoSelect = False
@@ -75,15 +77,15 @@ object fmDBInfo: TfmDBInfo
   end
   end
   object Label4: TLabel
   object Label4: TLabel
     Left = 15
     Left = 15
-    Height = 18
+    Height = 13
     Top = 142
     Top = 142
-    Width = 94
+    Width = 67
     Caption = 'Creation Date'
     Caption = 'Creation Date'
     ParentColor = False
     ParentColor = False
   end
   end
   object edCreationDate: TEdit
   object edCreationDate: TEdit
     Left = 144
     Left = 144
-    Height = 21
+    Height = 13
     Top = 139
     Top = 139
     Width = 176
     Width = 176
     AutoSelect = False
     AutoSelect = False
@@ -96,15 +98,15 @@ object fmDBInfo: TfmDBInfo
   end
   end
   object Label5: TLabel
   object Label5: TLabel
     Left = 15
     Left = 15
-    Height = 18
+    Height = 13
     Top = 172
     Top = 172
-    Width = 64
+    Width = 46
     Caption = 'Page Size'
     Caption = 'Page Size'
     ParentColor = False
     ParentColor = False
   end
   end
   object edPageSize: TEdit
   object edPageSize: TEdit
     Left = 144
     Left = 144
-    Height = 21
+    Height = 13
     Top = 169
     Top = 169
     Width = 88
     Width = 88
     AutoSelect = False
     AutoSelect = False
@@ -117,7 +119,7 @@ object fmDBInfo: TfmDBInfo
   end
   end
   object edDBSize: TEdit
   object edDBSize: TEdit
     Left = 144
     Left = 144
-    Height = 21
+    Height = 13
     Top = 201
     Top = 201
     Width = 176
     Width = 176
     AutoSelect = False
     AutoSelect = False
@@ -130,17 +132,17 @@ object fmDBInfo: TfmDBInfo
   end
   end
   object Label6: TLabel
   object Label6: TLabel
     Left = 15
     Left = 15
-    Height = 18
+    Height = 13
     Top = 204
     Top = 204
-    Width = 95
+    Width = 68
     Caption = 'Database Size'
     Caption = 'Database Size'
     ParentColor = False
     ParentColor = False
   end
   end
   object Label7: TLabel
   object Label7: TLabel
     Left = 16
     Left = 16
-    Height = 18
+    Height = 13
     Top = 270
     Top = 270
-    Width = 122
+    Width = 87
     Caption = 'Connected Clients'
     Caption = 'Connected Clients'
     ParentColor = False
     ParentColor = False
   end
   end
@@ -178,7 +180,7 @@ object fmDBInfo: TfmDBInfo
   end
   end
   object edConnections: TEdit
   object edConnections: TEdit
     Left = 144
     Left = 144
-    Height = 21
+    Height = 13
     Top = 267
     Top = 267
     Width = 112
     Width = 112
     AutoSelect = False
     AutoSelect = False
@@ -426,15 +428,15 @@ object fmDBInfo: TfmDBInfo
   end
   end
   object Label8: TLabel
   object Label8: TLabel
     Left = 16
     Left = 16
-    Height = 18
+    Height = 13
     Top = 237
     Top = 237
-    Width = 78
+    Width = 55
     Caption = 'Server time'
     Caption = 'Server time'
     ParentColor = False
     ParentColor = False
   end
   end
   object edServerTime: TEdit
   object edServerTime: TEdit
     Left = 144
     Left = 144
-    Height = 21
+    Height = 13
     Top = 234
     Top = 234
     Width = 176
     Width = 176
     AutoSelect = False
     AutoSelect = False

+ 59 - 42
dbinfo.pas

@@ -6,7 +6,7 @@ interface
 
 
 uses
 uses
   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
-  Buttons, ExtCtrls;
+  Buttons, ExtCtrls, LCLType;
 
 
 type
 type
 
 
@@ -36,6 +36,7 @@ type
     procedure bbCloseClick(Sender: TObject);
     procedure bbCloseClick(Sender: TObject);
     procedure bbRefreshClick(Sender: TObject);
     procedure bbRefreshClick(Sender: TObject);
     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
+    procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
   private
   private
     { private declarations }
     { private declarations }
     fdbIndex: Integer;
     fdbIndex: Integer;
@@ -71,6 +72,18 @@ begin
   CloseAction:= caFree;
   CloseAction:= caFree;
 end;
 end;
 
 
+procedure TfmDBInfo.FormKeyDown(Sender: TObject; var Key: Word;
+  Shift: TShiftState);
+begin
+  if (ssCtrl in Shift) and
+    ((key=VK_F4) or (key=VK_W)) then
+  begin
+    // Close when pressing Ctrl-W or Ctrl-F4 (Cmd-W/Cmd-F4 on OSX)
+    Close;
+    Parent.Free;
+  end;
+end;
+
 procedure TfmDBInfo.Init(dbIndex: Integer);
 procedure TfmDBInfo.Init(dbIndex: Integer);
 var
 var
   dbName, CreationDate, ACharSet: string;
   dbName, CreationDate, ACharSet: string;
@@ -83,51 +96,55 @@ var
 begin
 begin
   fdbIndex:= dbIndex;
   fdbIndex:= dbIndex;
   ProcessList:= TStringList.Create;
   ProcessList:= TStringList.Create;
-
-  // Read database info
-  if dmSysTables.GetDatabaseInfo(dbIndex, dbName, ACharSet, CreationDate, ServerTime,
-    MajorVer, MinorVer, Pages, PageSize, ProcessList, ErrorMsg) then
-  begin
-    edName.Text:= dbName;
-    edODSVer.Text:= IntToStr(MajorVer) + '.' + IntToStr(MinorVer);
-    edCharset.Text:= ACharSet;
-    edCreationDate.Text:= CreationDate;
-    edPageSize.Text:= IntToStr(PageSize);
-    edConnections.Text:= IntToStr(ProcessList.Count);
-    dbSize:= Pages * PageSize;
-
-    // Display database size in readable format
-    if dbSize > 1000000000 then
+  try
+    // Read database info
+    if dmSysTables.GetDatabaseInfo(dbIndex, dbName, ACharSet, CreationDate, ServerTime,
+      MajorVer, MinorVer, Pages, PageSize, ProcessList, ErrorMsg) then
     begin
     begin
-      dbSize:= ((dbSize / 1024) / 1024) / 1024;
-      AType:= 'Giga bytes';
+      edName.Text:= dbName;
+      edODSVer.Text:= IntToStr(MajorVer) + '.' + IntToStr(MinorVer);
+      edCharset.Text:= ACharSet;
+      edCreationDate.Text:= CreationDate;
+      edPageSize.Text:= IntToStr(PageSize);
+      edConnections.Text:= IntToStr(ProcessList.Count);
+      dbSize:= Pages * PageSize;
+
+      // Display database size in readable format
+      if dbSize > (1024*1024*1024) then
+      begin
+        dbSize:= ((dbSize / 1024) / 1024) / 1024;
+        AType:= 'Giga bytes';
+      end
+      else
+      if dbSize > (1024*1024) then
+      begin
+        dbSize:= ((dbSize / 1024) / 1024);
+        AType:= 'Mega bytes';
+      end
+      else
+      if dbSize > 1024 then
+      begin
+        dbSize:= (dbSize / 1024);
+        AType:= 'Kilo bytes';
+      end
+      else
+      begin
+        AType:= 'Bytes';
+      end;
+
+      edDBSize.Text:= Format('%3.1n %s', [dbSize, AType]);
+      fmDBInfo.edServerTime.Text:= ServerTime;
+      meClients.Lines.Text:= ProcessList.Text;
+      meClients.Lines.Insert(0, '');
+      Show;
     end
     end
     else
     else
-    if dbSize > 1000000 then
-    begin
-      dbSize:= ((dbSize / 1024) / 1024);
-      AType:= 'Mega bytes';
-    end
-    else
-    if dbSize > 1000 then
-    begin
-      dbSize:= (dbSize / 1024);
-      AType:= 'Kilo bytes';
-    end
-    else
-    begin
-      AType:= 'Bytes';
-    end;
-
-    edDBSize.Text:= Format('%3.1n %s', [dbSize, AType]);
-    fmDBInfo.edServerTime.Text:= ServerTime;
-    meClients.Lines.Text:= ProcessList.Text;
-    meClients.Lines.Insert(0, '');
+      ShowMessage('Unable to get database information' + LineEnding +
+        ErrorMsg);
+  finally
     ProcessList.Free;
     ProcessList.Free;
-    Show;
-  end
-  else
-    ShowMessage('Unable to get database information' + #10 + ErrorMsg);
+  end;
+
 end;
 end;
 
 
 
 

+ 2 - 1
main.lfm

@@ -13,8 +13,9 @@ object fmMain: TfmMain
   OnActivate = FormActivate
   OnActivate = FormActivate
   OnClose = FormClose
   OnClose = FormClose
   OnCreate = FormCreate
   OnCreate = FormCreate
+  OnDestroy = FormDestroy
   Position = poScreenCenter
   Position = poScreenCenter
-  LCLVersion = '1.3'
+  LCLVersion = '1.2.0.3'
   object tvMain: TTreeView
   object tvMain: TTreeView
     Left = 0
     Left = 0
     Height = 601
     Height = 601

+ 195 - 195
main.lrs

@@ -5,207 +5,207 @@ LazarusResources.Add('TfmMain','FORMDATA',[
   +'Width'#3#0#4#13'ActiveControl'#7#6'tvMain'#7'Caption'#6#28'TurboBird Admin '
   +'Width'#3#0#4#13'ActiveControl'#7#6'tvMain'#7'Caption'#6#28'TurboBird Admin '
   +'for FireBird'#12'ClientHeight'#3'm'#2#11'ClientWidth'#3#0#4#5'Color'#7#7'cl'
   +'for FireBird'#12'ClientHeight'#3'm'#2#11'ClientWidth'#3#0#4#5'Color'#7#7'cl'
   +'White'#9'Font.Name'#6#4'Sans'#4'Menu'#7#9'MainMenu1'#10'OnActivate'#7#12'Fo'
   +'White'#9'Font.Name'#6#4'Sans'#4'Menu'#7#9'MainMenu1'#10'OnActivate'#7#12'Fo'
-  +'rmActivate'#7'OnClose'#7#9'FormClose'#8'OnCreate'#7#10'FormCreate'#8'Positi'
-  +'on'#7#14'poScreenCenter'#10'LCLVersion'#6#3'1.3'#0#9'TTreeView'#6'tvMain'#4
-  +'Left'#2#0#6'Height'#3'Y'#2#3'Top'#2#0#5'Width'#3'h'#1#5'Align'#7#6'alLeft'
-  +#15'BackgroundColor'#7#7'clWhite'#5'Color'#7#7'clCream'#15'ExpandSignColor'#7
-  +#8'clMaroon'#13'HideSelection'#8#6'Images'#7#10'ImageList1'#6'Indent'#2#25#8
-  +'ReadOnly'#9#16'RightClickSelect'#9#9'ShowLines'#8#8'TabOrder'#2#0#10'OnDblC'
-  +'lick'#7#14'tvMainDblClick'#10'OnExpanded'#7#14'tvMainExpanded'#7'Options'#11
-  +#17'tvoAutoItemHeight'#21'tvoKeepCollapsedNodes'#11'tvoReadOnly'#19'tvoRight'
-  +'ClickSelect'#14'tvoShowButtons'#11'tvoShowRoot'#11'tvoToolTips'#0#0#0#9'TSp'
-  +'litter'#9'Splitter1'#4'Left'#3'h'#1#6'Height'#3'Y'#2#3'Top'#2#0#5'Width'#2
-  +#14#7'Beveled'#9#0#0#12'TPageControl'#12'PageControl1'#4'Left'#3'y'#1#6'Heig'
-  +'ht'#3'R'#2#3'Top'#2#3#5'Width'#3#132#2#10'ActivePage'#7#9'TabSheet1'#5'Alig'
-  +'n'#7#8'alClient'#18'BorderSpacing.Left'#2#1#17'BorderSpacing.Top'#2#1#19'Bo'
-  +'rderSpacing.Right'#2#1#20'BorderSpacing.Bottom'#2#2#20'BorderSpacing.Around'
-  +#2#2#25'BorderSpacing.InnerBorder'#2#1#9'Font.Name'#6#4'Sans'#10'ParentFont'
-  +#8#8'TabIndex'#2#0#8'TabOrder'#2#2#17'OnCloseTabClicked'#7#27'PageControl1Cl'
-  +'oseTabClicked'#7'Options'#11#20'nboHidePageListPopup'#0#0#9'TTabSheet'#9'Ta'
-  +'bSheet1'#11'BorderWidth'#2#1#7'Caption'#6#4'Main'#12'ClientHeight'#3'3'#2#11
-  +'ClientWidth'#3'|'#2#10'Font.Color'#7#6'clNavy'#9'Font.Name'#6#5'Arial'#10'P'
-  +'arentFont'#8#0#7'TBitBtn'#11'bbRestoreDB'#4'Left'#2#3#6'Height'#2']'#3'Top'
-  +#3#216#0#5'Width'#3#208#0#7'Caption'#6#16'Restore Database'#5'Color'#7#7'clC'
-  +'ream'#9'Font.Name'#6#4'Sans'#10'Glyph.Data'#10':'#16#0#0'6'#16#0#0'BM6'#16#0
-  +#0#0#0#0#0'6'#0#0#0'('#0#0#0' '#0#0#0' '#0#0#0#1#0' '#0#0#0#0#0#0#16#0#0'd'#0
-  +#0#0'd'#0#0#0#0#0#0#0#0#0#0#0#255#255#255#0#255#255#255#0#255#255#255#0#255
-  +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255
-  +#255#0#255#255#255#0#0#0#0#1'UUU'#3'@``'#8'NNN'#13'UUU'#18'QQQ'#22'YYY'#23'M'
-  +'YY'#20'UUU'#15'MfM'#10'fff'#5#128#128#128#2#0#0#0#1#255#255#255#0#255#255
+  +'rmActivate'#7'OnClose'#7#9'FormClose'#8'OnCreate'#7#10'FormCreate'#9'OnDest'
+  +'roy'#7#11'FormDestroy'#8'Position'#7#14'poScreenCenter'#10'LCLVersion'#6#7
+  +'1.2.0.3'#0#9'TTreeView'#6'tvMain'#4'Left'#2#0#6'Height'#3'Y'#2#3'Top'#2#0#5
+  +'Width'#3'h'#1#5'Align'#7#6'alLeft'#15'BackgroundColor'#7#7'clWhite'#5'Color'
+  +#7#7'clCream'#15'ExpandSignColor'#7#8'clMaroon'#13'HideSelection'#8#6'Images'
+  +#7#10'ImageList1'#6'Indent'#2#25#8'ReadOnly'#9#16'RightClickSelect'#9#9'Show'
+  +'Lines'#8#8'TabOrder'#2#0#10'OnDblClick'#7#14'tvMainDblClick'#10'OnExpanded'
+  +#7#14'tvMainExpanded'#7'Options'#11#17'tvoAutoItemHeight'#21'tvoKeepCollapse'
+  +'dNodes'#11'tvoReadOnly'#19'tvoRightClickSelect'#14'tvoShowButtons'#11'tvoSh'
+  +'owRoot'#11'tvoToolTips'#0#0#0#9'TSplitter'#9'Splitter1'#4'Left'#3'h'#1#6'He'
+  +'ight'#3'Y'#2#3'Top'#2#0#5'Width'#2#14#7'Beveled'#9#0#0#12'TPageControl'#12
+  +'PageControl1'#4'Left'#3'y'#1#6'Height'#3'R'#2#3'Top'#2#3#5'Width'#3#132#2#10
+  +'ActivePage'#7#9'TabSheet1'#5'Align'#7#8'alClient'#18'BorderSpacing.Left'#2#1
+  +#17'BorderSpacing.Top'#2#1#19'BorderSpacing.Right'#2#1#20'BorderSpacing.Bott'
+  +'om'#2#2#20'BorderSpacing.Around'#2#2#25'BorderSpacing.InnerBorder'#2#1#9'Fo'
+  +'nt.Name'#6#4'Sans'#10'ParentFont'#8#8'TabIndex'#2#0#8'TabOrder'#2#2#17'OnCl'
+  +'oseTabClicked'#7#27'PageControl1CloseTabClicked'#7'Options'#11#20'nboHidePa'
+  +'geListPopup'#0#0#9'TTabSheet'#9'TabSheet1'#11'BorderWidth'#2#1#7'Caption'#6
+  +#4'Main'#12'ClientHeight'#3'3'#2#11'ClientWidth'#3'|'#2#10'Font.Color'#7#6'c'
+  +'lNavy'#9'Font.Name'#6#5'Arial'#10'ParentFont'#8#0#7'TBitBtn'#11'bbRestoreDB'
+  +#4'Left'#2#3#6'Height'#2']'#3'Top'#3#216#0#5'Width'#3#208#0#7'Caption'#6#16
+  +'Restore Database'#5'Color'#7#7'clCream'#9'Font.Name'#6#4'Sans'#10'Glyph.Dat'
+  +'a'#10':'#16#0#0'6'#16#0#0'BM6'#16#0#0#0#0#0#0'6'#0#0#0'('#0#0#0' '#0#0#0' '
+  +#0#0#0#1#0' '#0#0#0#0#0#0#16#0#0'd'#0#0#0'd'#0#0#0#0#0#0#0#0#0#0#0#255#255
+  +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0
+  +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#0#0#0#1'UUU'#3'@``'
+  +#8'NNN'#13'UUU'#18'QQQ'#22'YYY'#23'MYY'#20'UUU'#15'MfM'#10'fff'#5#128#128#128
+  +#2#0#0#0#1#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255
   +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0
   +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0
   +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255
   +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255
-  +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#0#0#0#1'UUU'#3'NbN'#13
-  +'R[R'#28'QQQ/SVVDRXUTRWTdQVSqSWUuSXVkSYV\TWTLUUU9SZS%MYY'#20'III'#7#0#0#0#1
+  +#255#255#0#0#0#0#1'UUU'#3'NbN'#13'R[R'#28'QQQ/SVVDRXUTRWTdQVSqSWUuSXVkSYV\TW'
+  +'TLUUU9SZS%MYY'#20'III'#7#0#0#0#1#255#255#255#0#255#255#255#0#255#255#255#0
+  +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255
+  +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#128#128
+  +#128#2'III'#14'WWW)SVSSRVT'#130']^^'#179'pvs'#215'uyw'#226'uzx'#233'sxv'#240
+  +'uzx'#242'v{y'#237'v{x'#230'uzw'#222'jnl'#201'SWU'#153'SWUiRVV;RRR'#25'fff'#5
   +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255
   +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255
   +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255
   +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255
-  +#255#0#255#255#255#0#255#255#255#0#128#128#128#2'III'#14'WWW)SVSSRVT'#130']^'
-  +'^'#179'pvs'#215'uyw'#226'uzx'#233'sxv'#240'uzx'#242'v{y'#237'v{x'#230'uzw'
-  +#222'jnl'#201'SWU'#153'SWUiRVV;RRR'#25'fff'#5#255#255#255#0#255#255#255#0#255
-  +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255
-  +#255#0#255#255#255#0#255#255#255#0#255#255#255#0'@@@'#4'UUU'#24'RXUKY\['#151
-  +#133#137#135#215#161#167#165#243#177#183#180#254#167#173#170#255#155#161#159
-  +#255#144#149#147#255#133#138#136#255#133#138#136#255#141#146#144#255#152#158
-  +#155#255#164#170#167#255#175#182#179#255#174#181#177#250#148#155#152#231'msq'
-  +#188'SWUoSYY+MMM'#10#0#0#0#1#255#255#255#0#255#255#255#0#255#255#255#0#255
-  +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'UUU'#3'NX'
-  +'X'#26'TZW^lqn'#184#186#194#190#247#202#209#205#255#190#197#194#255#179#185
-  +#182#255#167#173#170#255#155#161#159#255#144#149#147#255#133#138#136#255#133
+  +#255#0'@@@'#4'UUU'#24'RXUKY\['#151#133#137#135#215#161#167#165#243#177#183
+  +#180#254#167#173#170#255#155#161#159#255#144#149#147#255#133#138#136#255#133
   +#138#136#255#141#146#144#255#152#158#155#255#164#170#167#255#175#182#179#255
   +#138#136#255#141#146#144#255#152#158#155#255#164#170#167#255#175#182#179#255
-  +#187#194#190#255#198#206#202#255#206#214#210#254#148#155#152#222'SYW'#133'UZ'
-  +'U6UUU'#9#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255
-  +#0#255#255#255#0#255#255#255#0#255#255#255#0'III'#14'SVVM{'#129'}'#189#202
-  +#210#206#253#207#215#211#255#202#209#205#255#190#197#194#255#179#185#182#255
-  +#167#173#170#255#155#161#159#255#144#149#147#255#133#138#136#255#133#138#136
-  +#255#141#146#144#255#152#158#155#255#164#170#167#255#175#182#179#255#187#194
-  +#190#255#198#206#202#255#207#215#211#255#207#215#211#255#172#179#175#234'TXV'
-  +#128'SZZ"UUU'#3#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255
-  +#255#255#0#255#255#255#0#0#0#0#1'RRR'#28'RVT|'#176#183#179#236#207#215#211
-  +#255#207#215#211#255#202#209#205#255#190#197#194#255#179#185#182#255#167#173
-  +#170#255#155#161#159#255#144#149#147#255#133#138#136#255#132#137#135#255#139
-  +#144#142#255#150#156#153#255#163#169#166#255#174#181#178#255#187#194#190#255
-  +#198#206#202#255#207#215#211#255#207#215#211#255#206#214#210#255'lrm'#184'HK'
-  +'KGMMM'#10#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255
-  ,#255#0#255#255#255#0#0#0#0#1'PWW#_cb'#149#206#213#210#254#207#215#211#255#207
-  +#215#211#255#202#209#205#255#190#197#194#255#179#185#182#255#167#173#170#255
-  +#154#160#158#255#140#145#143#255#127#132#130#255's'#128'y'#255']'#131'm'#255
-  +'g'#138'v'#255#131#151#139#255#160#169#165#255#180#186#183#255#195#203#199
-  +#255#206#214#210#255#206#214#210#255#201#208#204#255'X'#132'c'#236'*x:'#221
-  +'333'#25#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255
-  +#0#255#255#255#0#0#0#0#1'PWW#glj'#153#207#215#211#255#207#215#211#255#207#215
-  +#211#255#202#209#205#255#190#197#194#255#178#184#181#255#162#168#165#255#134
-  +#148#141#255'E'#135'd'#255','#145'Y'#255'%'#155'Y'#255'%'#154'V'#255'%'#152
-  +'T'#255'&'#151'R'#255''''#149'P'#255'>'#143'\'#255#141#169#151#255#197#205
-  +#201#255#201#209#205#255#149#175#157#255'*'#139'C'#255'*'#139'A'#255'$T,F'#0
-  +#0#0#2#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0
-  +#0#0#0#1'UUU!fli'#147#207#215#211#255#207#215#211#255#207#215#211#255#202#209
-  +#205#255#189#196#193#255#166#174#170#255'W'#147'u'#255'&'#157'a'#255'"'#160
-  +'_'#255'#'#159']'#255'$'#157'['#255'$'#156'Y'#255'%'#154'V'#255'%'#153'T'#255
-  +'&'#151'R'#255'&'#150'P'#255''''#148'N'#255'F'#146'a'#255#140#168#150#255'6'
-  +#141'P'#255')'#142'F'#255'*'#140'D'#255'$i5'#143#0#0#0#6#255#255#255#0#255
-  +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#0#0#0#1'PXX hkj'#142#207
-  +#215#211#255#207#215#211#255#207#215#211#255#202#209#205#255#186#192#189#255
-  +'W'#155'z'#255'!'#165'e'#255'!'#164'c'#255'"'#162'a'#255'"'#160'_'#255'#'#159
-  +']'#255'#'#157'['#255'$'#156'Y'#255'%'#154'W'#255'%'#153'U'#255'&'#151'S'#255
-  +'&'#150'P'#255''''#148'N'#255''''#147'L'#255'('#145'J'#255'('#144'H'#255')'
-  +#142'F'#255'%y;'#202#0#0#0#9#255#255#255#0#255#255#255#0#255#255#255#0#255
-  +#255#255#0#255#255#255#0#0#0#0#1'UUU'#30'hml'#135#207#215#211#255#207#215#211
-  +#255#207#215#211#255#202#209#205#255#190#196#194#255'o'#166#141#255' '#167'h'
-  +#255'!'#165'f'#255'!'#164'd'#255'"'#162'a'#255'"'#161'_'#255'#'#158']'#255'$'
-  +#157'['#255'$'#156'Y'#255'$'#155'W'#255'%'#153'U'#255'&'#151'S'#255'&'#150'Q'
-  +#255''''#148'O'#255''''#147'M'#255'('#145'K'#255'('#144'I'#255''''#138'C'#246
-  +#0#14#14#18#0#0#0#1#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#0
-  +#0#0#1'R[R'#28'jnn'#129#207#215#211#255#207#215#211#255#214#221#218#255#200
-  +#203#201#255#154#157#155#255'|'#128'|'#255'0'#149'f'#255' '#167'h'#255'!'#163
-  +'e'#255':'#137'c'#255']'#127'o'#255'z'#133#127#255'~'#136#129#255'b'#132'q'
-  +#255'4'#138'Z'#255'$'#155'W'#255'%'#153'U'#255'&'#152'S'#255'&'#150'Q'#255
-  +''''#149'O'#255''''#147'M'#255'('#146'K'#255'('#144'I'#255#28']/R'#0#0#0#3
-  +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#0#0#0#1'UUU'#27'jpo'
-  +'|'#207#215#211#255#218#223#221#255#171#175#173#255#178#185#181#255#189#196
-  +#193#255#178#184#181#255#144#160#153#255'Z'#147'y'#255'q'#137'~'#255#128#133
-  +#131#255#131#136#134#255#140#145#143#255#151#157#154#255#161#167#164#255#161
-  +#170#166#255'K'#148'l'#255'$'#155'X'#255'%'#153'V'#255'%'#152'S'#255'&'#150
-  +'Q'#255''''#149'O'#255''''#147'M'#255'('#146'K'#255#31'r:'#155#0#0#0#7#255
-  +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#0#0#0#1'R\R'#25'lqnu'
-  +#217#223#219#255#173#179#175#255#206#214#210#255#202#209#205#255#190#197#194
-  +#255#179#185#182#255#166#172#169#255#152#158#156#255#143#148#146#255#133#138
-  +#136#255#133#138#136#255#141#146#144#255#152#158#155#255#164#170#167#255#170
-  +#176#173#255'e'#151'|'#255'$'#157'Z'#255'$'#155'X'#255'%'#154'V'#255'%'#152
-  +'T'#255'&'#151'R'#255'&'#149'P'#255''''#148'N'#255'$'#131'D'#214#0#0#0#11#255
-  +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#0#0#0#1'YYY'#23'lsqo'
-  +#201#206#204#255#207#215#211#255#207#215#211#255#202#209#205#255#190#197#194
-  +#255#179#185#182#255#167#173#170#255#155#161#159#255#144#149#147#255#133#138
-  +#136#255#133#138#136#255#141#146#144#255#152#158#155#255#162#168#165#255#138
-  +#160#150#255''''#158'_'#255'#'#159'\'#255'$'#157'Z'#255'$'#155'X'#255'%'#154
-  +'V'#255'%'#152'T'#255'&'#151'R'#255'&'#149'P'#255'%'#142'K'#240#0#0#0#12#255
-  +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#0#0#0#1'QQQ'#22'cee`'
-  +#202#209#206#255#207#215#211#255#207#215#211#255#202#209#205#255#190#197#194
-  +#255#179#185#182#255#167#173#170#255#155#161#159#255#144#149#147#255#133#138
-  +#136#255#133#138#136#255#141#146#144#255#152#158#155#255#158#164#161#255'7'
-  +#153'i'#255'"'#162'a'#255'"'#160'_'#255'#'#159']'#255'$'#157'['#255'$'#156'Y'
-  +#255'%'#154'W'#255'%'#153'S'#254'$'#143'N'#239#30'x?'#153#0#0#0#7#255#255#255
-  +#0#255#255#255#0#255#255#255#0#255#255#255#0#0#0#0#1'YYY'#20'qssc'#207#215
-  +#211#255#207#215#211#255#207#215#211#255#202#209#205#255#190#197#194#255#179
-  +#185#182#255#167#173#170#255#155#161#159#255#144#149#147#255#133#138#136#255
-  +#133#138#136#255#141#146#144#255#152#158#155#255#158#163#160#255'3'#156'j'
-  +#255'5'#155'h'#255'G'#155'p'#255'\'#160'|'#255'r'#166#138#255#136#174#154#255
-  +#134#160#145#207'<K@D$$$'#21#0#0#0#7#0#0#0#1#255#255#255#0#255#255#255#0#255
-  ,#255#255#0#255#255#255#0#0#0#0#1'QQQ'#19'rwu]'#207#215#211#255#207#215#211
-  +#255#207#215#211#255#202#209#205#255#190#197#194#255#179#185#182#255#167#173
-  +#170#255#155#161#159#255#144#149#147#255#133#138#136#255#133#138#136#255#140
-  +#145#143#255#150#156#153#255#161#167#164#255#165#171#168#255#178#185#181#255
-  +#191#199#195#255#201#209#205#255#202#210#206#255#204#212#208#255#177#184#182
-  +#184'QQQ/UUU'#9#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255
-  +#255#255#0#255#255#255#0#0#0#0#1'ZZZ'#17'tywW'#207#215#211#255#207#215#211
-  +#255#207#215#211#255#202#209#205#255#190#197#194#255#178#184#181#255#164#170
-  +#167#255#150#156#154#255#139#144#142#255#127#132#130#255'~'#131#129#255'~'
-  +#136#133#255't'#144#132#255'i'#150#130#255'`'#156#129#255#172#184#178#255#197
-  +#205#201#255#207#215#211#255#207#215#211#255#207#215#211#255#182#189#186#180
-  +'QWW)```'#8#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255
-  +#255#0#255#255#255#0#255#255#255#0'UUU'#15'v||P'#207#215#211#255#207#215#211
-  +#255#207#215#211#255#202#209#205#255#189#196#193#255#165#175#170#255'_'#158
-  +#135#255'F'#156'|'#255'6'#157'v'#255'*'#163's'#255'"'#169's'#255#29#175's'
-  +#255#30#173'q'#255#30#172'o'#255#31#170'l'#255#138#171#156#255#196#204#200
-  +#255#207#215#211#255#207#215#211#255#207#215#211#255#184#192#188#176'SZS%ImI'
-  +#7#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255
-  +#255#255#0#255#255#255#0'I[['#14'x'#127#127'K'#207#215#211#255#207#215#211
-  +#255#207#215#211#255#208#215#211#255#207#211#210#255'Q'#175#142#255#26#184
-  +#128#255#26#183'}'#255#27#181'{'#255#27#180'y'#255#28#178'w'#255#29#177'u'
-  +#255#29#175's'#255#30#174'q'#255'4'#150'k'#255#144#149#146#255#174#181#177
-  +#255#203#211#207#255#207#215#211#255#207#215#211#255#186#193#190#173'SSS"UUU'
-  +#6#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255
-  +#255#255#0#255#255#255#0'UUU'#12'}'#132#128'D'#207#215#211#255#209#216#213
-  +#255#223#229#227#255#209#215#213#255#187#194#191#255'H'#168#135#255#25#186
-  +#130#255#26#184#128#255#26#183'~'#255#27#181'|'#255#27#180'z'#255#28#178'w'
-  +#255#28#177'u'#255'#'#168'r'#255#129#146#138#255#149#155#152#255#143#149#148
-  +#255#140#145#142#255#185#193#189#255#207#215#211#255#189#195#192#169'XXX'#29
-  +'UUU'#6#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0
-  +#255#255#255#0#255#255#255#0'MfM'#10#128#136#132'?'#211#218#215#255#224#227
-  +#226#255#202#209#206#255#195#203#199#255#187#195#191#255'q'#169#150#255#25
-  +#188#132#255#25#186#130#255#26#185#128#255#26#183'~'#255#27#182'|'#255#27#180
-  +'z'#255#28#179'x'#255'A'#148't'#255#145#151#148#255#149#155#152#255#146#152
-  +#150#255#143#148#146#255#137#141#140#255#169#174#171#255#184#190#185#168'@@@'
-  +'$'''''''#13#0#0#0#1#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0
-  +#255#255#255#0#255#255#255#0'UUU'#9#135#139#139'9'#223#227#225#255#203#210
-  +#207#255#199#206#203#255#195#203#199#255#190#197#193#255#162#179#172#255#25
-  +#188#134#255#24#188#133#255#25#186#130#255#26#185#128#255#26#183'~'#255#27
-  +#182'|'#255#27#180'z'#255#28#179'x'#255'I'#147'u'#255#140#146#143#255#142#147
-  +#145#255#139#143#141#255#133#138#136#255'u'#129'|'#255'D'#150'p'#225#30#161
-  +'c'#244#27#140'V'#186#0#0#0#12#0#0#0#1#255#255#255#0#255#255#255#0#255#255
-  +#255#0#255#255#255#0#255#255#255#0'III'#7#145#150#150'1'#220#225#223#255#203
-  +#210#207#255#199#206#203#255#195#203#199#255#191#199#195#255#180#187#183#255
-  +'+'#176#133#255#24#190#135#255#24#188#133#255#25#187#131#255#25#185#129#255
-  +#26#184#127#255#27#182'}'#255#27#181'z'#255#28#179'x'#255'%'#166'r'#255'8'
-  +#149'p'#255'@'#143'n'#255'0'#152'k'#255'!'#165'l'#255#31#170'l'#255' '#168'j'
-  +#255' '#167'h'#255#24'zK}'#0#0#0#5#255#255#255#0#255#255#255#0#255#255#255#0
-  +#255#255#255#0#255#255#255#0'fff'#5'YYY'#20#219#224#222#248#203#210#207#255
-  +#199#206#203#255#195#203#199#255#191#199#195#255#183#190#186#255'N'#168#139
-  +#255#23#191#137#255#24#190#135#255#24#188#133#255#25#187#131#255#25#185#129
-  +#255#26#184#127#255#26#182'}'#255#27#181'{'#255#28#179'y'#255#28#178'w'#255
-  +#29#176'u'#255#29#175'r'#255#30#173'p'#255#30#172'n'#255#31#170'l'#255#31#169
-  +'j'#255#30#156'b'#227#0#0#0#10#255#255#255#0#255#255#255#0#255#255#255#0#255
-  +#255#255#0#255#255#255#0#128#128#128#2'MMM'#10#216#220#218#151#205#211#208
-  +#255#199#206#203#255#195#203#199#255#191#199#195#255#185#192#188#255'{'#169
-  +#155#255#23#193#140#255#23#192#138#255#24#190#136#255'1'#167'~'#255#29#182
-  +#129#255#25#186#129#255#26#184#127#255#26#183'}'#255#27#181'{'#255#27#179'y'
-  +#255#28#178'w'#255#29#176'u'#255#29#175's'#255#30#173'q'#255#30#172'o'#255#31
-  +#167'k'#250#25#134'S'#145#0#0#0#6#255#255#255#0#255#255#255#0#255#255#255#0
-  +#255#255#255#0#255#255#255#0#255#255#255#0'UUU'#3'@``'#8#213#217#216#144#205
-  +#211#209#255#195#203#199#255#191#199#195#255#187#194#190#255#168#179#175#255
-  +#25#191#140#255#22#193#140#255','#175#133#255#153#161#158#255#142#158#152#255
-  +'F'#157#127#255#28#182#128#255#26#184#128#255#26#183'}'#255#27#181'{'#255#27
-  ,#180'y'#255#28#178'w'#255#29#177'u'#255#29#175'r'#254#26#148'`'#188#14'[:5'#0
-  +#0#0#8#0#0#0#1#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255
-  +#255#255#0#255#255#255#0#255#255#255#0#0#255#255#1'UUU'#3#205#220#215'4'#208
-  +#214#211#222#198#206#202#254#188#195#191#255#177#184#181#255'3'#177#139#255
-  +#26#191#140#255#134#162#152#255#167#173#170#255#164#170#168#255#156#163#160
-  +#255#132#152#145#255'O'#152'~'#255'='#153'x'#255'-'#159'v'#253'$'#166'u'#242
-  +#23#151'g'#186#22#133'Z'#128#14'd@8'#0#0#0#10#0#0#0#2#255#255#255#0#255#255
+  +#174#181#177#250#148#155#152#231'msq'#188'SWUoSYY+MMM'#10#0#0#0#1#255#255#255
+  +#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255
+  +#255#255#0#255#255#255#0'UUU'#3'NXX'#26'TZW^lqn'#184#186#194#190#247#202#209
+  +#205#255#190#197#194#255#179#185#182#255#167#173#170#255#155#161#159#255#144
+  +#149#147#255#133#138#136#255#133#138#136#255#141#146#144#255#152#158#155#255
+  +#164#170#167#255#175#182#179#255#187#194#190#255#198#206#202#255#206#214#210
+  +#254#148#155#152#222'SYW'#133'UZU6UUU'#9#255#255#255#0#255#255#255#0#255#255
   +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0
   +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0
-  +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#0#0#0#1#0#0#0#1#0#0
-  +#0#1#201#205#201'p'#188#193#192#213#146#176#167#238#142#171#161#248#170#175
-  +#172#252#168#174#172#253#163#169#167#249#159#164#162#240#153#159#155#225#147
-  +#152#150#180'xxx$'#0#0#0#11#0#0#0#12#0#0#0#9#0#0#0#5#0#0#0#2#255#255#255#0
-  +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255
+  +'III'#14'SVVM{'#129'}'#189#202#210#206#253#207#215#211#255#202#209#205#255
+  +#190#197#194#255#179#185#182#255#167#173#170#255#155#161#159#255#144#149#147
+  +#255#133#138#136#255#133#138#136#255#141#146#144#255#152#158#155#255#164#170
+  +#167#255#175#182#179#255#187#194#190#255#198#206#202#255#207#215#211#255#207
+  +#215#211#255#172#179#175#234'TXV'#128'SZZ"UUU'#3#255#255#255#0#255#255#255#0
+  +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#0#0#0#1'RRR'#28'RVT'
+  +'|'#176#183#179#236#207#215#211#255#207#215#211#255#202#209#205#255#190#197
+  +#194#255#179#185#182#255#167#173#170#255#155#161#159#255#144#149#147#255#133
+  +#138#136#255#132#137#135#255#139#144#142#255#150#156#153#255#163#169#166#255
+  +#174#181#178#255#187#194#190#255#198#206#202#255#207#215#211#255#207#215#211
+  +#255#206#214#210#255'lrm'#184'HKKGMMM'#10#255#255#255#0#255#255#255#0#255#255
+  ,#255#0#255#255#255#0#255#255#255#0#255#255#255#0#0#0#0#1'PWW#_cb'#149#206#213
+  +#210#254#207#215#211#255#207#215#211#255#202#209#205#255#190#197#194#255#179
+  +#185#182#255#167#173#170#255#154#160#158#255#140#145#143#255#127#132#130#255
+  +'s'#128'y'#255']'#131'm'#255'g'#138'v'#255#131#151#139#255#160#169#165#255
+  +#180#186#183#255#195#203#199#255#206#214#210#255#206#214#210#255#201#208#204
+  +#255'X'#132'c'#236'*x:'#221'333'#25#255#255#255#0#255#255#255#0#255#255#255#0
+  +#255#255#255#0#255#255#255#0#255#255#255#0#0#0#0#1'PWW#glj'#153#207#215#211
+  +#255#207#215#211#255#207#215#211#255#202#209#205#255#190#197#194#255#178#184
+  +#181#255#162#168#165#255#134#148#141#255'E'#135'd'#255','#145'Y'#255'%'#155
+  +'Y'#255'%'#154'V'#255'%'#152'T'#255'&'#151'R'#255''''#149'P'#255'>'#143'\'
+  +#255#141#169#151#255#197#205#201#255#201#209#205#255#149#175#157#255'*'#139
+  +'C'#255'*'#139'A'#255'$T,F'#0#0#0#2#255#255#255#0#255#255#255#0#255#255#255#0
+  +#255#255#255#0#255#255#255#0#0#0#0#1'UUU!fli'#147#207#215#211#255#207#215#211
+  +#255#207#215#211#255#202#209#205#255#189#196#193#255#166#174#170#255'W'#147
+  +'u'#255'&'#157'a'#255'"'#160'_'#255'#'#159']'#255'$'#157'['#255'$'#156'Y'#255
+  +'%'#154'V'#255'%'#153'T'#255'&'#151'R'#255'&'#150'P'#255''''#148'N'#255'F'
+  +#146'a'#255#140#168#150#255'6'#141'P'#255')'#142'F'#255'*'#140'D'#255'$i5'
+  +#143#0#0#0#6#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255
+  +#255#0#0#0#0#1'PXX hkj'#142#207#215#211#255#207#215#211#255#207#215#211#255
+  +#202#209#205#255#186#192#189#255'W'#155'z'#255'!'#165'e'#255'!'#164'c'#255'"'
+  +#162'a'#255'"'#160'_'#255'#'#159']'#255'#'#157'['#255'$'#156'Y'#255'%'#154'W'
+  +#255'%'#153'U'#255'&'#151'S'#255'&'#150'P'#255''''#148'N'#255''''#147'L'#255
+  +'('#145'J'#255'('#144'H'#255')'#142'F'#255'%y;'#202#0#0#0#9#255#255#255#0#255
+  +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#0#0#0#1'UUU'#30'hml'#135
+  +#207#215#211#255#207#215#211#255#207#215#211#255#202#209#205#255#190#196#194
+  +#255'o'#166#141#255' '#167'h'#255'!'#165'f'#255'!'#164'd'#255'"'#162'a'#255
+  +'"'#161'_'#255'#'#158']'#255'$'#157'['#255'$'#156'Y'#255'$'#155'W'#255'%'#153
+  +'U'#255'&'#151'S'#255'&'#150'Q'#255''''#148'O'#255''''#147'M'#255'('#145'K'
+  +#255'('#144'I'#255''''#138'C'#246#0#14#14#18#0#0#0#1#255#255#255#0#255#255
+  +#255#0#255#255#255#0#255#255#255#0#0#0#0#1'R[R'#28'jnn'#129#207#215#211#255
+  +#207#215#211#255#214#221#218#255#200#203#201#255#154#157#155#255'|'#128'|'
+  +#255'0'#149'f'#255' '#167'h'#255'!'#163'e'#255':'#137'c'#255']'#127'o'#255'z'
+  +#133#127#255'~'#136#129#255'b'#132'q'#255'4'#138'Z'#255'$'#155'W'#255'%'#153
+  +'U'#255'&'#152'S'#255'&'#150'Q'#255''''#149'O'#255''''#147'M'#255'('#146'K'
+  +#255'('#144'I'#255#28']/R'#0#0#0#3#255#255#255#0#255#255#255#0#255#255#255#0
+  +#255#255#255#0#0#0#0#1'UUU'#27'jpo|'#207#215#211#255#218#223#221#255#171#175
+  +#173#255#178#185#181#255#189#196#193#255#178#184#181#255#144#160#153#255'Z'
+  +#147'y'#255'q'#137'~'#255#128#133#131#255#131#136#134#255#140#145#143#255#151
+  +#157#154#255#161#167#164#255#161#170#166#255'K'#148'l'#255'$'#155'X'#255'%'
+  +#153'V'#255'%'#152'S'#255'&'#150'Q'#255''''#149'O'#255''''#147'M'#255'('#146
+  +'K'#255#31'r:'#155#0#0#0#7#255#255#255#0#255#255#255#0#255#255#255#0#255#255
+  +#255#0#0#0#0#1'R\R'#25'lqnu'#217#223#219#255#173#179#175#255#206#214#210#255
+  +#202#209#205#255#190#197#194#255#179#185#182#255#166#172#169#255#152#158#156
+  +#255#143#148#146#255#133#138#136#255#133#138#136#255#141#146#144#255#152#158
+  +#155#255#164#170#167#255#170#176#173#255'e'#151'|'#255'$'#157'Z'#255'$'#155
+  +'X'#255'%'#154'V'#255'%'#152'T'#255'&'#151'R'#255'&'#149'P'#255''''#148'N'
+  +#255'$'#131'D'#214#0#0#0#11#255#255#255#0#255#255#255#0#255#255#255#0#255#255
+  +#255#0#0#0#0#1'YYY'#23'lsqo'#201#206#204#255#207#215#211#255#207#215#211#255
+  +#202#209#205#255#190#197#194#255#179#185#182#255#167#173#170#255#155#161#159
+  +#255#144#149#147#255#133#138#136#255#133#138#136#255#141#146#144#255#152#158
+  +#155#255#162#168#165#255#138#160#150#255''''#158'_'#255'#'#159'\'#255'$'#157
+  +'Z'#255'$'#155'X'#255'%'#154'V'#255'%'#152'T'#255'&'#151'R'#255'&'#149'P'#255
+  +'%'#142'K'#240#0#0#0#12#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255
+  +#0#0#0#0#1'QQQ'#22'cee`'#202#209#206#255#207#215#211#255#207#215#211#255#202
+  +#209#205#255#190#197#194#255#179#185#182#255#167#173#170#255#155#161#159#255
+  +#144#149#147#255#133#138#136#255#133#138#136#255#141#146#144#255#152#158#155
+  +#255#158#164#161#255'7'#153'i'#255'"'#162'a'#255'"'#160'_'#255'#'#159']'#255
+  +'$'#157'['#255'$'#156'Y'#255'%'#154'W'#255'%'#153'S'#254'$'#143'N'#239#30'x?'
+  +#153#0#0#0#7#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#0#0#0#1
+  +'YYY'#20'qssc'#207#215#211#255#207#215#211#255#207#215#211#255#202#209#205
+  +#255#190#197#194#255#179#185#182#255#167#173#170#255#155#161#159#255#144#149
+  +#147#255#133#138#136#255#133#138#136#255#141#146#144#255#152#158#155#255#158
+  +#163#160#255'3'#156'j'#255'5'#155'h'#255'G'#155'p'#255'\'#160'|'#255'r'#166
+  +#138#255#136#174#154#255#134#160#145#207'<K@D$$$'#21#0#0#0#7#0#0#0#1#255#255
+  ,#255#0#255#255#255#0#255#255#255#0#255#255#255#0#0#0#0#1'QQQ'#19'rwu]'#207
+  +#215#211#255#207#215#211#255#207#215#211#255#202#209#205#255#190#197#194#255
+  +#179#185#182#255#167#173#170#255#155#161#159#255#144#149#147#255#133#138#136
+  +#255#133#138#136#255#140#145#143#255#150#156#153#255#161#167#164#255#165#171
+  +#168#255#178#185#181#255#191#199#195#255#201#209#205#255#202#210#206#255#204
+  +#212#208#255#177#184#182#184'QQQ/UUU'#9#255#255#255#0#255#255#255#0#255#255
+  +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#0#0#0#1'ZZZ'#17'tywW'#207
+  +#215#211#255#207#215#211#255#207#215#211#255#202#209#205#255#190#197#194#255
+  +#178#184#181#255#164#170#167#255#150#156#154#255#139#144#142#255#127#132#130
+  +#255'~'#131#129#255'~'#136#133#255't'#144#132#255'i'#150#130#255'`'#156#129
+  +#255#172#184#178#255#197#205#201#255#207#215#211#255#207#215#211#255#207#215
+  +#211#255#182#189#186#180'QWW)```'#8#255#255#255#0#255#255#255#0#255#255#255#0
+  +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0'UUU'#15'v||P'#207
+  +#215#211#255#207#215#211#255#207#215#211#255#202#209#205#255#189#196#193#255
+  +#165#175#170#255'_'#158#135#255'F'#156'|'#255'6'#157'v'#255'*'#163's'#255'"'
+  +#169's'#255#29#175's'#255#30#173'q'#255#30#172'o'#255#31#170'l'#255#138#171
+  +#156#255#196#204#200#255#207#215#211#255#207#215#211#255#207#215#211#255#184
+  +#192#188#176'SZS%ImI'#7#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255
+  +#0#255#255#255#0#255#255#255#0#255#255#255#0'I[['#14'x'#127#127'K'#207#215
+  +#211#255#207#215#211#255#207#215#211#255#208#215#211#255#207#211#210#255'Q'
+  +#175#142#255#26#184#128#255#26#183'}'#255#27#181'{'#255#27#180'y'#255#28#178
+  +'w'#255#29#177'u'#255#29#175's'#255#30#174'q'#255'4'#150'k'#255#144#149#146
+  +#255#174#181#177#255#203#211#207#255#207#215#211#255#207#215#211#255#186#193
+  +#190#173'SSS"UUU'#6#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0
+  +#255#255#255#0#255#255#255#0#255#255#255#0'UUU'#12'}'#132#128'D'#207#215#211
+  +#255#209#216#213#255#223#229#227#255#209#215#213#255#187#194#191#255'H'#168
+  +#135#255#25#186#130#255#26#184#128#255#26#183'~'#255#27#181'|'#255#27#180'z'
+  +#255#28#178'w'#255#28#177'u'#255'#'#168'r'#255#129#146#138#255#149#155#152
+  +#255#143#149#148#255#140#145#142#255#185#193#189#255#207#215#211#255#189#195
+  +#192#169'XXX'#29'UUU'#6#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255
+  +#0#255#255#255#0#255#255#255#0#255#255#255#0'MfM'#10#128#136#132'?'#211#218
+  +#215#255#224#227#226#255#202#209#206#255#195#203#199#255#187#195#191#255'q'
+  +#169#150#255#25#188#132#255#25#186#130#255#26#185#128#255#26#183'~'#255#27
+  +#182'|'#255#27#180'z'#255#28#179'x'#255'A'#148't'#255#145#151#148#255#149#155
+  +#152#255#146#152#150#255#143#148#146#255#137#141#140#255#169#174#171#255#184
+  +#190#185#168'@@@$'''''''#13#0#0#0#1#255#255#255#0#255#255#255#0#255#255#255#0
+  +#255#255#255#0#255#255#255#0#255#255#255#0'UUU'#9#135#139#139'9'#223#227#225
+  +#255#203#210#207#255#199#206#203#255#195#203#199#255#190#197#193#255#162#179
+  +#172#255#25#188#134#255#24#188#133#255#25#186#130#255#26#185#128#255#26#183
+  +'~'#255#27#182'|'#255#27#180'z'#255#28#179'x'#255'I'#147'u'#255#140#146#143
+  +#255#142#147#145#255#139#143#141#255#133#138#136#255'u'#129'|'#255'D'#150'p'
+  +#225#30#161'c'#244#27#140'V'#186#0#0#0#12#0#0#0#1#255#255#255#0#255#255#255#0
+  +#255#255#255#0#255#255#255#0#255#255#255#0'III'#7#145#150#150'1'#220#225#223
+  +#255#203#210#207#255#199#206#203#255#195#203#199#255#191#199#195#255#180#187
+  +#183#255'+'#176#133#255#24#190#135#255#24#188#133#255#25#187#131#255#25#185
+  +#129#255#26#184#127#255#27#182'}'#255#27#181'z'#255#28#179'x'#255'%'#166'r'
+  +#255'8'#149'p'#255'@'#143'n'#255'0'#152'k'#255'!'#165'l'#255#31#170'l'#255' '
+  +#168'j'#255' '#167'h'#255#24'zK}'#0#0#0#5#255#255#255#0#255#255#255#0#255#255
+  +#255#0#255#255#255#0#255#255#255#0'fff'#5'YYY'#20#219#224#222#248#203#210#207
+  +#255#199#206#203#255#195#203#199#255#191#199#195#255#183#190#186#255'N'#168
+  +#139#255#23#191#137#255#24#190#135#255#24#188#133#255#25#187#131#255#25#185
+  +#129#255#26#184#127#255#26#182'}'#255#27#181'{'#255#28#179'y'#255#28#178'w'
+  +#255#29#176'u'#255#29#175'r'#255#30#173'p'#255#30#172'n'#255#31#170'l'#255#31
+  +#169'j'#255#30#156'b'#227#0#0#0#10#255#255#255#0#255#255#255#0#255#255#255#0
+  +#255#255#255#0#255#255#255#0#128#128#128#2'MMM'#10#216#220#218#151#205#211
+  +#208#255#199#206#203#255#195#203#199#255#191#199#195#255#185#192#188#255'{'
+  +#169#155#255#23#193#140#255#23#192#138#255#24#190#136#255'1'#167'~'#255#29
+  +#182#129#255#25#186#129#255#26#184#127#255#26#183'}'#255#27#181'{'#255#27#179
+  +'y'#255#28#178'w'#255#29#176'u'#255#29#175's'#255#30#173'q'#255#30#172'o'#255
+  +#31#167'k'#250#25#134'S'#145#0#0#0#6#255#255#255#0#255#255#255#0#255#255#255
+  +#0#255#255#255#0#255#255#255#0#255#255#255#0'UUU'#3'@``'#8#213#217#216#144
+  +#205#211#209#255#195#203#199#255#191#199#195#255#187#194#190#255#168#179#175
+  +#255#25#191#140#255#22#193#140#255','#175#133#255#153#161#158#255#142#158#152
+  +#255'F'#157#127#255#28#182#128#255#26#184#128#255#26#183'}'#255#27#181'{'#255
+  ,#27#180'y'#255#28#178'w'#255#29#177'u'#255#29#175'r'#254#26#148'`'#188#14'[:'
+  +'5'#0#0#0#8#0#0#0#1#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0
+  +#255#255#255#0#255#255#255#0#255#255#255#0#0#255#255#1'UUU'#3#205#220#215'4'
+  +#208#214#211#222#198#206#202#254#188#195#191#255#177#184#181#255'3'#177#139
+  +#255#26#191#140#255#134#162#152#255#167#173#170#255#164#170#168#255#156#163
+  +#160#255#132#152#145#255'O'#152'~'#255'='#153'x'#255'-'#159'v'#253'$'#166'u'
+  +#242#23#151'g'#186#22#133'Z'#128#14'd@8'#0#0#0#10#0#0#0#2#255#255#255#0#255
+  +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255
+  +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#0#0#0#1#0#0#0
+  +#1#0#0#0#1#201#205#201'p'#188#193#192#213#146#176#167#238#142#171#161#248#170
+  +#175#172#252#168#174#172#253#163#169#167#249#159#164#162#240#153#159#155#225
+  +#147#152#150#180'xxx$'#0#0#0#11#0#0#0#12#0#0#0#9#0#0#0#5#0#0#0#2#255#255#255
+  +#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255
   +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255
   +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255
   +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0
   +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0
   +#255#255#255#0#0#0#0#2#0#0#0#2#255#255#255#0#255#255#255#0#255#255#255#0#255
   +#255#255#255#0#0#0#0#2#0#0#0#2#255#255#255#0#255#255#255#0#255#255#255#0#255

File diff suppressed because it is too large
+ 584 - 557
main.pas


+ 8 - 5
newconstraint.pas

@@ -53,12 +53,15 @@ procedure TfmNewConstraint.cbTablesChange(Sender: TObject);
 var
 var
   FieldsList: TStringList;
   FieldsList: TStringList;
 begin
 begin
-  // Get foriegn table fields
+  // Get foreign table fields
   FieldsList:= TStringList.Create;
   FieldsList:= TStringList.Create;
-  fmMain.GetFields(DatabaseIndex, cbTables.Text, FieldsList);
-  clxForFields.Clear;
-  clxForFields.Items.AddStrings(FieldsList);
-  FieldsList.Free;
+  try
+    fmMain.GetFields(DatabaseIndex, cbTables.Text, FieldsList);
+    clxForFields.Clear;
+    clxForFields.Items.AddStrings(FieldsList);
+  finally
+    FieldsList.Free;
+  end;
   fmMain.SQLQuery1.Close;
   fmMain.SQLQuery1.Close;
 end;
 end;
 
 

+ 24 - 21
newgen.pas

@@ -54,30 +54,33 @@ begin
   begin
   begin
     Valid:= True;
     Valid:= True;
     List:= TStringList.Create;
     List:= TStringList.Create;
-    List.Add('create generator ' + edGenName.Text + ';');
-    if cxTrigger.Checked then
-    begin
-      Valid:= False;
-      if (cbTables.ItemIndex = -1) or (cbFields.ItemIndex = -1) then
-        MessageDlg('You should select a table and a field', mtError, [mbOk], 0)
-      else
-      if Trim(edGenName.Text) = '' then
-        MessageDlg('You should enter generator name', mtError, [mbOK], 0)
-      else
+    try
+      List.Add('create generator ' + edGenName.Text + ';');
+      if cxTrigger.Checked then
       begin
       begin
-        List.Add('CREATE TRIGGER ' + Trim(edGenName.Text) + ' FOR ' + cbTables.Text);
-        List.Add('ACTIVE BEFORE INSERT POSITION 0 ');
-        List.Add('AS BEGIN ');
-        List.Add('IF (NEW.' + cbFields.Text + ' IS NULL OR NEW.' + cbFields.Text + ' = 0) THEN ');
-        List.Add('  NEW.' + cbFields.Text + ' = GEN_ID(' + edGenName.Text + ', 1);');
-        List.Add('END;');
-        Valid:= True;
-      end;
+        Valid:= False;
+        if (cbTables.ItemIndex = -1) or (cbFields.ItemIndex = -1) then
+          MessageDlg('You should select a table and a field', mtError, [mbOk], 0)
+        else
+        if Trim(edGenName.Text) = '' then
+          MessageDlg('You should enter generator name', mtError, [mbOK], 0)
+        else
+        begin
+          List.Add('CREATE TRIGGER ' + Trim(edGenName.Text) + ' FOR ' + cbTables.Text);
+          List.Add('ACTIVE BEFORE INSERT POSITION 0 ');
+          List.Add('AS BEGIN ');
+          List.Add('IF (NEW.' + cbFields.Text + ' IS NULL OR NEW.' + cbFields.Text + ' = 0) THEN ');
+          List.Add('  NEW.' + cbFields.Text + ' = GEN_ID(' + edGenName.Text + ', 1);');
+          List.Add('END;');
+          Valid:= True;
+        end;
 
 
+      end;
+      fmMain.ShowCompleteQueryWindow(fdbIndex, 'Create Generator: ' + edGenName.Text, List.Text);
+      Close;
+    finally
+      List.Free;
     end;
     end;
-    fmMain.ShowCompleteQueryWindow(fdbIndex, 'Create Generator: ' + edGenName.Text, List.Text);
-    Close;
-    List.Free;
   end
   end
   else
   else
     MessageDlg('You should write Generator name', mtError, [mbOK], 0);
     MessageDlg('You should write Generator name', mtError, [mbOK], 0);

+ 21 - 19
newtable.lfm

@@ -7,14 +7,16 @@ object fmNewTable: TfmNewTable
   Caption = 'New Table'
   Caption = 'New Table'
   ClientHeight = 618
   ClientHeight = 618
   ClientWidth = 594
   ClientWidth = 594
+  KeyPreview = True
   OnClose = FormClose
   OnClose = FormClose
+  OnKeyDown = FormKeyDown
   Position = poScreenCenter
   Position = poScreenCenter
-  LCLVersion = '1.0.4.0'
+  LCLVersion = '1.2.0.3'
   object Label1: TLabel
   object Label1: TLabel
     Left = 18
     Left = 18
-    Height = 14
+    Height = 13
     Top = 9
     Top = 9
-    Width = 85
+    Width = 79
     Caption = 'New Table name'
     Caption = 'New Table name'
     Font.Height = -11
     Font.Height = -11
     ParentColor = False
     ParentColor = False
@@ -22,7 +24,7 @@ object fmNewTable: TfmNewTable
   end
   end
   object edNewTable: TEdit
   object edNewTable: TEdit
     Left = 18
     Left = 18
-    Height = 23
+    Height = 21
     Top = 28
     Top = 28
     Width = 206
     Width = 206
     OnKeyUp = edNewTableKeyUp
     OnKeyUp = edNewTableKeyUp
@@ -100,9 +102,9 @@ object fmNewTable: TfmNewTable
   end
   end
   object cxCreateGen: TCheckBox
   object cxCreateGen: TCheckBox
     Left = 18
     Left = 18
-    Height = 19
-    Top = 501
-    Width = 259
+    Height = 17
+    Top = 503
+    Width = 239
     Anchors = [akLeft, akBottom]
     Anchors = [akLeft, akBottom]
     Caption = 'Create Auto increment Generator and Trigger'
     Caption = 'Create Auto increment Generator and Trigger'
     TabOrder = 4
     TabOrder = 4
@@ -122,9 +124,9 @@ object fmNewTable: TfmNewTable
   end
   end
   object cxGrantPermission: TCheckBox
   object cxGrantPermission: TCheckBox
     Left = 16
     Left = 16
-    Height = 19
-    Top = 534
-    Width = 49
+    Height = 17
+    Top = 536
+    Width = 47
     Anchors = [akLeft, akBottom]
     Anchors = [akLeft, akBottom]
     Caption = 'Grant'
     Caption = 'Grant'
     OnChange = cxGrantPermissionChange
     OnChange = cxGrantPermissionChange
@@ -132,12 +134,12 @@ object fmNewTable: TfmNewTable
   end
   end
   object cbPermission: TComboBox
   object cbPermission: TComboBox
     Left = 96
     Left = 96
-    Height = 23
-    Top = 530
+    Height = 21
+    Top = 532
     Width = 145
     Width = 145
     Anchors = [akLeft, akBottom]
     Anchors = [akLeft, akBottom]
     Enabled = False
     Enabled = False
-    ItemHeight = 15
+    ItemHeight = 13
     ItemIndex = 0
     ItemIndex = 0
     Items.Strings = (
     Items.Strings = (
       'Full'
       'Full'
@@ -150,9 +152,9 @@ object fmNewTable: TfmNewTable
   end
   end
   object laPermission: TLabel
   object laPermission: TLabel
     Left = 256
     Left = 256
-    Height = 16
-    Top = 533
-    Width = 73
+    Height = 13
+    Top = 536
+    Width = 63
     Anchors = [akLeft, akBottom]
     Anchors = [akLeft, akBottom]
     Caption = 'Permission to'
     Caption = 'Permission to'
     ParentColor = False
     ParentColor = False
@@ -160,11 +162,11 @@ object fmNewTable: TfmNewTable
   end
   end
   object cbRolesUsers: TComboBox
   object cbRolesUsers: TComboBox
     Left = 361
     Left = 361
-    Height = 23
-    Top = 530
+    Height = 21
+    Top = 532
     Width = 181
     Width = 181
     Anchors = [akLeft, akBottom]
     Anchors = [akLeft, akBottom]
-    ItemHeight = 15
+    ItemHeight = 13
     Items.Strings = (
     Items.Strings = (
       'Full'
       'Full'
       'Read '
       'Read '

+ 160 - 157
newtable.lrs

@@ -1,161 +1,164 @@
+{ This is an automatically generated lazarus resource file }
+
 LazarusResources.Add('TfmNewTable','FORMDATA',[
 LazarusResources.Add('TfmNewTable','FORMDATA',[
   'TPF0'#11'TfmNewTable'#10'fmNewTable'#4'Left'#3#23#2#6'Height'#3'j'#2#3'Top'#3
   'TPF0'#11'TfmNewTable'#10'fmNewTable'#4'Left'#3#23#2#6'Height'#3'j'#2#3'Top'#3
   +#192#0#5'Width'#3'R'#2#13'ActiveControl'#7#10'edNewTable'#7'Caption'#6#9'New'
   +#192#0#5'Width'#3'R'#2#13'ActiveControl'#7#10'edNewTable'#7'Caption'#6#9'New'
-  +' Table'#12'ClientHeight'#3'j'#2#11'ClientWidth'#3'R'#2#7'OnClose'#7#9'FormC'
-  +'lose'#8'Position'#7#14'poScreenCenter'#10'LCLVersion'#6#7'1.0.4.0'#0#6'TLab'
-  +'el'#6'Label1'#4'Left'#2#18#6'Height'#2#14#3'Top'#2#9#5'Width'#2'U'#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#23#3'Top'#2#28#5
-  +'Width'#3#206#0#7'OnKeyUp'#7#15'edNewTableKeyUp'#8'TabOrder'#2#0#0#0#11'TStr'
-  +'ingGrid'#11'StringGrid1'#4'Left'#2#18#6'Height'#3#163#1#3'Top'#2'B'#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'#18'goAlwaysShowEditor'#14'goSmoothScroll'#0#8'RowCount'#2#3#8'TabOrder'#2
-  +#1#13'OnEditingDone'#7#25'StringGrid1PickListSelect'#7'OnKeyUp'#7#16'StringG'
-  +'rid1KeyUp'#9'OnMouseUp'#7#18'StringGrid1MouseUp'#16'OnPickListSelect'#7#25
-  +'StringGrid1PickListSelect'#0#0#7'TBitBtn'#7'BitBtn2'#4'Left'#3#192#1#6'Heig'
-  +'ht'#2'.'#3'Top'#3'0'#2#5'Width'#2'`'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#6
-  +'Cancel'#9#7'Caption'#6#6'Cancel'#5'Color'#4#219#242#247#0#4'Kind'#7#8'bkCan'
-  +'cel'#11'ModalResult'#2#2#7'OnClick'#7#12'BitBtn2Click'#8'TabOrder'#2#2#0#0#7
-  +'TBitBtn'#8'bbScript'#4'Left'#2#18#6'Height'#2'.'#3'Top'#3'0'#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#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#19#3'Top'#3#245#1
-  +#5'Width'#3#3#1#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Caption'#6'+Create A'
-  +'uto increment Generator and Trigger'#8'TabOrder'#2#4#0#0#7'TBitBtn'#7'bbClo'
-  +'se'#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.S'
-  +'tyle'#11#6'fsBold'#0#7'OnClick'#7#12'bbCloseClick'#10'ParentFont'#8#8'TabOr'
-  +'der'#2#5#0#0#9'TCheckBox'#17'cxGrantPermission'#4'Left'#2#16#6'Height'#2#19
-  +#3'Top'#3#22#2#5'Width'#2'1'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Caption'
-  +#6#5'Grant'#8'OnChange'#7#23'cxGrantPermissionChange'#8'TabOrder'#2#6#0#0#9
-  +'TComboBox'#12'cbPermission'#4'Left'#2'`'#6'Height'#2#23#3'Top'#3#18#2#5'Wid'
-  +'th'#3#145#0#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Enabled'#8#10'ItemHeigh'
-  +'t'#2#15#9'ItemIndex'#2#0#13'Items.Strings'#1#6#4'Full'#6#7'Modify '#6#4'Rea'
-  +'d'#0#5'Style'#7#14'csDropDownList'#8'TabOrder'#2#7#4'Text'#6#4'Full'#0#0#6
-  +'TLabel'#12'laPermission'#4'Left'#3#0#1#6'Height'#2#16#3'Top'#3#21#2#5'Width'
-  +#2'I'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Caption'#6#13'Permission to'#11
-  +'ParentColor'#8#7'Visible'#8#0#0#9'TComboBox'#12'cbRolesUsers'#4'Left'#3'i'#1
-  +#6'Height'#2#23#3'Top'#3#18#2#5'Width'#3#181#0#7'Anchors'#11#6'akLeft'#8'akB'
-  +'ottom'#0#10'ItemHeight'#2#15#13'Items.Strings'#1#6#4'Full'#6#5'Read '#6#6'I'
-  +'nsert'#0#8'TabOrder'#2#8#7'Visible'#8#0#0#6'TImage'#6'Image1'#4'Left'#3#192
-  +#1#6'Height'#2'?'#3'Top'#2#0#5'Width'#2'P'#12'Picture.Data'#10#189#10#0#0#23
-  +'TPortableNetworkGraphic'#161#10#0#0#137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0
-  +#0'@'#0#0#0'@'#8#6#0#0#0#170'iq'#222#0#0#0#4'sBIT'#8#8#8#8'|'#8'd'#136#0#0#0
-  +#9'pHYs'#0#0#13#215#0#0#13#215#1'B('#155'x'#0#0#0#25'tEXtSoftware'#0'www.ink'
-  +'scape.org'#155#238'<'#26#0#0#10#30'IDATx'#156#237'[MhU'#219#21#254#214#249
-  +#203#185#215#188#220'h~j'#213#151#196#24'#'#25'X'#131'>H0'#133'V(t'#148'I;'
-  +#234'@'#177'"tP'#138#208'A'#139'#'#133'"'#165#208#161#224#228'U|8'#16#4#235
-  +'@'#20#138#130'P^G'#26#127'jP'#136'6'#228'E^$'#168'Qs'#239'M'#206#239'^'#29
-  +#220#187#239#219#247#228#220#159'sn'#174'B_'#23'l'#206#222#235#236#179#207'^'
-  +#223'^{'#237#181#255#136#153#241'}&'#237'SW'#224'S'#211#255#1#248#212#21#248
-  +#212'd'#180#242'1'#17#17#0'Z\\'#28#176','#235#11'f'#142#5'4'#12#195#186'i'#0
-  +#240'}'#127'qdd'#228'>'#0#193#204#162#149'z%!Jk'#4#151#150#150'vn'#217#178
-  +#229'oB'#136'q!D'#151'Z'#14'3W'#130'L'#215#227#11'! '#132'0'#29#199#249'rll'
-  +#236#15#0#214'P'#2#162#237#22':1'#0'DD'#239#223#191#255'53'#255'E'#8#177'E'#8
-  +'AB'#8'R'#203#147'A'#136#239#26'R'#229#199#129#21#134#161#25#134'!'#28#199
-  +#185'=>>'#254'+'#0#171#0#194'v'#131#144#8#0'"'#162#165#165#165'/l'#219#190
-  +#195#204'V'#24#134'$'#132' f'#150#130#19#128'D'#173#175#0#160#251#190'OB'#8
-  ,'0'#243#191#15#28'8'#240'3'#0#31#0#248#237#4'!'#145#17'<{'#246#172'n'#219#246
-  +'WB'#8'+'#8#2'-'#12'C'#141#153'5'#169#5'eUFY'#8#168#233'F'#252'0'#12#17#134
-  +'!'#130' '#128#231'y?z'#252#248#241'}'#0#219#0#152'e['#211#22'j'#26#0'"'#162
-  +#227#199#143#255'\'#8'1$['#30#128'l'#177#216#22'V'#187'B'#28'_'#205#31#5#162
-  +'P('#12'<x'#240#224#233#238#221#187#127#8#192'"'#162#182#140'XI'#10'%'#211'4'
-  +#127#170#168'<'#133'aXW'#240'Z'#253'='#238#27'!'#4#130' '#168#2'buuu'#235#149
-  +'+W'#158#29'=zt'#31#128#142'v'#128#144#8#0']'#215#15'0sE'#221#155#21'^'#213
-  +#130'zZ'#162'j'#128#2'B'#230#228#201#147#247#207#156'9s'#24#128#189#217' $)L'
-  +'c'#230#174'zB&Q'#249'h^)p'#28#8#249'|'#222#156#154#154#250#199#133#11#23'~'
-  +#1' '#187#153' $'#210#128' '#8'*'#234#223#170#202'G'#131#212#0#181#27#200'x'
-  +#217'&'#232#3#3#3'_]'#185'r'#229#183#0':'#137'H'#255#216#0#0'@'#211#173#155
-  +#180#139#0#168#169#1#10#8#154'a'#24#127#190'v'#237#218#159#0'|FDz'#171'#D"'#0
-  +'j'#9#159'F'#229#163'|M'#211#184'^7'#144'O'#199'qhmm'#237'w7o'#222#252#18'@'
-  +#14'@K $'#214#128#205'R'#249'(_'#211'4'#142#19'8'#142#231'y'#30'-//'#255#242
-  +#214#173'[7'#0't'#3'0'#210#130#208'2'#0#146#151'T'#229#163'A'#211'4d2'#25#150
-  +'B'#199#129#160#218#4#215'u'#177#176#176'p'#248#198#141#27'_'#3#216#138#148
-  +#14'S"'#0'6S'#229'c'#242's6'#155#21'D'#212'P'#3'T#'#249#226#197#139'}'#215
-  +#175'_'#127#220#211#211#211'W'#6'!'#145'L'#169'4 '#10'H+-'#175#242#1#160#183
-  +#183'7'#236#232#232#224'F '#168#241#185#185#185#237#231#207#159#127'z'#240
-  +#224#193#207#145#208'kL'#172#1'i'#4'L'#240#13'k'#154#134#254#254'~'#209#223
-  +#223#207']]]lYV'#165#12#169#225#170#166#19#17#136#8#11#11#11']'#167'N'#157'z'
-  +'r'#228#200#145'a$'#232#14#137#22'D'#132#16#208'4'#173#162#218#170#0#210'-Vy'
-  +'qqY'#225'8'#0'$V'#0'('#155#205#138'L&'#131#158#158#158#154' F'#248'LD'#198
-  +#232#232#232'O'#238#222#189#251#6#192'['#0#27'W^Z'#1' '#174#194'O'#158'<'#209
-  +#230#230#230'4'#245'}'#220'S}'#223#223#223#207#19#19#19#161'L'#231#243'yZXX '
-  +#215'uU'#155'Qq'#183'U;"'#227'===<44'#196#134'aT'#242'33'#150#151#151'w'#162
-  +'42'#188''''#162#134#139'*'#137#0#136#10'U6B'#218#225#195#135'C'#223#247#225
-  +#186'.'#28#199#129#231'yp'#28#7#174#235#194'u]'#146'<'#215'u'#225'y'#30#152
-  +'Y{'#247#238#29#229'r9'#14#195#16#15#31'>'#212#182'o'#223'.'#136#8#249'|'#30
-  +#133'B'#129#242#249'<'#23#139#197'J'#186'P('#160'X,'#162'P('#160'P(Poo/MOO'
-  +#243#228#228#164'P4'#0#190#239'g'#0't'#0'h'#170#11#164'6'#130#204#12#207#243
-  +'`'#24#6#151#231#240'q'#129'<'#207#131#239#251'U'#252' '#8#216'u]'#0#192#250
-  +#250':e2'#25'tvv'#178'a'#24#208'4'#13'D'#196#0#212#245#1'v'#28#7'kkk'#18#4'~'
-  +#250#244')'#242#249'<'#202'-'#204'j'#183'jVx '#229#162'h'#180'/'#150'['#186
-  +'*x'#158'G'#178#197#229#179#28#175#154'Gd'#179'Y6'#12#131#231#231#231'ufF'#16
-  +#4'`fd2'#25#152#166#137#174#174'.'#4'AP'#9#190#239'#'#8#2'tuu'#241#190'}'#251
-  +'D'#180'NI)U'#23#136#142#237#209#22#174#213#242#158#231#145#239#251#27#156
-  +#166#253#251#247#139#178'f'#144'Zn'#189#184'eY,'#13#242'G'#7' Z'#153'h'#203
-  +'G'#187'B'#25#136#10'?'#206'k4M'#19#134'ap'#163'!4'#174#30#181#12#238#166#3
-  +' '#132#136#29#194#20'#G1*_'#5#132#239#251#21#139#221'H'#160'('#175#25'~['#1
-  +#168'UY)'#168'Ty'#249'TxU'#192#196#9#146'$'#30#253#191#202'o+'#0'q?g'#230#13
-  +'*^'#203#30#200' w'#134#228#247#133'B'#129'^'#190'|I'#145#238'QYeV'#255'%'
-  +#211#219#182'm'#227#129#129#1#161#235'zKZ'#144'J'#3'T/'#16'@'#205'~'#239#251
-  +#254#6#225'}'#223#175#18'>'#12'C'#204#206#206'j}}}'#162#12#134#28#247#185#28
-  +'G'#177'X'#172#242#3#138#197'"z{{'#181#233#233'i:t'#232'P'#216#10#0'-M'#135
-  +'5MC'#24#134#20'1'#130#21'{'#160#14#131'jwP'#221#225#245#245'u'#178'm'#27#217
-  +'l'#150'u]'#135#166'i'#0'PY'#28#9#130#0#174#235'F'#253#0'(~@'#149'f$'#165#196
-  +']@'#253#137'i'#154#200#229'r'#188#186#186'JD'#4#203#178'`'#24#6':::'#160#142
-  +#233#234#166#137#174#235#200#229'r'#200#229'r,'#253#0']'#215'yqq'#177#226#7
-  +'h'#154#134#206#206'N'#216#182#141#238#238#238#138#15#16#134'a'#149#31'022"'
-  +#212':'#181#29#128'8 '#166#166#166#194#149#149#21'*['#247'X'#160'T>'#17#161
-  +#187#187#155#203'-'#13'f'#198#216#216'X'#197#15#136#254#163#150#245'7Ms'#131
-  +#31#144#134'Ri@'#20#245#173'['#183'n'#24#191#147'Zv'#195'0*~@'#244'_q'#229
-  +#169#239#210#170#127'b'#0#226#28#152'Z'#149'jV'#136'8~'#179#241#232#148'<'#13
-  +#165#158#14#215#19'('#202#219','#190#250#207#184#165'6"'#170#218#146'o'#134
-  +'R'#27#193'4'#241'z'#2'%'#1#165#158'&&'#165#150'g'#131'A'#16#224#213#171'W'
-  +#20#157#229#197#229#143#171'h='#1#226'@'#146'd'#219'6'#231'r9'#150'+_'#159
-  +#196#8'23ffft!'#4'l'#219#174'Z'#210#14#130#128#212#177'<'#186#172#29']'#254
-  +#142'{WNS'#220#251'={'#246'`hh'#136#247#238#221#27#166#21#190'e'#0#132#16'XY'
-  +'Y'#161#137#137#137#128#185'2+'#148#142#17'K'''#8#0'\'#215#173'lj'#168#206'Q'
-  +#212#131#148#19'*'#197#163'd'#153'Ou'#185#159'={'#134#163'G'#143'RT'#187#218
-  +#10#0'P='#228#16#17'v'#237#218'%fff'#12#219#182'Y'#130#18#5#137#153#161#235
-  +':l'#219#134'eY'#177'@'#170'e'#151#207' '#196#230#145#241'\.'#135#29';vT9Bi6'
-  +#135#18#15#131#146#228#143#199#198#198#196#192#192#0';'#142'S'#225#171#239
-  ,#213#252'I'#159#245#202#178'm'#187#178' '#170'~'#151#148'Z'#158#12'1'#151#220
-  +#217'L&S'#197'ke'#232'k'#198#223#144'i'#149#159#134'R'#219#128'Z'#21'heH'#140
-  +#2#155#6#196#182#250#1'QA'#154#173#152'L'#215#227#199#237'76'#138'G'#203'k'
-  +#187#13#136#254'8N'#160'('#175#221'*'#31#247'>'#9#181#188'('#26#134'!'#150
-  +#151#151#201'q'#28'R'#243#196'U'#168#150#193'k&'#175#202'g.'#173#10#231'r9'
-  +#174#245'}'#179#212#242'd'#232#209#163'G:3C'#238#232#198'9Bq{'#254#170'c'#19
-  +#183#227#27'u'#132#162'e'#12#13#13'app'#144#135#135#135'[Z'#17'jio'#144#153
-  +#241#225#195#7#26#31#31#15#153#153#165'#TvbdZ='#217'Q'#181'a'#210#228'n'#18
-  +'G'#22'['#201#247'}'#204#206#206#226#216#177'c'#20']'#158'k+'#0'B'#136'B'#20
-  +#237#157';w'#138#217#217'Y'#221'4M'#150'VXU_YA'#203#178'`YV'#172#22')'#223
-  +#144#250'M'#20'l5tvv'#162#191#191'_D'#187#202#252#252#252'j'#219#0'('#20#10
-  +#179#182'm'#255'X'#173#220#240#240#176#216#177'cGe'#175'/'#206#136'I!'#227
-  +#248#181#242'7'#202'g'#154'&'#203#21'a'#133#188#231#207#159#191'C'#19#219#226
-  +#146#146#0#192#139#139#139'_'#143#142#142#254#134'KTqW;::X'#174#3#214#27#226
-  +#146'X'#243'f'#135'>'#149#239#186#238'*'#128'u'#0'~'#137#221#184'_$Y'#21#22
-  +'''N'#156#248#167#16'b'#177'V%'#227#134#185#205':L'#29#205#27#151#255#230#205
-  +#155#255'B'#233#136#189#3#160')'#163#144#4#0#6#176'~'#241#226#197'?2s'#208
-  +#168#194'q'#155#26#245#242'7#|='#254#235#215#175#191#185'z'#245#234#12#128
-  +#215#0#138'h'#178#27'$'#5#192#185't'#233#210#204#237#219#183#255'*'#132'Xo'
-  +#212#234#9'N'#136#165#6#11#0#222#188'y'#243#242#244#233#211#127#7#240#13#128
-  +'oQ'#186'r'#211#148#6'$'#189'1'#162#1#200#2#24#24#28#28#156'<w'#238#220#239
-  +'{zz>'#215'u='#131#200'u'#153'F'#173#27#199#151#233#168#128'5'#226#161#231'y'
-  +#133';w'#238'<'#184'|'#249#242'='#0#255#1#240#24#192'<'#128#15#220#228#197
-  +#171#196'WfP'#210#154'N'#0';'#1#140#0#24#236#235#235#251#193#228#228#228' 3'
-  +#27'hp:'#163#222#255#26'Md'#228#183'o'#223#190']'#191'w'#239#222'2'#0#23#165
-  +'>'#255#18#192#11#0#139'('#221'5'#10#154'1'#128'@'#202'[c'#229#147#218#25#148
-  +'Nh'#246#149#159#159#161't6gSNq7 '#1#192#3'P'#0#240#30#165'~'#255#22'%'#213
-  +'Ot'#209'*'#245#181#185'rw0'#0'X'#0#236#242#211#192#199#185#140#201'('#25'9'
-  +#15'%'#139#239#0#8#208#228#208#167'Rj'#0#128#239'.N'#150#147#26#18#28'N'#218
-  +#4'b5$'#21'\RK'#0#252'/'#208#247#254#238#240#127#1#155#11#30'&'#160#155'1'
-  +#142#0#0#0#0'IEND'#174'B`'#130#0#0#0
+  +' Table'#12'ClientHeight'#3'j'#2#11'ClientWidth'#3'R'#2#10'KeyPreview'#9#7'O'
+  +'nClose'#7#9'FormClose'#9'OnKeyDown'#7#11'FormKeyDown'#8'Position'#7#14'poSc'
+  +'reenCenter'#10'LCLVersion'#6#7'1.2.0.3'#0#6'TLabel'#6'Label1'#4'Left'#2#18#6
+  +'Height'#2#13#3'Top'#2#9#5'Width'#2'O'#7'Caption'#6#14'New Table name'#11'Fo'
+  +'nt.Height'#2#245#11'ParentColor'#8#10'ParentFont'#8#0#0#5'TEdit'#10'edNewTa'
+  +'ble'#4'Left'#2#18#6'Height'#2#21#3'Top'#2#28#5'Width'#3#206#0#7'OnKeyUp'#7
+  +#15'edNewTableKeyUp'#8'TabOrder'#2#0#0#0#11'TStringGrid'#11'StringGrid1'#4'L'
+  +'eft'#2#18#6'Height'#3#163#1#3'Top'#2'B'#5'Width'#3'='#2#7'Anchors'#11#5'akT'
+  +'op'#6'akLeft'#7'akRight'#8'akBottom'#0#8'ColCount'#2#6#7'Columns'#14#1#13'T'
+  +'itle.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 Null'#5'Width'#2'Z'#0#1
+  +#11'ButtonStyle'#7#17'cbsCheckboxColumn'#13'Title.Caption'#6#5'P-Key'#11'Tit'
+  +'le.Color'#4#219#216#174#0#16'Title.Font.Color'#4#12#8#253#0#0#1#13'Title.Ca'
+  +'ption'#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'g'
+  +'oVertLine'#10'goHorzLine'#13'goRangeSelect'#9'goEditing'#18'goAlwaysShowEdi'
+  +'tor'#14'goSmoothScroll'#0#8'RowCount'#2#3#8'TabOrder'#2#1#13'OnEditingDone'
+  +#7#25'StringGrid1PickListSelect'#7'OnKeyUp'#7#16'StringGrid1KeyUp'#9'OnMouse'
+  +'Up'#7#18'StringGrid1MouseUp'#16'OnPickListSelect'#7#25'StringGrid1PickListS'
+  +'elect'#0#0#7'TBitBtn'#7'BitBtn2'#4'Left'#3#192#1#6'Height'#2'.'#3'Top'#3'0'
+  +#2#5'Width'#2'`'#7'Anchors'#11#6'akLeft'#8'akBottom'#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#18#6'Height'#2'.'#3'Top'#3'0'#2#5'Width'#2'v'#7'Anchors'#11#6'akLef'
+  +'t'#8'akBottom'#0#7'Caption'#6#6'Script'#5'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'c'
+  +'xCreateGen'#4'Left'#2#18#6'Height'#2#17#3'Top'#3#247#1#5'Width'#3#239#0#7'A'
+  +'nchors'#11#6'akLeft'#8'akBottom'#0#7'Caption'#6'+Create Auto increment Gene'
+  +'rator and Trigger'#8'TabOrder'#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'Color'#4#219#242#247#0#10'Font.Style'#11#6'fsBold'#0
+  +#7'OnClick'#7#12'bbCloseClick'#10'ParentFont'#8#8'TabOrder'#2#5#0#0#9'TCheck'
+  +'Box'#17'cxGrantPermission'#4'Left'#2#16#6'Height'#2#17#3'Top'#3#24#2#5'Widt'
+  +'h'#2'/'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Caption'#6#5'Grant'#8'OnCha'
+  +'nge'#7#23'cxGrantPermissionChange'#8'TabOrder'#2#6#0#0#9'TComboBox'#12'cbPe'
+  +'rmission'#4'Left'#2'`'#6'Height'#2#21#3'Top'#3#20#2#5'Width'#3#145#0#7'Anch'
+  +'ors'#11#6'akLeft'#8'akBottom'#0#7'Enabled'#8#10'ItemHeight'#2#13#9'ItemInde'
+  +'x'#2#0#13'Items.Strings'#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'#12'laPermis'
+  +'sion'#4'Left'#3#0#1#6'Height'#2#13#3'Top'#3#24#2#5'Width'#2'?'#7'Anchors'#11
+  +#6'akLeft'#8'akBottom'#0#7'Caption'#6#13'Permission to'#11'ParentColor'#8#7
+  +'Visible'#8#0#0#9'TComboBox'#12'cbRolesUsers'#4'Left'#3'i'#1#6'Height'#2#21#3
+  +'Top'#3#20#2#5'Width'#3#181#0#7'Anchors'#11#6'akLeft'#8'akBottom'#0#10'ItemH'
+  +'eight'#2#13#13'Items.Strings'#1#6#4'Full'#6#5'Read '#6#6'Insert'#0#8'TabOrd'
+  +'er'#2#8#7'Visible'#8#0#0#6'TImage'#6'Image1'#4'Left'#3#192#1#6'Height'#2'?'
+  +#3'Top'#2#0#5'Width'#2'P'#12'Picture.Data'#10#189#10#0#0#23'TPortableNetwork'
+  +'Graphic'#161#10#0#0#137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0'@'#0#0#0'@'#8
+  +#6#0#0#0#170'iq'#222#0#0#0#4'sBIT'#8#8#8#8'|'#8'd'#136#0#0#0#9'pHYs'#0#0#13
+  +#215#0#0#13#215#1'B('#155'x'#0#0#0#25'tEXtSoftware'#0'www.inkscape.org'#155
+  +#238'<'#26#0#0#10#30'IDATx'#156#237'[MhU'#219#21#254#214#249#203#185#215#188
+  +#220'h~j'#213#151#196#24'#'#25'X'#131'>H0'#133'V(t'#148'I;'#234'@'#177'"tP'
+  +#138#208'A'#139'#'#133'"'#165#208#161#224#228'U|8'#16#4#235'@'#20#138#130'P^'
+  +'G'#26#127'jP'#136'6'#228'E^$'#168'Qs'#239'M'#206#239'^'#29#220#187#239#219
+  +#247#228#220#159'sn'#174'B_'#23'l'#206#222#235#236#179#207'^'#223'^{'#237#181
+  +#255#136#153#241'}&'#237'SW'#224'S'#211#255#1#248#212#21#248#212'd'#180#242
+  +'1'#17#17#0'Z\\'#28#176','#235#11'f'#142#5'4'#12#195#186'i'#0#240'}'#127'qdd'
+  +#228'>'#0#193#204#162#149'z%!Jk'#4#151#150#150'vn'#217#178#229'oB'#136'q!D'
+  +#151'Z'#14'3W'#130'L'#215#227#11'! '#132'0'#29#199#249'rll'#236#15#0#214'P'#2
+  +#162#237#22':1'#0'DD'#239#223#191#255'53'#255'E'#8#177'E'#8'AB'#8'R'#203#147
+  +'A'#136#239#26'R'#229#199#129#21#134#161#25#134'!'#28#199#185'=>>'#254'+'#0
+  +#171#0#194'v'#131#144#8#0'"'#162#165#165#165'/l'#219#190#195#204'V'#24#134'$'
+  ,#132' f'#150#130#19#128'D'#173#175#0#160#251#190'OB'#8'0'#243#191#15#28'8'
+  +#240'3'#0#31#0#248#237#4'!'#145#17'<{'#246#172'n'#219#246'WB'#8'+'#8#2'-'#12
+  +'C'#141#153'5'#169#5'eUFY'#8#168#233'F'#252'0'#12#17#134'!'#130' '#128#231'y'
+  +'?z'#252#248#241'}'#0#219#0#152'e['#211#22'j'#26#0'"'#162#227#199#143#255'\'
+  +#8'1$['#30#128'l'#177#216#22'V'#187'B'#28'_'#205#31#5#162'P('#12'<x'#240#224
+  +#233#238#221#187#127#8#192'"'#162#182#140'XI'#10'%'#211'4'#127#170#168'<'#133
+  +'aXW'#240'Z'#253'='#238#27'!'#4#130' '#168#2'buuu'#235#149'+W'#158#29'=zt'#31
+  +#128#142'v'#128#144#8#0']'#215#15'0sE'#221#155#21'^'#213#130'zZ'#162'j'#128#2
+  +'B'#230#228#201#147#247#207#156'9s'#24#128#189#217' $)Lc'#230#174'zB&Q'#249
+  +'h^)p'#28#8#249'|'#222#156#154#154#250#199#133#11#23'~'#1' '#187#153' $'#210
+  +#128' '#8'*'#234#223#170#202'G'#131#212#0#181#27#200'x'#217'&'#232#3#3#3'_]'
+  +#185'r'#229#183#0':'#137'H'#255#216#0#0'@'#211#173#155#180#139#0#168#169#1#10
+  +#8#154'a'#24#127#190'v'#237#218#159#0'|FDz'#171'#D"'#0'j'#9#159'F'#229#163'|'
+  +'M'#211#184'^7'#144'O'#199'qhmm'#237'w7o'#222#252#18'@'#14'@K $'#214#128#205
+  +'R'#249'(_'#211'4'#142#19'8'#142#231'y'#30'-//'#255#242#214#173'[7'#0't'#3'0'
+  +#210#130#208'2'#0#146#151'T'#229#163'A'#211'4d2'#25#150'B'#199#129#160#218#4
+  +#215'u'#177#176#176'p'#248#198#141#27'_'#3#216#138#148#14'S"'#0'6S'#229'c'
+  +#242's6'#155#21'D'#212'P'#3'T#'#249#226#197#139'}'#215#175'_'#127#220#211#211
+  +#211'W'#6'!'#145'L'#169'4 '#10'H+-'#175#242#1#160#183#183'7'#236#232#232#224
+  +'F '#168#241#185#185#185#237#231#207#159#127'z'#240#224#193#207#145#208'kL'
+  +#172#1'i'#4'L'#240#13'k'#154#134#254#254'~'#209#223#223#207']]]lYV'#165#12
+  +#169#225#170#166#19#17#136#8#11#11#11']'#167'N'#157'zr'#228#200#145'a$'#232
+  +#14#137#22'D'#132#16#208'4'#173#162#218#170#0#210'-VyqqY'#225'8'#0'$V'#0'('
+  +#155#205#138'L&'#131#158#158#158#154' F'#248'LD'#198#232#232#232'O'#238#222
+  +#189#251#6#192'['#0#27'W^Z'#1' '#174#194'O'#158'<'#209#230#230#230'4'#245'}'
+  +#220'S}'#223#223#223#207#19#19#19#161'L'#231#243'yZXX '#215'uU'#155'Qq'#183
+  +'U;"'#227'===<44'#196#134'aT'#242'33'#150#151#151'w'#162'42'#188''''#162#134
+  +#139'*'#137#0#136#10'U6B'#218#225#195#135'C'#223#247#225#186'.'#28#199#129
+  +#231'yp'#28#7#174#235#194'u]'#146'<'#215'u'#225'y'#30#152'Y{'#247#238#29#229
+  +'r9'#14#195#16#15#31'>'#212#182'o'#223'.'#136#8#249'|'#30#133'B'#129#242#249
+  +'<'#23#139#197'J'#186'P('#160'X,'#162'P('#160'P(Poo/MOO'#243#228#228#164'P4'
+  +#0#190#239'g'#0't'#0'h'#170#11#164'6'#130#204#12#207#243'`'#24#6#151#231#240
+  +'q'#129'<'#207#131#239#251'U'#252' '#8#216'u]'#0#192#250#250':e2'#25'tvv'#178
+  +'a'#24#208'4'#13'D'#196#0#212#245#1'v'#28#7'kkk'#18#4'~'#250#244')'#242#249
+  +'<'#202'-'#204'j'#183'jVx '#229#162'h'#180'/'#150'['#186'*x'#158'G'#178#197
+  +#229#179#28#175#154'Gd'#179'Y6'#12#131#231#231#231'ufF'#16#4'`fd2'#25#152#166
+  +#137#174#174'.'#4'AP'#9#190#239'#'#8#2'tuu'#241#190'}'#251'D'#180'NI)U'#23
+  +#136#142#237#209#22#174#213#242#158#231#145#239#251#27#156#166#253#251#247
+  +#139#178'f'#144'Zn'#189#184'eY,'#13#242'G'#7' Z'#153'h'#203'G'#187'B'#25#136
+  +#10'?'#206'k4M'#19#134'ap'#163'!4'#174#30#181#12#238#166#3' '#132#136#29#194
+  +#20'#G1*_'#5#132#239#251#21#139#221'H'#160'('#175#25'~['#1#168'UY)'#168'Ty'
+  +#249'TxU'#192#196#9#146'$'#30#253#191#202'o+'#0'q?g'#230#13'*^'#203#30#200' '
+  +'w'#134#228#247#133'B'#129'^'#190'|I'#145#238'QYeV'#255'%'#211#219#182'm'#227
+  +#129#129#1#161#235'zKZ'#144'J'#3'T/'#16'@'#205'~'#239#251#254#6#225'}'#223
+  +#175#18'>'#12'C'#204#206#206'j}}}'#162#12#134#28#247#185#28'G'#177'X'#172#242
+  +#3#138#197'"z{{'#181#233#233'i:t'#232'P'#216#10#0'-M'#135'5MC'#24#134#20'1'
+  +#130#21'{'#160#14#131'jwP'#221#225#245#245'u'#178'm'#27#217'l'#150'u]'#135
+  +#166'i'#0'PY'#28#9#130#0#174#235'F'#253#0'(~@'#149'f$'#165#196']@'#253#137'i'
+  +#154#200#229'r'#188#186#186'JD'#4#203#178'`'#24#6':::'#160#142#233#234#166
+  +#137#174#235#200#229'r'#200#229'r,'#253#0']'#215'yqq'#177#226#7'h'#154#134
+  +#206#206'N'#216#182#141#238#238#238#138#15#16#134'a'#149#31'022"'#212':'#181
+  +#29#128'8 '#166#166#166#194#149#149#21'*['#247'X'#160'T>'#17#161#187#187#155
+  +#203'-'#13'f'#198#216#216'X'#197#15#136#254#163#150#245'7Ms'#131#31#144#134
+  +'Ri@'#20#245#173'['#183'n'#24#191#147'Zv'#195'0*~@'#244'_q'#229#169#239#210
+  +#170#127'b'#0#226#28#152'Z'#149'jV'#136'8~'#179#241#232#148'<'#13#165#158#14
+  +#215#19'('#202#219','#190#250#207#184#165'6"'#170#218#146'o'#134'R'#27#193'4'
+  +#241'z'#2'%'#1#165#158'&&'#165#150'g'#131'A'#16#224#213#171'W'#20#157#229#197
+  +#229#143#171'h='#1#226'@'#146'd'#219'6'#231'r9'#150'+_'#159#196#8'23ffft!'#4
+  +'l'#219#174'Z'#210#14#130#128#212#177'<'#186#172#29']'#254#142'{WNS'#220#251
+  +'={'#246'`hh'#136#247#238#221#27#166#21#190'e'#0#132#16'XYY'#161#137#137#137
+  +#128#185'2+'#148#142#17'K'''#8#0'\'#215#173'lj'#168#206'Q'#212#131#148#19'*'
+  +#197#163'd'#153'Ou'#185#159'={'#134#163'G'#143'RT'#187#218#10#0'P='#228#16#17
+  +'v'#237#218'%fff'#12#219#182'Y'#130#18#5#137#153#161#235':l'#219#134'eY'#177
+  +'@'#170'e'#151#207' '#196#230#145#241'\.'#135#29';vT9Bi6'#135#18#15#131#146
+  ,#228#143#199#198#198#196#192#192#0';'#142'S'#225#171#239#213#252'I'#159#245
+  +#202#178'm'#187#178' '#170'~'#151#148'Z'#158#12'1'#151#220#217'L&S'#197'ke'
+  +#232'k'#198#223#144'i'#149#159#134'R'#219#128'Z'#21'heH'#140#2#155#6#196#182
+  +#250#1'QA'#154#173#152'L'#215#227#199#237'76'#138'G'#203'k'#187#13#136#254'8'
+  +'N'#160'('#175#221'*'#31#247'>'#9#181#188'('#26#134'!'#150#151#151#201'q'#28
+  +'R'#243#196'U'#168#150#193'k&'#175#202'g.'#173#10#231'r9'#174#245'}'#179#212
+  +#242'd'#232#209#163'G:3C'#238#232#198'9Bq{'#254#170'c'#19#183#227#27'u'#132
+  +#162'e'#12#13#13'app'#144#135#135#135'[Z'#17'jio'#144#153#241#225#195#7#26#31
+  +#31#15#153#153#165'#TvbdZ='#217'Q'#181'a'#210#228'n'#18'G'#22'['#201#247'}'
+  +#204#206#206#226#216#177'c'#20']'#158'k+'#0'B'#136'B'#20#237#157';w'#138#217
+  +#217'Y'#221'4M'#150'VXU_YA'#203#178'`YV'#172#22')'#223#144#250'M'#20'l5tvv'
+  +#162#191#191'_D'#187#202#252#252#252'j'#219#0'('#20#10#179#182'm'#255'X'#173
+  +#220#240#240#176#216#177'cGe'#175'/'#206#136'I!'#227#248#181#242'7'#202'g'
+  +#154'&'#203#21'a'#133#188#231#207#159#191'C'#19#219#226#146#146#0#192#139#139
+  +#139'_'#143#142#142#254#134'KTqW;::X'#174#3#214#27#226#146'X'#243'f'#135'>'
+  +#149#239#186#238'*'#128'u'#0'~'#137#221#184'_$Y'#21#22'''N'#156#248#167#16'b'
+  +#177'V%'#227#134#185#205':L'#29#205#27#151#255#230#205#155#255'B'#233#136#189
+  +#3#160')'#163#144#4#0#6#176'~'#241#226#197'?2s'#208#168#194'q'#155#26#245#242
+  +'7#|='#254#235#215#175#191#185'z'#245#234#12#128#215#0#138'h'#178#27'$'#5#192
+  +#185't'#233#210#204#237#219#183#255'*'#132'Xo'#212#234#9'N'#136#165#6#11#0
+  +#222#188'y'#243#242#244#233#211#127#7#240#13#128'oQ'#186'r'#211#148#6'$'#189
+  +'1'#162#1#200#2#24#24#28#28#156'<w'#238#220#239'{zz>'#215'u='#131#200'u'#153
+  +'F'#173#27#199#151#233#168#128'5'#226#161#231'y'#133';w'#238'<'#184'|'#249
+  +#242'='#0#255#1#240#24#192'<'#128#15#220#228#197#171#196'WfP'#210#154'N'#0';'
+  +#1#140#0#24#236#235#235#251#193#228#228#228' 3'#27'hp:'#163#222#255#26'Md'
+  +#228#183'o'#223#190']'#191'w'#239#222'2'#0#23#165'>'#255#18#192#11#0#139'('
+  +#221'5'#10#154'1'#128'@'#202'[c'#229#147#218#25#148'Nh'#246#149#159#159#161
+  +'t6gSNq7 '#1#192#3'P'#0#240#30#165'~'#255#22'%'#213'Ot'#209'*'#245#181#185'r'
+  +'w0'#0'X'#0#236#242#211#192#199#185#140#201'('#25'9'#15'%'#139#239#0#8#208
+  +#228#208#167'Rj'#0#128#239'.N'#150#147#26#18#28'N'#218#4'b5$'#21'\RK'#0#252
+  +'/'#208#247#254#238#240#127#1#155#11#30'&'#160#155'1'#142#0#0#0#0'IEND'#174
+  +'B`'#130#0#0#0
 ]);
 ]);

+ 37 - 20
newtable.pas

@@ -7,7 +7,7 @@ interface
 uses
 uses
   Classes, SysUtils, IBConnection, sqldb, FileUtil, LResources, Forms, Controls,
   Classes, SysUtils, IBConnection, sqldb, FileUtil, LResources, Forms, Controls,
   Graphics, Dialogs, StdCtrls, Grids, Buttons, ExtCtrls, SynEdit, SynCompletion,
   Graphics, Dialogs, StdCtrls, Grids, Buttons, ExtCtrls, SynEdit, SynCompletion,
-  SynHighlighterSQL;
+  SynHighlighterSQL, LCLType;
 
 
 type
 type
 
 
@@ -32,6 +32,7 @@ type
     procedure cxGrantPermissionChange(Sender: TObject);
     procedure cxGrantPermissionChange(Sender: TObject);
     procedure edNewTableKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
     procedure edNewTableKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
+    procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
     procedure StringGrid1KeyUp(Sender: TObject; var Key: Word;
     procedure StringGrid1KeyUp(Sender: TObject; var Key: Word;
       Shift: TShiftState);
       Shift: TShiftState);
     procedure StringGrid1MouseUp(Sender: TObject; Button: TMouseButton;
     procedure StringGrid1MouseUp(Sender: TObject; Button: TMouseButton;
@@ -275,27 +276,28 @@ begin
   if Validate then
   if Validate then
   begin
   begin
     List:= TStringList.Create;
     List:= TStringList.Create;
-    List.Text:= GenerateCreateSQL(KeyField, GeneratorName);
-    if cxCreateGen.Checked then
-    begin;
-      List.Add('');
-      List.Add('-- Generator');
-      List.Add('create generator ' + GeneratorName + ';');
-
-      List.Add('');
-      List.Add('-- Trigger');
-      List.Add('CREATE TRIGGER ' + GeneratorName + ' FOR ' + edNewTable.Text);
-      List.Add('ACTIVE BEFORE INSERT POSITION 0 ');
-      List.Add('AS BEGIN ');
-      List.Add('IF (NEW.' + KeyField + ' IS NULL OR NEW.' + KeyField + ' = 0) THEN ');
-      List.Add('  NEW.' + KeyField + ' = GEN_ID(' + GeneratorName + ', 1);');
-      List.Add('END;');
+    try
+      List.Text:= GenerateCreateSQL(KeyField, GeneratorName);
+      if cxCreateGen.Checked then
+      begin;
+        List.Add('');
+        List.Add('-- Generator');
+        List.Add('create generator ' + GeneratorName + ';');
+
+        List.Add('');
+        List.Add('-- Trigger');
+        List.Add('CREATE TRIGGER ' + GeneratorName + ' FOR ' + edNewTable.Text);
+        List.Add('ACTIVE BEFORE INSERT POSITION 0 ');
+        List.Add('AS BEGIN ');
+        List.Add('IF (NEW.' + KeyField + ' IS NULL OR NEW.' + KeyField + ' = 0) THEN ');
+        List.Add('  NEW.' + KeyField + ' = GEN_ID(' + GeneratorName + ', 1);');
+        List.Add('END;');
+      end;
+      fmMain.ShowCompleteQueryWindow(fdbIndex, 'Create New Table: ' + edNewTable.Text, List.Text);
+    finally
+      List.Free;
     end;
     end;
-
-    fmMain.ShowCompleteQueryWindow(fdbIndex, 'Create New Table: ' + edNewTable.Text, List.Text);
-    List.Free;
     bbCloseClick(nil);
     bbCloseClick(nil);
-
   end;
   end;
 end;
 end;
 
 
@@ -330,6 +332,21 @@ begin
   CloseAction:= caFree;
   CloseAction:= caFree;
 end;
 end;
 
 
+procedure TfmNewTable.FormKeyDown(Sender: TObject; var Key: Word;
+  Shift: TShiftState);
+begin
+  if (ssCtrl in Shift) and
+    ((Key=VK_F4) or (Key=VK_W)) then
+  begin
+    if MessageDlg('Do you want to close this query window?', mtConfirmation, [mbNo, mbYes], 0) = mrYes then
+    begin
+      // Close when pressing Ctrl-W or Ctrl-F4 (Cmd-W/Cmd-F4 on OSX)
+      Close;
+      Parent.Free;
+    end;
+  end;
+end;
+
 
 
 procedure TfmNewTable.StringGrid1KeyUp(Sender: TObject; var Key: Word;
 procedure TfmNewTable.StringGrid1KeyUp(Sender: TObject; var Key: Word;
   Shift: TShiftState);
   Shift: TShiftState);

+ 42 - 44
permissionmanage.lfm

@@ -8,7 +8,7 @@ object fmPermissionManage: TfmPermissionManage
   ClientWidth = 518
   ClientWidth = 518
   OnClose = FormClose
   OnClose = FormClose
   Position = poScreenCenter
   Position = poScreenCenter
-  LCLVersion = '1.0.4.0'
+  LCLVersion = '1.2.0.3'
   object PageControl1: TPageControl
   object PageControl1: TPageControl
     Left = 0
     Left = 0
     Height = 368
     Height = 368
@@ -20,86 +20,86 @@ object fmPermissionManage: TfmPermissionManage
     TabOrder = 0
     TabOrder = 0
     object tsTables: TTabSheet
     object tsTables: TTabSheet
       Caption = 'Tables'
       Caption = 'Tables'
-      ClientHeight = 337
-      ClientWidth = 492
+      ClientHeight = 342
+      ClientWidth = 488
       object Label1: TLabel
       object Label1: TLabel
         Left = 14
         Left = 14
-        Height = 18
+        Height = 13
         Top = 11
         Top = 11
-        Width = 67
+        Width = 47
         Caption = 'User/Role'
         Caption = 'User/Role'
         ParentColor = False
         ParentColor = False
       end
       end
       object Label2: TLabel
       object Label2: TLabel
         Left = 14
         Left = 14
-        Height = 18
+        Height = 13
         Top = 95
         Top = 95
-        Width = 37
+        Width = 26
         Caption = 'Table'
         Caption = 'Table'
         ParentColor = False
         ParentColor = False
       end
       end
       object cbTables: TComboBox
       object cbTables: TComboBox
         Left = 18
         Left = 18
-        Height = 31
+        Height = 21
         Top = 124
         Top = 124
         Width = 236
         Width = 236
-        ItemHeight = 0
+        ItemHeight = 13
         OnChange = cbTablesChange
         OnChange = cbTablesChange
         Style = csDropDownList
         Style = csDropDownList
         TabOrder = 0
         TabOrder = 0
       end
       end
       object Label3: TLabel
       object Label3: TLabel
         Left = 310
         Left = 310
-        Height = 18
+        Height = 13
         Top = 10
         Top = 10
-        Width = 83
+        Width = 55
         Caption = 'Permissions'
         Caption = 'Permissions'
         ParentColor = False
         ParentColor = False
       end
       end
       object cxSelect: TCheckBox
       object cxSelect: TCheckBox
         Left = 317
         Left = 317
-        Height = 24
+        Height = 17
         Top = 86
         Top = 86
-        Width = 67
+        Width = 49
         Caption = 'Select'
         Caption = 'Select'
         TabOrder = 1
         TabOrder = 1
       end
       end
       object cxInsert: TCheckBox
       object cxInsert: TCheckBox
         Left = 318
         Left = 318
-        Height = 24
+        Height = 17
         Top = 138
         Top = 138
-        Width = 65
+        Width = 49
         Caption = 'Insert'
         Caption = 'Insert'
         TabOrder = 2
         TabOrder = 2
       end
       end
       object cxUpdate: TCheckBox
       object cxUpdate: TCheckBox
         Left = 317
         Left = 317
-        Height = 24
+        Height = 17
         Top = 183
         Top = 183
-        Width = 76
+        Width = 55
         Caption = 'Update'
         Caption = 'Update'
         TabOrder = 3
         TabOrder = 3
       end
       end
       object cxDelete: TCheckBox
       object cxDelete: TCheckBox
         Left = 317
         Left = 317
-        Height = 24
+        Height = 17
         Top = 236
         Top = 236
-        Width = 70
+        Width = 51
         Caption = 'Delete'
         Caption = 'Delete'
         TabOrder = 4
         TabOrder = 4
       end
       end
       object cxReferences: TCheckBox
       object cxReferences: TCheckBox
         Left = 318
         Left = 318
-        Height = 24
+        Height = 17
         Top = 287
         Top = 287
-        Width = 101
+        Width = 75
         Caption = 'References'
         Caption = 'References'
         TabOrder = 5
         TabOrder = 5
       end
       end
       object bbApplyTable: TBitBtn
       object bbApplyTable: TBitBtn
         Left = 6
         Left = 6
         Height = 35
         Height = 35
-        Top = 299
+        Top = 304
         Width = 75
         Width = 75
         Anchors = [akLeft, akBottom]
         Anchors = [akLeft, akBottom]
         Caption = 'Apply'
         Caption = 'Apply'
@@ -109,50 +109,50 @@ object fmPermissionManage: TfmPermissionManage
       end
       end
       object cbUsers: TComboBox
       object cbUsers: TComboBox
         Left = 18
         Left = 18
-        Height = 29
+        Height = 21
         Top = 34
         Top = 34
         Width = 236
         Width = 236
-        ItemHeight = 0
+        ItemHeight = 13
         OnChange = cbTablesChange
         OnChange = cbTablesChange
         TabOrder = 7
         TabOrder = 7
       end
       end
       object cxSelectGrant: TCheckBox
       object cxSelectGrant: TCheckBox
         Left = 345
         Left = 345
-        Height = 24
+        Height = 17
         Top = 103
         Top = 103
-        Width = 99
+        Width = 72
         Caption = 'With Grant'
         Caption = 'With Grant'
         TabOrder = 8
         TabOrder = 8
       end
       end
       object cxInsertGrant: TCheckBox
       object cxInsertGrant: TCheckBox
         Left = 345
         Left = 345
-        Height = 24
+        Height = 17
         Top = 156
         Top = 156
-        Width = 99
+        Width = 72
         Caption = 'With Grant'
         Caption = 'With Grant'
         TabOrder = 9
         TabOrder = 9
       end
       end
       object cxUpdateGrant: TCheckBox
       object cxUpdateGrant: TCheckBox
         Left = 345
         Left = 345
-        Height = 24
+        Height = 17
         Top = 203
         Top = 203
-        Width = 99
+        Width = 72
         Caption = 'With Grant'
         Caption = 'With Grant'
         TabOrder = 10
         TabOrder = 10
       end
       end
       object cxDeleteGrant: TCheckBox
       object cxDeleteGrant: TCheckBox
         Left = 342
         Left = 342
-        Height = 24
+        Height = 17
         Top = 254
         Top = 254
-        Width = 99
+        Width = 72
         Caption = 'With Grant'
         Caption = 'With Grant'
         TabOrder = 11
         TabOrder = 11
       end
       end
       object cxReferencesGrant: TCheckBox
       object cxReferencesGrant: TCheckBox
         Left = 345
         Left = 345
-        Height = 24
+        Height = 17
         Top = 309
         Top = 309
-        Width = 99
+        Width = 72
         Caption = 'With Grant'
         Caption = 'With Grant'
         TabOrder = 12
         TabOrder = 12
       end
       end
@@ -193,10 +193,10 @@ object fmPermissionManage: TfmPermissionManage
       end
       end
       object cbViewsUsers: TComboBox
       object cbViewsUsers: TComboBox
         Left = 18
         Left = 18
-        Height = 29
+        Height = 21
         Top = 34
         Top = 34
         Width = 220
         Width = 220
-        ItemHeight = 0
+        ItemHeight = 13
         OnChange = cbViewsUsersChange
         OnChange = cbViewsUsersChange
         TabOrder = 0
         TabOrder = 0
       end
       end
@@ -210,10 +210,10 @@ object fmPermissionManage: TfmPermissionManage
       end
       end
       object cbViews: TComboBox
       object cbViews: TComboBox
         Left = 18
         Left = 18
-        Height = 31
+        Height = 21
         Top = 124
         Top = 124
         Width = 220
         Width = 220
-        ItemHeight = 0
+        ItemHeight = 13
         OnChange = cbViewsChange
         OnChange = cbViewsChange
         Style = csDropDownList
         Style = csDropDownList
         TabOrder = 1
         TabOrder = 1
@@ -352,10 +352,10 @@ object fmPermissionManage: TfmPermissionManage
       end
       end
       object cbProcUsers: TComboBox
       object cbProcUsers: TComboBox
         Left = 18
         Left = 18
-        Height = 29
+        Height = 21
         Top = 34
         Top = 34
         Width = 196
         Width = 196
-        ItemHeight = 0
+        ItemHeight = 13
         OnChange = cbProcUsersChange
         OnChange = cbProcUsersChange
         TabOrder = 0
         TabOrder = 0
       end
       end
@@ -377,7 +377,6 @@ object fmPermissionManage: TfmPermissionManage
         OnClick = clbProceduresClick
         OnClick = clbProceduresClick
         OnKeyUp = clbProceduresKeyUp
         OnKeyUp = clbProceduresKeyUp
         TabOrder = 1
         TabOrder = 1
-        TopIndex = -1
       end
       end
       object bbApplyProc: TBitBtn
       object bbApplyProc: TBitBtn
         Left = 6
         Left = 6
@@ -415,10 +414,10 @@ object fmPermissionManage: TfmPermissionManage
       end
       end
       object cbRolesUser: TComboBox
       object cbRolesUser: TComboBox
         Left = 18
         Left = 18
-        Height = 29
+        Height = 21
         Top = 34
         Top = 34
         Width = 188
         Width = 188
-        ItemHeight = 0
+        ItemHeight = 13
         OnChange = cbRolesUserChange
         OnChange = cbRolesUserChange
         TabOrder = 0
         TabOrder = 0
       end
       end
@@ -451,7 +450,6 @@ object fmPermissionManage: TfmPermissionManage
         OnClick = clbRolesClick
         OnClick = clbRolesClick
         OnKeyUp = clbRolesKeyUp
         OnKeyUp = clbRolesKeyUp
         TabOrder = 2
         TabOrder = 2
-        TopIndex = -1
       end
       end
       object BitBtn1: TBitBtn
       object BitBtn1: TBitBtn
         Left = 102
         Left = 102

+ 65 - 63
permissionmanage.lrs

@@ -1,41 +1,43 @@
+{ This is an automatically generated lazarus resource file }
+
 LazarusResources.Add('TfmPermissionManage','FORMDATA',[
 LazarusResources.Add('TfmPermissionManage','FORMDATA',[
   'TPF0'#19'TfmPermissionManage'#18'fmPermissionManage'#4'Left'#3#218#1#6'Heigh'
   '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'
   +'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'
   +'nt'#12'ClientHeight'#3'p'#1#11'ClientWidth'#3#6#2#7'OnClose'#7#9'FormClose'
-  +#8'Position'#7#14'poScreenCenter'#10'LCLVersion'#6#7'1.0.4.0'#0#12'TPageCont'
+  +#8'Position'#7#14'poScreenCenter'#10'LCLVersion'#6#7'1.2.0.3'#0#12'TPageCont'
   +'rol'#12'PageControl1'#4'Left'#2#0#6'Height'#3'p'#1#3'Top'#2#0#5'Width'#3#240
   +'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
   +#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'
   +'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'
+  +'ption'#6#6'Tables'#12'ClientHeight'#3'V'#1#11'ClientWidth'#3#232#1#0#6'TLab'
+  +'el'#6'Label1'#4'Left'#2#14#6'Height'#2#13#3'Top'#2#11#5'Width'#2'/'#7'Capti'
   +'on'#6#9'User/Role'#11'ParentColor'#8#0#0#6'TLabel'#6'Label2'#4'Left'#2#14#6
   +'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
+  +'Height'#2#13#3'Top'#2'_'#5'Width'#2#26#7'Caption'#6#5'Table'#11'ParentColor'
+  +#8#0#0#9'TComboBox'#8'cbTables'#4'Left'#2#18#6'Height'#2#21#3'Top'#2'|'#5'Wi'
+  +'dth'#3#236#0#10'ItemHeight'#2#13#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
   +#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'
+  +'Height'#2#13#3'Top'#2#10#5'Width'#2'7'#7'Caption'#6#11'Permissions'#11'Pare'
+  +'ntColor'#8#0#0#9'TCheckBox'#8'cxSelect'#4'Left'#3'='#1#6'Height'#2#17#3'Top'
+  +#2'V'#5'Width'#2'1'#7'Caption'#6#6'Select'#8'TabOrder'#2#1#0#0#9'TCheckBox'#8
+  +'cxInsert'#4'Left'#3'>'#1#6'Height'#2#17#3'Top'#3#138#0#5'Width'#2'1'#7'Capt'
   +'ion'#6#6'Insert'#8'TabOrder'#2#2#0#0#9'TCheckBox'#8'cxUpdate'#4'Left'#3'='#1
   +'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
+  +#6'Height'#2#17#3'Top'#3#183#0#5'Width'#2'7'#7'Caption'#6#6'Update'#8'TabOrd'
+  +'er'#2#3#0#0#9'TCheckBox'#8'cxDelete'#4'Left'#3'='#1#6'Height'#2#17#3'Top'#3
+  +#236#0#5'Width'#2'3'#7'Caption'#6#6'Delete'#8'TabOrder'#2#4#0#0#9'TCheckBox'
+  +#12'cxReferences'#4'Left'#3'>'#1#6'Height'#2#17#3'Top'#3#31#1#5'Width'#2'K'#7
   +'Caption'#6#10'References'#8'TabOrder'#2#5#0#0#7'TBitBtn'#12'bbApplyTable'#4
   +'Caption'#6#10'References'#8'TabOrder'#2#5#0#0#7'TBitBtn'#12'bbApplyTable'#4
-  +'Left'#2#6#6'Height'#2'#'#3'Top'#3'+'#1#5'Width'#2'K'#7'Anchors'#11#6'akLeft'
+  +'Left'#2#6#6'Height'#2'#'#3'Top'#3'0'#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'
   +#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'
   +'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
+  +'ight'#2#21#3'Top'#2'"'#5'Width'#3#236#0#10'ItemHeight'#2#13#8'OnChange'#7#14
   +'cbTablesChange'#8'TabOrder'#2#7#0#0#9'TCheckBox'#13'cxSelectGrant'#4'Left'#3
   +'cbTablesChange'#8'TabOrder'#2#7#0#0#9'TCheckBox'#13'cxSelectGrant'#4'Left'#3
-  +'Y'#1#6'Height'#2#24#3'Top'#2'g'#5'Width'#2'c'#7'Caption'#6#10'With Grant'#8
+  +'Y'#1#6'Height'#2#17#3'Top'#2'g'#5'Width'#2'H'#7'Caption'#6#10'With Grant'#8
   +'TabOrder'#2#8#0#0#9'TCheckBox'#13'cxInsertGrant'#4'Left'#3'Y'#1#6'Height'#2
   +'TabOrder'#2#8#0#0#9'TCheckBox'#13'cxInsertGrant'#4'Left'#3'Y'#1#6'Height'#2
-  +#24#3'Top'#3#156#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
-  +#203#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#254#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'5'#1#5'Width'#2'c'
+  +#17#3'Top'#3#156#0#5'Width'#2'H'#7'Caption'#6#10'With Grant'#8'TabOrder'#2#9
+  +#0#0#9'TCheckBox'#13'cxUpdateGrant'#4'Left'#3'Y'#1#6'Height'#2#17#3'Top'#3
+  +#203#0#5'Width'#2'H'#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#17#3'Top'#3#254#0#5'Wid'
+  +'th'#2'H'#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#17#3'Top'#3'5'#1#5'Width'#2'H'
   +#7'Caption'#6#10'With Grant'#8'TabOrder'#2#12#0#0#9'TCheckBox'#5'cxAll'#4'Le'
   +#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'B'#8'AutoSize'#8#7'Caption'
   +'ft'#3'>'#1#6'Height'#2#24#3'Top'#2'"'#5'Width'#2'B'#8'AutoSize'#8#7'Caption'
   +#6#3'All'#10'Font.Style'#11#6'fsBold'#0#10'ParentFont'#8#8'TabOrder'#2#13#0#0
   +#6#3'All'#10'Font.Style'#11#6'fsBold'#0#10'ParentFont'#8#8'TabOrder'#2#13#0#0
@@ -45,12 +47,12 @@ LazarusResources.Add('TfmPermissionManage','FORMDATA',[
   +'tion'#6#5'Views'#12'ClientHeight'#3'Q'#1#11'ClientWidth'#3#236#1#0#6'TLabel'
   +'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
   +#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
   +#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'
+  +#18#6'Height'#2#21#3'Top'#2'"'#5'Width'#3#220#0#10'ItemHeight'#2#13#8'OnChan'
+  +'ge'#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'
   +#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
+  +'tColor'#8#0#0#9'TComboBox'#7'cbViews'#4'Left'#2#18#6'Height'#2#21#3'Top'#2
+  +'|'#5'Width'#3#220#0#10'ItemHeight'#2#13#8'OnChange'#7#13'cbViewsChange'#5'S'
+  +'tyle'#7#14'csDropDownList'#8'TabOrder'#2#1#0#0#7'TBitBtn'#11'bbApplyView'#4
   +'Left'#2#6#6'Height'#2'!'#3'Top'#3'+'#1#5'Width'#2'K'#7'Anchors'#11#6'akLeft'
   +'Left'#2#6#6'Height'#2'!'#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'
   +#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'
   +'lyViewClick'#8'TabOrder'#2#2#0#0#6'TLabel'#7'Label10'#4'Left'#3'6'#1#6'Heig'
@@ -81,39 +83,39 @@ LazarusResources.Add('TfmPermissionManage','FORMDATA',[
   +#0#0#0#9'TTabSheet'#12'tsProcedures'#7'Caption'#6#10'Procedures'#12'ClientHe'
   +#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'
   +'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'
   +'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'!'#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'#'#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'#'#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
+  +'lor'#8#0#0#9'TComboBox'#11'cbProcUsers'#4'Left'#2#18#6'Height'#2#21#3'Top'#2
+  +'"'#5'Width'#3#196#0#10'ItemHeight'#2#13#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'To'
+  +'p'#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#1#1#3'Top'#2
+  +''''#5'Width'#3#211#0#7'Anchors'#11#5'akTop'#6'akLeft'#8'akBottom'#0#10'Item'
+  +'Height'#2#0#7'OnClick'#7#18'clbProceduresClick'#7'OnKeyUp'#7#18'clbProcedur'
+  +'esKeyUp'#8'TabOrder'#2#1#0#0#7'TBitBtn'#11'bbApplyProc'#4'Left'#2#6#6'Heigh'
+  +'t'#2'!'#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'T'
+  +'abOrder'#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
+  +'TTabSheet'#7'tsRoles'#7'Caption'#6#5'Roles'#12'ClientHeight'#3'Q'#1#11'Clie'
+  +'ntWidth'#3#236#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#21#3'Top'#2'"'#5'Width'#3#188#0#10'It'
+  +'emHeight'#2#13#8'OnChange'#7#17'cbRolesUserChange'#8'TabOrder'#2#0#0#0#6'TL'
+  +'abel'#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'#'#3'Top'#3'*'#1#5'Width'#2'K'#7'Anchors'#11#6'akL'
+  +'eft'#8'akBottom'#0#7'Caption'#6#5'Apply'#4'Kind'#7#4'bkOK'#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#0#0#7'TBitBtn'#7'BitBtn1'#4'Le'
+  +'ft'#2'f'#6'Height'#2'#'#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'TabOr'
+  +'der'#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'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'bbCloseClick'#10'Pa'
+  +'rentFont'#8#8'TabOrder'#2#1#0#0#0
 ]);
 ]);

+ 77 - 68
permissionmanage.pas

@@ -318,20 +318,22 @@ begin
   if (cbUsers.Text <> '') and (cbTables.ItemIndex <> -1) then
   if (cbUsers.Text <> '') and (cbTables.ItemIndex <> -1) then
   begin
   begin
     List:= TStringList.Create;
     List:= TStringList.Create;
+    try
+      if cxAll.Checked then
+        ComposeTablePermissionSQL(cbTables.Text, 'All', cxAll.Checked, cxAllGrant.Checked, List)
+      else
+      begin
+        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;
 
 
-    if cxAll.Checked then
-      ComposeTablePermissionSQL(cbTables.Text, 'All', cxAll.Checked, cxAllGrant.Checked, List)
-    else
-    begin
-      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);
+      fmMain.ShowCompleteQueryWindow(fdbIndex, 'Edit Permission for: ' + cbTables.Text, List.Text, fOnCommitProcedure);
+    finally
+      List.Free;
     end;
     end;
-
-    fmMain.ShowCompleteQueryWindow(fdbIndex, 'Edit Permission for: ' + cbTables.Text, List.Text, fOnCommitProcedure);
-    List.Free;
     Close;
     Close;
     Parent.Free;
     Parent.Free;
   end
   end
@@ -346,20 +348,22 @@ begin
   if (cbViewsUsers.Text <> '') and (cbViews.ItemIndex <> -1) then
   if (cbViewsUsers.Text <> '') and (cbViews.ItemIndex <> -1) then
   begin
   begin
     List:= TStringList.Create;
     List:= TStringList.Create;
+    try
+      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;
 
 
-    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);
+      fmMain.ShowCompleteQueryWindow(fdbIndex, 'Edit Permission for: ' + cbViews.Text, List.Text, fOnCommitProcedure);
+    finally
+      List.Free;
     end;
     end;
-
-    fmMain.ShowCompleteQueryWindow(fdbIndex, 'Edit Permission for: ' + cbViews.Text, List.Text, fOnCommitProcedure);
-    List.Free;
     Close;
     Close;
     Parent.Free;
     Parent.Free;
   end
   end
@@ -388,30 +392,33 @@ begin
   if Trim(cbProcUsers.Text) <> '' then
   if Trim(cbProcUsers.Text) <> '' then
   begin
   begin
     List:= TStringList.Create;
     List:= TStringList.Create;
-    For i:= 0 to clbProcedures.Items.Count - 1 do
-    begin
-      if clbProcedures.Checked[i] and
-        ((ProcList.IndexOf(clbProcedures.Items[i]) = -1) or (ProcGrant[i] and (not OrigProcGrant[i]))) then // Grant this proc
-        begin
-          Line:= 'grant execute on procedure ' + clbProcedures.Items[i] + ' to ' + cbProcUsers.Text;
-          if ProcGrant[i] then
-            Line:= Line + ' with grant option';
-          List.Add(Line + ';');
-
-        end;
-
-      if (not clbProcedures.Checked[i]) and (ProcList.IndexOf(clbProcedures.Items[i]) <> -1) then // Remove this proc
-        List.Add('Revoke execute on procedure ' + clbProcedures.Items[i] + ' from ' + cbProcUsers.Text + ';');
-    end;
-    if List.Count > 0 then
-    begin
-      fmMain.ShowCompleteQueryWindow(fdbIndex, 'Edit Permission for: ' + cbProcUsers.Text, List.Text, fOnCommitProcedure);
+    try
+      For i:= 0 to clbProcedures.Items.Count - 1 do
+      begin
+        if clbProcedures.Checked[i] and
+          ((ProcList.IndexOf(clbProcedures.Items[i]) = -1) or (ProcGrant[i] and (not OrigProcGrant[i]))) then // Grant this proc
+          begin
+            Line:= 'grant execute on procedure ' + clbProcedures.Items[i] + ' to ' + cbProcUsers.Text;
+            if ProcGrant[i] then
+              Line:= Line + ' with grant option';
+            List.Add(Line + ';');
+
+          end;
+
+        if (not clbProcedures.Checked[i]) and (ProcList.IndexOf(clbProcedures.Items[i]) <> -1) then // Remove this proc
+          List.Add('Revoke execute on procedure ' + clbProcedures.Items[i] + ' from ' + cbProcUsers.Text + ';');
+      end;
+      if List.Count > 0 then
+      begin
+        fmMain.ShowCompleteQueryWindow(fdbIndex, 'Edit Permission for: ' + cbProcUsers.Text, List.Text, fOnCommitProcedure);
+        Close;
+        Parent.Free;
+      end
+      else
+        ShowMessage('There is no change');
+    finally
       List.Free;
       List.Free;
-      Close;
-      Parent.Free;
-    end
-    else
-      ShowMessage('There is no change');
+    end;
   end;
   end;
 end;
 end;
 
 
@@ -424,32 +431,34 @@ begin
   if Trim(cbRolesUser.Text) <> '' then
   if Trim(cbRolesUser.Text) <> '' then
   begin
   begin
     List:= TStringList.Create;
     List:= TStringList.Create;
-    For i:= 0 to clbRoles.Items.Count - 1 do
-    begin
-      if clbRoles.Checked[i] and
-        ((RoleList.IndexOf(clbRoles.Items[i]) = -1) or (RoleGrant[i] and (not OrigRoleGrant[i]))) then // Grant this Role
+    try
+      For i:= 0 to clbRoles.Items.Count - 1 do
       begin
       begin
-        Line:= 'grant ' + clbRoles.Items[i] + ' to ' + cbRolesUser.Text;
-        if RoleGrant[i] then
-          Line:= Line + ' with admin option';
-        List.Add(Line + ';');
-      end;
+        if clbRoles.Checked[i] and
+          ((RoleList.IndexOf(clbRoles.Items[i]) = -1) or (RoleGrant[i] and (not OrigRoleGrant[i]))) then // Grant this Role
+        begin
+          Line:= 'grant ' + clbRoles.Items[i] + ' to ' + cbRolesUser.Text;
+          if RoleGrant[i] then
+            Line:= Line + ' with admin option';
+          List.Add(Line + ';');
+        end;
 
 
-      if (not clbRoles.Checked[i]) and (RoleList.IndexOf(clbRoles.Items[i]) <> -1) then // Remove this Role
-        List.Add('Revoke ' + clbRoles.Items[i] + ' from ' + cbRolesUser.Text + ';');
-    end;
+        if (not clbRoles.Checked[i]) and (RoleList.IndexOf(clbRoles.Items[i]) <> -1) then // Remove this Role
+          List.Add('Revoke ' + clbRoles.Items[i] + ' from ' + cbRolesUser.Text + ';');
+      end;
 
 
-    if List.Count > 0 then
-    begin
-      fmMain.ShowCompleteQueryWindow(fdbIndex, 'Edit Permission for: ' + cbRolesUser.Text, List.Text, fOnCommitProcedure);
+      if List.Count > 0 then
+      begin
+        fmMain.ShowCompleteQueryWindow(fdbIndex, 'Edit Permission for: ' + cbRolesUser.Text, List.Text, fOnCommitProcedure);
+        Close;
+        Parent.Free;
+      end
+      else
+        ShowMessage('There is no change');
+    finally
       List.Free;
       List.Free;
-      Close;
-      Parent.Free;
-    end
-    else
-      ShowMessage('There is no change');
+    end;
   end;
   end;
-
 end;
 end;
 
 
 procedure TfmPermissionManage.cbProcUsersChange(Sender: TObject);
 procedure TfmPermissionManage.cbProcUsersChange(Sender: TObject);

+ 0 - 6
querycomplition.txt

@@ -1,6 +0,0 @@
-create
-table
-Select
-From
-INTEGER
-FLOAT

+ 16 - 3
querywindow.lfm

@@ -8,13 +8,15 @@ object fmQueryWindow: TfmQueryWindow
   ClientHeight = 601
   ClientHeight = 601
   ClientWidth = 720
   ClientWidth = 720
   Color = clForm
   Color = clForm
+  KeyPreview = True
   Menu = MainMenu1
   Menu = MainMenu1
   OnClose = FormClose
   OnClose = FormClose
   OnCreate = FormCreate
   OnCreate = FormCreate
+  OnKeyDown = FormKeyDown
   OnShow = FormShow
   OnShow = FormShow
   PopupMenu = pmTab
   PopupMenu = pmTab
   Position = poScreenCenter
   Position = poScreenCenter
-  LCLVersion = '1.0.14.0'
+  LCLVersion = '1.2.0.3'
   object Panel1: TPanel
   object Panel1: TPanel
     Left = 0
     Left = 0
     Height = 60
     Height = 60
@@ -189,9 +191,9 @@ object fmQueryWindow: TfmQueryWindow
       end
       end
       object cxAutoCommit: TCheckBox
       object cxAutoCommit: TCheckBox
         Left = 396
         Left = 396
-        Height = 24
+        Height = 17
         Top = 2
         Top = 2
-        Width = 116
+        Width = 81
         Caption = 'Auto Commit'
         Caption = 'Auto Commit'
         Checked = True
         Checked = True
         State = cbChecked
         State = cbChecked
@@ -759,23 +761,31 @@ object fmQueryWindow: TfmQueryWindow
       end>
       end>
     VisibleSpecialChars = [vscSpace, vscTabAtLast]
     VisibleSpecialChars = [vscSpace, vscTabAtLast]
     RightEdge = 120
     RightEdge = 120
+    SelectedColor.FrameEdges = sfeAround
     SelectedColor.BackPriority = 50
     SelectedColor.BackPriority = 50
     SelectedColor.ForePriority = 50
     SelectedColor.ForePriority = 50
     SelectedColor.FramePriority = 50
     SelectedColor.FramePriority = 50
     SelectedColor.BoldPriority = 50
     SelectedColor.BoldPriority = 50
     SelectedColor.ItalicPriority = 50
     SelectedColor.ItalicPriority = 50
     SelectedColor.UnderlinePriority = 50
     SelectedColor.UnderlinePriority = 50
+    SelectedColor.StrikeOutPriority = 50
+    IncrementColor.FrameEdges = sfeAround
+    HighlightAllColor.FrameEdges = sfeAround
     BracketHighlightStyle = sbhsBoth
     BracketHighlightStyle = sbhsBoth
     BracketMatchColor.Background = clNone
     BracketMatchColor.Background = clNone
     BracketMatchColor.Foreground = clNone
     BracketMatchColor.Foreground = clNone
+    BracketMatchColor.FrameEdges = sfeAround
     BracketMatchColor.Style = [fsBold]
     BracketMatchColor.Style = [fsBold]
     FoldedCodeColor.Background = clNone
     FoldedCodeColor.Background = clNone
     FoldedCodeColor.Foreground = clGray
     FoldedCodeColor.Foreground = clGray
     FoldedCodeColor.FrameColor = clGray
     FoldedCodeColor.FrameColor = clGray
+    FoldedCodeColor.FrameEdges = sfeAround
     MouseLinkColor.Background = clNone
     MouseLinkColor.Background = clNone
     MouseLinkColor.Foreground = clBlue
     MouseLinkColor.Foreground = clBlue
+    MouseLinkColor.FrameEdges = sfeAround
     LineHighlightColor.Background = clNone
     LineHighlightColor.Background = clNone
     LineHighlightColor.Foreground = clNone
     LineHighlightColor.Foreground = clNone
+    LineHighlightColor.FrameEdges = sfeAround
     inline TSynGutterPartList
     inline TSynGutterPartList
       object TSynGutterMarks
       object TSynGutterMarks
         Width = 24
         Width = 24
@@ -786,6 +796,7 @@ object fmQueryWindow: TfmQueryWindow
         MouseActions = <>
         MouseActions = <>
         MarkupInfo.Background = 16710387
         MarkupInfo.Background = 16710387
         MarkupInfo.Foreground = clNone
         MarkupInfo.Foreground = clNone
+        MarkupInfo.FrameEdges = sfeAround
         DigitCount = 2
         DigitCount = 2
         ShowOnlyLineNumbersMultiplesOf = 1
         ShowOnlyLineNumbersMultiplesOf = 1
         ZeroStart = False
         ZeroStart = False
@@ -802,6 +813,7 @@ object fmQueryWindow: TfmQueryWindow
         MouseActions = <>
         MouseActions = <>
         MarkupInfo.Background = clWhite
         MarkupInfo.Background = clWhite
         MarkupInfo.Foreground = clGray
         MarkupInfo.Foreground = clGray
+        MarkupInfo.FrameEdges = sfeAround
       end
       end
       object TSynGutterCodeFolding
       object TSynGutterCodeFolding
         MouseActions = <        
         MouseActions = <        
@@ -832,6 +844,7 @@ object fmQueryWindow: TfmQueryWindow
           end>
           end>
         MarkupInfo.Background = clNone
         MarkupInfo.Background = clNone
         MarkupInfo.Foreground = clGray
         MarkupInfo.Foreground = clGray
+        MarkupInfo.FrameEdges = sfeAround
         MouseActionsExpanded = <        
         MouseActionsExpanded = <        
           item
           item
             ClickCount = ccAny
             ClickCount = ccAny

File diff suppressed because it is too large
+ 570 - 564
querywindow.lrs


+ 174 - 142
querywindow.pas

@@ -12,6 +12,13 @@ uses
 
 
 type
 type
 
 
+  TQueryTypes = (
+    qtUnknown=0,
+    qtSelectable=1,
+    qtExecute=2,
+    qtScript=3);
+
+
   { TQueryThread }
   { TQueryThread }
 
 
   TQueryThread = class(TThread)
   TQueryThread = class(TThread)
@@ -103,6 +110,7 @@ type
     procedure FindDialog1Find(Sender: TObject);
     procedure FindDialog1Find(Sender: TObject);
     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
     procedure FormCreate(Sender: TObject);
     procedure FormCreate(Sender: TObject);
+    procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
     procedure FormShow(Sender: TObject);
     procedure FormShow(Sender: TObject);
     procedure lmCloseTabClick(Sender: TObject);
     procedure lmCloseTabClick(Sender: TObject);
     procedure lmCommaDelemitedClick(Sender: TObject);
     procedure lmCommaDelemitedClick(Sender: TObject);
@@ -154,7 +162,7 @@ type
     fStartLine: Integer;
     fStartLine: Integer;
     fList: TStringList;
     fList: TStringList;
     fQuery: string;
     fQuery: string;
-    fOrigQueryType: Integer;
+    fOrigQueryType: TQueryTypes;
     fFinished: Boolean;
     fFinished: Boolean;
     fQT: TQueryThread;
     fQT: TQueryThread;
     fQueryPart: string;
     fQueryPart: string;
@@ -172,7 +180,7 @@ type
     function GetNewTabNum: string;
     function GetNewTabNum: string;
     procedure FinishCellEditing(DataSet: TDataSet);
     procedure FinishCellEditing(DataSet: TDataSet);
     function GetRecordSet(TabIndex: Integer): TSQLQuery;
     function GetRecordSet(TabIndex: Integer): TSQLQuery;
-    function getQuerySQLType(QueryList: TStringList; var SecondRealStart: Integer;
+    function GetQuerySQLType(QueryList: TStringList; var SecondRealStart: Integer;
       var IsDDL: Boolean): Integer;
       var IsDDL: Boolean): Integer;
     procedure NewCommitButton(const Pan: TPanel; var ATab: TTabSheet);
     procedure NewCommitButton(const Pan: TPanel; var ATab: TTabSheet);
     procedure RemoveComments(QueryList: TStringList; StartLine: Integer;
     procedure RemoveComments(QueryList: TStringList; StartLine: Integer;
@@ -189,7 +197,7 @@ type
   public
   public
     OnCommit: TNotifyEvent;
     OnCommit: TNotifyEvent;
     procedure Init(dbIndex: Integer);
     procedure Init(dbIndex: Integer);
-    function GetQueryType(AQuery: string): Integer;
+    function GetQueryType(AQuery: string): TQueryTypes;
     function GetQuery: string;
     function GetQuery: string;
     function CreateResultTab(QueryType: Byte; var aSqlQuery: TSQLQuery; var aSQLScript: TSqlScript;
     function CreateResultTab(QueryType: Byte; var aSqlQuery: TSQLQuery; var aSQLScript: TSqlScript;
       var meResult: TMemo; AdditionalTitle: string = ''): TTabSheet;
       var meResult: TMemo; AdditionalTitle: string = ''): TTabSheet;
@@ -202,8 +210,8 @@ type
     function GetSQLSegment(QueryList: TStringList; StartLine: Integer; var QueryType, EndLine: Integer;
     function GetSQLSegment(QueryList: TStringList; StartLine: Integer; var QueryType, EndLine: Integer;
       var SQLSegment: string; var IsDDL: Boolean): Boolean;
       var SQLSegment: string; var IsDDL: Boolean): Boolean;
     procedure QueryAfterScroll(DataSet: TDataSet);
     procedure QueryAfterScroll(DataSet: TDataSet);
-    procedure CallExecuteQuery(aQueryType: Integer);
-    procedure sortsyncompletion;
+    procedure CallExecuteQuery(aQueryType: TQueryTypes);
+    procedure SortSynCompletion;
     procedure ThreadTerminated(Sender: TObject);
     procedure ThreadTerminated(Sender: TObject);
     procedure EnableButtons;
     procedure EnableButtons;
 
 
@@ -319,7 +327,7 @@ end;
 { TQueryThread }
 { TQueryThread }
 
 
 
 
-{ FinishCellEditing: Insert current been edited record in ModifiedRecords array }
+{ FinishCellEditing: Insert current just edited record in ModifiedRecords array }
 
 
 procedure TfmQueryWindow.FinishCellEditing(DataSet: TDataSet);
 procedure TfmQueryWindow.FinishCellEditing(DataSet: TDataSet);
 begin
 begin
@@ -328,7 +336,7 @@ end;
 
 
 
 
 
 
-{ InsertMOdifiedRecord: insert modified query record in ModifiedRecords array }
+{ InsertModifiedRecord: insert modified query record in ModifiedRecords array }
 
 
 procedure TfmQueryWindow.InsertModifiedRecord(RecordNo, TabIndex: Integer);
 procedure TfmQueryWindow.InsertModifiedRecord(RecordNo, TabIndex: Integer);
 var
 var
@@ -388,91 +396,92 @@ begin
     PKName:= fmMain.GetPrimaryKeyIndexName(fdbIndex, ATableName, ConstraintName);
     PKName:= fmMain.GetPrimaryKeyIndexName(fdbIndex, ATableName, ConstraintName);
     if PKName <> '' then
     if PKName <> '' then
     begin
     begin
-
-      aQuery:= TSQLQuery.Create(nil);
-      aQuery.DataBase:= ibConnection;
-      aQuery.Transaction:= SqlTrans;
       KeyList:= TStringList.Create;
       KeyList:= TStringList.Create;
       Fieldslist:= tstringList.Create;
       Fieldslist:= tstringList.Create;
-
-      // Get primary key fields
-      fmMain.GetIndexFields(ATableName, PKName, aQuery, KeyList);
-      fmMain.GetFields(fdbIndex, ATableName, FieldsList);
-      WhereClause:= 'where ';
-
-      RecordSet.DisableControls;
-      // Check modified fields
-      for i:= 0 to High(ModifiedRecords[TabIndex]) do
-      begin
-        FieldsSQL:= '';
-        RecordSet.RecNo:= ModifiedRecords[TabIndex][i];
-        for x:= 0 to RecordSet.Fields.Count - 1 do
-        if FieldsList.IndexOf(RecordSet.Fields[x].FieldName) <> -1 then // Field exist in origional table
-
-        if (RecordSet.Fields[x].NewValue <> RecordSet.Fields[x].OldValue) then // field data has been modified
-        begin
-         if FieldsSQL <> '' then
-             FieldsSQL += ',';
-           FieldsSQL += RecordSet.Fields[x].FieldName + '=';
-
-           // Typecast field values according to thier main type
-           case RecordSet.Fields[x].DataType of
-            ftInteger, ftSmallint: FieldsSQL += IntToStr(RecordSet.Fields[x].NewValue);
-            ftFloat: FieldsSQL += FloatToStr(RecordSet.Fields[x].NewValue);
-            ftTimeStamp, ftDateTime: FieldsSQL += '''' + DateTimeToStr(RecordSet.Fields[x].NewValue) + '''';
-            ftTime: FieldsSQL += '''' + TimeToStr(RecordSet.Fields[x].NewValue) + '''';
-            ftDate: FieldsSQL += '''' + DateToStr(RecordSet.Fields[x].NewValue) + '''';
-
-           else // Other types like string
-              FieldsSQL += '''' + RecordSet.Fields[x].NewValue + '''';
-
-         end;
-        end;
-
-
-        // Update current record
-        if FieldsSQL <> '' then
+      aQuery:= TSQLQuery.Create(nil);
+      try
+        aQuery.DataBase:= ibConnection;
+        aQuery.Transaction:= SqlTrans;
+
+        // Get primary key fields
+        fmMain.GetIndexFields(ATableName, PKName, aQuery, KeyList);
+        fmMain.GetFields(fdbIndex, ATableName, FieldsList);
+        WhereClause:= 'where ';
+
+        RecordSet.DisableControls;
+        // Check modified fields
+        for i:= Low(ModifiedRecords[TabIndex]) to High(ModifiedRecords[TabIndex]) do
         begin
         begin
-          aQuery.Close;
-          aQuery.SQL.Text:= 'update ' + aTableName + ' set ' + FieldsSQL;
+         FieldsSQL:= '';
+         RecordSet.RecNo:= ModifiedRecords[TabIndex][i];
+         for x:= 0 to RecordSet.Fields.Count - 1 do
+         if FieldsList.IndexOf(RecordSet.Fields[x].FieldName) <> -1 then // Field exist in origional table
+
+         if (RecordSet.Fields[x].NewValue <> RecordSet.Fields[x].OldValue) then // field data has been modified
+         begin
+          if FieldsSQL <> '' then
+              FieldsSQL += ',';
+            FieldsSQL += RecordSet.Fields[x].FieldName + '=';
+
+            // Typecast field values according to thier main type
+            case RecordSet.Fields[x].DataType of
+             ftInteger, ftSmallint: FieldsSQL += IntToStr(RecordSet.Fields[x].NewValue);
+             ftFloat: FieldsSQL += FloatToStr(RecordSet.Fields[x].NewValue);
+             ftTimeStamp, ftDateTime: FieldsSQL += '''' + DateTimeToStr(RecordSet.Fields[x].NewValue) + '''';
+             ftTime: FieldsSQL += '''' + TimeToStr(RecordSet.Fields[x].NewValue) + '''';
+             ftDate: FieldsSQL += '''' + DateToStr(RecordSet.Fields[x].NewValue) + '''';
 
 
-          WhereClause:= 'where ';
-          // where clause
-          for x:= 0 to KeyList.Count - 1 do
-          if Trim(KeyList[x]) <> '' then
-          begin
-            WhereClause += KeyList[x] + ' = ';
+            else // Other types like string
+               FieldsSQL += '''' + RecordSet.Fields[x].NewValue + '''';
 
 
-            // Typecase index values
-            case RecordSet.Fields[x].DataType of
-             ftInteger, ftSmallint: WhereClause += IntToStr(RecordSet.Fields[x].OldValue);
-             ftFloat: WhereClause += FloatToStr(RecordSet.Fields[x].OldValue);
-            else
-               WhereClause += '''' + RecordSet.Fields[x].OldValue + '''';
-            end;
-            if x < KeyList.Count - 1 then
-              WhereClause += ' and ';
           end;
           end;
+         end;
 
 
-          aQuery.SQL.Add(WhereClause);
-          aQuery.ExecSQL;
-          (Sender as TBitBtn).Visible:= False;
 
 
-          // Auto commit
-          if cxAutoCommit.Checked then
-            SqlTrans.CommitRetaining
-          else
-            EnableCommitButton;
+         // Update current record
+         if FieldsSQL <> '' then
+         begin
+           aQuery.Close;
+           aQuery.SQL.Text:= 'update ' + aTableName + ' set ' + FieldsSQL;
+
+           WhereClause:= 'where ';
+           // where clause
+           for x:= 0 to KeyList.Count - 1 do
+           if Trim(KeyList[x]) <> '' then
+           begin
+             WhereClause += KeyList[x] + ' = ';
+
+             // Typecase index values
+             case RecordSet.Fields[x].DataType of
+              ftInteger, ftSmallint: WhereClause += IntToStr(RecordSet.Fields[x].OldValue);
+              ftFloat: WhereClause += FloatToStr(RecordSet.Fields[x].OldValue);
+             else
+                WhereClause += '''' + RecordSet.Fields[x].OldValue + '''';
+             end;
+             if x < KeyList.Count - 1 then
+               WhereClause += ' and ';
+           end;
+
+           aQuery.SQL.Add(WhereClause);
+           aQuery.ExecSQL;
+           (Sender as TBitBtn).Visible:= False;
+
+           // Auto commit
+           if cxAutoCommit.Checked then
+             SqlTrans.CommitRetaining
+           else
+             EnableCommitButton;
+         end;
         end;
         end;
-      end;
 
 
-      // Reset ModifedRecords pointer
-      ModifiedRecords[TabIndex]:= nil;
-
-      RecordSet.EnableControls;
-      FieldsList.Free;
-      KeyList.Free;
-      aQuery.Free;
+        // Reset ModifedRecords pointer
+        ModifiedRecords[TabIndex]:= nil;
+        RecordSet.EnableControls;
+      finally
+        FieldsList.Free;
+        KeyList.Free;
+        aQuery.Free;
+      end;
     end
     end
     else
     else
       ShowMessage('There is no primary key on the table: ' + aTableName);
       ShowMessage('There is no primary key on the table: ' + aTableName);
@@ -486,10 +495,9 @@ begin
 
 
   end;
   end;
 
 
-
 end;
 end;
 
 
-{ EnableApplyButton: enable save updates button when records has been modified }
+{ EnableApplyButton: enable save updates button when records have been modified }
 
 
 procedure TfmQueryWindow.EnableApplyButton;
 procedure TfmQueryWindow.EnableApplyButton;
 var
 var
@@ -587,7 +595,7 @@ end;
 
 
 { GetQuerySQLType: get query type: select, script, execute from current string list }
 { GetQuerySQLType: get query type: select, script, execute from current string list }
 
 
-function TfmQueryWindow.getQuerySQLType(QueryList: TStringList; var SecondRealStart: Integer; var IsDDL: Boolean): Integer;
+function TfmQueryWindow.GetQuerySQLType(QueryList: TStringList; var SecondRealStart: Integer; var IsDDL: Boolean): Integer;
 var
 var
   SQLSegment: string;
   SQLSegment: string;
 begin
 begin
@@ -907,7 +915,7 @@ end;
 
 
 procedure TfmQueryWindow.tbRunClick(Sender: TObject);
 procedure TfmQueryWindow.tbRunClick(Sender: TObject);
 begin
 begin
-  CallExecuteQuery(0);
+  CallExecuteQuery(qtUnknown);
 end;
 end;
 
 
 
 
@@ -962,12 +970,12 @@ begin
   // Get current database tables to be hilighted in SQL query editor
   // Get current database tables to be hilighted in SQL query editor
   SynSQLSyn1.TableNames.CommaText:= fmMain.GetTableNames(dbIndex);
   SynSQLSyn1.TableNames.CommaText:= fmMain.GetTableNames(dbIndex);
   SynCompletion1.ItemList.AddStrings(SynSQLSyn1.TableNames);
   SynCompletion1.ItemList.AddStrings(SynSQLSyn1.TableNames);
-  sortsyncompletion;
+  SortSynCompletion;
 end;
 end;
 
 
 (************* Is Selectable (Check statement type Select, Update, Alter, etc) *******************)
 (************* Is Selectable (Check statement type Select, Update, Alter, etc) *******************)
 
 
-function TfmQueryWindow.GetQueryType(AQuery: string): Integer;
+function TfmQueryWindow.GetQueryType(AQuery: string): TQueryTypes;
 var
 var
   List: TStringList;
   List: TStringList;
   i: Integer;
   i: Integer;
@@ -978,7 +986,7 @@ begin
   try
   try
     List.Text:= AQuery;
     List.Text:= AQuery;
 
 
-    Result:= 2; // Default Execute
+    Result:= qtExecute; // Default Execute
 
 
     for i:= 0 to List.Count - 1 do
     for i:= 0 to List.Count - 1 do
     begin
     begin
@@ -995,19 +1003,19 @@ begin
 
 
       if (Pos('select', LowerCase(Trim(Line))) = 1) then
       if (Pos('select', LowerCase(Trim(Line))) = 1) then
       begin
       begin
-        Result:= 1; // Selectable
+        Result:= qtSelectable; // Selectable
         Break;
         Break;
       end
       end
       else
       else
       if Pos('setterm', LowerCase(StringReplace(Line, ' ', '', [rfReplaceAll]))) = 1 then
       if Pos('setterm', LowerCase(StringReplace(Line, ' ', '', [rfReplaceAll]))) = 1 then
       begin
       begin
-        Result:= 3;
+        Result:= qtScript;
         Break;
         Break;
       end;
       end;
 
 
       if Trim(Line) <> '' then
       if Trim(Line) <> '' then
       begin
       begin
-        Result:= 2; // Executable
+        Result:= qtExecute; // Executable
         Break;
         Break;
       end;
       end;
 
 
@@ -1150,7 +1158,7 @@ begin
   try
   try
 
 
     // Script
     // Script
-    if (fOrigQueryType = 3) then
+    if (fOrigQueryType = qtScript) then
     begin
     begin
       ExecuteScript(fQuery);
       ExecuteScript(fQuery);
       Inc(fModifyCount);
       Inc(fModifyCount);
@@ -1480,7 +1488,7 @@ var
   i: Integer;
   i: Integer;
   CannotFree: Boolean;
   CannotFree: Boolean;
 begin
 begin
-  for i:= High(ResultControls) downto  0 do
+  for i:= High(ResultControls) downto Low(ResultControls) do
   begin
   begin
     if ResultControls[i] is TSQLQuery then
     if ResultControls[i] is TSQLQuery then
     begin
     begin
@@ -1563,7 +1571,7 @@ begin
   removeEmptyLines(QueryList, SecondRealStart, RealStartLine);
   removeEmptyLines(QueryList, SecondRealStart, RealStartLine);
 
 
   // Get SQL type
   // Get SQL type
-  QueryType:= getQuerySQLType(QueryList, SecondRealStart, IsDDL);
+  QueryType:= GetQuerySQLType(QueryList, SecondRealStart, IsDDL);
 
 
   // Concatinate
   // Concatinate
   SQLSegment:= '';
   SQLSegment:= '';
@@ -1615,7 +1623,7 @@ end;
 
 
 procedure TfmQueryWindow.bbRunClick(Sender: TObject);
 procedure TfmQueryWindow.bbRunClick(Sender: TObject);
 begin
 begin
-  CallExecuteQuery(0);
+  CallExecuteQuery(qtUnknown);
 end;
 end;
 
 
 
 
@@ -1696,7 +1704,24 @@ var
   str:string;
   str:string;
 begin
 begin
   SynCompletion1.ItemList.CommaText:= 'create,table,Select,From,INTEGER,FLOAT';
   SynCompletion1.ItemList.CommaText:= 'create,table,Select,From,INTEGER,FLOAT';
-  Sortsyncompletion;
+  SortSynCompletion;
+end;
+
+procedure TfmQueryWindow.FormKeyDown(Sender: TObject; var Key: Word;
+  Shift: TShiftState);
+begin
+  if (ssCtrl in Shift) and
+    ((Key=VK_F4) or (Key=VK_W)) then
+  begin
+    if ((Trim(meQuery.Lines.Text) = '') or
+      (MessageDlg('Do you want to close this query window?', mtConfirmation, [mbNo, mbYes], 0) = mrYes))
+      then
+    begin
+      // Close when pressing Ctrl-W or Ctrl-F4 (Cmd-W/Cmd-F4 on OSX)
+      Close;
+      Parent.Free;
+    end;
+  end;
 end;
 end;
 
 
 
 
@@ -1787,37 +1812,40 @@ begin
     Grid.DataSource.DataSet.DisableControls;
     Grid.DataSource.DataSet.DisableControls;
     Grid.DataSource.DataSet.First;
     Grid.DataSource.DataSet.First;
     List:= TStringList.Create;
     List:= TStringList.Create;
-    Line:= '';
-
-    // Copy fields header
-    with Grid.DataSource.DataSet do
-    for i:= 0 to FieldCount - 1 do
-    begin
-      Line:= Line + '"' + Fields[i].FieldName + '"';
-      if i + 1 < FieldCount then
-        Line:= Line + ',';
-    end;
-    List.Add(Line);
-
-    // Copy table data
-    with Grid.DataSource.DataSet do
-    while not Eof do
-    begin
+    try
       Line:= '';
       Line:= '';
+
+      // Copy fields header
+      with Grid.DataSource.DataSet do
       for i:= 0 to FieldCount - 1 do
       for i:= 0 to FieldCount - 1 do
       begin
       begin
-        Line:= Line + '"' + Trim(Fields[i].AsString) + '"';
+        Line:= Line + '"' + Fields[i].FieldName + '"';
         if i + 1 < FieldCount then
         if i + 1 < FieldCount then
           Line:= Line + ',';
           Line:= Line + ',';
       end;
       end;
       List.Add(Line);
       List.Add(Line);
-      Next;
-    end;
-   Clipboard.AsText:= List.Text;
 
 
+      // Copy table data
+      with Grid.DataSource.DataSet do
+      while not Eof do
+      begin
+        Line:= '';
+        for i:= 0 to FieldCount - 1 do
+        begin
+          Line:= Line + '"' + Trim(Fields[i].AsString) + '"';
+          if i + 1 < FieldCount then
+            Line:= Line + ',';
+        end;
+        List.Add(Line);
+        Next;
+      end;
+      Clipboard.AsText:= List.Text;
+    finally
+      List.Free;
+    end;
   except
   except
-  on e: exception do
-    ShowMessage(e.Message);
+    on e: exception do
+      ShowMessage(e.Message);
   end;
   end;
   grid.DataSource.DataSet.EnableControls;
   grid.DataSource.DataSet.EnableControls;
 end;
 end;
@@ -1939,7 +1967,7 @@ end;
 
 
 procedure TfmQueryWindow.lmRunClick(Sender: TObject);
 procedure TfmQueryWindow.lmRunClick(Sender: TObject);
 begin
 begin
-  CallExecuteQuery(0);
+  CallExecuteQuery(qtUnknown);
 end;
 end;
 
 
 
 
@@ -1947,7 +1975,7 @@ end;
 
 
 procedure TfmQueryWindow.lmRunExecClick(Sender: TObject);
 procedure TfmQueryWindow.lmRunExecClick(Sender: TObject);
 begin
 begin
-  CallExecuteQuery(2);
+  CallExecuteQuery(qtExecute);
 end;
 end;
 
 
 
 
@@ -1955,7 +1983,7 @@ end;
 
 
 procedure TfmQueryWindow.lmRunScriptClick(Sender: TObject);
 procedure TfmQueryWindow.lmRunScriptClick(Sender: TObject);
 begin
 begin
-  CallExecuteQuery(3);
+  CallExecuteQuery(qtScript);
 end;
 end;
 
 
 
 
@@ -1963,7 +1991,7 @@ end;
 
 
 procedure TfmQueryWindow.lmRunSelectClick(Sender: TObject);
 procedure TfmQueryWindow.lmRunSelectClick(Sender: TObject);
 begin
 begin
-  CallExecuteQuery(1);
+  CallExecuteQuery(qtSelectable);
 end;
 end;
 
 
 
 
@@ -2007,7 +2035,7 @@ begin
   // Execute query by pressing Ctrl + Enter
   // Execute query by pressing Ctrl + Enter
   if (ssCtrl in shift) and (key = 13) then
   if (ssCtrl in shift) and (key = 13) then
   begin
   begin
-    CallExecuteQuery(0);
+    CallExecuteQuery(qtUnknown);
     key:= 0;
     key:= 0;
   end;
   end;
 end;
 end;
@@ -2023,24 +2051,25 @@ begin
   TabSheet:= nil;
   TabSheet:= nil;
   // Get DataSet's TTabsheet
   // Get DataSet's TTabsheet
   for i:= 0 to High(ResultControls) do
   for i:= 0 to High(ResultControls) do
-  if ResultControls[i] <> nil then
-  if DataSet = ResultControls[i] then
+  if (ResultControls[i] <> nil) and
+    (DataSet = ResultControls[i]) then
   begin
   begin
     TabSheet:= ParentResultControls[i] as TTabSheet;
     TabSheet:= ParentResultControls[i] as TTabSheet;
     Break;
     Break;
   end;
   end;
 
 
+
   // Search for status bar inside current query result TabSheet
   // Search for status bar inside current query result TabSheet
   if TabSheet <> nil then
   if TabSheet <> nil then
   for i:= 0 to High(ResultControls) do
   for i:= 0 to High(ResultControls) do
   if ResultControls[i] <> nil then
   if ResultControls[i] <> nil then
     if  (ParentResultControls[i] <> nil) and ((ParentResultControls[i] as TTabSheet) = TabSheet)
     if  (ParentResultControls[i] <> nil) and ((ParentResultControls[i] as TTabSheet) = TabSheet)
       and (ResultControls[i] is TStatusBar) then
       and (ResultControls[i] is TStatusBar) then
-      begin
-        // Display current record and number of total records in status bar
-        (ResultControls[i] as TStatusBar).SimpleText:= IntToStr(DataSet.RecordCount) +
-        ' records fetched. At record # ' + IntToStr(DataSet.RecNo);
-      break;
+    begin
+      // Display current record and number of total records in status bar
+      (ResultControls[i] as TStatusBar).SimpleText:= IntToStr(DataSet.RecordCount) +
+      ' records fetched. At record # ' + IntToStr(DataSet.RecNo);
+    break;
   end;
   end;
 
 
 end;
 end;
@@ -2048,7 +2077,7 @@ end;
 
 
 { Execute query according to passed query ype }
 { Execute query according to passed query ype }
 
 
-procedure TfmQueryWindow.CallExecuteQuery(aQueryType: Integer);
+procedure TfmQueryWindow.CallExecuteQuery(aQueryType: TQueryTypes);
 begin
 begin
   fList:= TStringList.Create;
   fList:= TStringList.Create;
 
 
@@ -2068,12 +2097,12 @@ begin
   RemoveControls;
   RemoveControls;
 
 
   // Get initial query type, it could be changed later in the next parts
   // Get initial query type, it could be changed later in the next parts
-  if aQueryType = 0 then // Auto
+  if aQueryType = qtUnknown then // Auto
     fOrigQueryType:= GetQueryType(fQuery)
     fOrigQueryType:= GetQueryType(fQuery)
   else
   else
     fOrigQueryType:= aQueryType;
     fOrigQueryType:= aQueryType;
 
 
-  // Call execute query for each parts until finished
+  // Call execute query for each part until finished
   fCnt:= 0;
   fCnt:= 0;
   fFinished:= False;
   fFinished:= False;
   repeat
   repeat
@@ -2085,19 +2114,22 @@ end;
 
 
 { sort auto completion options }
 { sort auto completion options }
 
 
-procedure TfmQueryWindow.sortsyncompletion;
+procedure TfmQueryWindow.SortSynCompletion;
 var
 var
-  sortinglis:TStringList;
+  SortingList:TStringList;
   i:Integer;
   i:Integer;
 begin
 begin
-  sortinglis:=TStringList.Create;
+  SortingList:=TStringList.Create;
+  try
     for i:=0 to SynCompletion1.ItemList.Count-1 do
     for i:=0 to SynCompletion1.ItemList.Count-1 do
-        sortinglis.Add(SynCompletion1.ItemList.Strings[i]);
-    sortinglis.Sort;
+       SortingList.Add(SynCompletion1.ItemList.Strings[i]);
+    SortingList.Sort;
     SynCompletion1.ItemList.Clear;
     SynCompletion1.ItemList.Clear;
-    for i:=0 to sortinglis.Count-1 do
-    SynCompletion1.ItemList.Add(sortinglis.Strings[i]);
-
+    for i:=0 to SortingList.Count-1 do
+      SynCompletion1.ItemList.Add(SortingList.Strings[i]);
+  finally
+    SortingList.Free;
+  end;
 end;
 end;
 
 
 
 

+ 267 - 234
scriptdb.pas

@@ -32,6 +32,10 @@ procedure RemoveParamClosing(var AParams: string);
 
 
 implementation
 implementation
 
 
+{ to do: add support for dependencies when extracting script; otherwise running the script may fail
+evaluating dependency order:
+http://rosettacode.org/wiki/Topological_sort#Object_Pascal
+}
 uses SysTables, Main;
 uses SysTables, Main;
 
 
 (********************  Script Roles  ***********************)
 (********************  Script Roles  ***********************)
@@ -149,90 +153,92 @@ begin
   ScriptList.Clear;
   ScriptList.Clear;
   ScriptList.Add('create table ' + ATableName + ' (');
   ScriptList.Add('create table ' + ATableName + ' (');
   CalculatedList:= TStringList.Create;
   CalculatedList:= TStringList.Create;
-
-  // Fields
-  with fmMain.SQLQuery1 do
-  while not EOF do
-  begin
-    Skipped:= False;
-    if (FieldByName('Computed_Source').AsString = '') and
-     ((Pos('CHAR', Trim(FieldByName('Field_Type_Str').AsString)) = 0) or
-     (Trim(FieldByName('Field_Collation').AsString) = 'NONE') or
-     (FieldByName('Field_Collation').IsNull)) then
+  try
+    // Fields
+    with fmMain.SQLQuery1 do
+    while not EOF do
     begin
     begin
-      // Field Name
-      FieldLine:= Trim(FieldByName('Field_Name').AsString) + ' ';
-
-      // Field Type
-      if FieldByName('Field_Type_Int').AsInteger in [7, 8, 16] then
-        FieldLine:= FieldLine + fmMain.GetNumericFieldType(FieldByName('Field_Type_Int').AsInteger,
-          FieldByName('Field_SubType').AsInteger, FieldByName('Field_Length').AsInteger,
-          FieldByName('Field_Scale').AsInteger)
-      else
-        FieldLine:= FieldLine + Trim(FieldByName('Field_Type_Str').AsString);
-
-      if Pos('char', LowerCase(FieldByName('Field_Type_Str').AsString)) > 0 then
-        FieldLine:= FieldLine + '(' + FieldByName('Character_Leng').AsString + ') ';
-
-      // Default value
-      DefaultValue:= Trim(FieldByName('Field_Default_Value').AsString);
-      if DefaultValue <> '' then
+      Skipped:= False;
+      if (FieldByName('Computed_Source').AsString = '') and
+       ((Pos('CHAR', Trim(FieldByName('Field_Type_Str').AsString)) = 0) or
+       (Trim(FieldByName('Field_Collation').AsString) = 'NONE') or
+       (FieldByName('Field_Collation').IsNull)) then
       begin
       begin
-        if pos('default', DefaultValue) <> 1 then
-          DefaultValue:= ' default ''' + DefaultValue + '''';
+        // Field Name
+        FieldLine:= Trim(FieldByName('Field_Name').AsString) + ' ';
+
+        // Field Type
+        if FieldByName('Field_Type_Int').AsInteger in [7, 8, 16] then
+          FieldLine:= FieldLine + fmMain.GetNumericFieldType(FieldByName('Field_Type_Int').AsInteger,
+            FieldByName('Field_SubType').AsInteger, FieldByName('Field_Length').AsInteger,
+            FieldByName('Field_Scale').AsInteger)
+        else
+          FieldLine:= FieldLine + Trim(FieldByName('Field_Type_Str').AsString);
+
+        if Pos('char', LowerCase(FieldByName('Field_Type_Str').AsString)) > 0 then
+          FieldLine:= FieldLine + '(' + FieldByName('Character_Leng').AsString + ') ';
+
+        // Default value
+        DefaultValue:= Trim(FieldByName('Field_Default_Value').AsString);
+        if DefaultValue <> '' then
+        begin
+          if pos('default', DefaultValue) <> 1 then
+            DefaultValue:= ' default ''' + DefaultValue + '''';
+
+          FieldLine:= FieldLine + ' ' + DefaultValue;
+        end;
+
+        // Null/Not null
+        if FieldByName('field_not_null_constraint').AsString = '1' then
+           FieldLine:= FieldLine + ' not null ';
 
 
-        FieldLine:= FieldLine + ' ' + DefaultValue;
-      end;
-
-      // Null/Not null
-      if FieldByName('field_not_null_constraint').AsString = '1' then
-         FieldLine:= FieldLine + ' not null ';
-
-    end
-    else
-      Skipped:= True;
+      end
+      else
+        Skipped:= True;
 
 
-    // Computed Fields
-    if FieldByName('Computed_Source').AsString <> '' then
-      CalculatedList.Add('ALTER TABLE ' + ATableName + ' ADD ' +
-        Trim(FieldByName('Field_Name').AsString) + ' COMPUTED BY ' + FieldByName('Computed_Source').AsString + ';');
+      // Computed Fields
+      if FieldByName('Computed_Source').AsString <> '' then
+        CalculatedList.Add('ALTER TABLE ' + ATableName + ' ADD ' +
+          Trim(FieldByName('Field_Name').AsString) + ' COMPUTED BY ' + FieldByName('Computed_Source').AsString + ';');
 
 
-    Next;
+      Next;
 
 
-    if not Skipped then
-    begin
-      if not EOF then
-        FieldLine:= FieldLine + ',';
-      ScriptList.Add(FieldLine);
+      if not Skipped then
+      begin
+        if not EOF then
+          FieldLine:= FieldLine + ',';
+        ScriptList.Add(FieldLine);
+      end;
     end;
     end;
-  end;
 
 
-  if Pos(',', ScriptList[ScriptList.Count - 1]) > 0 then
-    ScriptList[ScriptList.Count - 1]:= Copy(ScriptList[ScriptList.Count - 1], 1,
-      Length(ScriptList[ScriptList.Count - 1]) - 1);
+    if Pos(',', ScriptList[ScriptList.Count - 1]) > 0 then
+      ScriptList[ScriptList.Count - 1]:= Copy(ScriptList[ScriptList.Count - 1], 1,
+        Length(ScriptList[ScriptList.Count - 1]) - 1);
 
 
-  fmMain.SQLQuery1.Close;
+    fmMain.SQLQuery1.Close;
 
 
-  // Primary Keys
-  PKFieldsList:= TStringList.Create;
-  PKeyName:= fmMain.GetPrimaryKeyIndexName(dbIndex, ATableName, ConstraintName);
-  if PKeyName <> '' then
-  begin
-    fmMain.GetConstraintFields(ATableName, PKeyName, PKFieldsList);
-    FieldLine:= 'constraint ' + PKeyName + ' primary key (';
-    for i:= 0 to PKFieldsList.Count - 1 do
-      FieldLine:= FieldLine + PKFieldsList[i] + ', ';
-    if PKFieldsList.Count > 0 then
+    // Primary Keys
+    PKFieldsList:= TStringList.Create;
+    PKeyName:= fmMain.GetPrimaryKeyIndexName(dbIndex, ATableName, ConstraintName);
+    if PKeyName <> '' then
     begin
     begin
-      Delete(FieldLine, Length(FieldLine) - 1, 2);
-      FieldLine:= FieldLine + ')';
-      ScriptList.Add(', ' + FieldLine);
+      fmMain.GetConstraintFields(ATableName, PKeyName, PKFieldsList);
+      FieldLine:= 'constraint ' + PKeyName + ' primary key (';
+      for i:= 0 to PKFieldsList.Count - 1 do
+        FieldLine:= FieldLine + PKFieldsList[i] + ', ';
+      if PKFieldsList.Count > 0 then
+      begin
+        Delete(FieldLine, Length(FieldLine) - 1, 2);
+        FieldLine:= FieldLine + ')';
+        ScriptList.Add(', ' + FieldLine);
+      end;
     end;
     end;
-  end;
 
 
-  ScriptList.Add(');');
-  ScriptList.Add(CalculatedList.Text);
-  CalculatedList.Free;
+    ScriptList.Add(');');
+    ScriptList.Add(CalculatedList.Text);
+  finally
+    CalculatedList.Free;
+  end;
 end;
 end;
 
 
 (***************  Script All Tables  ********************)
 (***************  Script All Tables  ********************)
@@ -246,17 +252,20 @@ var
 begin
 begin
   TablesList:= TStringList.Create;
   TablesList:= TStringList.Create;
   TableScript:= TStringList.Create;
   TableScript:= TStringList.Create;
-  TablesList.CommaText:= dmSysTables.GetDBObjectNames(dbIndex, 1, Count);
-  List.Clear;
-  for i:= 0 to TablesList.Count - 1 do
-  begin
-    ScriptTableAsCreate(dbIndex, TablesList[i], TableScript);
-    List.Add('');
-    List.AddStrings(TableScript);
+  try
+    TablesList.CommaText:= dmSysTables.GetDBObjectNames(dbIndex, 1, Count);
+    List.Clear;
+    for i:= 0 to TablesList.Count - 1 do
+    begin
+      ScriptTableAsCreate(dbIndex, TablesList[i], TableScript);
+      List.Add('');
+      List.AddStrings(TableScript);
+    end;
+    Result:= TablesList.Count > 0;
+  finally
+    TablesList.Free;
+    TableScript.Free;
   end;
   end;
-  Result:= TablesList.Count > 0;
-  TablesList.Free;
-  TableScript.Free;
 end;
 end;
 
 
 (********************  Script Procedure Template  ***********************)
 (********************  Script Procedure Template  ***********************)
@@ -272,21 +281,24 @@ var
 begin
 begin
   ProceduresList:= TStringList.Create;
   ProceduresList:= TStringList.Create;
   ProcedureScript:= TStringList.Create;
   ProcedureScript:= TStringList.Create;
-  ProceduresList.CommaText:= dmSysTables.GetDBObjectNames(dbIndex, 5, Count);
-  List.Clear;
-  for i:= 0 to ProceduresList.Count - 1 do
-  begin
-    ProcedureScript.Text:= fmMain.GetStoredProcBody(dbIndex, ProceduresList[i], SPOwner);
-    ProcedureScript.Insert(0, 'SET TERM ^ ;');
-    ProcedureScript.Insert(1, 'CREATE Procedure ' + ProceduresList[i] + '(');
-    ProcedureScript.Add('^');
-    ProcedureScript.Add('SET TERM ; ^');
-    ProcedureScript.Add('');
-    List.AddStrings(ProcedureScript);
+  try
+    ProceduresList.CommaText:= dmSysTables.GetDBObjectNames(dbIndex, 5, Count);
+    List.Clear;
+    for i:= 0 to ProceduresList.Count - 1 do
+    begin
+      ProcedureScript.Text:= fmMain.GetStoredProcBody(dbIndex, ProceduresList[i], SPOwner);
+      ProcedureScript.Insert(0, 'SET TERM ^ ;');
+      ProcedureScript.Insert(1, 'CREATE Procedure ' + ProceduresList[i] + '(');
+      ProcedureScript.Add('^');
+      ProcedureScript.Add('SET TERM ; ^');
+      ProcedureScript.Add('');
+      List.AddStrings(ProcedureScript);
+    end;
+    Result:= ProceduresList.Count > 0;
+  finally
+    ProceduresList.Free;
+    ProcedureScript.Free;
   end;
   end;
-  Result:= ProceduresList.Count > 0;
-  ProceduresList.Free;
-  ProcedureScript.Free;
 end;
 end;
 
 
 (********************  Script Views   ***********************)
 (********************  Script Views   ***********************)
@@ -301,20 +313,23 @@ var
 begin
 begin
   ViewsList:= TStringList.Create;
   ViewsList:= TStringList.Create;
   ViewsBodyList:= TStringList.Create;
   ViewsBodyList:= TStringList.Create;
-  ViewsList.CommaText:= dmSysTables.GetDBObjectNames(dbIndex, 4, Count);
-  List.Clear;
-  for i:= 0 to ViewsList.Count - 1 do
-  begin
-    fmMain.GetViewInfo(dbIndex, ViewsList[i], Columns, ViewBody);
-    ViewsBodyList.Text:= Trim(ViewBody);
-    List.Add('CREATE VIEW "' + ViewsList[i] + '" (' + Columns + ')');
-    List.Add('AS');
-    List.AddStrings(ViewsBodyList);
-    List.Add(' ;');
+  try
+    ViewsList.CommaText:= dmSysTables.GetDBObjectNames(dbIndex, 4, Count);
+    List.Clear;
+    for i:= 0 to ViewsList.Count - 1 do
+    begin
+      fmMain.GetViewInfo(dbIndex, ViewsList[i], Columns, ViewBody);
+      ViewsBodyList.Text:= Trim(ViewBody);
+      List.Add('CREATE VIEW "' + ViewsList[i] + '" (' + Columns + ')');
+      List.Add('AS');
+      List.AddStrings(ViewsBodyList);
+      List.Add(' ;');
+    end;
+    Result:= ViewsList.Count > 0;
+  finally
+    ViewsList.Free;
+    ViewsBodyList.Free;
   end;
   end;
-  Result:= ViewsList.Count > 0;
-  ViewsList.Free;
-  ViewsBodyList.Free;
 end;
 end;
 
 
 
 
@@ -329,18 +344,21 @@ var
 begin
 begin
   TriggersList:= TStringList.Create;
   TriggersList:= TStringList.Create;
   TriggerScript:= TStringList.Create;
   TriggerScript:= TStringList.Create;
-  TriggersList.CommaText:= dmSysTables.GetDBObjectNames(dbIndex, 3, Count);
-  List.Clear;
-  for i:= 0 to TriggersList.Count - 1 do
-  begin
-    TriggerScript.Clear;
-    dmSysTables.ScriptTrigger(dbIndex, TriggersList[i], TriggerScript, True);
-    List.AddStrings(TriggerScript);
-    List.Add('');
+  try
+    TriggersList.CommaText:= dmSysTables.GetDBObjectNames(dbIndex, 3, Count);
+    List.Clear;
+    for i:= 0 to TriggersList.Count - 1 do
+    begin
+      TriggerScript.Clear;
+      dmSysTables.ScriptTrigger(dbIndex, TriggersList[i], TriggerScript, True);
+      List.AddStrings(TriggerScript);
+      List.Add('');
+    end;
+    Result:= TriggersList.Count > 0;
+  finally
+    TriggerScript.Free;
+    TriggersList.Free;
   end;
   end;
-  Result:= TriggersList.Count > 0;
-  TriggerScript.Free;
-  TriggersList.Free;
 end;
 end;
 
 
 (********************  Script Secondary indices  ***********************)
 (********************  Script Secondary indices  ***********************)
@@ -357,38 +375,41 @@ var
 begin
 begin
   TablesList:= TStringList.Create;
   TablesList:= TStringList.Create;
   FieldsList:= TStringList.Create;
   FieldsList:= TStringList.Create;
-  TablesList.CommaText:= dmSysTables.GetDBObjectNames(dbIndex, 1, Count);
-  List.Clear;
-  for i:= 0 to TablesList.Count - 1 do
-  begin
-    PKName:= fmMain.GetPrimaryKeyIndexName(dbIndex, TablesList[i], ConstraintName);
-
-    if fmMain.GetIndices(TablesList[i], dmSysTables.sqQuery) then
-    with dmSysTables.sqQuery do
-    while not EOF do
+  try
+    TablesList.CommaText:= dmSysTables.GetDBObjectNames(dbIndex, 1, Count);
+    List.Clear;
+    for i:= 0 to TablesList.Count - 1 do
     begin
     begin
-      if PKName <> Trim(FieldByName('RDB$Index_name').AsString) then
-      begin
-        Line:= 'create ';
-        if FieldByName('RDB$Unique_Flag').AsString = '1' then
-          Line:= Line + 'Unique ';
-        if FieldByName('RDB$Index_Type').AsString = '1' then
-          Line:= Line + 'Descending ';
-
-        Line:= Line + 'index ' + Trim(FieldByName('RDB$Index_name').AsString) + ' on ' + TablesList[i];
-
-        fmMain.GetIndexFields(TablesList[i], Trim(FieldByName('RDB$Index_Name').AsString), fmMain.SQLQuery1, FieldsList);
-        Line:= Line + ' (' + FieldsList.CommaText + ') ;';
-        List.Add(Line);
+      PKName:= fmMain.GetPrimaryKeyIndexName(dbIndex, TablesList[i], ConstraintName);
 
 
+      if fmMain.GetIndices(TablesList[i], dmSysTables.sqQuery) then
+      with dmSysTables.sqQuery do
+      while not EOF do
+      begin
+        if PKName <> Trim(FieldByName('RDB$Index_name').AsString) then
+        begin
+          Line:= 'create ';
+          if FieldByName('RDB$Unique_Flag').AsString = '1' then
+            Line:= Line + 'Unique ';
+          if FieldByName('RDB$Index_Type').AsString = '1' then
+            Line:= Line + 'Descending ';
+
+          Line:= Line + 'index ' + Trim(FieldByName('RDB$Index_name').AsString) + ' on ' + TablesList[i];
+
+          fmMain.GetIndexFields(TablesList[i], Trim(FieldByName('RDB$Index_Name').AsString), fmMain.SQLQuery1, FieldsList);
+          Line:= Line + ' (' + FieldsList.CommaText + ') ;';
+          List.Add(Line);
+
+        end;
+        Next;
       end;
       end;
-      Next;
     end;
     end;
+    dmSysTables.sqQuery.Close;
+    Result:= List.Count > 0;
+  finally
+    TablesList.Free;
+    FieldsList.Free;
   end;
   end;
-  dmSysTables.sqQuery.Close;
-  Result:= List.Count > 0;
-  TablesList.Free;
-  FieldsList.Free;
 end;
 end;
 
 
 
 
@@ -402,28 +423,35 @@ var
   Line: string;
   Line: string;
 begin
 begin
   TablesList:= TStringList.Create;
   TablesList:= TStringList.Create;
-  TablesList.CommaText:= dmSysTables.GetDBObjectNames(dbIndex, 1, Count);
-  List.Clear;
-  for i:= 0 to TablesList.Count - 1 do
-  with dmSysTables do
-  begin
-    GetTableConstraints(TablesList[i], sqQuery);
-    while not sqQuery.EOF do
+  try
+    TablesList.CommaText:= dmSysTables.GetDBObjectNames(dbIndex, 1, Count);
+    List.Clear;
+    for i:= 0 to TablesList.Count - 1 do
+    with dmSysTables do
     begin
     begin
-       Line:= 'alter table ' + TablesList[i] + ' add constraint ' + sqQuery.Fields[0].AsString +
-         ' foreign key (' + sqQuery.Fields[3].AsString + ') references ' +  sqQuery.Fields[4].AsString  +
-         ' (' + dmSysTables.GetConstraintForiegnKeyFields(sqQuery.Fields[5].AsString, fmMain.SQLQuery1) + ') ';
-       if Trim(sqQuery.Fields[6].AsString) <> 'RESTRICT' then
-         Line:= Line + ' on update ' + Trim(sqQuery.Fields[6].AsString);
-       if Trim(sqQuery.Fields[7].AsString) <> 'RESTRICT' then
-         Line:= Line + ' on delete ' + Trim(sqQuery.Fields[7].AsString);
-       List.Add(Line + ';');
-       sqQuery.Next;
+      { to do: foreign keys are not picked up while FlameRobin does, e.g. this for employee.fdb:
+      ALTER TABLE EMPLOYEE ADD CONSTRAINT INTEG_28
+        FOREIGN KEY (DEPT_NO) REFERENCES DEPARTMENT (DEPT_NO);
+      }
+      GetTableConstraints(TablesList[i], sqQuery);
+      while not sqQuery.EOF do
+      begin
+         Line:= 'alter table ' + TablesList[i] + ' add constraint ' + sqQuery.Fields[0].AsString +
+           ' foreign key (' + sqQuery.Fields[3].AsString + ') references ' +  sqQuery.Fields[4].AsString  +
+           ' (' + dmSysTables.GetConstraintForiegnKeyFields(sqQuery.Fields[5].AsString, fmMain.SQLQuery1) + ') ';
+         if Trim(sqQuery.Fields[6].AsString) <> 'RESTRICT' then
+           Line:= Line + ' on update ' + Trim(sqQuery.Fields[6].AsString);
+         if Trim(sqQuery.Fields[7].AsString) <> 'RESTRICT' then
+           Line:= Line + ' on delete ' + Trim(sqQuery.Fields[7].AsString);
+         List.Add(Line + ';');
+         sqQuery.Next;
+      end;
+      sqQuery.Close;
     end;
     end;
-    sqQuery.Close;
+    Result:= List.Count > 0;
+  finally
+    TablesList.Free;
   end;
   end;
-  Result:= List.Count > 0;
-  TablesList.Free;
 end;
 end;
 
 
 
 
@@ -442,46 +470,47 @@ begin
     ObjName:= Copy(ObjName, 4, Length(ObjName) - 3);
     ObjName:= Copy(ObjName, 4, Length(ObjName) - 3);
     Permissions:= dmSysTables.GetObjectUserPermission(dbIndex, ObjName, UserName, ObjType);
     Permissions:= dmSysTables.GetObjectUserPermission(dbIndex, ObjName, UserName, ObjType);
     PermissionList:= TstringList.Create;
     PermissionList:= TstringList.Create;
-    if Permissions <> '' then
-    begin
-      if Pos('<T>', OrigObjName) = 1 then // Table/View
+    try
+      if Permissions <> '' then
       begin
       begin
-        PermissionList.Clear;
-        if Pos('S', Permissions) > 0 then
-          PermissionList.Add('Select');
-
-        if Pos('U', Permissions) > 0 then
-          PermissionList.Add('Update');
-
-        if Pos('I', Permissions) > 0 then
-          PermissionList.Add('Insert');
-
-        if Pos('D', Permissions) > 0 then
-          PermissionList.Add('Delete');
-
-        if Pos('R', Permissions) > 0 then
-          PermissionList.Add('References');
-        Line:= 'Grant ' + PermissionList.CommaText + ' on ' + ObjName + ' to ' + NewUser;
-        if Pos('G', Permissions) > 0 then
-          Line:= Line + ' with Grant option';
-        List.Add(Line + ' ;');
-      end
-      else
-      if Pos('<P>', OrigObjName) = 1 then // Procedure
-        List.Add('Grant Execute on procedure ' + ObjName + ' to ' + NewUser + ' ;')
-      else
-      if Pos('<R>', OrigObjName) = 1 then // Role
-        List.Add('Grant ' + ObjName + ' to ' + NewUser + ' ;');
+        if Pos('<T>', OrigObjName) = 1 then // Table/View
+        begin
+          PermissionList.Clear;
+          if Pos('S', Permissions) > 0 then
+            PermissionList.Add('Select');
+
+          if Pos('U', Permissions) > 0 then
+            PermissionList.Add('Update');
+
+          if Pos('I', Permissions) > 0 then
+            PermissionList.Add('Insert');
+
+          if Pos('D', Permissions) > 0 then
+            PermissionList.Add('Delete');
+
+          if Pos('R', Permissions) > 0 then
+            PermissionList.Add('References');
+          Line:= 'Grant ' + PermissionList.CommaText + ' on ' + ObjName + ' to ' + NewUser;
+          if Pos('G', Permissions) > 0 then
+            Line:= Line + ' with Grant option';
+          List.Add(Line + ' ;');
+        end
+        else
+        if Pos('<P>', OrigObjName) = 1 then // Procedure
+          List.Add('Grant Execute on procedure ' + ObjName + ' to ' + NewUser + ' ;')
+        else
+        if Pos('<R>', OrigObjName) = 1 then // Role
+          List.Add('Grant ' + ObjName + ' to ' + NewUser + ' ;');
 
 
+      end;
+    finally
+      PermissionList.Free;
     end;
     end;
-    PermissionList.Free;
     Result:= True;
     Result:= True;
-
   except
   except
-  on e: exception do
-    Result:= False;
+    on e: exception do
+      Result:= False;
   end;
   end;
-
 end;
 end;
 
 
 (********************  Script All Usesr and Rules permissions ***********************)
 (********************  Script All Usesr and Rules permissions ***********************)
@@ -502,35 +531,37 @@ begin
   UsersList:= TStringList.Create;
   UsersList:= TStringList.Create;
   ObjectsList:= TStringList.Create;
   ObjectsList:= TStringList.Create;
   PermissionList:= TStringList.Create;
   PermissionList:= TStringList.Create;
+  try
+    UsersList.CommaText:= dmSysTables.GetDBUsers(dbIndex);
+    List.Clear;
+    for i:= 0 to UsersList.Count - 1 do
+      if Pos('<R>', UsersList[i]) = 1 then
+        List.Add('/* Role ' + Copy(UsersList[i], 4, Length(UsersList[i]) - 3) + ' */')
+      else
+        List.Add('/* User ' + UsersList[i] + ' */');
 
 
-  UsersList.CommaText:= dmSysTables.GetDBUsers(dbIndex);
-  List.Clear;
-  for i:= 0 to UsersList.Count - 1 do
-    if Pos('<R>', UsersList[i]) = 1 then
-      List.Add('/* Role ' + Copy(UsersList[i], 4, Length(UsersList[i]) - 3) + ' */')
-    else
-      List.Add('/* User ' + UsersList[i] + ' */');
-
-  for i:= 0 to UsersList.Count - 1 do
-  begin
-    ObjectsList.CommaText:= dmSysTables.GetDBObjectsForPermissions(dbIndex);
-    if Pos('<R>', UsersList[i]) = 1 then
-      UserName:= Copy(UsersList[i], 4, Length(UsersList[i]) - 3)
-    else
-      UserName:= UsersList[i];
+    for i:= 0 to UsersList.Count - 1 do
+    begin
+      ObjectsList.CommaText:= dmSysTables.GetDBObjectsForPermissions(dbIndex);
+      if Pos('<R>', UsersList[i]) = 1 then
+        UserName:= Copy(UsersList[i], 4, Length(UsersList[i]) - 3)
+      else
+        UserName:= UsersList[i];
 
 
-    List.Add('');
-    List.Add('/* Permissions for: ' + UserName + ' */');
+      List.Add('');
+      List.Add('/* Permissions for: ' + UserName + ' */');
 
 
-    for j:= 0 to ObjectsList.Count - 1 do
-    begin
-      Result:= ScriptObjectPermission(dbIndex,  ObjectsList[j], UserName, ObjType, List);
+      for j:= 0 to ObjectsList.Count - 1 do
+      begin
+        Result:= ScriptObjectPermission(dbIndex,  ObjectsList[j], UserName, ObjType, List);
+      end;
     end;
     end;
+    Result:= UsersList.Count > 0;
+  finally
+    UsersList.Free;
+    ObjectsList.Free;
+    PermissionList.Free;
   end;
   end;
-  Result:= UsersList.Count > 0;
-  UsersList.Free;
-  ObjectsList.Free;
-  PermissionList.Free;
 end;
 end;
 
 
 (********************  Script One User or Rule permissions ***********************)
 (********************  Script One User or Rule permissions ***********************)
@@ -547,21 +578,23 @@ begin
     NewUser:= UserName;
     NewUser:= UserName;
   UsersList:= TStringList.Create;
   UsersList:= TStringList.Create;
   ObjectsList:= TStringList.Create;
   ObjectsList:= TStringList.Create;
+  try
+    UsersList.CommaText:= dmSysTables.GetDBUsers(dbIndex);
+    List.Clear;
 
 
-  UsersList.CommaText:= dmSysTables.GetDBUsers(dbIndex);
-  List.Clear;
-
-  ObjectsList.CommaText:= dmSysTables.GetDBObjectsForPermissions(dbIndex);
+    ObjectsList.CommaText:= dmSysTables.GetDBObjectsForPermissions(dbIndex);
 
 
-  List.Add('');
-  List.Add('/* Permissions for: ' + UserName + ' */');
+    List.Add('');
+    List.Add('/* Permissions for: ' + UserName + ' */');
 
 
-  for j:= 0 to ObjectsList.Count - 1 do
-    Result:= ScriptObjectPermission(dbIndex,  ObjectsList[j], UserName, ObjType, List, NewUser);
+    for j:= 0 to ObjectsList.Count - 1 do
+      Result:= ScriptObjectPermission(dbIndex,  ObjectsList[j], UserName, ObjType, List, NewUser);
 
 
-  Result:= UsersList.Count > 0;
-  UsersList.Free;
-  ObjectsList.Free;
+    Result:= UsersList.Count > 0;
+  finally
+    UsersList.Free;
+    ObjectsList.Free;
+  end;
 end;
 end;
 
 
 end.
 end.

+ 12 - 48
sqlhistory.lfm

@@ -9,7 +9,7 @@ object fmSQLHistory: TfmSQLHistory
   OnClose = FormClose
   OnClose = FormClose
   OnCreate = FormCreate
   OnCreate = FormCreate
   Position = poScreenCenter
   Position = poScreenCenter
-  LCLVersion = '1.0.8.0'
+  LCLVersion = '1.2.0.3'
   object DBGrid1: TDBGrid
   object DBGrid1: TDBGrid
     Left = 0
     Left = 0
     Height = 404
     Height = 404
@@ -54,21 +54,21 @@ object fmSQLHistory: TfmSQLHistory
     Width = 585
     Width = 585
     Anchors = [akLeft, akRight, akBottom]
     Anchors = [akLeft, akRight, akBottom]
     Caption = 'Export to text file'
     Caption = 'Export to text file'
-    ClientHeight = 37
+    ClientHeight = 38
     ClientWidth = 581
     ClientWidth = 581
     TabOrder = 3
     TabOrder = 3
     object cxAfterDate: TCheckBox
     object cxAfterDate: TCheckBox
       Left = 6
       Left = 6
-      Height = 24
+      Height = 17
       Top = 7
       Top = 7
-      Width = 152
+      Width = 113
       Caption = 'Only after the date'
       Caption = 'Only after the date'
       OnClick = cxAfterDateClick
       OnClick = cxAfterDateClick
       TabOrder = 0
       TabOrder = 0
     end
     end
     object DateEdit1: TDateEdit
     object DateEdit1: TDateEdit
       Left = 163
       Left = 163
-      Height = 27
+      Height = 21
       Top = 2
       Top = 2
       Width = 104
       Width = 104
       CalendarDisplaySettings = [dsShowHeadings, dsShowDayNames]
       CalendarDisplaySettings = [dsShowHeadings, dsShowDayNames]
@@ -77,61 +77,25 @@ object fmSQLHistory: TfmSQLHistory
       DateOrder = doNone
       DateOrder = doNone
       ButtonWidth = 23
       ButtonWidth = 23
       CharCase = ecNormal
       CharCase = ecNormal
-      Glyph.Data = {
-        36040000424D3604000000000000360000002800000010000000100000000100
-        2000000000000004000064000000640000000000000000000000FFFFFF00FFFF
-        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
-        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00D69E
-        72C4D3996EF4D19668FFCE9263FFCB8E5EFFC98A5BFFC78756FFC38452FFC384
-        52FFC38452FFC38452FFC38452FFC38452FFBB7742B0FFFFFF00FFFFFF00D7A1
-        75FFF8F2EDFFF7F0EAFFF6EDE6FFF4EAE2FFF3E7DEFFF1E4DBFFF0E2D8FFEAD6
-        C8FFF2E5DCFFFAF4F1FFF9F3F0FFFAF5F2FFC58A5DFDFFFFFF00FFFFFF00D9A4
-        7AFFF9F3EEFFEBD2BEFFFFFFFFFFEBD3BFFFFFFFFFFFEBD3C0FFFFFFFFFFEAC7
-        ADFFECD9CDFFF1E4DBFFF9F3F0FFF9F2EFFFC68C5FFFFFFFFF00FFFFFF00DDA8
-        7EFFF9F3EFFFEBD0BAFFEBD0BBFF75B57AFF75B57AFF75B57AFFEBD1BDFFEACD
-        B5FFFAF4F0FFEBD9CCFFF1E4DBFFFAF4F1FFC68A5CFFFFFFFF00FFFFFF00DFAA
-        82FFF9F3EFFFEACEB7FFFFFFFFFF75B57AFF94D49BFF74B579FFFFFFFFFFEACF
-        BAFFFBF6F2FFFAF3F0FFEBD8CBFFF2E6DDFFC88D5FFFFFFFFF00FFFFFF00E1AE
-        87FFFAF4F0FFEACBB2FFEACCB3FF75B57AFF74B579FF73B478FFEACEB7FF70B3
-        75FF6FB274FF6EB172FFE8C8AEFFEAD7C9FFC48654FFFFFFFF00FFFFFF00E3B1
-        8CFFFAF6F1FFEAC9AEFFFFFFFFFFEAC9B0FFFFFFFFFFE9CBB3FFFFFFFFFF6FB1
-        73FF8ED295FF6BAF6FFFFFFFFFFFF1E5DBFFC68655FFFFFFFF00FFFFFF00E5B4
-        8FFFFAF6F2FFE9C6AAFFE9C6ACFFEAC7ACFFE9C7ADFFE9C9AEFFE9C9B0FF6CB0
-        71FF6AAF6EFF68AD6DFFE8CCB5FFF2E7DEFFC88A59FFFFFFFF00FFFFFF00E7B7
-        94FFFBF7F4FFE9C3A6FFFFFFFFFFE8C4A9FFFFFFFFFFE9C6AAFFFFFFFFFFE8C7
-        ACFFFFFFFFFFE8C8B0FFFFFFFFFFF7F1EBFFCB8F5FFFFFFFFF00FFFFFF00E9BA
-        98FFFBF7F4FF65A4FFFF64A3FFFF62A2FFFF61A1FFFF5F9FFFFF5C9DFFFF5A9A
-        FFFF5798FFFF5495FFFF5294FFFFFBF7F4FFCE9364FFFFFFFF00FFFFFF00EBBD
-        9BFFFBF7F4FF64A4FFFF79BDFFFF75BBFFFF71B9FFFF6DB8FFFF68B3FFFF61B0
-        FFFF5AABFFFF54A7FFFF3B7DFFFFFBF7F4FFD1976AFFFFFFFF00FFFFFF00ECBF
-        9EFFFBF7F4FF65A4FFFF64A3FFFF60A0FFFF5D9EFFFF5899FFFF5496FFFF4D90
-        FFFF478BFFFF4284FFFF3D7FFFFFFBF7F4FFD49B6FFFFFFFFF00FFFFFF00EEC1
-        A1EBFBF7F4FFFBF7F4FFFBF7F4FFFBF7F4FFFBF7F4FFFBF7F4FFFBF7F4FFFBF7
-        F4FFFBF7F4FFFBF7F4FFFBF7F4FFFBF7F4FFD7A074F8FFFFFF00FFFFFF00EFC2
-        A37EEFC1A2E3EDC09FFFEBBE9DFFEBBC9AFFE9BA96FFE7B793FFE6B590FFE4B2
-        8CFFE2AF88FFE0AC84FFDDA980FFDCA57DFFDAA37ACAFFFFFF00FFFFFF00FFFF
-        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
-        FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00
-      }
-      NumGlyphs = 0
+      NumGlyphs = 1
       MaxLength = 0
       MaxLength = 0
       TabOrder = 1
       TabOrder = 1
       Visible = False
       Visible = False
     end
     end
     object Label1: TLabel
     object Label1: TLabel
       Left = 307
       Left = 307
-      Height = 18
+      Height = 13
       Top = 5
       Top = 5
-      Width = 63
+      Width = 46
       Caption = 'SQL Type'
       Caption = 'SQL Type'
       ParentColor = False
       ParentColor = False
     end
     end
     object cbSQLType: TComboBox
     object cbSQLType: TComboBox
       Left = 379
       Left = 379
-      Height = 27
+      Height = 21
       Top = -2
       Top = -2
       Width = 100
       Width = 100
-      ItemHeight = 0
+      ItemHeight = 13
       ItemIndex = 0
       ItemIndex = 0
       Items.Strings = (
       Items.Strings = (
         'All'
         'All'
@@ -156,9 +120,9 @@ object fmSQLHistory: TfmSQLHistory
   end
   end
   object cxOverwrite: TCheckBox
   object cxOverwrite: TCheckBox
     Left = 8
     Left = 8
-    Height = 24
+    Height = 17
     Top = 462
     Top = 462
-    Width = 179
+    Width = 130
     Caption = 'Overwrite existing SQL'
     Caption = 'Overwrite existing SQL'
     TabOrder = 4
     TabOrder = 4
   end
   end

+ 24 - 75
sqlhistory.lrs

@@ -1,8 +1,10 @@
+{ This is an automatically generated lazarus resource file }
+
 LazarusResources.Add('TfmSQLHistory','FORMDATA',[
 LazarusResources.Add('TfmSQLHistory','FORMDATA',[
   'TPF0'#13'TfmSQLHistory'#12'fmSQLHistory'#4'Left'#3#207#1#6'Height'#3#236#1#3
   'TPF0'#13'TfmSQLHistory'#12'fmSQLHistory'#4'Left'#3#207#1#6'Height'#3#236#1#3
   +'Top'#3'%'#1#5'Width'#3'i'#3#7'Caption'#6#11'SQL History'#12'ClientHeight'#3
   +'Top'#3'%'#1#5'Width'#3'i'#3#7'Caption'#6#11'SQL History'#12'ClientHeight'#3
   +#236#1#11'ClientWidth'#3'i'#3#7'OnClose'#7#9'FormClose'#8'OnCreate'#7#10'For'
   +#236#1#11'ClientWidth'#3'i'#3#7'OnClose'#7#9'FormClose'#8'OnCreate'#7#10'For'
-  +'mCreate'#8'Position'#7#14'poScreenCenter'#10'LCLVersion'#6#7'1.0.8.0'#0#7'T'
+  +'mCreate'#8'Position'#7#14'poScreenCenter'#10'LCLVersion'#6#7'1.2.0.3'#0#7'T'
   +'DBGrid'#7'DBGrid1'#4'Left'#2#0#6'Height'#3#148#1#3'Top'#2#8#5'Width'#3'T'#3
   +'DBGrid'#7'DBGrid1'#4'Left'#2#0#6'Height'#3#148#1#3'Top'#2#8#5'Width'#3'T'#3
   +#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#11'BorderStyle'#7
   +#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#11'BorderStyle'#7
   +#6'bsNone'#5'Color'#7#8'clWindow'#7'Columns'#14#0#10'DataSource'#7#11'Dataso'
   +#6'bsNone'#5'Color'#7#8'clWindow'#7'Columns'#14#0#10'DataSource'#7#11'Dataso'
@@ -18,78 +20,25 @@ LazarusResources.Add('TfmSQLHistory','FORMDATA',[
   +'l'#7'OnClick'#7#13'bbDeleteClick'#8'TabOrder'#2#2#0#0#9'TGroupBox'#9'GroupB'
   +'l'#7'OnClick'#7#13'bbDeleteClick'#8'TabOrder'#2#2#0#0#9'TGroupBox'#9'GroupB'
   +'ox1'#4'Left'#3#19#1#6'Height'#2'8'#3'Top'#3#166#1#5'Width'#3'I'#2#7'Anchors'
   +'ox1'#4'Left'#3#19#1#6'Height'#2'8'#3'Top'#3#166#1#5'Width'#3'I'#2#7'Anchors'
   +#11#6'akLeft'#7'akRight'#8'akBottom'#0#7'Caption'#6#19'Export to text file'
   +#11#6'akLeft'#7'akRight'#8'akBottom'#0#7'Caption'#6#19'Export to text file'
-  +#12'ClientHeight'#2'%'#11'ClientWidth'#3'E'#2#8'TabOrder'#2#3#0#9'TCheckBox'
-  +#11'cxAfterDate'#4'Left'#2#6#6'Height'#2#24#3'Top'#2#7#5'Width'#3#152#0#7'Ca'
-  +'ption'#6#19'Only after the date'#7'OnClick'#7#16'cxAfterDateClick'#8'TabOrd'
-  +'er'#2#0#0#0#9'TDateEdit'#9'DateEdit1'#4'Left'#3#163#0#6'Height'#2#27#3'Top'
-  +#2#2#5'Width'#2'h'#23'CalendarDisplaySettings'#11#14'dsShowHeadings'#14'dsSh'
-  +'owDayNames'#0#9'OKCaption'#6#2'OK'#13'CancelCaption'#6#6'Cancel'#9'DateOrde'
-  +'r'#7#6'doNone'#11'ButtonWidth'#2#23#8'CharCase'#7#8'ecNormal'#10'Glyph.Data'
-  +#10':'#4#0#0'6'#4#0#0'BM6'#4#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#16#0#0#0#16#0#0#0
-  +#1#0' '#0#0#0#0#0#0#4#0#0'd'#0#0#0'd'#0#0#0#0#0#0#0#0#0#0#0#255#255#255#0#255
-  +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255
-  +#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0
-  +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#214
-  +#158'r'#196#211#153'n'#244#209#150'h'#255#206#146'c'#255#203#142'^'#255#201
-  +#138'['#255#199#135'V'#255#195#132'R'#255#195#132'R'#255#195#132'R'#255#195
-  +#132'R'#255#195#132'R'#255#195#132'R'#255#187'wB'#176#255#255#255#0#255#255
-  +#255#0#215#161'u'#255#248#242#237#255#247#240#234#255#246#237#230#255#244#234
-  +#226#255#243#231#222#255#241#228#219#255#240#226#216#255#234#214#200#255#242
-  +#229#220#255#250#244#241#255#249#243#240#255#250#245#242#255#197#138']'#253
-  +#255#255#255#0#255#255#255#0#217#164'z'#255#249#243#238#255#235#210#190#255
-  +#255#255#255#255#235#211#191#255#255#255#255#255#235#211#192#255#255#255#255
-  +#255#234#199#173#255#236#217#205#255#241#228#219#255#249#243#240#255#249#242
-  +#239#255#198#140'_'#255#255#255#255#0#255#255#255#0#221#168'~'#255#249#243
-  +#239#255#235#208#186#255#235#208#187#255'u'#181'z'#255'u'#181'z'#255'u'#181
-  +'z'#255#235#209#189#255#234#205#181#255#250#244#240#255#235#217#204#255#241
-  +#228#219#255#250#244#241#255#198#138'\'#255#255#255#255#0#255#255#255#0#223
-  +#170#130#255#249#243#239#255#234#206#183#255#255#255#255#255'u'#181'z'#255
-  +#148#212#155#255't'#181'y'#255#255#255#255#255#234#207#186#255#251#246#242
-  +#255#250#243#240#255#235#216#203#255#242#230#221#255#200#141'_'#255#255#255
-  +#255#0#255#255#255#0#225#174#135#255#250#244#240#255#234#203#178#255#234#204
-  +#179#255'u'#181'z'#255't'#181'y'#255's'#180'x'#255#234#206#183#255'p'#179'u'
-  +#255'o'#178't'#255'n'#177'r'#255#232#200#174#255#234#215#201#255#196#134'T'
-  +#255#255#255#255#0#255#255#255#0#227#177#140#255#250#246#241#255#234#201#174
-  +#255#255#255#255#255#234#201#176#255#255#255#255#255#233#203#179#255#255#255
-  +#255#255'o'#177's'#255#142#210#149#255'k'#175'o'#255#255#255#255#255#241#229
-  +#219#255#198#134'U'#255#255#255#255#0#255#255#255#0#229#180#143#255#250#246
-  +#242#255#233#198#170#255#233#198#172#255#234#199#172#255#233#199#173#255#233
-  +#201#174#255#233#201#176#255'l'#176'q'#255'j'#175'n'#255'h'#173'm'#255#232
-  +#204#181#255#242#231#222#255#200#138'Y'#255#255#255#255#0#255#255#255#0#231
-  +#183#148#255#251#247#244#255#233#195#166#255#255#255#255#255#232#196#169#255
-  +#255#255#255#255#233#198#170#255#255#255#255#255#232#199#172#255#255#255#255
-  +#255#232#200#176#255#255#255#255#255#247#241#235#255#203#143'_'#255#255#255
-  +#255#0#255#255#255#0#233#186#152#255#251#247#244#255'e'#164#255#255'd'#163
-  +#255#255'b'#162#255#255'a'#161#255#255'_'#159#255#255'\'#157#255#255'Z'#154
-  +#255#255'W'#152#255#255'T'#149#255#255'R'#148#255#255#251#247#244#255#206#147
-  +'d'#255#255#255#255#0#255#255#255#0#235#189#155#255#251#247#244#255'd'#164
-  ,#255#255'y'#189#255#255'u'#187#255#255'q'#185#255#255'm'#184#255#255'h'#179
-  +#255#255'a'#176#255#255'Z'#171#255#255'T'#167#255#255';}'#255#255#251#247#244
-  +#255#209#151'j'#255#255#255#255#0#255#255#255#0#236#191#158#255#251#247#244
-  +#255'e'#164#255#255'd'#163#255#255'`'#160#255#255']'#158#255#255'X'#153#255
-  +#255'T'#150#255#255'M'#144#255#255'G'#139#255#255'B'#132#255#255'='#127#255
-  +#255#251#247#244#255#212#155'o'#255#255#255#255#0#255#255#255#0#238#193#161
-  +#235#251#247#244#255#251#247#244#255#251#247#244#255#251#247#244#255#251#247
-  +#244#255#251#247#244#255#251#247#244#255#251#247#244#255#251#247#244#255#251
-  +#247#244#255#251#247#244#255#251#247#244#255#215#160't'#248#255#255#255#0#255
-  +#255#255#0#239#194#163'~'#239#193#162#227#237#192#159#255#235#190#157#255#235
-  +#188#154#255#233#186#150#255#231#183#147#255#230#181#144#255#228#178#140#255
-  +#226#175#136#255#224#172#132#255#221#169#128#255#220#165'}'#255#218#163'z'
-  +#202#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0
-  +#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255
-  +#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255#255#0#255#255
-  +#255#0#255#255#255#0#9'NumGlyphs'#2#0#9'MaxLength'#2#0#8'TabOrder'#2#1#7'Vis'
-  +'ible'#8#0#0#6'TLabel'#6'Label1'#4'Left'#3'3'#1#6'Height'#2#18#3'Top'#2#5#5
-  +'Width'#2'?'#7'Caption'#6#8'SQL Type'#11'ParentColor'#8#0#0#9'TComboBox'#9'c'
-  +'bSQLType'#4'Left'#3'{'#1#6'Height'#2#27#3'Top'#2#254#5'Width'#2'd'#10'ItemH'
-  +'eight'#2#0#9'ItemIndex'#2#0#13'Items.Strings'#1#6#3'All'#6#7'DDL,DML'#6#3'D'
-  +'DL'#6#3'DML'#6#6'Select'#0#5'Style'#7#14'csDropDownList'#8'TabOrder'#2#2#4
-  +'Text'#6#3'All'#0#0#7'TBitBtn'#8'bbExport'#4'Left'#3#243#1#6'Height'#2#30#3
-  +'Top'#2#0#5'Width'#2'K'#7'Caption'#6#6'Export'#7'OnClick'#7#13'bbExportClick'
-  +#8'TabOrder'#2#3#0#0#0#9'TCheckBox'#11'cxOverwrite'#4'Left'#2#8#6'Height'#2
-  +#24#3'Top'#3#206#1#5'Width'#3#179#0#7'Caption'#6#22'Overwrite existing SQL'#8
-  +'TabOrder'#2#4#0#0#11'TDatasource'#11'Datasource1'#4'left'#2#127#3'top'#2#12
-  +#0#0#11'TSaveDialog'#11'SaveDialog1'#10'DefaultExt'#6#4'.sql'#6'Filter'#6#28
-  +'SQL File|*.sql|All files|*.*'#7'Options'#11#17'ofOverwritePrompt'#14'ofEnab'
-  +'leSizing'#12'ofViewDetail'#0#4'left'#3#17#3#3'top'#2'z'#0#0#0
+  +#12'ClientHeight'#2'&'#11'ClientWidth'#3'E'#2#8'TabOrder'#2#3#0#9'TCheckBox'
+  +#11'cxAfterDate'#4'Left'#2#6#6'Height'#2#17#3'Top'#2#7#5'Width'#2'q'#7'Capti'
+  +'on'#6#19'Only after the date'#7'OnClick'#7#16'cxAfterDateClick'#8'TabOrder'
+  +#2#0#0#0#9'TDateEdit'#9'DateEdit1'#4'Left'#3#163#0#6'Height'#2#21#3'Top'#2#2
+  +#5'Width'#2'h'#23'CalendarDisplaySettings'#11#14'dsShowHeadings'#14'dsShowDa'
+  +'yNames'#0#9'OKCaption'#6#2'OK'#13'CancelCaption'#6#6'Cancel'#9'DateOrder'#7
+  +#6'doNone'#11'ButtonWidth'#2#23#8'CharCase'#7#8'ecNormal'#9'NumGlyphs'#2#1#9
+  +'MaxLength'#2#0#8'TabOrder'#2#1#7'Visible'#8#0#0#6'TLabel'#6'Label1'#4'Left'
+  +#3'3'#1#6'Height'#2#13#3'Top'#2#5#5'Width'#2'.'#7'Caption'#6#8'SQL Type'#11
+  +'ParentColor'#8#0#0#9'TComboBox'#9'cbSQLType'#4'Left'#3'{'#1#6'Height'#2#21#3
+  +'Top'#2#254#5'Width'#2'd'#10'ItemHeight'#2#13#9'ItemIndex'#2#0#13'Items.Stri'
+  +'ngs'#1#6#3'All'#6#7'DDL,DML'#6#3'DDL'#6#3'DML'#6#6'Select'#0#5'Style'#7#14
+  +'csDropDownList'#8'TabOrder'#2#2#4'Text'#6#3'All'#0#0#7'TBitBtn'#8'bbExport'
+  +#4'Left'#3#243#1#6'Height'#2#30#3'Top'#2#0#5'Width'#2'K'#7'Caption'#6#6'Expo'
+  +'rt'#7'OnClick'#7#13'bbExportClick'#8'TabOrder'#2#3#0#0#0#9'TCheckBox'#11'cx'
+  +'Overwrite'#4'Left'#2#8#6'Height'#2#17#3'Top'#3#206#1#5'Width'#3#130#0#7'Cap'
+  +'tion'#6#22'Overwrite existing SQL'#8'TabOrder'#2#4#0#0#11'TDatasource'#11'D'
+  +'atasource1'#4'left'#2#127#3'top'#2#12#0#0#11'TSaveDialog'#11'SaveDialog1'#10
+  +'DefaultExt'#6#4'.sql'#6'Filter'#6#28'SQL File|*.sql|All files|*.*'#7'Option'
+  +'s'#11#17'ofOverwritePrompt'#14'ofEnableSizing'#12'ofViewDetail'#0#4'left'#3
+  +#17#3#3'top'#2'z'#0#0#0
 ]);
 ]);

+ 22 - 24
sqlhistory.pas

@@ -28,7 +28,6 @@ type
     procedure bbDeleteClick(Sender: TObject);
     procedure bbDeleteClick(Sender: TObject);
     procedure bbExportClick(Sender: TObject);
     procedure bbExportClick(Sender: TObject);
     procedure bbInsertClick(Sender: TObject);
     procedure bbInsertClick(Sender: TObject);
-    procedure Button1Click(Sender: TObject);
     procedure cxAfterDateClick(Sender: TObject);
     procedure cxAfterDateClick(Sender: TObject);
     procedure DBGrid1DblClick(Sender: TObject);
     procedure DBGrid1DblClick(Sender: TObject);
     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
@@ -84,10 +83,6 @@ begin
   Close;
   Close;
 end;
 end;
 
 
-procedure TfmSQLHistory.Button1Click(Sender: TObject);
-begin
-end;
-
 procedure TfmSQLHistory.cxAfterDateClick(Sender: TObject);
 procedure TfmSQLHistory.cxAfterDateClick(Sender: TObject);
 begin
 begin
   DateEdit1.Visible:= cxAfterDate.Checked;
   DateEdit1.Visible:= cxAfterDate.Checked;
@@ -117,28 +112,31 @@ begin
     DBGrid1.Visible:= False;
     DBGrid1.Visible:= False;
     First;
     First;
     List:= TStringList.Create;
     List:= TStringList.Create;
-    while not Eof do
-    begin
-      if (not cxAfterDate.Checked) or (FieldByName('Time').AsDateTime > DateEdit1.Date) then
+    try
+      while not Eof do
       begin
       begin
-        CurrType:= FieldByName('SQLType').AsString;
-        if (cbSQLType.ItemIndex = 0) or
-          ((CurrType = 'DDL') and (cbSQLType.ItemIndex in [1, 2])) or
-          ((CurrType = 'DML') and (cbSQLType.ItemIndex in [1, 3])) or
-          ((CurrType = 'SELECT') and (cbSQLType.ItemIndex = 4)) then
-          begin
-            List.Add('-- ' + FieldByName('Time').AsString);
-            Line:= FieldByName('SQLStatement').AsString;
-            if Pos(';', Line) = 0 then
-              Line:= Line + ';';
-            List.Add(Line);
-          end;
-
+        if (not cxAfterDate.Checked) or (FieldByName('Time').AsDateTime > DateEdit1.Date) then
+        begin
+          CurrType:= FieldByName('SQLType').AsString;
+          if (cbSQLType.ItemIndex = 0) or
+            ((CurrType = 'DDL') and (cbSQLType.ItemIndex in [1, 2])) or
+            ((CurrType = 'DML') and (cbSQLType.ItemIndex in [1, 3])) or
+            ((CurrType = 'SELECT') and (cbSQLType.ItemIndex = 4)) then
+            begin
+              List.Add('-- ' + FieldByName('Time').AsString);
+              Line:= FieldByName('SQLStatement').AsString;
+              if Pos(';', Line) = 0 then
+                Line:= Line + ';';
+              List.Add(Line);
+            end;
+
+        end;
+        Next;
       end;
       end;
-      Next;
+      List.SaveToFile(SaveDialog1.FileName);
+    finally
+      List.Free;
     end;
     end;
-    List.SaveToFile(SaveDialog1.FileName);
-    List.Free;
     DBGrid1.Visible:= True;
     DBGrid1.Visible:= True;
   end;
   end;
 end;
 end;

+ 1 - 1
systables.lfm

@@ -1,7 +1,7 @@
 object dmSysTables: TdmSysTables
 object dmSysTables: TdmSysTables
   OldCreateOrder = False
   OldCreateOrder = False
   Height = 300
   Height = 300
-  HorizontalOffset = 810
+  HorizontalOffset = 574
   VerticalOffset = 383
   VerticalOffset = 383
   Width = 400
   Width = 400
   object sqQuery: TSQLQuery
   object sqQuery: TSQLQuery

+ 3 - 1
systables.lrs

@@ -1,6 +1,8 @@
+{ This is an automatically generated lazarus resource file }
+
 LazarusResources.Add('TdmSysTables','FORMDATA',[
 LazarusResources.Add('TdmSysTables','FORMDATA',[
   'TPF0'#12'TdmSysTables'#11'dmSysTables'#14'OldCreateOrder'#8#6'Height'#3','#1
   'TPF0'#12'TdmSysTables'#11'dmSysTables'#14'OldCreateOrder'#8#6'Height'#3','#1
-  +#16'HorizontalOffset'#3'*'#3#14'VerticalOffset'#3#127#1#5'Width'#3#144#1#0#9
+  +#16'HorizontalOffset'#3'>'#2#14'VerticalOffset'#3#127#1#5'Width'#3#144#1#0#9
   +'TSQLQuery'#7'sqQuery'#9'FieldDefs'#14#0#14'AutoCalcFields'#8#6'Params'#14#0
   +'TSQLQuery'#7'sqQuery'#9'FieldDefs'#14#0#14'AutoCalcFields'#8#6'Params'#14#0
   +#4'left'#3#216#0#3'top'#2' '#0#0#0
   +#4'left'#3#216#0#3'top'#2' '#0#0#0
 ]);
 ]);

+ 26 - 21
systables.pas

@@ -281,9 +281,9 @@ begin
     'RDB$Update_Rule as UpdateRule, RDB$Delete_Rule as DeleteRule ' +
     'RDB$Update_Rule as UpdateRule, RDB$Delete_Rule as DeleteRule ' +
     'from RDB$RELATION_CONSTRAINTS Con, rdb$REF_Constraints Refc, RDB$INDEX_SEGMENTS Seg, ' +
     'from RDB$RELATION_CONSTRAINTS Con, rdb$REF_Constraints Refc, RDB$INDEX_SEGMENTS Seg, ' +
     'RDB$INDICES Ind ' +
     'RDB$INDICES Ind ' +
-    'where Con.RDB$COnstraint_Name = Refc.RDB$Const_Name_UQ ' +
-    '  and Refc.RDB$COnstraint_Name = Ind.RDB$Index_Name' +
-    '  and Refc.RDB$COnstraint_Name = Seg.RDB$Index_Name' +
+    'where Con.RDB$Constraint_Name = Refc.RDB$Const_Name_UQ ' +
+    '  and Refc.RDB$Constraint_Name = Ind.RDB$Index_Name' +
+    '  and Refc.RDB$Constraint_Name = Seg.RDB$Index_Name' +
     '  and Ind.RDB$Relation_Name = ''' + UpperCase(ATableName) + '''';
     '  and Ind.RDB$Relation_Name = ''' + UpperCase(ATableName) + '''';
   SqlQuery.Open;
   SqlQuery.Open;
   Result:= SqlQuery.RecordCount > 0;
   Result:= SqlQuery.RecordCount > 0;
@@ -307,19 +307,24 @@ function TdmSysTables.GetConstraintsOfTable(ATableName: string; var SqlQuery: TS
    ConstraintsList: TStringList = nil): Boolean;
    ConstraintsList: TStringList = nil): Boolean;
 begin
 begin
   SqlQuery.Close;
   SqlQuery.Close;
-  SqlQuery.SQL.Text:= 'select Trim(Refc.RDB$Constraint_Name) as ConstName, ' +
-    'Trim(Refc.RDB$CONST_NAME_UQ) as KeyName, ' +
-    'Trim(Ind.RDB$Relation_Name) as CurrentTableName, ' +
-    'Trim(Seg.RDB$Field_name) as CurrentFieldName, ' +
-    'Trim(Con.RDB$Relation_Name) as OtherTableName, ' +
-    'Trim(Ind.RDB$Foreign_key) as OtherFieldName, ' +
-    'RDB$Update_Rule as UpdateRule, RDB$Delete_Rule as DeleteRule ' +
-    'from RDB$RELATION_CONSTRAINTS Con, rdb$REF_Constraints Refc, RDB$INDEX_SEGMENTS Seg, ' +
-    'RDB$INDICES Ind ' +
-    'where Con.RDB$COnstraint_Name = Refc.RDB$Const_Name_UQ ' +
-    '  and Refc.RDB$COnstraint_Name = Ind.RDB$Index_Name' +
-    '  and Refc.RDB$COnstraint_Name = Seg.RDB$Index_Name' +
-    '  and Con.RDB$Relation_Name = ''' + UpperCase(ATableName) + '''';
+  SQLQuery.SQL.Text:='select '+
+  'rc.rdb$constraint_name as ConstName, '+
+  'rfc.rdb$const_name_uq as KeyName, '+
+  'rc2.rdb$relation_name as CurrentTableName, '+
+  'flds_pk.rdb$field_name as CurrentFieldName, '+
+  'rc.rdb$relation_name as OtherTableName, '+
+  'flds_fk.rdb$field_name as OtherFieldName, '+
+  'rfc.rdb$update_rule as UpdateRule, '+
+  'rfc.rdb$delete_rule as DeleteRule '+
+  'from rdb$relation_constraints AS rc '+
+  'inner join rdb$ref_constraints as rfc on (rc.rdb$constraint_name = rfc.rdb$constraint_name) '+
+  'inner join rdb$index_segments as flds_fk on (flds_fk.rdb$index_name = rc.rdb$index_name) ' +
+  'inner join rdb$relation_constraints as rc2 on (rc2.rdb$constraint_name = rfc.rdb$const_name_uq) ' +
+  'inner join rdb$index_segments as flds_pk on ' +
+  '((flds_pk.rdb$index_name = rc2.rdb$index_name) and (flds_fk.rdb$field_position = flds_pk.rdb$field_position)) ' +
+  'where rc.rdb$constraint_type = ''FOREIGN KEY'' '+
+  'and rc.rdb$relation_name = ''' + UpperCase(ATableName) + ''' '+
+  'order by rc.rdb$constraint_name, flds_fk.rdb$field_position ';
   SqlQuery.Open;
   SqlQuery.Open;
   Result:= SqlQuery.RecordCount > 0;
   Result:= SqlQuery.RecordCount > 0;
   with SqlQuery do
   with SqlQuery do
@@ -768,11 +773,11 @@ begin
     Result:= True;
     Result:= True;
 
 
   except
   except
-  on e: exception do
-  begin
-    ErrorMsg:= e.Message;
-    Result:= False;
-  end;
+    on e: exception do
+    begin
+      ErrorMsg:= e.Message;
+      Result:= False;
+    end;
   end;
   end;
 end;
 end;
 
 

+ 3 - 1
tablemanage.lfm

@@ -8,9 +8,11 @@ object fmTableManage: TfmTableManage
   Caption = 'Table Management'
   Caption = 'Table Management'
   ClientHeight = 448
   ClientHeight = 448
   ClientWidth = 819
   ClientWidth = 819
+  KeyPreview = True
   OnClose = FormClose
   OnClose = FormClose
+  OnKeyDown = FormKeyDown
   Position = poScreenCenter
   Position = poScreenCenter
-  LCLVersion = '1.3'
+  LCLVersion = '1.2.0.3'
   object PageControl1: TPageControl
   object PageControl1: TPageControl
     Left = 0
     Left = 0
     Height = 413
     Height = 413

File diff suppressed because it is too large
+ 477 - 476
tablemanage.lrs


+ 102 - 77
tablemanage.pas

@@ -6,7 +6,7 @@ interface
 
 
 uses
 uses
   Classes, SysUtils, sqldb, IBConnection, FileUtil, LResources, Forms, Controls,
   Classes, SysUtils, sqldb, IBConnection, FileUtil, LResources, Forms, Controls,
-  Graphics, Dialogs, ComCtrls, Grids, Buttons, StdCtrls, CheckLst;
+  Graphics, Dialogs, ComCtrls, Grids, Buttons, StdCtrls, CheckLst, LCLType;
 
 
 type
 type
 
 
@@ -80,6 +80,7 @@ type
     procedure edDropClick(Sender: TObject);
     procedure edDropClick(Sender: TObject);
     procedure edEditPermissionClick(Sender: TObject);
     procedure edEditPermissionClick(Sender: TObject);
     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
+    procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
   private
   private
     fdbIndex: Integer;
     fdbIndex: Integer;
     fTableName: string;
     fTableName: string;
@@ -108,6 +109,21 @@ begin
   CloseAction:= caFree;
   CloseAction:= caFree;
 end;
 end;
 
 
+procedure TfmTableManage.FormKeyDown(Sender: TObject; var Key: Word;
+  Shift: TShiftState);
+begin
+  if (ssCtrl in Shift) and
+    ((Key=VK_F4) or (Key=VK_W)) then
+  begin
+    if (MessageDlg('Do you want to close this query window?', mtConfirmation, [mbNo, mbYes], 0) = mrYes) then
+    begin
+      // Close when pressing Ctrl-W or Ctrl-F4 (Cmd-W/Cmd-F4 on OSX)
+      Close;
+      Parent.Free;
+    end;
+  end;
+end;
+
 
 
 procedure TfmTableManage.bbEditClick(Sender: TObject);
 procedure TfmTableManage.bbEditClick(Sender: TObject);
 var
 var
@@ -143,10 +159,13 @@ begin
   if sgTriggers.RowCount > 1 then
   if sgTriggers.RowCount > 1 then
   begin
   begin
     List:= TStringList.Create;
     List:= TStringList.Create;
-    ATriggerName:= sgTriggers.Cells[0, sgTriggers.Row];
-    dmSysTables.ScriptTrigger(fdbIndex, ATriggerName, List);
-    fmMain.ShowCompleteQueryWindow(fdbIndex, 'Edit Trigger ', List.Text, bbRefreshTriggers.OnClick);
-    List.Free;
+    try
+      ATriggerName:= sgTriggers.Cells[0, sgTriggers.Row];
+      dmSysTables.ScriptTrigger(fdbIndex, ATriggerName, List);
+      fmMain.ShowCompleteQueryWindow(fdbIndex, 'Edit Trigger ', List.Text, bbRefreshTriggers.OnClick);
+    finally
+      List.Free;
+    end;
   end;
   end;
 
 
 end;
 end;
@@ -281,10 +300,13 @@ var
 begin
 begin
   // Get current fields
   // Get current fields
   FieldsList:= TStringList.Create;
   FieldsList:= TStringList.Create;
-  fmMain.GetFields(fdbIndex, fTableName, FieldsList);
-  fmNewConstraint.clxOnFields.Clear;
-  fmNewConstraint.clxOnFields.Items.AddStrings(FieldsList);
-  FieldsList.Free;
+  try
+    fmMain.GetFields(fdbIndex, fTableName, FieldsList);
+    fmNewConstraint.clxOnFields.Clear;
+    fmNewConstraint.clxOnFields.Items.AddStrings(FieldsList);
+  finally
+    FieldsList.Free;
+  end;
   fmMain.SQLQuery1.Close;
   fmMain.SQLQuery1.Close;
   fmNewConstraint.edNewName.Text:= 'FK_' + fTableName + '_' + IntToStr(sgConstraints.RowCount);
   fmNewConstraint.edNewName.Text:= 'FK_' + fTableName + '_' + IntToStr(sgConstraints.RowCount);
 
 
@@ -481,75 +503,78 @@ var
 begin
 begin
   sqlTrans.Commit;
   sqlTrans.Commit;
   UsersList:= TStringList.Create;
   UsersList:= TStringList.Create;
-  UsersList.CommaText:= dmSysTables.GetDBUsers(fdbIndex, fTableName);
-  sgPermissions.RowCount:= UsersList.Count + 1;
-  for i:= 0 to UsersList.Count - 1 do
-  begin
-    UserName:= UsersList[i];
-    if Pos('<R>', UserName) = 1 then
-      begin
-        sgPermissions.Cells[1, i + 1]:= 'Role';
-        Delete(UserName, 1, 3);
-      end
-    else
-      sgPermissions.Cells[1, i + 1]:= 'User';
-
-    sgPermissions.Cells[0, i + 1]:= UserName;
-
-    // Permissions
-    Permissions:= dmSysTables.GetObjectUserPermission(fdbIndex, fTableName, UserName, ObjType);
-
-    if Pos('S', Permissions) > 0 then
-      sgPermissions.Cells[2, i + 1]:= '1'
-    else
-      sgPermissions.Cells[2, i + 1]:= '0';
-
-    if Pos('I', Permissions) > 0 then
-      sgPermissions.Cells[3, i + 1]:= '1'
-    else
-      sgPermissions.Cells[3, i + 1]:= '0';
-
-    if Pos('U', Permissions) > 0 then
-      sgPermissions.Cells[4, i + 1]:= '1'
-    else
-      sgPermissions.Cells[4, i + 1]:= '0';
-
-    if Pos('D', Permissions) > 0 then
-      sgPermissions.Cells[5, i + 1]:= '1'
-    else
-      sgPermissions.Cells[5, i + 1]:= '0';
-
-    if Pos('R', Permissions) > 0 then
-      sgPermissions.Cells[6, i + 1]:= '1'
-    else
-      sgPermissions.Cells[6, i + 1]:= '0';
-
-    if Pos('SG', Permissions) > 0 then
-      sgPermissions.Cells[7, i + 1]:= '1'
-    else
-      sgPermissions.Cells[7, i + 1]:= '0';
-
-    if Pos('IG', Permissions) > 0 then
-      sgPermissions.Cells[8, i + 1]:= '1'
-    else
-      sgPermissions.Cells[8, i + 1]:= '0';
-
-    if Pos('UG', Permissions) > 0 then
-      sgPermissions.Cells[9, i + 1]:= '1'
-    else
-      sgPermissions.Cells[9, i + 1]:= '0';
-
-    if Pos('DG', Permissions) > 0 then
-      sgPermissions.Cells[10, i + 1]:= '1'
-    else
-      sgPermissions.Cells[10, i + 1]:= '0';
-
-    if Pos('RG', Permissions) > 0 then
-      sgPermissions.Cells[11, i + 1]:= '1'
-    else
-      sgPermissions.Cells[11, i + 1]:= '0';
+  try
+    UsersList.CommaText:= dmSysTables.GetDBUsers(fdbIndex, fTableName);
+    sgPermissions.RowCount:= UsersList.Count + 1;
+    for i:= 0 to UsersList.Count - 1 do
+    begin
+      UserName:= UsersList[i];
+      if Pos('<R>', UserName) = 1 then
+        begin
+          sgPermissions.Cells[1, i + 1]:= 'Role';
+          Delete(UserName, 1, 3);
+        end
+      else
+        sgPermissions.Cells[1, i + 1]:= 'User';
+
+      sgPermissions.Cells[0, i + 1]:= UserName;
+
+      // Permissions
+      Permissions:= dmSysTables.GetObjectUserPermission(fdbIndex, fTableName, UserName, ObjType);
+
+      if Pos('S', Permissions) > 0 then
+        sgPermissions.Cells[2, i + 1]:= '1'
+      else
+        sgPermissions.Cells[2, i + 1]:= '0';
+
+      if Pos('I', Permissions) > 0 then
+        sgPermissions.Cells[3, i + 1]:= '1'
+      else
+        sgPermissions.Cells[3, i + 1]:= '0';
+
+      if Pos('U', Permissions) > 0 then
+        sgPermissions.Cells[4, i + 1]:= '1'
+      else
+        sgPermissions.Cells[4, i + 1]:= '0';
+
+      if Pos('D', Permissions) > 0 then
+        sgPermissions.Cells[5, i + 1]:= '1'
+      else
+        sgPermissions.Cells[5, i + 1]:= '0';
+
+      if Pos('R', Permissions) > 0 then
+        sgPermissions.Cells[6, i + 1]:= '1'
+      else
+        sgPermissions.Cells[6, i + 1]:= '0';
+
+      if Pos('SG', Permissions) > 0 then
+        sgPermissions.Cells[7, i + 1]:= '1'
+      else
+        sgPermissions.Cells[7, i + 1]:= '0';
+
+      if Pos('IG', Permissions) > 0 then
+        sgPermissions.Cells[8, i + 1]:= '1'
+      else
+        sgPermissions.Cells[8, i + 1]:= '0';
+
+      if Pos('UG', Permissions) > 0 then
+        sgPermissions.Cells[9, i + 1]:= '1'
+      else
+        sgPermissions.Cells[9, i + 1]:= '0';
+
+      if Pos('DG', Permissions) > 0 then
+        sgPermissions.Cells[10, i + 1]:= '1'
+      else
+        sgPermissions.Cells[10, i + 1]:= '0';
+
+      if Pos('RG', Permissions) > 0 then
+        sgPermissions.Cells[11, i + 1]:= '1'
+      else
+        sgPermissions.Cells[11, i + 1]:= '0';
+    end;
+  finally
+    UsersList.Free;
   end;
   end;
-  UsersList.Free;
 end;
 end;
 
 
 initialization
 initialization

+ 14 - 12
udfinfo.lfm

@@ -7,38 +7,40 @@ object fmUDFInfo: TfmUDFInfo
   Caption = 'fmUDFInfo'
   Caption = 'fmUDFInfo'
   ClientHeight = 277
   ClientHeight = 277
   ClientWidth = 489
   ClientWidth = 489
+  KeyPreview = True
   OnClose = FormClose
   OnClose = FormClose
+  OnKeyDown = FormKeyDown
   Position = poScreenCenter
   Position = poScreenCenter
-  LCLVersion = '0.9.31'
+  LCLVersion = '1.2.0.3'
   object Label1: TLabel
   object Label1: TLabel
     Left = 11
     Left = 11
-    Height = 18
+    Height = 13
     Top = 15
     Top = 15
-    Width = 102
+    Width = 71
     Caption = 'Function Name'
     Caption = 'Function Name'
     ParentColor = False
     ParentColor = False
   end
   end
   object Label2: TLabel
   object Label2: TLabel
     Left = 11
     Left = 11
-    Height = 18
+    Height = 13
     Top = 96
     Top = 96
-    Width = 35
+    Width = 24
     Caption = 'Body'
     Caption = 'Body'
     ParentColor = False
     ParentColor = False
   end
   end
   object Label3: TLabel
   object Label3: TLabel
     Left = 11
     Left = 11
-    Height = 18
+    Height = 13
     Top = 44
     Top = 44
-    Width = 52
+    Width = 34
     Caption = 'Module'
     Caption = 'Module'
     ParentColor = False
     ParentColor = False
   end
   end
   object Label7: TLabel
   object Label7: TLabel
     Left = 11
     Left = 11
-    Height = 18
+    Height = 13
     Top = 72
     Top = 72
-    Width = 75
+    Width = 53
     Caption = 'Entry Point'
     Caption = 'Entry Point'
     DragCursor = crAppStart
     DragCursor = crAppStart
     ParentColor = False
     ParentColor = False
@@ -55,7 +57,7 @@ object fmUDFInfo: TfmUDFInfo
   end
   end
   object edName: TEdit
   object edName: TEdit
     Left = 120
     Left = 120
-    Height = 21
+    Height = 13
     Top = 14
     Top = 14
     Width = 256
     Width = 256
     Anchors = [akTop, akLeft, akRight]
     Anchors = [akTop, akLeft, akRight]
@@ -69,7 +71,7 @@ object fmUDFInfo: TfmUDFInfo
   end
   end
   object edModule: TEdit
   object edModule: TEdit
     Left = 120
     Left = 120
-    Height = 21
+    Height = 13
     Top = 44
     Top = 44
     Width = 256
     Width = 256
     Anchors = [akTop, akLeft, akRight]
     Anchors = [akTop, akLeft, akRight]
@@ -83,7 +85,7 @@ object fmUDFInfo: TfmUDFInfo
   end
   end
   object edEntry: TEdit
   object edEntry: TEdit
     Left = 120
     Left = 120
-    Height = 21
+    Height = 13
     Top = 72
     Top = 72
     Width = 256
     Width = 256
     Anchors = [akTop, akLeft, akRight]
     Anchors = [akTop, akLeft, akRight]

+ 28 - 26
udfinfo.lrs

@@ -1,30 +1,32 @@
+{ This is an automatically generated lazarus resource file }
+
 LazarusResources.Add('TfmUDFInfo','FORMDATA',[
 LazarusResources.Add('TfmUDFInfo','FORMDATA',[
   'TPF0'#10'TfmUDFInfo'#9'fmUDFInfo'#4'Left'#3'J'#1#6'Height'#3#21#1#3'Top'#3
   'TPF0'#10'TfmUDFInfo'#9'fmUDFInfo'#4'Left'#3'J'#1#6'Height'#3#21#1#3'Top'#3
   +#216#0#5'Width'#3#233#1#13'ActiveControl'#7#6'meBody'#7'Caption'#6#9'fmUDFIn'
   +#216#0#5'Width'#3#233#1#13'ActiveControl'#7#6'meBody'#7'Caption'#6#9'fmUDFIn'
-  +'fo'#12'ClientHeight'#3#21#1#11'ClientWidth'#3#233#1#7'OnClose'#7#9'FormClos'
-  +'e'#8'Position'#7#14'poScreenCenter'#10'LCLVersion'#6#6'0.9.31'#0#6'TLabel'#6
-  +'Label1'#4'Left'#2#11#6'Height'#2#18#3'Top'#2#15#5'Width'#2'f'#7'Caption'#6
-  +#13'Function Name'#11'ParentColor'#8#0#0#6'TLabel'#6'Label2'#4'Left'#2#11#6
-  +'Height'#2#18#3'Top'#2'`'#5'Width'#2'#'#7'Caption'#6#4'Body'#11'ParentColor'
-  +#8#0#0#6'TLabel'#6'Label3'#4'Left'#2#11#6'Height'#2#18#3'Top'#2','#5'Width'#2
-  +'4'#7'Caption'#6#6'Module'#11'ParentColor'#8#0#0#6'TLabel'#6'Label7'#4'Left'
-  +#2#11#6'Height'#2#18#3'Top'#2'H'#5'Width'#2'K'#7'Caption'#6#11'Entry Point'
-  +#10'DragCursor'#7#10'crAppStart'#11'ParentColor'#8#0#0#5'TMemo'#6'meBody'#4
-  +'Left'#2#11#6'Height'#3#160#0#3'Top'#2'p'#5'Width'#3#213#1#7'Anchors'#11#5'a'
-  +'kTop'#6'akLeft'#7'akRight'#8'akBottom'#0#8'ReadOnly'#9#10'ScrollBars'#7#10
-  +'ssAutoBoth'#8'TabOrder'#2#0#0#0#5'TEdit'#6'edName'#4'Left'#2'x'#6'Height'#2
-  +#21#3'Top'#2#14#5'Width'#3#0#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0
-  +#10'AutoSelect'#8#11'BorderStyle'#7#6'bsNone'#10'Font.Color'#7#6'clNavy'#10
-  +'ParentFont'#8#8'ReadOnly'#9#8'TabOrder'#2#1#4'Text'#6#6'edName'#0#0#5'TEdit'
-  +#8'edModule'#4'Left'#2'x'#6'Height'#2#21#3'Top'#2','#5'Width'#3#0#1#7'Anchor'
-  +'s'#11#5'akTop'#6'akLeft'#7'akRight'#0#10'AutoSelect'#8#11'BorderStyle'#7#6
-  +'bsNone'#10'Font.Color'#7#6'clNavy'#10'ParentFont'#8#8'ReadOnly'#9#8'TabOrde'
-  +'r'#2#2#4'Text'#6#8'edModule'#0#0#5'TEdit'#7'edEntry'#4'Left'#2'x'#6'Height'
-  +#2#21#3'Top'#2'H'#5'Width'#3#0#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'
-  +#0#10'AutoSelect'#8#11'BorderStyle'#7#6'bsNone'#10'Font.Color'#7#6'clNavy'#10
-  +'ParentFont'#8#8'ReadOnly'#9#8'TabOrder'#2#3#4'Text'#6#9'edGenName'#0#0#7'TB'
-  +'itBtn'#7'bbClose'#4'Left'#3#206#1#6'Height'#2#24#3'Top'#2#4#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#4#0#0#0
+  +'fo'#12'ClientHeight'#3#21#1#11'ClientWidth'#3#233#1#10'KeyPreview'#9#7'OnCl'
+  +'ose'#7#9'FormClose'#9'OnKeyDown'#7#11'FormKeyDown'#8'Position'#7#14'poScree'
+  +'nCenter'#10'LCLVersion'#6#7'1.2.0.3'#0#6'TLabel'#6'Label1'#4'Left'#2#11#6'H'
+  +'eight'#2#13#3'Top'#2#15#5'Width'#2'G'#7'Caption'#6#13'Function Name'#11'Par'
+  +'entColor'#8#0#0#6'TLabel'#6'Label2'#4'Left'#2#11#6'Height'#2#13#3'Top'#2'`'
+  +#5'Width'#2#24#7'Caption'#6#4'Body'#11'ParentColor'#8#0#0#6'TLabel'#6'Label3'
+  +#4'Left'#2#11#6'Height'#2#13#3'Top'#2','#5'Width'#2'"'#7'Caption'#6#6'Module'
+  +#11'ParentColor'#8#0#0#6'TLabel'#6'Label7'#4'Left'#2#11#6'Height'#2#13#3'Top'
+  +#2'H'#5'Width'#2'5'#7'Caption'#6#11'Entry Point'#10'DragCursor'#7#10'crAppSt'
+  +'art'#11'ParentColor'#8#0#0#5'TMemo'#6'meBody'#4'Left'#2#11#6'Height'#3#160#0
+  +#3'Top'#2'p'#5'Width'#3#213#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8
+  +'akBottom'#0#8'ReadOnly'#9#10'ScrollBars'#7#10'ssAutoBoth'#8'TabOrder'#2#0#0
+  +#0#5'TEdit'#6'edName'#4'Left'#2'x'#6'Height'#2#13#3'Top'#2#14#5'Width'#3#0#1
+  +#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#10'AutoSelect'#8#11'BorderSty'
+  +'le'#7#6'bsNone'#10'Font.Color'#7#6'clNavy'#10'ParentFont'#8#8'ReadOnly'#9#8
+  +'TabOrder'#2#1#4'Text'#6#6'edName'#0#0#5'TEdit'#8'edModule'#4'Left'#2'x'#6'H'
+  +'eight'#2#13#3'Top'#2','#5'Width'#3#0#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'a'
+  +'kRight'#0#10'AutoSelect'#8#11'BorderStyle'#7#6'bsNone'#10'Font.Color'#7#6'c'
+  +'lNavy'#10'ParentFont'#8#8'ReadOnly'#9#8'TabOrder'#2#2#4'Text'#6#8'edModule'
+  +#0#0#5'TEdit'#7'edEntry'#4'Left'#2'x'#6'Height'#2#13#3'Top'#2'H'#5'Width'#3#0
+  +#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#10'AutoSelect'#8#11'BorderS'
+  +'tyle'#7#6'bsNone'#10'Font.Color'#7#6'clNavy'#10'ParentFont'#8#8'ReadOnly'#9
+  +#8'TabOrder'#2#3#4'Text'#6#9'edGenName'#0#0#7'TBitBtn'#7'bbClose'#4'Left'#3
+  +#206#1#6'Height'#2#24#3'Top'#2#4#5'Width'#2#27#7'Anchors'#11#5'akTop'#7'akRi'
+  +'ght'#0#7'Caption'#6#4' X  '#5'Color'#4#219#242#247#0#10'Font.Style'#11#6'fs'
+  +'Bold'#0#7'OnClick'#7#12'bbCloseClick'#10'ParentFont'#8#8'TabOrder'#2#4#0#0#0
 ]);
 ]);

+ 17 - 1
udfinfo.pas

@@ -6,7 +6,7 @@ interface
 
 
 uses
 uses
   Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
   Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
-  StdCtrls, Buttons;
+  StdCtrls, Buttons, LCLType;
 
 
 type
 type
 
 
@@ -24,6 +24,7 @@ type
     meBody: TMemo;
     meBody: TMemo;
     procedure bbCloseClick(Sender: TObject);
     procedure bbCloseClick(Sender: TObject);
     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
+    procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
   private
   private
     { private declarations }
     { private declarations }
   public
   public
@@ -42,6 +43,21 @@ begin
   CloseAction:= caFree;
   CloseAction:= caFree;
 end;
 end;
 
 
+procedure TfmUDFInfo.FormKeyDown(Sender: TObject; var Key: Word;
+  Shift: TShiftState);
+begin
+  if (ssCtrl in Shift) and
+    ((Key=VK_F4) or (Key=VK_W)) then
+  begin
+    if MessageDlg('Do you want to close this query window?', mtConfirmation, [mbNo, mbYes], 0) = mrYes then
+    begin
+      // Close when pressing Ctrl-W or Ctrl-F4 (Cmd-W/Cmd-F4 on OSX)
+      Close;
+      Parent.Free;
+    end;
+  end;
+end;
+
 procedure TfmUDFInfo.bbCloseClick(Sender: TObject);
 procedure TfmUDFInfo.bbCloseClick(Sender: TObject);
 begin
 begin
   Close;
   Close;

+ 20 - 20
update.lfm

@@ -10,12 +10,12 @@ object fmUpdate: TfmUpdate
   OnActivate = FormActivate
   OnActivate = FormActivate
   OnClose = FormClose
   OnClose = FormClose
   Position = poScreenCenter
   Position = poScreenCenter
-  LCLVersion = '1.0.14.0'
+  LCLVersion = '1.2.0.3'
   object Label1: TLabel
   object Label1: TLabel
     Left = 8
     Left = 8
-    Height = 18
+    Height = 13
     Top = 32
     Top = 32
-    Width = 104
+    Width = 75
     BidiMode = bdRightToLeft
     BidiMode = bdRightToLeft
     Caption = 'Current version'
     Caption = 'Current version'
     ParentBidiMode = False
     ParentBidiMode = False
@@ -64,9 +64,9 @@ object fmUpdate: TfmUpdate
   end
   end
   object cxProxy: TCheckBox
   object cxProxy: TCheckBox
     Left = 16
     Left = 16
-    Height = 24
+    Height = 17
     Top = 176
     Top = 176
-    Width = 177
+    Width = 130
     Caption = 'connect through proxy'
     Caption = 'connect through proxy'
     OnChange = cxProxyChange
     OnChange = cxProxyChange
     ParentBidiMode = False
     ParentBidiMode = False
@@ -77,38 +77,38 @@ object fmUpdate: TfmUpdate
     Height = 108
     Height = 108
     Top = 198
     Top = 198
     Width = 472
     Width = 472
-    ClientHeight = 104
+    ClientHeight = 90
     ClientWidth = 468
     ClientWidth = 468
     TabOrder = 5
     TabOrder = 5
     Visible = False
     Visible = False
     object Label2: TLabel
     object Label2: TLabel
       Left = 6
       Left = 6
-      Height = 18
+      Height = 13
       Top = 11
       Top = 11
-      Width = 85
+      Width = 62
       Alignment = taRightJustify
       Alignment = taRightJustify
       Caption = 'Proxy server'
       Caption = 'Proxy server'
       ParentColor = False
       ParentColor = False
     end
     end
     object edProxy: TEdit
     object edProxy: TEdit
       Left = 103
       Left = 103
-      Height = 27
+      Height = 21
       Top = 8
       Top = 8
       Width = 112
       Width = 112
       TabOrder = 0
       TabOrder = 0
     end
     end
     object Label3: TLabel
     object Label3: TLabel
       Left = 7
       Left = 7
-      Height = 18
+      Height = 13
       Top = 41
       Top = 41
-      Width = 73
+      Width = 51
       Alignment = taRightJustify
       Alignment = taRightJustify
       Caption = 'Proxy port'
       Caption = 'Proxy port'
       ParentColor = False
       ParentColor = False
     end
     end
     object edPort: TEdit
     object edPort: TEdit
       Left = 103
       Left = 103
-      Height = 27
+      Height = 21
       Top = 40
       Top = 40
       Width = 69
       Width = 69
       TabOrder = 1
       TabOrder = 1
@@ -116,32 +116,32 @@ object fmUpdate: TfmUpdate
     end
     end
     object Label4: TLabel
     object Label4: TLabel
       Left = 6
       Left = 6
-      Height = 18
+      Height = 13
       Top = 80
       Top = 80
-      Width = 32
+      Width = 22
       Alignment = taRightJustify
       Alignment = taRightJustify
       Caption = 'User'
       Caption = 'User'
       ParentColor = False
       ParentColor = False
     end
     end
     object edUser: TEdit
     object edUser: TEdit
       Left = 335
       Left = 335
-      Height = 27
+      Height = 21
       Top = 71
       Top = 71
       Width = 112
       Width = 112
       TabOrder = 2
       TabOrder = 2
     end
     end
     object Label5: TLabel
     object Label5: TLabel
       Left = 247
       Left = 247
-      Height = 18
+      Height = 13
       Top = 80
       Top = 80
-      Width = 67
+      Width = 46
       Alignment = taRightJustify
       Alignment = taRightJustify
       Caption = 'Password'
       Caption = 'Password'
       ParentColor = False
       ParentColor = False
     end
     end
     object edPassword: TEdit
     object edPassword: TEdit
       Left = 103
       Left = 103
-      Height = 27
+      Height = 21
       Top = 71
       Top = 71
       Width = 112
       Width = 112
       EchoMode = emPassword
       EchoMode = emPassword
@@ -163,9 +163,9 @@ object fmUpdate: TfmUpdate
   end
   end
   object laTime: TLabel
   object laTime: TLabel
     Left = 408
     Left = 408
-    Height = 27
+    Height = 24
     Top = 104
     Top = 104
-    Width = 66
+    Width = 54
     Caption = '00:00'
     Caption = '00:00'
     Color = clCream
     Color = clCream
     Font.Color = clRed
     Font.Color = clRed

+ 21 - 19
update.lrs

@@ -1,43 +1,45 @@
+{ This is an automatically generated lazarus resource file }
+
 LazarusResources.Add('TfmUpdate','FORMDATA',[
 LazarusResources.Add('TfmUpdate','FORMDATA',[
   'TPF0'#9'TfmUpdate'#8'fmUpdate'#4'Left'#3'K'#2#6'Height'#3':'#1#3'Top'#3#9#1#5
   'TPF0'#9'TfmUpdate'#8'fmUpdate'#4'Left'#3'K'#2#6'Height'#3':'#1#3'Top'#3#9#1#5
   +'Width'#3#245#1#11'BorderStyle'#7#8'bsDialog'#7'Caption'#6#14'Version update'
   +'Width'#3#245#1#11'BorderStyle'#7#8'bsDialog'#7'Caption'#6#14'Version update'
   +#12'ClientHeight'#3':'#1#11'ClientWidth'#3#245#1#10'OnActivate'#7#12'FormAct'
   +#12'ClientHeight'#3':'#1#11'ClientWidth'#3#245#1#10'OnActivate'#7#12'FormAct'
   +'ivate'#7'OnClose'#7#9'FormClose'#8'Position'#7#14'poScreenCenter'#10'LCLVer'
   +'ivate'#7'OnClose'#7#9'FormClose'#8'Position'#7#14'poScreenCenter'#10'LCLVer'
-  +'sion'#6#8'1.0.14.0'#0#6'TLabel'#6'Label1'#4'Left'#2#8#6'Height'#2#18#3'Top'
-  +#2' '#5'Width'#2'h'#8'BidiMode'#7#13'bdRightToLeft'#7'Caption'#6#15'Current '
-  +'version'#14'ParentBidiMode'#8#11'ParentColor'#8#0#0#11'TStaticText'#9'stVer'
-  +'sion'#4'Left'#3#152#0#6'Height'#2#19#3'Top'#2' '#5'Width'#3#148#0#7'Caption'
-  +#6#9'stVersion'#5'Color'#7#7'clWhite'#11'ParentColor'#8#8'TabOrder'#2#0#11'T'
-  +'ransparent'#8#0#0#7'TBitBtn'#8'bbSearch'#4'Left'#2#8#6'Height'#2#30#3'Top'#2
+  +'sion'#6#7'1.2.0.3'#0#6'TLabel'#6'Label1'#4'Left'#2#8#6'Height'#2#13#3'Top'#2
+  +' '#5'Width'#2'K'#8'BidiMode'#7#13'bdRightToLeft'#7'Caption'#6#15'Current ve'
+  +'rsion'#14'ParentBidiMode'#8#11'ParentColor'#8#0#0#11'TStaticText'#9'stVersi'
+  +'on'#4'Left'#3#152#0#6'Height'#2#19#3'Top'#2' '#5'Width'#3#148#0#7'Caption'#6
+  +#9'stVersion'#5'Color'#7#7'clWhite'#11'ParentColor'#8#8'TabOrder'#2#0#11'Tra'
+  +'nsparent'#8#0#0#7'TBitBtn'#8'bbSearch'#4'Left'#2#8#6'Height'#2#30#3'Top'#2
   +'H'#5'Width'#2'K'#7'Caption'#6#5'Check'#7'OnClick'#7#13'bbSearchClick'#8'Tab'
   +'H'#5'Width'#2'K'#7'Caption'#6#5'Check'#7'OnClick'#7#13'bbSearchClick'#8'Tab'
   +'Order'#2#1#0#0#11'TStaticText'#12'stNewVersion'#4'Left'#3#152#0#6'Height'#2
   +'Order'#2#1#0#0#11'TStaticText'#12'stNewVersion'#4'Left'#3#152#0#6'Height'#2
   +#23#3'Top'#2'H'#5'Width'#3#196#0#7'Caption'#6#1'-'#5'Color'#7#7'clWhite'#11
   +#23#3'Top'#2'H'#5'Width'#3#196#0#7'Caption'#6#1'-'#5'Color'#7#7'clWhite'#11
   +'ParentColor'#8#8'TabOrder'#2#2#11'Transparent'#8#0#0#7'TBitBtn'#10'bbDownlo'
   +'ParentColor'#8#8'TabOrder'#2#2#11'Transparent'#8#0#0#7'TBitBtn'#10'bbDownlo'
   +'ad'#4'Left'#2#8#6'Height'#2#30#3'Top'#2'p'#5'Width'#3#148#0#7'Caption'#6#14
   +'ad'#4'Left'#2#8#6'Height'#2#30#3'Top'#2'p'#5'Width'#3#148#0#7'Caption'#6#14
   +'Install Update'#7'OnClick'#7#15'bbDownloadClick'#8'TabOrder'#2#3#7'Visible'
   +'Install Update'#7'OnClick'#7#15'bbDownloadClick'#8'TabOrder'#2#3#7'Visible'
-  +#8#0#0#9'TCheckBox'#7'cxProxy'#4'Left'#2#16#6'Height'#2#24#3'Top'#3#176#0#5
-  +'Width'#3#177#0#7'Caption'#6#21'connect through proxy'#8'OnChange'#7#13'cxPr'
+  +#8#0#0#9'TCheckBox'#7'cxProxy'#4'Left'#2#16#6'Height'#2#17#3'Top'#3#176#0#5
+  +'Width'#3#130#0#7'Caption'#6#21'connect through proxy'#8'OnChange'#7#13'cxPr'
   +'oxyChange'#14'ParentBidiMode'#8#8'TabOrder'#2#4#0#0#9'TGroupBox'#9'GroupBox'
   +'oxyChange'#14'ParentBidiMode'#8#8'TabOrder'#2#4#0#0#9'TGroupBox'#9'GroupBox'
   +'1'#4'Left'#2#15#6'Height'#2'l'#3'Top'#3#198#0#5'Width'#3#216#1#12'ClientHei'
   +'1'#4'Left'#2#15#6'Height'#2'l'#3'Top'#3#198#0#5'Width'#3#216#1#12'ClientHei'
-  +'ght'#2'h'#11'ClientWidth'#3#212#1#8'TabOrder'#2#5#7'Visible'#8#0#6'TLabel'#6
-  +'Label2'#4'Left'#2#6#6'Height'#2#18#3'Top'#2#11#5'Width'#2'U'#9'Alignment'#7
+  +'ght'#2'Z'#11'ClientWidth'#3#212#1#8'TabOrder'#2#5#7'Visible'#8#0#6'TLabel'#6
+  +'Label2'#4'Left'#2#6#6'Height'#2#13#3'Top'#2#11#5'Width'#2'>'#9'Alignment'#7
   +#14'taRightJustify'#7'Caption'#6#12'Proxy server'#11'ParentColor'#8#0#0#5'TE'
   +#14'taRightJustify'#7'Caption'#6#12'Proxy server'#11'ParentColor'#8#0#0#5'TE'
-  +'dit'#7'edProxy'#4'Left'#2'g'#6'Height'#2#27#3'Top'#2#8#5'Width'#2'p'#8'TabO'
-  +'rder'#2#0#0#0#6'TLabel'#6'Label3'#4'Left'#2#7#6'Height'#2#18#3'Top'#2')'#5
-  +'Width'#2'I'#9'Alignment'#7#14'taRightJustify'#7'Caption'#6#10'Proxy port'#11
-  +'ParentColor'#8#0#0#5'TEdit'#6'edPort'#4'Left'#2'g'#6'Height'#2#27#3'Top'#2
+  +'dit'#7'edProxy'#4'Left'#2'g'#6'Height'#2#21#3'Top'#2#8#5'Width'#2'p'#8'TabO'
+  +'rder'#2#0#0#0#6'TLabel'#6'Label3'#4'Left'#2#7#6'Height'#2#13#3'Top'#2')'#5
+  +'Width'#2'3'#9'Alignment'#7#14'taRightJustify'#7'Caption'#6#10'Proxy port'#11
+  +'ParentColor'#8#0#0#5'TEdit'#6'edPort'#4'Left'#2'g'#6'Height'#2#21#3'Top'#2
   +'('#5'Width'#2'E'#8'TabOrder'#2#1#4'Text'#6#4'8080'#0#0#6'TLabel'#6'Label4'#4
   +'('#5'Width'#2'E'#8'TabOrder'#2#1#4'Text'#6#4'8080'#0#0#6'TLabel'#6'Label4'#4
-  +'Left'#2#6#6'Height'#2#18#3'Top'#2'P'#5'Width'#2' '#9'Alignment'#7#14'taRigh'
+  +'Left'#2#6#6'Height'#2#13#3'Top'#2'P'#5'Width'#2#22#9'Alignment'#7#14'taRigh'
   +'tJustify'#7'Caption'#6#4'User'#11'ParentColor'#8#0#0#5'TEdit'#6'edUser'#4'L'
   +'tJustify'#7'Caption'#6#4'User'#11'ParentColor'#8#0#0#5'TEdit'#6'edUser'#4'L'
-  +'eft'#3'O'#1#6'Height'#2#27#3'Top'#2'G'#5'Width'#2'p'#8'TabOrder'#2#2#0#0#6
-  +'TLabel'#6'Label5'#4'Left'#3#247#0#6'Height'#2#18#3'Top'#2'P'#5'Width'#2'C'#9
+  +'eft'#3'O'#1#6'Height'#2#21#3'Top'#2'G'#5'Width'#2'p'#8'TabOrder'#2#2#0#0#6
+  +'TLabel'#6'Label5'#4'Left'#3#247#0#6'Height'#2#13#3'Top'#2'P'#5'Width'#2'.'#9
   +'Alignment'#7#14'taRightJustify'#7'Caption'#6#8'Password'#11'ParentColor'#8#0
   +'Alignment'#7#14'taRightJustify'#7'Caption'#6#8'Password'#11'ParentColor'#8#0
-  +#0#5'TEdit'#10'edPassword'#4'Left'#2'g'#6'Height'#2#27#3'Top'#2'G'#5'Width'#2
+  +#0#5'TEdit'#10'edPassword'#4'Left'#2'g'#6'Height'#2#21#3'Top'#2'G'#5'Width'#2
   +'p'#8'EchoMode'#7#10'emPassword'#12'PasswordChar'#6#1'*'#8'TabOrder'#2#3#0#0
   +'p'#8'EchoMode'#7#10'emPassword'#12'PasswordChar'#6#1'*'#8'TabOrder'#2#3#0#0
   +#0#11'TStaticText'#8'stStatus'#4'Left'#2#8#6'Height'#2#28#3'Top'#3#146#0#5'W'
   +#0#11'TStaticText'#8'stStatus'#4'Left'#2#8#6'Height'#2#28#3'Top'#3#146#0#5'W'
   +'idth'#3#223#1#9'Alignment'#7#8'taCenter'#7'Caption'#6#1'-'#5'Color'#7#7'clW'
   +'idth'#3#223#1#9'Alignment'#7#8'taCenter'#7'Caption'#6#1'-'#5'Color'#7#7'clW'
   +'hite'#11'ParentColor'#8#8'TabOrder'#2#6#11'Transparent'#8#0#0#6'TLabel'#6'l'
   +'hite'#11'ParentColor'#8#8'TabOrder'#2#6#11'Transparent'#8#0#0#6'TLabel'#6'l'
-  +'aTime'#4'Left'#3#152#1#6'Height'#2#27#3'Top'#2'h'#5'Width'#2'B'#7'Caption'#6
+  +'aTime'#4'Left'#3#152#1#6'Height'#2#24#3'Top'#2'h'#5'Width'#2'6'#7'Caption'#6
   +#5'00:00'#5'Color'#7#7'clCream'#10'Font.Color'#7#5'clRed'#11'Font.Height'#2
   +#5'00:00'#5'Color'#7#7'clCream'#10'Font.Color'#7#5'clRed'#11'Font.Height'#2
   +#235#9'Font.Name'#6#16'Courier 10 Pitch'#11'ParentColor'#8#10'ParentFont'#8
   +#235#9'Font.Name'#6#16'Courier 10 Pitch'#11'ParentColor'#8#10'ParentFont'#8
   +#11'Transparent'#8#7'Visible'#8#0#0#8'TProcess'#8'Process1'#6'Active'#8#7'Op'
   +#11'Transparent'#8#7'Visible'#8#0#0#8'TProcess'#8'Process1'#6'Active'#8#7'Op'

+ 67 - 62
update.pas

@@ -116,37 +116,40 @@ var
 begin
 begin
   try
   try
     http:= THTTPSend.Create;
     http:= THTTPSend.Create;
-
-    with fmUpdate do
-    if cxProxy.Checked then
-    begin
-      http.ProxyHost:= edProxy.Text;
-      http.ProxyPort:= edPort.Text;
-      http.ProxyUser:= edUser.Text;
-      http.ProxyPass:= edPassword.Text;
+    try
+      with fmUpdate do
+      if cxProxy.Checked then
+      begin
+        http.ProxyHost:= edProxy.Text;
+        http.ProxyPort:= edPort.Text;
+        http.ProxyUser:= edUser.Text;
+        http.ProxyPass:= edPassword.Text;
+      end;
+
+      fSuccess:= http.HTTPMethod('GET', fURL);
+      if fSuccess then
+      if http.Document.Size > 10000 then  // Actual file has been downloaded
+        http.Document.SaveToFile(ExtractFilePath(ParamStr(0)) + fFileName)
+      else
+      begin // Error HTML response
+        List:= TStringList.Create;
+        try
+          List.LoadFromStream(http.Document);
+          fSuccess:= False;
+          fErrorMessage:= List.Text;
+        finally
+          List.Free;
+        end;
+      end;
+    finally
+      http.Free
     end;
     end;
-
-    fSuccess:= http.HTTPMethod('GET', fURL);
-    if fSuccess then
-    if http.Document.Size > 10000 then  // Actual file has been downloaded
-      http.Document.SaveToFile(ExtractFilePath(ParamStr(0)) + fFileName)
-    else
-    begin // Error HTML response
-      List:= TStringList.Create;
-      List.LoadFromStream(http.Document);
+  except
+    on e: exception do
+    begin
       fSuccess:= False;
       fSuccess:= False;
-      fErrorMessage:= List.Text;
-      List.Free;
+      fErrorMessage:= e.Message;
     end;
     end;
-
-    http.Free
-
-  except
-  on e: exception do
-  begin
-    fSuccess:= False;
-    fErrorMessage:= e.Message;
-  end;
   end;
   end;
 
 
 end;
 end;
@@ -262,44 +265,46 @@ var
   ServerMinor: Word;
   ServerMinor: Word;
   VerStr: string;
   VerStr: string;
 begin
 begin
-  List:= TStringList.Create;
-
-  OS:= Target + Arch + '-';
   try
   try
-    http:= THTTPSend.Create;
-
-    if cxProxy.Checked then
-    begin
-      http.ProxyHost:= edProxy.Text;
-      http.ProxyPort:= edPort.Text;
-      http.ProxyUser:= edUser.Text;
-      http.ProxyPass:= edPassword.Text;
+    List:= TStringList.Create;
+    try
+      OS:= Target + Arch + '-';
+        http:= THTTPSend.Create;
+        try
+          if cxProxy.Checked then
+          begin
+            http.ProxyHost:= edProxy.Text;
+            http.ProxyPort:= edPort.Text;
+            http.ProxyUser:= edUser.Text;
+            http.ProxyPass:= edPassword.Text;
+          end;
+
+          http.HTTPMethod('GET', 'http://code-sd.com/turbobird/releases/' + OS + IntToStr(Major));
+          // Linux64-0
+          List.LoadFromStream(http.Document);
+          VerStr:= Trim(List.Text);
+          ServerMinor:= StrToInt(Copy(VerStr, 1, Pos('.', VerStr) - 1));
+          Delete(VerStr, 1, Pos('.', VerStr));
+          ServerRelease:= StrToInt(VerStr);
+          NewVersion:= (Minor < ServerMinor) or (ServerRelease > ReleaseVersion);
+
+          Version:= IntToStr(Major) + '.' + IntToStr(ServerMinor) + '.' + IntToStr(ServerRelease);
+          AFileName:= 'TurboBird-' + OS + IntToStr(Major) + '.zip';
+          // TurboBird-Linux32-1.zip
+          Result:= True;
+        finally
+          http.free;
+        end;
+    finally
+      List.Free;
     end;
     end;
-
-    http.HTTPMethod('GET', 'http://code-sd.com/turbobird/releases/' + OS + IntToStr(Major));
-    // Linux64-0
-    List.LoadFromStream(http.Document);
-    VerStr:= Trim(List.Text);
-    ServerMinor:= StrToInt(Copy(VerStr, 1, Pos('.', VerStr) - 1));
-    Delete(VerStr, 1, Pos('.', VerStr));
-    ServerRelease:= StrToInt(VerStr);
-    NewVersion:= (Minor < ServerMinor) or (ServerRelease > ReleaseVersion);
-
-    Version:= IntToStr(Major) + '.' + IntToStr(ServerMinor) + '.' + IntToStr(ServerRelease);
-    AFileName:= 'TurboBird-' + OS + IntToStr(Major) + '.zip';
-    // TurboBird-Linux32-1.zip
-    Result:= True;
-    List.Free;
-    http.Free
-
   except
   except
-  on e: exception do
-  begin
-    Result:= False;
-    ResMsg:= e.Message;
-  end;
+    on e: exception do
+    begin
+      Result:= False;
+      ResMsg:= e.Message;
+    end;
   end;
   end;
-
 end;
 end;
 
 
 function TfmUpdate.DownloadNewVersion: Boolean;
 function TfmUpdate.DownloadNewVersion: Boolean;

+ 7 - 8
userpermissions.lfm

@@ -7,9 +7,11 @@ object fmUserPermissions: TfmUserPermissions
   Caption = 'fmUserPermissions'
   Caption = 'fmUserPermissions'
   ClientHeight = 363
   ClientHeight = 363
   ClientWidth = 500
   ClientWidth = 500
+  KeyPreview = True
   OnClose = FormClose
   OnClose = FormClose
+  OnKeyDown = FormKeyDown
   Position = poScreenCenter
   Position = poScreenCenter
-  LCLVersion = '0.9.31'
+  LCLVersion = '1.2.0.3'
   object StringGrid1: TStringGrid
   object StringGrid1: TStringGrid
     Left = 0
     Left = 0
     Height = 331
     Height = 331
@@ -21,17 +23,14 @@ object fmUserPermissions: TfmUserPermissions
     Columns = <    
     Columns = <    
       item
       item
         Title.Caption = 'Obj Type'
         Title.Caption = 'Obj Type'
-        Title.PrefixOption = poNone
         Width = 100
         Width = 100
       end    
       end    
       item
       item
         Title.Caption = 'Object'
         Title.Caption = 'Object'
-        Title.PrefixOption = poNone
         Width = 200
         Width = 200
       end    
       end    
       item
       item
         Title.Caption = 'Permission'
         Title.Caption = 'Permission'
-        Title.PrefixOption = poNone
         Width = 200
         Width = 200
       end>
       end>
     FixedColor = 14539471
     FixedColor = 14539471
@@ -56,17 +55,17 @@ object fmUserPermissions: TfmUserPermissions
   end
   end
   object Label1: TLabel
   object Label1: TLabel
     Left = 3
     Left = 3
-    Height = 18
+    Height = 13
     Top = 12
     Top = 12
-    Width = 46
+    Width = 32
     Caption = 'Object'
     Caption = 'Object'
     ParentColor = False
     ParentColor = False
   end
   end
   object laObject: TLabel
   object laObject: TLabel
     Left = 62
     Left = 62
-    Height = 18
+    Height = 13
     Top = 11
     Top = 11
-    Width = 62
+    Width = 47
     Caption = 'laObject'
     Caption = 'laObject'
     Font.Style = [fsBold]
     Font.Style = [fsBold]
     ParentColor = False
     ParentColor = False

+ 19 - 18
userpermissions.lrs

@@ -1,23 +1,24 @@
+{ This is an automatically generated lazarus resource file }
+
 LazarusResources.Add('TfmUserPermissions','FORMDATA',[
 LazarusResources.Add('TfmUserPermissions','FORMDATA',[
   'TPF0'#18'TfmUserPermissions'#17'fmUserPermissions'#4'Left'#3'D'#2#6'Height'#3
   'TPF0'#18'TfmUserPermissions'#17'fmUserPermissions'#4'Left'#3'D'#2#6'Height'#3
   +'k'#1#3'Top'#3#205#0#5'Width'#3#244#1#13'ActiveControl'#7#11'StringGrid1'#7
   +'k'#1#3'Top'#3#205#0#5'Width'#3#244#1#13'ActiveControl'#7#11'StringGrid1'#7
   +'Caption'#6#17'fmUserPermissions'#12'ClientHeight'#3'k'#1#11'ClientWidth'#3
   +'Caption'#6#17'fmUserPermissions'#12'ClientHeight'#3'k'#1#11'ClientWidth'#3
-  +#244#1#7'OnClose'#7#9'FormClose'#8'Position'#7#14'poScreenCenter'#10'LCLVers'
-  +'ion'#6#6'0.9.31'#0#11'TStringGrid'#11'StringGrid1'#4'Left'#2#0#6'Height'#3
-  +'K'#1#3'Top'#2#31#5'Width'#3#221#1#7'Anchors'#11#5'akTop'#6'akLeft'#8'akBott'
-  +'om'#0#11'BorderStyle'#7#6'bsNone'#8'ColCount'#2#3#7'Columns'#14#1#13'Title.'
-  +'Caption'#6#8'Obj Type'#18'Title.PrefixOption'#7#6'poNone'#5'Width'#2'd'#0#1
-  +#13'Title.Caption'#6#6'Object'#18'Title.PrefixOption'#7#6'poNone'#5'Width'#3
-  +#200#0#0#1#13'Title.Caption'#6#10'Permission'#18'Title.PrefixOption'#7#6'poN'
-  +'one'#5'Width'#3#200#0#0#0#10'FixedColor'#4#207#218#221#0#9'FixedCols'#2#0#4
-  +'Flat'#9#7'Options'#11#15'goFixedVertLine'#15'goFixedHorzLine'#10'goVertLine'
-  +#10'goHorzLine'#11'goColSizing'#11'goRowSelect'#14'goSmoothScroll'#0#8'TabOr'
-  +'der'#2#0#14'UseXORFeatures'#9#0#0#7'TBitBtn'#7'bbClose'#4'Left'#3#218#1#6'H'
-  +'eight'#2#24#3'Top'#2#1#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#6'TLabel'#6
-  +'Label1'#4'Left'#2#3#6'Height'#2#18#3'Top'#2#12#5'Width'#2'.'#7'Caption'#6#6
-  +'Object'#11'ParentColor'#8#0#0#6'TLabel'#8'laObject'#4'Left'#2'>'#6'Height'#2
-  +#18#3'Top'#2#11#5'Width'#2'>'#7'Caption'#6#8'laObject'#10'Font.Style'#11#6'f'
-  +'sBold'#0#11'ParentColor'#8#10'ParentFont'#8#0#0#0
+  +#244#1#10'KeyPreview'#9#7'OnClose'#7#9'FormClose'#9'OnKeyDown'#7#11'FormKeyD'
+  +'own'#8'Position'#7#14'poScreenCenter'#10'LCLVersion'#6#7'1.2.0.3'#0#11'TStr'
+  +'ingGrid'#11'StringGrid1'#4'Left'#2#0#6'Height'#3'K'#1#3'Top'#2#31#5'Width'#3
+  +#221#1#7'Anchors'#11#5'akTop'#6'akLeft'#8'akBottom'#0#11'BorderStyle'#7#6'bs'
+  +'None'#8'ColCount'#2#3#7'Columns'#14#1#13'Title.Caption'#6#8'Obj Type'#5'Wid'
+  +'th'#2'd'#0#1#13'Title.Caption'#6#6'Object'#5'Width'#3#200#0#0#1#13'Title.Ca'
+  +'ption'#6#10'Permission'#5'Width'#3#200#0#0#0#10'FixedColor'#4#207#218#221#0
+  +#9'FixedCols'#2#0#4'Flat'#9#7'Options'#11#15'goFixedVertLine'#15'goFixedHorz'
+  +'Line'#10'goVertLine'#10'goHorzLine'#11'goColSizing'#11'goRowSelect'#14'goSm'
+  +'oothScroll'#0#8'TabOrder'#2#0#14'UseXORFeatures'#9#0#0#7'TBitBtn'#7'bbClose'
+  +#4'Left'#3#218#1#6'Height'#2#24#3'Top'#2#1#5'Width'#2#27#7'Anchors'#11#5'akT'
+  +'op'#7'akRight'#0#7'Caption'#6#4' X  '#5'Color'#4#219#242#247#0#10'Font.Styl'
+  +'e'#11#6'fsBold'#0#7'OnClick'#7#12'bbCloseClick'#10'ParentFont'#8#8'TabOrder'
+  +#2#1#0#0#6'TLabel'#6'Label1'#4'Left'#2#3#6'Height'#2#13#3'Top'#2#12#5'Width'
+  +#2' '#7'Caption'#6#6'Object'#11'ParentColor'#8#0#0#6'TLabel'#8'laObject'#4'L'
+  +'eft'#2'>'#6'Height'#2#13#3'Top'#2#11#5'Width'#2'/'#7'Caption'#6#8'laObject'
+  +#10'Font.Style'#11#6'fsBold'#0#11'ParentColor'#8#10'ParentFont'#8#0#0#0
 ]);
 ]);

+ 17 - 1
userpermissions.pas

@@ -6,7 +6,7 @@ interface
 
 
 uses
 uses
   Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
   Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
-  Grids, Buttons, StdCtrls;
+  Grids, Buttons, StdCtrls, LCLType;
 
 
 type
 type
 
 
@@ -19,6 +19,7 @@ type
     StringGrid1: TStringGrid;
     StringGrid1: TStringGrid;
     procedure bbCloseClick(Sender: TObject);
     procedure bbCloseClick(Sender: TObject);
     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
+    procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
   private
   private
     { private declarations }
     { private declarations }
   public
   public
@@ -38,6 +39,21 @@ begin
   CloseAction:= caFree;
   CloseAction:= caFree;
 end;
 end;
 
 
+procedure TfmUserPermissions.FormKeyDown(Sender: TObject; var Key: Word;
+  Shift: TShiftState);
+begin
+  if (ssCtrl in Shift) and
+    ((Key=VK_F4) or (Key=VK_W)) then
+  begin
+    if (MessageDlg('Do you want to close this query window?', mtConfirmation, [mbNo, mbYes], 0) = mrYes) then
+    begin
+      // Close when pressing Ctrl-W or Ctrl-F4 (Cmd-W/Cmd-F4 on OSX)
+      Close;
+      Parent.Free;
+    end;
+  end;
+end;
+
 procedure TfmUserPermissions.bbCloseClick(Sender: TObject);
 procedure TfmUserPermissions.bbCloseClick(Sender: TObject);
 begin
 begin
   Close;
   Close;

+ 15 - 13
viewdomain.lfm

@@ -6,22 +6,24 @@ object fmViewDomain: TfmViewDomain
   Caption = 'fmViewDomain'
   Caption = 'fmViewDomain'
   ClientHeight = 164
   ClientHeight = 164
   ClientWidth = 617
   ClientWidth = 617
+  KeyPreview = True
   OnClose = FormClose
   OnClose = FormClose
+  OnKeyDown = FormKeyDown
   Position = poScreenCenter
   Position = poScreenCenter
-  LCLVersion = '0.9.31'
+  LCLVersion = '1.2.0.3'
   object Label1: TLabel
   object Label1: TLabel
     Left = 11
     Left = 11
-    Height = 18
+    Height = 13
     Top = 15
     Top = 15
-    Width = 93
+    Width = 64
     Caption = 'Domain name'
     Caption = 'Domain name'
     ParentColor = False
     ParentColor = False
   end
   end
   object Label3: TLabel
   object Label3: TLabel
     Left = 11
     Left = 11
-    Height = 18
+    Height = 13
     Top = 48
     Top = 48
-    Width = 66
+    Width = 48
     Caption = 'Data type'
     Caption = 'Data type'
     ParentColor = False
     ParentColor = False
   end
   end
@@ -29,7 +31,7 @@ object fmViewDomain: TfmViewDomain
     Left = 120
     Left = 120
     Height = 18
     Height = 18
     Top = 48
     Top = 48
-    Width = 52
+    Width = 54
     Caption = 'laName'
     Caption = 'laName'
     Font.Color = 10234153
     Font.Color = 10234153
     Font.Name = 'courier 10 pitch [bitstream]'
     Font.Name = 'courier 10 pitch [bitstream]'
@@ -38,9 +40,9 @@ object fmViewDomain: TfmViewDomain
   end
   end
   object Label4: TLabel
   object Label4: TLabel
     Left = 11
     Left = 11
-    Height = 18
+    Height = 13
     Top = 80
     Top = 80
-    Width = 28
+    Width = 19
     Caption = 'Size'
     Caption = 'Size'
     ParentColor = False
     ParentColor = False
   end
   end
@@ -48,7 +50,7 @@ object fmViewDomain: TfmViewDomain
     Left = 120
     Left = 120
     Height = 18
     Height = 18
     Top = 80
     Top = 80
-    Width = 52
+    Width = 54
     Caption = 'laName'
     Caption = 'laName'
     Font.Color = 10234153
     Font.Color = 10234153
     Font.Name = 'courier 10 pitch [bitstream]'
     Font.Name = 'courier 10 pitch [bitstream]'
@@ -57,9 +59,9 @@ object fmViewDomain: TfmViewDomain
   end
   end
   object Label5: TLabel
   object Label5: TLabel
     Left = 11
     Left = 11
-    Height = 18
+    Height = 13
     Top = 112
     Top = 112
-    Width = 92
+    Width = 64
     Caption = 'Default Value'
     Caption = 'Default Value'
     ParentColor = False
     ParentColor = False
   end
   end
@@ -67,7 +69,7 @@ object fmViewDomain: TfmViewDomain
     Left = 120
     Left = 120
     Height = 18
     Height = 18
     Top = 112
     Top = 112
-    Width = 52
+    Width = 54
     Caption = 'laName'
     Caption = 'laName'
     Font.Color = 10234153
     Font.Color = 10234153
     Font.Name = 'courier 10 pitch [bitstream]'
     Font.Name = 'courier 10 pitch [bitstream]'
@@ -76,7 +78,7 @@ object fmViewDomain: TfmViewDomain
   end
   end
   object edName: TEdit
   object edName: TEdit
     Left = 120
     Left = 120
-    Height = 21
+    Height = 13
     Top = 16
     Top = 16
     Width = 306
     Width = 306
     AutoSelect = False
     AutoSelect = False

+ 26 - 23
viewdomain.lrs

@@ -1,27 +1,30 @@
+{ This is an automatically generated lazarus resource file }
+
 LazarusResources.Add('TfmViewDomain','FORMDATA',[
 LazarusResources.Add('TfmViewDomain','FORMDATA',[
   'TPF0'#13'TfmViewDomain'#12'fmViewDomain'#4'Left'#3'J'#1#6'Height'#3#164#0#3
   'TPF0'#13'TfmViewDomain'#12'fmViewDomain'#4'Left'#3'J'#1#6'Height'#3#164#0#3
   +'Top'#3#216#0#5'Width'#3'i'#2#7'Caption'#6#12'fmViewDomain'#12'ClientHeight'
   +'Top'#3#216#0#5'Width'#3'i'#2#7'Caption'#6#12'fmViewDomain'#12'ClientHeight'
-  +#3#164#0#11'ClientWidth'#3'i'#2#7'OnClose'#7#9'FormClose'#8'Position'#7#14'p'
-  +'oScreenCenter'#10'LCLVersion'#6#6'0.9.31'#0#6'TLabel'#6'Label1'#4'Left'#2#11
-  +#6'Height'#2#18#3'Top'#2#15#5'Width'#2']'#7'Caption'#6#11'Domain name'#11'Pa'
-  +'rentColor'#8#0#0#6'TLabel'#6'Label3'#4'Left'#2#11#6'Height'#2#18#3'Top'#2'0'
-  +#5'Width'#2'B'#7'Caption'#6#9'Data type'#11'ParentColor'#8#0#0#6'TLabel'#6'l'
-  +'aType'#4'Left'#2'x'#6'Height'#2#18#3'Top'#2'0'#5'Width'#2'4'#7'Caption'#6#6
-  +'laName'#10'Font.Color'#4'))'#156#0#9'Font.Name'#6#28'courier 10 pitch [bits'
-  +'tream]'#11'ParentColor'#8#10'ParentFont'#8#0#0#6'TLabel'#6'Label4'#4'Left'#2
-  +#11#6'Height'#2#18#3'Top'#2'P'#5'Width'#2#28#7'Caption'#6#4'Size'#11'ParentC'
-  +'olor'#8#0#0#6'TLabel'#6'laSize'#4'Left'#2'x'#6'Height'#2#18#3'Top'#2'P'#5'W'
-  +'idth'#2'4'#7'Caption'#6#6'laName'#10'Font.Color'#4'))'#156#0#9'Font.Name'#6
-  +#28'courier 10 pitch [bitstream]'#11'ParentColor'#8#10'ParentFont'#8#0#0#6'T'
-  +'Label'#6'Label5'#4'Left'#2#11#6'Height'#2#18#3'Top'#2'p'#5'Width'#2'\'#7'Ca'
-  +'ption'#6#13'Default Value'#11'ParentColor'#8#0#0#6'TLabel'#9'laDefault'#4'L'
-  +'eft'#2'x'#6'Height'#2#18#3'Top'#2'p'#5'Width'#2'4'#7'Caption'#6#6'laName'#10
-  +'Font.Color'#4'))'#156#0#9'Font.Name'#6#28'courier 10 pitch [bitstream]'#11
-  +'ParentColor'#8#10'ParentFont'#8#0#0#5'TEdit'#6'edName'#4'Left'#2'x'#6'Heigh'
-  +'t'#2#21#3'Top'#2#16#5'Width'#3'2'#1#10'AutoSelect'#8#11'BorderStyle'#7#6'bs'
-  +'None'#10'Font.Color'#7#6'clNavy'#10'ParentFont'#8#8'ReadOnly'#9#8'TabOrder'
-  +#2#0#4'Text'#6#9'edGenName'#0#0#7'TBitBtn'#7'bbClose'#4'Left'#3'N'#2#6'Heigh'
-  +'t'#2#24#3'Top'#2#0#5'Width'#2#27#7'Anchors'#11#5'akTop'#7'akRight'#0#7'Capt'
-  +'ion'#6#4' X  '#5'Color'#4#219#242#247#0#10'Font.Style'#11#6'fsBold'#0#7'OnC'
-  +'lick'#7#12'bbCloseClick'#10'ParentFont'#8#8'TabOrder'#2#1#0#0#0
+  +#3#164#0#11'ClientWidth'#3'i'#2#10'KeyPreview'#9#7'OnClose'#7#9'FormClose'#9
+  +'OnKeyDown'#7#11'FormKeyDown'#8'Position'#7#14'poScreenCenter'#10'LCLVersion'
+  +#6#7'1.2.0.3'#0#6'TLabel'#6'Label1'#4'Left'#2#11#6'Height'#2#13#3'Top'#2#15#5
+  +'Width'#2'@'#7'Caption'#6#11'Domain name'#11'ParentColor'#8#0#0#6'TLabel'#6
+  +'Label3'#4'Left'#2#11#6'Height'#2#13#3'Top'#2'0'#5'Width'#2'0'#7'Caption'#6#9
+  +'Data type'#11'ParentColor'#8#0#0#6'TLabel'#6'laType'#4'Left'#2'x'#6'Height'
+  +#2#18#3'Top'#2'0'#5'Width'#2'6'#7'Caption'#6#6'laName'#10'Font.Color'#4'))'
+  +#156#0#9'Font.Name'#6#28'courier 10 pitch [bitstream]'#11'ParentColor'#8#10
+  +'ParentFont'#8#0#0#6'TLabel'#6'Label4'#4'Left'#2#11#6'Height'#2#13#3'Top'#2
+  +'P'#5'Width'#2#19#7'Caption'#6#4'Size'#11'ParentColor'#8#0#0#6'TLabel'#6'laS'
+  +'ize'#4'Left'#2'x'#6'Height'#2#18#3'Top'#2'P'#5'Width'#2'6'#7'Caption'#6#6'l'
+  +'aName'#10'Font.Color'#4'))'#156#0#9'Font.Name'#6#28'courier 10 pitch [bitst'
+  +'ream]'#11'ParentColor'#8#10'ParentFont'#8#0#0#6'TLabel'#6'Label5'#4'Left'#2
+  +#11#6'Height'#2#13#3'Top'#2'p'#5'Width'#2'@'#7'Caption'#6#13'Default Value'
+  +#11'ParentColor'#8#0#0#6'TLabel'#9'laDefault'#4'Left'#2'x'#6'Height'#2#18#3
+  +'Top'#2'p'#5'Width'#2'6'#7'Caption'#6#6'laName'#10'Font.Color'#4'))'#156#0#9
+  +'Font.Name'#6#28'courier 10 pitch [bitstream]'#11'ParentColor'#8#10'ParentFo'
+  +'nt'#8#0#0#5'TEdit'#6'edName'#4'Left'#2'x'#6'Height'#2#13#3'Top'#2#16#5'Widt'
+  +'h'#3'2'#1#10'AutoSelect'#8#11'BorderStyle'#7#6'bsNone'#10'Font.Color'#7#6'c'
+  +'lNavy'#10'ParentFont'#8#8'ReadOnly'#9#8'TabOrder'#2#0#4'Text'#6#9'edGenName'
+  +#0#0#7'TBitBtn'#7'bbClose'#4'Left'#3'N'#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'Pa'
+  +'rentFont'#8#8'TabOrder'#2#1#0#0#0
 ]);
 ]);

+ 17 - 1
viewdomain.pas

@@ -6,7 +6,7 @@ interface
 
 
 uses
 uses
   Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
   Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
-  StdCtrls, Buttons;
+  StdCtrls, Buttons, LCLType;
 
 
 type
 type
 
 
@@ -24,6 +24,7 @@ type
     laSize: TLabel;
     laSize: TLabel;
     procedure bbCloseClick(Sender: TObject);
     procedure bbCloseClick(Sender: TObject);
     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
+    procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
   private
   private
     { private declarations }
     { private declarations }
   public
   public
@@ -42,6 +43,21 @@ begin
   CloseAction:= caFree;
   CloseAction:= caFree;
 end;
 end;
 
 
+procedure TfmViewDomain.FormKeyDown(Sender: TObject; var Key: Word;
+  Shift: TShiftState);
+begin
+  if (ssCtrl in Shift) and
+    ((Key=VK_F4) or (Key=VK_W)) then
+  begin
+    if MessageDlg('Do you want to close this query window?', mtConfirmation, [mbNo, mbYes], 0) = mrYes then
+    begin
+      // Close when pressing Ctrl-W or Ctrl-F4 (Cmd-W/Cmd-F4 on OSX)
+      Close;
+      Parent.Free;
+    end;
+  end;
+end;
+
 procedure TfmViewDomain.bbCloseClick(Sender: TObject);
 procedure TfmViewDomain.bbCloseClick(Sender: TObject);
 begin
 begin
   Close;
   Close;

+ 9 - 7
viewgen.lfm

@@ -6,28 +6,30 @@ object fmViewGen: TfmViewGen
   Caption = 'fmViewGen'
   Caption = 'fmViewGen'
   ClientHeight = 85
   ClientHeight = 85
   ClientWidth = 615
   ClientWidth = 615
+  KeyPreview = True
   OnClose = FormClose
   OnClose = FormClose
+  OnKeyDown = FormKeyDown
   Position = poScreenCenter
   Position = poScreenCenter
-  LCLVersion = '0.9.31'
+  LCLVersion = '1.2.0.3'
   object Label1: TLabel
   object Label1: TLabel
     Left = 11
     Left = 11
-    Height = 18
+    Height = 13
     Top = 15
     Top = 15
-    Width = 70
+    Width = 49
     Caption = 'Generator'
     Caption = 'Generator'
     ParentColor = False
     ParentColor = False
   end
   end
   object Label3: TLabel
   object Label3: TLabel
     Left = 11
     Left = 11
-    Height = 18
+    Height = 13
     Top = 48
     Top = 48
-    Width = 93
+    Width = 66
     Caption = 'Current Value'
     Caption = 'Current Value'
     ParentColor = False
     ParentColor = False
   end
   end
   object edGenName: TEdit
   object edGenName: TEdit
     Left = 120
     Left = 120
-    Height = 21
+    Height = 13
     Top = 8
     Top = 8
     Width = 207
     Width = 207
     Anchors = [akTop, akLeft, akRight]
     Anchors = [akTop, akLeft, akRight]
@@ -41,7 +43,7 @@ object fmViewGen: TfmViewGen
   end
   end
   object edValue: TEdit
   object edValue: TEdit
     Left = 120
     Left = 120
-    Height = 21
+    Height = 13
     Top = 40
     Top = 40
     Width = 144
     Width = 144
     AutoSelect = False
     AutoSelect = False

+ 18 - 15
viewgen.lrs

@@ -1,19 +1,22 @@
+{ This is an automatically generated lazarus resource file }
+
 LazarusResources.Add('TfmViewGen','FORMDATA',[
 LazarusResources.Add('TfmViewGen','FORMDATA',[
   'TPF0'#10'TfmViewGen'#9'fmViewGen'#4'Left'#3'j'#1#6'Height'#2'U'#3'Top'#3#201
   'TPF0'#10'TfmViewGen'#9'fmViewGen'#4'Left'#3'j'#1#6'Height'#2'U'#3'Top'#3#201
   +#0#5'Width'#3'g'#2#7'Caption'#6#9'fmViewGen'#12'ClientHeight'#2'U'#11'Client'
   +#0#5'Width'#3'g'#2#7'Caption'#6#9'fmViewGen'#12'ClientHeight'#2'U'#11'Client'
-  +'Width'#3'g'#2#7'OnClose'#7#9'FormClose'#8'Position'#7#14'poScreenCenter'#10
-  +'LCLVersion'#6#6'0.9.31'#0#6'TLabel'#6'Label1'#4'Left'#2#11#6'Height'#2#18#3
-  +'Top'#2#15#5'Width'#2'F'#7'Caption'#6#9'Generator'#11'ParentColor'#8#0#0#6'T'
-  +'Label'#6'Label3'#4'Left'#2#11#6'Height'#2#18#3'Top'#2'0'#5'Width'#2']'#7'Ca'
-  +'ption'#6#13'Current Value'#11'ParentColor'#8#0#0#5'TEdit'#9'edGenName'#4'Le'
-  +'ft'#2'x'#6'Height'#2#21#3'Top'#2#8#5'Width'#3#207#0#7'Anchors'#11#5'akTop'#6
-  +'akLeft'#7'akRight'#0#10'AutoSelect'#8#11'BorderStyle'#7#6'bsNone'#10'Font.C'
-  +'olor'#7#6'clNavy'#10'ParentFont'#8#8'ReadOnly'#9#8'TabOrder'#2#0#4'Text'#6#9
-  +'edGenName'#0#0#5'TEdit'#7'edValue'#4'Left'#2'x'#6'Height'#2#21#3'Top'#2'('#5
-  +'Width'#3#144#0#10'AutoSelect'#8#11'BorderStyle'#7#6'bsNone'#10'Font.Color'#7
-  +#6'clNavy'#10'ParentFont'#8#8'ReadOnly'#9#8'TabOrder'#2#1#4'Text'#6#9'edGenN'
-  +'ame'#0#0#7'TBitBtn'#7'bbClose'#4'Left'#3'L'#2#6'Height'#2#24#3'Top'#2#4#5'W'
-  +'idth'#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#2#0#0#0
+  +'Width'#3'g'#2#10'KeyPreview'#9#7'OnClose'#7#9'FormClose'#9'OnKeyDown'#7#11
+  +'FormKeyDown'#8'Position'#7#14'poScreenCenter'#10'LCLVersion'#6#7'1.2.0.3'#0
+  +#6'TLabel'#6'Label1'#4'Left'#2#11#6'Height'#2#13#3'Top'#2#15#5'Width'#2'1'#7
+  +'Caption'#6#9'Generator'#11'ParentColor'#8#0#0#6'TLabel'#6'Label3'#4'Left'#2
+  +#11#6'Height'#2#13#3'Top'#2'0'#5'Width'#2'B'#7'Caption'#6#13'Current Value'
+  +#11'ParentColor'#8#0#0#5'TEdit'#9'edGenName'#4'Left'#2'x'#6'Height'#2#13#3'T'
+  +'op'#2#8#5'Width'#3#207#0#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#10'A'
+  +'utoSelect'#8#11'BorderStyle'#7#6'bsNone'#10'Font.Color'#7#6'clNavy'#10'Pare'
+  +'ntFont'#8#8'ReadOnly'#9#8'TabOrder'#2#0#4'Text'#6#9'edGenName'#0#0#5'TEdit'
+  +#7'edValue'#4'Left'#2'x'#6'Height'#2#13#3'Top'#2'('#5'Width'#3#144#0#10'Auto'
+  +'Select'#8#11'BorderStyle'#7#6'bsNone'#10'Font.Color'#7#6'clNavy'#10'ParentF'
+  +'ont'#8#8'ReadOnly'#9#8'TabOrder'#2#1#4'Text'#6#9'edGenName'#0#0#7'TBitBtn'#7
+  +'bbClose'#4'Left'#3'L'#2#6'Height'#2#24#3'Top'#2#4#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'F'
+  +'ont.Style'#11#6'fsBold'#0#7'OnClick'#7#12'bbCloseClick'#10'ParentFont'#8#8
+  +'TabOrder'#2#2#0#0#0
 ]);
 ]);

+ 17 - 1
viewgen.pas

@@ -6,7 +6,7 @@ interface
 
 
 uses
 uses
   Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
   Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
-  StdCtrls, Buttons;
+  StdCtrls, Buttons, LCLType;
 
 
 type
 type
 
 
@@ -20,6 +20,7 @@ type
     Label3: TLabel;
     Label3: TLabel;
     procedure bbCloseClick(Sender: TObject);
     procedure bbCloseClick(Sender: TObject);
     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
+    procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
   private
   private
     { private declarations }
     { private declarations }
   public
   public
@@ -38,6 +39,21 @@ begin
   CloseAction:= caFree;
   CloseAction:= caFree;
 end;
 end;
 
 
+procedure TfmViewGen.FormKeyDown(Sender: TObject; var Key: Word;
+  Shift: TShiftState);
+begin
+  if (ssCtrl in Shift) and
+    ((Key=VK_F4) or (Key=VK_W)) then
+  begin
+    if MessageDlg('Do you want to close this query window?', mtConfirmation, [mbNo, mbYes], 0) = mrYes then
+    begin
+      // Close when pressing Ctrl-W or Ctrl-F4 (Cmd-W/Cmd-F4 on OSX)
+      Close;
+      Parent.Free;
+    end;
+  end;
+end;
+
 procedure TfmViewGen.bbCloseClick(Sender: TObject);
 procedure TfmViewGen.bbCloseClick(Sender: TObject);
 begin
 begin
   Close;
   Close;

+ 52 - 105
viewsproc.lfm

@@ -6,30 +6,32 @@ object fmViewSProc: TfmViewSProc
   Caption = 'fmViewSProc'
   Caption = 'fmViewSProc'
   ClientHeight = 420
   ClientHeight = 420
   ClientWidth = 530
   ClientWidth = 530
+  KeyPreview = True
   OnClose = FormClose
   OnClose = FormClose
+  OnKeyDown = FormKeyDown
   Position = poScreenCenter
   Position = poScreenCenter
-  LCLVersion = '0.9.31'
+  LCLVersion = '1.2.0.3'
   object Label1: TLabel
   object Label1: TLabel
     Left = 11
     Left = 11
-    Height = 18
+    Height = 13
     Top = 15
     Top = 15
-    Width = 120
+    Width = 84
     Caption = 'Stored Procedure'
     Caption = 'Stored Procedure'
     ParentColor = False
     ParentColor = False
   end
   end
   object Label2: TLabel
   object Label2: TLabel
     Left = 11
     Left = 11
-    Height = 18
+    Height = 13
     Top = 79
     Top = 79
-    Width = 35
+    Width = 24
     Caption = 'Body'
     Caption = 'Body'
     ParentColor = False
     ParentColor = False
   end
   end
   object Label3: TLabel
   object Label3: TLabel
     Left = 11
     Left = 11
-    Height = 18
+    Height = 13
     Top = 48
     Top = 48
-    Width = 45
+    Width = 32
     Caption = 'Owner'
     Caption = 'Owner'
     ParentColor = False
     ParentColor = False
   end
   end
@@ -50,50 +52,24 @@ object fmViewSProc: TfmViewSProc
     Gutter.Width = 17
     Gutter.Width = 17
     Gutter.MouseActions = <    
     Gutter.MouseActions = <    
       item
       item
-        Shift = []
-        ShiftMask = []
-        Button = mbLeft
         ClickCount = ccAny
         ClickCount = ccAny
         ClickDir = cdDown
         ClickDir = cdDown
-        Command = 13
-        MoveCaret = False
-        Option = 0
-        Priority = 0
+        Command = emcOnMainGutterClick
       end    
       end    
       item
       item
-        Shift = []
-        ShiftMask = []
         Button = mbRight
         Button = mbRight
-        ClickCount = ccSingle
-        ClickDir = cdUp
-        Command = 12
-        MoveCaret = False
-        Option = 0
-        Priority = 0
+        Command = emcContextMenu
       end>
       end>
     RightGutter.Width = 0
     RightGutter.Width = 0
     RightGutter.MouseActions = <    
     RightGutter.MouseActions = <    
       item
       item
-        Shift = []
-        ShiftMask = []
-        Button = mbLeft
         ClickCount = ccAny
         ClickCount = ccAny
         ClickDir = cdDown
         ClickDir = cdDown
-        Command = 13
-        MoveCaret = False
-        Option = 0
-        Priority = 0
+        Command = emcOnMainGutterClick
       end    
       end    
       item
       item
-        Shift = []
-        ShiftMask = []
         Button = mbRight
         Button = mbRight
-        ClickCount = ccSingle
-        ClickDir = cdUp
-        Command = 12
-        MoveCaret = False
-        Option = 0
-        Priority = 0
+        Command = emcContextMenu
       end>
       end>
     Highlighter = SynSQLSyn1
     Highlighter = SynSQLSyn1
     Keystrokes = <    
     Keystrokes = <    
@@ -519,137 +495,108 @@ object fmViewSProc: TfmViewSProc
       end>
       end>
     MouseActions = <    
     MouseActions = <    
       item
       item
-        Shift = []
         ShiftMask = [ssShift, ssAlt]
         ShiftMask = [ssShift, ssAlt]
-        Button = mbLeft
-        ClickCount = ccSingle
         ClickDir = cdDown
         ClickDir = cdDown
-        Command = 1
+        Command = emcStartSelections
         MoveCaret = True
         MoveCaret = True
-        Option = 0
-        Priority = 0
       end    
       end    
       item
       item
         Shift = [ssShift]
         Shift = [ssShift]
         ShiftMask = [ssShift, ssAlt]
         ShiftMask = [ssShift, ssAlt]
-        Button = mbLeft
-        ClickCount = ccSingle
         ClickDir = cdDown
         ClickDir = cdDown
-        Command = 1
+        Command = emcStartSelections
         MoveCaret = True
         MoveCaret = True
         Option = 1
         Option = 1
-        Priority = 0
       end    
       end    
       item
       item
         Shift = [ssAlt]
         Shift = [ssAlt]
         ShiftMask = [ssShift, ssAlt]
         ShiftMask = [ssShift, ssAlt]
-        Button = mbLeft
-        ClickCount = ccSingle
         ClickDir = cdDown
         ClickDir = cdDown
-        Command = 3
+        Command = emcStartColumnSelections
         MoveCaret = True
         MoveCaret = True
-        Option = 0
-        Priority = 0
       end    
       end    
       item
       item
         Shift = [ssShift, ssAlt]
         Shift = [ssShift, ssAlt]
         ShiftMask = [ssShift, ssAlt]
         ShiftMask = [ssShift, ssAlt]
-        Button = mbLeft
-        ClickCount = ccSingle
         ClickDir = cdDown
         ClickDir = cdDown
-        Command = 3
+        Command = emcStartColumnSelections
         MoveCaret = True
         MoveCaret = True
         Option = 1
         Option = 1
-        Priority = 0
       end    
       end    
       item
       item
-        Shift = []
-        ShiftMask = []
         Button = mbRight
         Button = mbRight
-        ClickCount = ccSingle
-        ClickDir = cdUp
-        Command = 12
-        MoveCaret = False
-        Option = 0
-        Priority = 0
+        Command = emcContextMenu
       end    
       end    
       item
       item
-        Shift = []
-        ShiftMask = []
-        Button = mbLeft
         ClickCount = ccDouble
         ClickCount = ccDouble
         ClickDir = cdDown
         ClickDir = cdDown
-        Command = 6
+        Command = emcSelectWord
         MoveCaret = True
         MoveCaret = True
-        Option = 0
-        Priority = 0
       end    
       end    
       item
       item
-        Shift = []
-        ShiftMask = []
-        Button = mbLeft
         ClickCount = ccTriple
         ClickCount = ccTriple
         ClickDir = cdDown
         ClickDir = cdDown
-        Command = 7
+        Command = emcSelectLine
         MoveCaret = True
         MoveCaret = True
-        Option = 0
-        Priority = 0
       end    
       end    
       item
       item
-        Shift = []
-        ShiftMask = []
-        Button = mbLeft
         ClickCount = ccQuad
         ClickCount = ccQuad
         ClickDir = cdDown
         ClickDir = cdDown
-        Command = 8
+        Command = emcSelectPara
         MoveCaret = True
         MoveCaret = True
-        Option = 0
-        Priority = 0
       end    
       end    
       item
       item
-        Shift = []
-        ShiftMask = []
         Button = mbMiddle
         Button = mbMiddle
-        ClickCount = ccSingle
         ClickDir = cdDown
         ClickDir = cdDown
-        Command = 10
+        Command = emcPasteSelection
         MoveCaret = True
         MoveCaret = True
-        Option = 0
-        Priority = 0
       end    
       end    
       item
       item
         Shift = [ssCtrl]
         Shift = [ssCtrl]
         ShiftMask = [ssShift, ssAlt, ssCtrl]
         ShiftMask = [ssShift, ssAlt, ssCtrl]
-        Button = mbLeft
-        ClickCount = ccSingle
-        ClickDir = cdUp
-        Command = 11
-        MoveCaret = False
-        Option = 0
-        Priority = 0
+        Command = emcMouseLink
       end>
       end>
     MouseSelActions = <    
     MouseSelActions = <    
       item
       item
-        Shift = []
-        ShiftMask = []
-        Button = mbLeft
-        ClickCount = ccSingle
         ClickDir = cdDown
         ClickDir = cdDown
-        Command = 9
-        MoveCaret = False
-        Option = 0
-        Priority = 0
+        Command = emcStartDragMove
       end>
       end>
+    VisibleSpecialChars = [vscSpace, vscTabAtLast]
     ReadOnly = True
     ReadOnly = True
     RightEdge = 120
     RightEdge = 120
     RightEdgeColor = 13487600
     RightEdgeColor = 13487600
+    SelectedColor.FrameEdges = sfeAround
+    SelectedColor.BackPriority = 50
+    SelectedColor.ForePriority = 50
+    SelectedColor.FramePriority = 50
+    SelectedColor.BoldPriority = 50
+    SelectedColor.ItalicPriority = 50
+    SelectedColor.UnderlinePriority = 50
+    SelectedColor.StrikeOutPriority = 50
+    IncrementColor.FrameEdges = sfeAround
+    HighlightAllColor.FrameEdges = sfeAround
     BracketHighlightStyle = sbhsBoth
     BracketHighlightStyle = sbhsBoth
+    BracketMatchColor.Background = clNone
+    BracketMatchColor.Foreground = clNone
+    BracketMatchColor.FrameEdges = sfeAround
+    BracketMatchColor.Style = [fsBold]
+    FoldedCodeColor.Background = clNone
+    FoldedCodeColor.Foreground = clGray
+    FoldedCodeColor.FrameColor = clGray
+    FoldedCodeColor.FrameEdges = sfeAround
+    MouseLinkColor.Background = clNone
+    MouseLinkColor.Foreground = clBlue
+    MouseLinkColor.FrameEdges = sfeAround
+    LineHighlightColor.Background = clNone
+    LineHighlightColor.Foreground = clNone
+    LineHighlightColor.FrameEdges = sfeAround
     inline TSynGutterPartList
     inline TSynGutterPartList
       object TSynGutterLineNumber
       object TSynGutterLineNumber
         Width = 17
         Width = 17
         MouseActions = <>
         MouseActions = <>
         MarkupInfo.Background = 13820657
         MarkupInfo.Background = 13820657
         MarkupInfo.Foreground = clNone
         MarkupInfo.Foreground = clNone
+        MarkupInfo.FrameEdges = sfeAround
         DigitCount = 2
         DigitCount = 2
         ShowOnlyLineNumbersMultiplesOf = 1
         ShowOnlyLineNumbersMultiplesOf = 1
         ZeroStart = False
         ZeroStart = False
@@ -659,7 +606,7 @@ object fmViewSProc: TfmViewSProc
   end
   end
   object edName: TEdit
   object edName: TEdit
     Left = 144
     Left = 144
-    Height = 21
+    Height = 13
     Top = 15
     Top = 15
     Width = 240
     Width = 240
     AutoSelect = False
     AutoSelect = False
@@ -672,7 +619,7 @@ object fmViewSProc: TfmViewSProc
   end
   end
   object edOwner: TEdit
   object edOwner: TEdit
     Left = 144
     Left = 144
-    Height = 21
+    Height = 13
     Top = 48
     Top = 48
     Width = 168
     Width = 168
     AutoSelect = False
     AutoSelect = False

+ 155 - 153
viewsproc.lrs

@@ -1,157 +1,159 @@
+{ This is an automatically generated lazarus resource file }
+
 LazarusResources.Add('TfmViewSProc','FORMDATA',[
 LazarusResources.Add('TfmViewSProc','FORMDATA',[
   'TPF0'#12'TfmViewSProc'#11'fmViewSProc'#4'Left'#3'j'#1#6'Height'#3#164#1#3'To'
   'TPF0'#12'TfmViewSProc'#11'fmViewSProc'#4'Left'#3'j'#1#6'Height'#3#164#1#3'To'
   +'p'#3#201#0#5'Width'#3#18#2#7'Caption'#6#11'fmViewSProc'#12'ClientHeight'#3
   +'p'#3#201#0#5'Width'#3#18#2#7'Caption'#6#11'fmViewSProc'#12'ClientHeight'#3
-  +#164#1#11'ClientWidth'#3#18#2#7'OnClose'#7#9'FormClose'#8'Position'#7#14'poS'
-  +'creenCenter'#10'LCLVersion'#6#6'0.9.31'#0#6'TLabel'#6'Label1'#4'Left'#2#11#6
-  +'Height'#2#18#3'Top'#2#15#5'Width'#2'x'#7'Caption'#6#16'Stored Procedure'#11
-  +'ParentColor'#8#0#0#6'TLabel'#6'Label2'#4'Left'#2#11#6'Height'#2#18#3'Top'#2
-  +'O'#5'Width'#2'#'#7'Caption'#6#4'Body'#11'ParentColor'#8#0#0#6'TLabel'#6'Lab'
-  +'el3'#4'Left'#2#11#6'Height'#2#18#3'Top'#2'0'#5'Width'#2'-'#7'Caption'#6#5'O'
-  +'wner'#11'ParentColor'#8#0#0#244#8'TSynEdit'#8'seScript'#4'Left'#2#11#6'Heig'
-  +'ht'#3'8'#1#3'Top'#2'`'#5'Width'#3#1#2#7'Anchors'#11#5'akTop'#6'akLeft'#7'ak'
-  +'Right'#8'akBottom'#0#11'Font.Height'#2#243#9'Font.Name'#6#11'Courier New'#10
-  +'Font.Pitch'#7#7'fpFixed'#12'Font.Quality'#7#16'fqNonAntialiased'#11'ParentC'
-  +'olor'#8#10'ParentFont'#8#8'TabOrder'#2#0#12'Gutter.Color'#4#249#242#234#0#12
-  +'Gutter.Width'#2#17#19'Gutter.MouseActions'#14#1#5'Shift'#11#0#9'ShiftMask'
-  +#11#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#5'ccAny'#8'ClickDir'#7#6'cdDown'
-  +#7'Command'#2#13#9'MoveCaret'#8#6'Option'#2#0#8'Priority'#2#0#0#1#5'Shift'#11
-  +#0#9'ShiftMask'#11#0#6'Button'#7#7'mbRight'#10'ClickCount'#7#8'ccSingle'#8'C'
-  +'lickDir'#7#4'cdUp'#7'Command'#2#12#9'MoveCaret'#8#6'Option'#2#0#8'Priority'
-  +#2#0#0#0#17'RightGutter.Width'#2#0#24'RightGutter.MouseActions'#14#1#5'Shift'
-  +#11#0#9'ShiftMask'#11#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#5'ccAny'#8'Cl'
-  +'ickDir'#7#6'cdDown'#7'Command'#2#13#9'MoveCaret'#8#6'Option'#2#0#8'Priority'
-  +#2#0#0#1#5'Shift'#11#0#9'ShiftMask'#11#0#6'Button'#7#7'mbRight'#10'ClickCoun'
-  +'t'#7#8'ccSingle'#8'ClickDir'#7#4'cdUp'#7'Command'#2#12#9'MoveCaret'#8#6'Opt'
-  +'ion'#2#0#8'Priority'#2#0#0#0#11'Highlighter'#7#10'SynSQLSyn1'#10'Keystrokes'
-  +#14#1#7'Command'#7#4'ecUp'#8'ShortCut'#2'&'#0#1#7'Command'#7#7'ecSelUp'#8'Sh'
-  +'ortCut'#3'& '#0#1#7'Command'#7#10'ecScrollUp'#8'ShortCut'#3'&@'#0#1#7'Comma'
-  +'nd'#7#6'ecDown'#8'ShortCut'#2'('#0#1#7'Command'#7#9'ecSelDown'#8'ShortCut'#3
-  +'( '#0#1#7'Command'#7#12'ecScrollDown'#8'ShortCut'#3'(@'#0#1#7'Command'#7#6
-  +'ecLeft'#8'ShortCut'#2'%'#0#1#7'Command'#7#9'ecSelLeft'#8'ShortCut'#3'% '#0#1
-  +#7'Command'#7#10'ecWordLeft'#8'ShortCut'#3'%@'#0#1#7'Command'#7#13'ecSelWord'
-  +'Left'#8'ShortCut'#3'%`'#0#1#7'Command'#7#7'ecRight'#8'ShortCut'#2''''#0#1#7
-  +'Command'#7#10'ecSelRight'#8'ShortCut'#3''' '#0#1#7'Command'#7#11'ecWordRigh'
-  +'t'#8'ShortCut'#3'''@'#0#1#7'Command'#7#14'ecSelWordRight'#8'ShortCut'#3'''`'
-  +#0#1#7'Command'#7#10'ecPageDown'#8'ShortCut'#2'"'#0#1#7'Command'#7#13'ecSelP'
-  +'ageDown'#8'ShortCut'#3'" '#0#1#7'Command'#7#12'ecPageBottom'#8'ShortCut'#3
-  +'"@'#0#1#7'Command'#7#15'ecSelPageBottom'#8'ShortCut'#3'"`'#0#1#7'Command'#7
-  +#8'ecPageUp'#8'ShortCut'#2'!'#0#1#7'Command'#7#11'ecSelPageUp'#8'ShortCut'#3
-  +'! '#0#1#7'Command'#7#9'ecPageTop'#8'ShortCut'#3'!@'#0#1#7'Command'#7#12'ecS'
-  +'elPageTop'#8'ShortCut'#3'!`'#0#1#7'Command'#7#11'ecLineStart'#8'ShortCut'#2
-  +'$'#0#1#7'Command'#7#14'ecSelLineStart'#8'ShortCut'#3'$ '#0#1#7'Command'#7#11
-  +'ecEditorTop'#8'ShortCut'#3'$@'#0#1#7'Command'#7#14'ecSelEditorTop'#8'ShortC'
-  +'ut'#3'$`'#0#1#7'Command'#7#9'ecLineEnd'#8'ShortCut'#2'#'#0#1#7'Command'#7#12
-  +'ecSelLineEnd'#8'ShortCut'#3'# '#0#1#7'Command'#7#14'ecEditorBottom'#8'Short'
-  +'Cut'#3'#@'#0#1#7'Command'#7#17'ecSelEditorBottom'#8'ShortCut'#3'#`'#0#1#7'C'
-  +'ommand'#7#12'ecToggleMode'#8'ShortCut'#2'-'#0#1#7'Command'#7#6'ecCopy'#8'Sh'
-  +'ortCut'#3'-@'#0#1#7'Command'#7#7'ecPaste'#8'ShortCut'#3'- '#0#1#7'Command'#7
-  +#12'ecDeleteChar'#8'ShortCut'#2'.'#0#1#7'Command'#7#5'ecCut'#8'ShortCut'#3'.'
-  +' '#0#1#7'Command'#7#16'ecDeleteLastChar'#8'ShortCut'#2#8#0#1#7'Command'#7#16
-  +'ecDeleteLastChar'#8'ShortCut'#3#8' '#0#1#7'Command'#7#16'ecDeleteLastWord'#8
-  +'ShortCut'#3#8'@'#0#1#7'Command'#7#6'ecUndo'#8'ShortCut'#4#8#128#0#0#0#1#7'C'
-  +'ommand'#7#6'ecRedo'#8'ShortCut'#4#8#160#0#0#0#1#7'Command'#7#11'ecLineBreak'
-  +#8'ShortCut'#2#13#0#1#7'Command'#7#11'ecSelectAll'#8'ShortCut'#3'A@'#0#1#7'C'
-  +'ommand'#7#6'ecCopy'#8'ShortCut'#3'C@'#0#1#7'Command'#7#13'ecBlockIndent'#8
-  +'ShortCut'#3'I`'#0#1#7'Command'#7#11'ecLineBreak'#8'ShortCut'#3'M@'#0#1#7'Co'
-  +'mmand'#7#12'ecInsertLine'#8'ShortCut'#3'N@'#0#1#7'Command'#7#12'ecDeleteWor'
-  +'d'#8'ShortCut'#3'T@'#0#1#7'Command'#7#15'ecBlockUnindent'#8'ShortCut'#3'U`'
-  +#0#1#7'Command'#7#7'ecPaste'#8'ShortCut'#3'V@'#0#1#7'Command'#7#5'ecCut'#8'S'
-  +'hortCut'#3'X@'#0#1#7'Command'#7#12'ecDeleteLine'#8'ShortCut'#3'Y@'#0#1#7'Co'
-  +'mmand'#7#11'ecDeleteEOL'#8'ShortCut'#3'Y`'#0#1#7'Command'#7#6'ecUndo'#8'Sho'
-  +'rtCut'#3'Z@'#0#1#7'Command'#7#6'ecRedo'#8'ShortCut'#3'Z`'#0#1#7'Command'#7
-  +#13'ecGotoMarker0'#8'ShortCut'#3'0@'#0#1#7'Command'#7#13'ecGotoMarker1'#8'Sh'
-  +'ortCut'#3'1@'#0#1#7'Command'#7#13'ecGotoMarker2'#8'ShortCut'#3'2@'#0#1#7'Co'
-  +'mmand'#7#13'ecGotoMarker3'#8'ShortCut'#3'3@'#0#1#7'Command'#7#13'ecGotoMark'
-  +'er4'#8'ShortCut'#3'4@'#0#1#7'Command'#7#13'ecGotoMarker5'#8'ShortCut'#3'5@'
-  ,#0#1#7'Command'#7#13'ecGotoMarker6'#8'ShortCut'#3'6@'#0#1#7'Command'#7#13'ec'
-  +'GotoMarker7'#8'ShortCut'#3'7@'#0#1#7'Command'#7#13'ecGotoMarker8'#8'ShortCu'
-  +'t'#3'8@'#0#1#7'Command'#7#13'ecGotoMarker9'#8'ShortCut'#3'9@'#0#1#7'Command'
-  +#7#12'ecSetMarker0'#8'ShortCut'#3'0`'#0#1#7'Command'#7#12'ecSetMarker1'#8'Sh'
-  +'ortCut'#3'1`'#0#1#7'Command'#7#12'ecSetMarker2'#8'ShortCut'#3'2`'#0#1#7'Com'
-  +'mand'#7#12'ecSetMarker3'#8'ShortCut'#3'3`'#0#1#7'Command'#7#12'ecSetMarker4'
-  +#8'ShortCut'#3'4`'#0#1#7'Command'#7#12'ecSetMarker5'#8'ShortCut'#3'5`'#0#1#7
-  +'Command'#7#12'ecSetMarker6'#8'ShortCut'#3'6`'#0#1#7'Command'#7#12'ecSetMark'
-  +'er7'#8'ShortCut'#3'7`'#0#1#7'Command'#7#12'ecSetMarker8'#8'ShortCut'#3'8`'#0
-  +#1#7'Command'#7#12'ecSetMarker9'#8'ShortCut'#3'9`'#0#1#7'Command'#7#12'EcFol'
-  +'dLevel1'#8'ShortCut'#4'1'#160#0#0#0#1#7'Command'#7#12'EcFoldLevel2'#8'Short'
-  +'Cut'#4'2'#160#0#0#0#1#7'Command'#7#12'EcFoldLevel1'#8'ShortCut'#4'3'#160#0#0
-  +#0#1#7'Command'#7#12'EcFoldLevel1'#8'ShortCut'#4'4'#160#0#0#0#1#7'Command'#7
-  +#12'EcFoldLevel1'#8'ShortCut'#4'5'#160#0#0#0#1#7'Command'#7#12'EcFoldLevel6'
-  +#8'ShortCut'#4'6'#160#0#0#0#1#7'Command'#7#12'EcFoldLevel7'#8'ShortCut'#4'7'
-  +#160#0#0#0#1#7'Command'#7#12'EcFoldLevel8'#8'ShortCut'#4'8'#160#0#0#0#1#7'Co'
-  +'mmand'#7#12'EcFoldLevel9'#8'ShortCut'#4'9'#160#0#0#0#1#7'Command'#7#12'EcFo'
-  +'ldLevel0'#8'ShortCut'#4'0'#160#0#0#0#1#7'Command'#7#13'EcFoldCurrent'#8'Sho'
-  +'rtCut'#4'-'#160#0#0#0#1#7'Command'#7#15'EcUnFoldCurrent'#8'ShortCut'#4'+'
-  +#160#0#0#0#1#7'Command'#7#18'EcToggleMarkupWord'#8'ShortCut'#4'M'#128#0#0#0#1
-  +#7'Command'#7#14'ecNormalSelect'#8'ShortCut'#3'N`'#0#1#7'Command'#7#14'ecCol'
-  +'umnSelect'#8'ShortCut'#3'C`'#0#1#7'Command'#7#12'ecLineSelect'#8'ShortCut'#3
-  +'L`'#0#1#7'Command'#7#5'ecTab'#8'ShortCut'#2#9#0#1#7'Command'#7#10'ecShiftTa'
-  +'b'#8'ShortCut'#3#9' '#0#1#7'Command'#7#14'ecMatchBracket'#8'ShortCut'#3'B`'
-  +#0#1#7'Command'#7#10'ecColSelUp'#8'ShortCut'#4'&'#160#0#0#0#1#7'Command'#7#12
-  +'ecColSelDown'#8'ShortCut'#4'('#160#0#0#0#1#7'Command'#7#12'ecColSelLeft'#8
-  +'ShortCut'#4'%'#160#0#0#0#1#7'Command'#7#13'ecColSelRight'#8'ShortCut'#4''''
-  +#160#0#0#0#1#7'Command'#7#16'ecColSelPageDown'#8'ShortCut'#4'"'#160#0#0#0#1#7
-  +'Command'#7#18'ecColSelPageBottom'#8'ShortCut'#4'"'#224#0#0#0#1#7'Command'#7
-  +#14'ecColSelPageUp'#8'ShortCut'#4'!'#160#0#0#0#1#7'Command'#7#15'ecColSelPag'
-  +'eTop'#8'ShortCut'#4'!'#224#0#0#0#1#7'Command'#7#17'ecColSelLineStart'#8'Sho'
-  +'rtCut'#4'$'#160#0#0#0#1#7'Command'#7#15'ecColSelLineEnd'#8'ShortCut'#4'#'
-  +#160#0#0#0#1#7'Command'#7#17'ecColSelEditorTop'#8'ShortCut'#4'$'#224#0#0#0#1
-  +#7'Command'#7#20'ecColSelEditorBottom'#8'ShortCut'#4'#'#224#0#0#0#0#12'Mouse'
-  +'Actions'#14#1#5'Shift'#11#0#9'ShiftMask'#11#7'ssShift'#5'ssAlt'#0#6'Button'
-  +#7#6'mbLeft'#10'ClickCount'#7#8'ccSingle'#8'ClickDir'#7#6'cdDown'#7'Command'
-  +#2#1#9'MoveCaret'#9#6'Option'#2#0#8'Priority'#2#0#0#1#5'Shift'#11#7'ssShift'
-  +#0#9'ShiftMask'#11#7'ssShift'#5'ssAlt'#0#6'Button'#7#6'mbLeft'#10'ClickCount'
-  +#7#8'ccSingle'#8'ClickDir'#7#6'cdDown'#7'Command'#2#1#9'MoveCaret'#9#6'Optio'
-  +'n'#2#1#8'Priority'#2#0#0#1#5'Shift'#11#5'ssAlt'#0#9'ShiftMask'#11#7'ssShift'
-  +#5'ssAlt'#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#8'ccSingle'#8'ClickDir'#7
-  +#6'cdDown'#7'Command'#2#3#9'MoveCaret'#9#6'Option'#2#0#8'Priority'#2#0#0#1#5
-  +'Shift'#11#7'ssShift'#5'ssAlt'#0#9'ShiftMask'#11#7'ssShift'#5'ssAlt'#0#6'But'
-  +'ton'#7#6'mbLeft'#10'ClickCount'#7#8'ccSingle'#8'ClickDir'#7#6'cdDown'#7'Com'
-  +'mand'#2#3#9'MoveCaret'#9#6'Option'#2#1#8'Priority'#2#0#0#1#5'Shift'#11#0#9
-  +'ShiftMask'#11#0#6'Button'#7#7'mbRight'#10'ClickCount'#7#8'ccSingle'#8'Click'
-  +'Dir'#7#4'cdUp'#7'Command'#2#12#9'MoveCaret'#8#6'Option'#2#0#8'Priority'#2#0
-  +#0#1#5'Shift'#11#0#9'ShiftMask'#11#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#8
-  +'ccDouble'#8'ClickDir'#7#6'cdDown'#7'Command'#2#6#9'MoveCaret'#9#6'Option'#2
-  +#0#8'Priority'#2#0#0#1#5'Shift'#11#0#9'ShiftMask'#11#0#6'Button'#7#6'mbLeft'
-  +#10'ClickCount'#7#8'ccTriple'#8'ClickDir'#7#6'cdDown'#7'Command'#2#7#9'MoveC'
-  +'aret'#9#6'Option'#2#0#8'Priority'#2#0#0#1#5'Shift'#11#0#9'ShiftMask'#11#0#6
-  +'Button'#7#6'mbLeft'#10'ClickCount'#7#6'ccQuad'#8'ClickDir'#7#6'cdDown'#7'Co'
-  +'mmand'#2#8#9'MoveCaret'#9#6'Option'#2#0#8'Priority'#2#0#0#1#5'Shift'#11#0#9
-  +'ShiftMask'#11#0#6'Button'#7#8'mbMiddle'#10'ClickCount'#7#8'ccSingle'#8'Clic'
-  +'kDir'#7#6'cdDown'#7'Command'#2#10#9'MoveCaret'#9#6'Option'#2#0#8'Priority'#2
-  +#0#0#1#5'Shift'#11#6'ssCtrl'#0#9'ShiftMask'#11#7'ssShift'#5'ssAlt'#6'ssCtrl'
-  +#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#8'ccSingle'#8'ClickDir'#7#4'cdUp'#7
-  +'Command'#2#11#9'MoveCaret'#8#6'Option'#2#0#8'Priority'#2#0#0#0#15'MouseSelA'
-  +'ctions'#14#1#5'Shift'#11#0#9'ShiftMask'#11#0#6'Button'#7#6'mbLeft'#10'Click'
-  +'Count'#7#8'ccSingle'#8'ClickDir'#7#6'cdDown'#7'Command'#2#9#9'MoveCaret'#8#6
-  +'Option'#2#0#8'Priority'#2#0#0#0#8'ReadOnly'#9#9'RightEdge'#2'x'#14'RightEdg'
-  +'eColor'#4#240#205#205#0#21'BracketHighlightStyle'#7#8'sbhsBoth'#0#244#18'TS'
-  +'ynGutterPartList'#0#0#20'TSynGutterLineNumber'#0#5'Width'#2#17#12'MouseActi'
-  ,'ons'#14#0#21'MarkupInfo.Background'#4#241#226#210#0#21'MarkupInfo.Foregroun'
-  +'d'#7#6'clNone'#10'DigitCount'#2#2#30'ShowOnlyLineNumbersMultiplesOf'#2#1#9
-  +'ZeroStart'#8#12'LeadingZeros'#8#0#0#0#0#5'TEdit'#6'edName'#4'Left'#3#144#0#6
-  +'Height'#2#21#3'Top'#2#15#5'Width'#3#240#0#10'AutoSelect'#8#11'BorderStyle'#7
-  +#6'bsNone'#10'Font.Color'#7#6'clNavy'#10'ParentFont'#8#8'ReadOnly'#9#8'TabOr'
-  +'der'#2#1#4'Text'#6#9'edGenName'#0#0#5'TEdit'#7'edOwner'#4'Left'#3#144#0#6'H'
-  +'eight'#2#21#3'Top'#2'0'#5'Width'#3#168#0#10'AutoSelect'#8#11'BorderStyle'#7
-  +#6'bsNone'#10'Font.Color'#7#6'clNavy'#10'ParentFont'#8#8'ReadOnly'#9#8'TabOr'
-  +'der'#2#2#4'Text'#6#9'edGenName'#0#0#7'TBitBtn'#7'bbClose'#4'Left'#3#247#1#6
-  +'Height'#2#24#3'Top'#2#3#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#3#0#0#10'TSynSQL'
-  +'Syn'#10'SynSQLSyn1'#13'DefaultFilter'#6#23'SQL Files (*.sql)|*.sql'#7'Enabl'
-  +'ed'#8#23'CommentAttri.Foreground'#7#6'clTeal'#23'CommentAttri.FrameEdges'#7
-  +#9'sfeAround'#24'DataTypeAttri.FrameEdges'#7#9'sfeAround'#30'DefaultPackageA'
-  +'ttri.FrameEdges'#7#9'sfeAround'#25'ExceptionAttri.FrameEdges'#7#9'sfeAround'
-  +#24'FunctionAttri.FrameEdges'#7#9'sfeAround'#26'IdentifierAttri.Foreground'#4
-  +'1'#26#255#0#26'IdentifierAttri.FrameEdges'#7#9'sfeAround'#19'KeyAttri.Frame'
-  +'Edges'#7#9'sfeAround'#22'NumberAttri.Foreground'#7#9'clMedGray'#22'NumberAt'
-  +'tri.FrameEdges'#7#9'sfeAround'#21'PLSQLAttri.FrameEdges'#7#9'sfeAround'#21
-  +'SpaceAttri.FrameEdges'#7#9'sfeAround'#23'SQLPlusAttri.FrameEdges'#7#9'sfeAr'
-  +'ound'#22'StringAttri.Foreground'#4#161#16#16#0#22'StringAttri.FrameEdges'#7
-  +#9'sfeAround'#22'SymbolAttri.Foreground'#4'b'#8#8#0#22'SymbolAttri.FrameEdge'
-  +'s'#7#9'sfeAround'#25'TableNameAttri.Foreground'#7#6'clNavy'#25'TableNameAtt'
-  +'ri.FrameEdges'#7#9'sfeAround'#20'TableNameAttri.Style'#11#6'fsBold'#0#24'Va'
-  +'riableAttri.FrameEdges'#7#9'sfeAround'#10'SQLDialect'#7#9'sqlSybase'#4'left'
-  +#3#168#1#3'top'#3#228#0#0#0#0
+  +#164#1#11'ClientWidth'#3#18#2#10'KeyPreview'#9#7'OnClose'#7#9'FormClose'#9'O'
+  +'nKeyDown'#7#11'FormKeyDown'#8'Position'#7#14'poScreenCenter'#10'LCLVersion'
+  +#6#7'1.2.0.3'#0#6'TLabel'#6'Label1'#4'Left'#2#11#6'Height'#2#13#3'Top'#2#15#5
+  +'Width'#2'T'#7'Caption'#6#16'Stored Procedure'#11'ParentColor'#8#0#0#6'TLabe'
+  +'l'#6'Label2'#4'Left'#2#11#6'Height'#2#13#3'Top'#2'O'#5'Width'#2#24#7'Captio'
+  +'n'#6#4'Body'#11'ParentColor'#8#0#0#6'TLabel'#6'Label3'#4'Left'#2#11#6'Heigh'
+  +'t'#2#13#3'Top'#2'0'#5'Width'#2' '#7'Caption'#6#5'Owner'#11'ParentColor'#8#0
+  +#0#244#8'TSynEdit'#8'seScript'#4'Left'#2#11#6'Height'#3'8'#1#3'Top'#2'`'#5'W'
+  +'idth'#3#1#2#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#11'Fo'
+  +'nt.Height'#2#243#9'Font.Name'#6#11'Courier New'#10'Font.Pitch'#7#7'fpFixed'
+  +#12'Font.Quality'#7#16'fqNonAntialiased'#11'ParentColor'#8#10'ParentFont'#8#8
+  +'TabOrder'#2#0#12'Gutter.Color'#4#249#242#234#0#12'Gutter.Width'#2#17#19'Gut'
+  +'ter.MouseActions'#14#1#10'ClickCount'#7#5'ccAny'#8'ClickDir'#7#6'cdDown'#7
+  +'Command'#7#20'emcOnMainGutterClick'#0#1#6'Button'#7#7'mbRight'#7'Command'#7
+  +#14'emcContextMenu'#0#0#17'RightGutter.Width'#2#0#24'RightGutter.MouseAction'
+  +'s'#14#1#10'ClickCount'#7#5'ccAny'#8'ClickDir'#7#6'cdDown'#7'Command'#7#20'e'
+  +'mcOnMainGutterClick'#0#1#6'Button'#7#7'mbRight'#7'Command'#7#14'emcContextM'
+  +'enu'#0#0#11'Highlighter'#7#10'SynSQLSyn1'#10'Keystrokes'#14#1#7'Command'#7#4
+  +'ecUp'#8'ShortCut'#2'&'#0#1#7'Command'#7#7'ecSelUp'#8'ShortCut'#3'& '#0#1#7
+  +'Command'#7#10'ecScrollUp'#8'ShortCut'#3'&@'#0#1#7'Command'#7#6'ecDown'#8'Sh'
+  +'ortCut'#2'('#0#1#7'Command'#7#9'ecSelDown'#8'ShortCut'#3'( '#0#1#7'Command'
+  +#7#12'ecScrollDown'#8'ShortCut'#3'(@'#0#1#7'Command'#7#6'ecLeft'#8'ShortCut'
+  +#2'%'#0#1#7'Command'#7#9'ecSelLeft'#8'ShortCut'#3'% '#0#1#7'Command'#7#10'ec'
+  +'WordLeft'#8'ShortCut'#3'%@'#0#1#7'Command'#7#13'ecSelWordLeft'#8'ShortCut'#3
+  +'%`'#0#1#7'Command'#7#7'ecRight'#8'ShortCut'#2''''#0#1#7'Command'#7#10'ecSel'
+  +'Right'#8'ShortCut'#3''' '#0#1#7'Command'#7#11'ecWordRight'#8'ShortCut'#3''''
+  +'@'#0#1#7'Command'#7#14'ecSelWordRight'#8'ShortCut'#3'''`'#0#1#7'Command'#7
+  +#10'ecPageDown'#8'ShortCut'#2'"'#0#1#7'Command'#7#13'ecSelPageDown'#8'ShortC'
+  +'ut'#3'" '#0#1#7'Command'#7#12'ecPageBottom'#8'ShortCut'#3'"@'#0#1#7'Command'
+  +#7#15'ecSelPageBottom'#8'ShortCut'#3'"`'#0#1#7'Command'#7#8'ecPageUp'#8'Shor'
+  +'tCut'#2'!'#0#1#7'Command'#7#11'ecSelPageUp'#8'ShortCut'#3'! '#0#1#7'Command'
+  +#7#9'ecPageTop'#8'ShortCut'#3'!@'#0#1#7'Command'#7#12'ecSelPageTop'#8'ShortC'
+  +'ut'#3'!`'#0#1#7'Command'#7#11'ecLineStart'#8'ShortCut'#2'$'#0#1#7'Command'#7
+  +#14'ecSelLineStart'#8'ShortCut'#3'$ '#0#1#7'Command'#7#11'ecEditorTop'#8'Sho'
+  +'rtCut'#3'$@'#0#1#7'Command'#7#14'ecSelEditorTop'#8'ShortCut'#3'$`'#0#1#7'Co'
+  +'mmand'#7#9'ecLineEnd'#8'ShortCut'#2'#'#0#1#7'Command'#7#12'ecSelLineEnd'#8
+  +'ShortCut'#3'# '#0#1#7'Command'#7#14'ecEditorBottom'#8'ShortCut'#3'#@'#0#1#7
+  +'Command'#7#17'ecSelEditorBottom'#8'ShortCut'#3'#`'#0#1#7'Command'#7#12'ecTo'
+  +'ggleMode'#8'ShortCut'#2'-'#0#1#7'Command'#7#6'ecCopy'#8'ShortCut'#3'-@'#0#1
+  +#7'Command'#7#7'ecPaste'#8'ShortCut'#3'- '#0#1#7'Command'#7#12'ecDeleteChar'
+  +#8'ShortCut'#2'.'#0#1#7'Command'#7#5'ecCut'#8'ShortCut'#3'. '#0#1#7'Command'
+  +#7#16'ecDeleteLastChar'#8'ShortCut'#2#8#0#1#7'Command'#7#16'ecDeleteLastChar'
+  +#8'ShortCut'#3#8' '#0#1#7'Command'#7#16'ecDeleteLastWord'#8'ShortCut'#3#8'@'
+  +#0#1#7'Command'#7#6'ecUndo'#8'ShortCut'#4#8#128#0#0#0#1#7'Command'#7#6'ecRed'
+  +'o'#8'ShortCut'#4#8#160#0#0#0#1#7'Command'#7#11'ecLineBreak'#8'ShortCut'#2#13
+  +#0#1#7'Command'#7#11'ecSelectAll'#8'ShortCut'#3'A@'#0#1#7'Command'#7#6'ecCop'
+  +'y'#8'ShortCut'#3'C@'#0#1#7'Command'#7#13'ecBlockIndent'#8'ShortCut'#3'I`'#0
+  +#1#7'Command'#7#11'ecLineBreak'#8'ShortCut'#3'M@'#0#1#7'Command'#7#12'ecInse'
+  +'rtLine'#8'ShortCut'#3'N@'#0#1#7'Command'#7#12'ecDeleteWord'#8'ShortCut'#3'T'
+  +'@'#0#1#7'Command'#7#15'ecBlockUnindent'#8'ShortCut'#3'U`'#0#1#7'Command'#7#7
+  +'ecPaste'#8'ShortCut'#3'V@'#0#1#7'Command'#7#5'ecCut'#8'ShortCut'#3'X@'#0#1#7
+  +'Command'#7#12'ecDeleteLine'#8'ShortCut'#3'Y@'#0#1#7'Command'#7#11'ecDeleteE'
+  +'OL'#8'ShortCut'#3'Y`'#0#1#7'Command'#7#6'ecUndo'#8'ShortCut'#3'Z@'#0#1#7'Co'
+  +'mmand'#7#6'ecRedo'#8'ShortCut'#3'Z`'#0#1#7'Command'#7#13'ecGotoMarker0'#8'S'
+  +'hortCut'#3'0@'#0#1#7'Command'#7#13'ecGotoMarker1'#8'ShortCut'#3'1@'#0#1#7'C'
+  +'ommand'#7#13'ecGotoMarker2'#8'ShortCut'#3'2@'#0#1#7'Command'#7#13'ecGotoMar'
+  +'ker3'#8'ShortCut'#3'3@'#0#1#7'Command'#7#13'ecGotoMarker4'#8'ShortCut'#3'4@'
+  +#0#1#7'Command'#7#13'ecGotoMarker5'#8'ShortCut'#3'5@'#0#1#7'Command'#7#13'ec'
+  +'GotoMarker6'#8'ShortCut'#3'6@'#0#1#7'Command'#7#13'ecGotoMarker7'#8'ShortCu'
+  +'t'#3'7@'#0#1#7'Command'#7#13'ecGotoMarker8'#8'ShortCut'#3'8@'#0#1#7'Command'
+  +#7#13'ecGotoMarker9'#8'ShortCut'#3'9@'#0#1#7'Command'#7#12'ecSetMarker0'#8'S'
+  +'hortCut'#3'0`'#0#1#7'Command'#7#12'ecSetMarker1'#8'ShortCut'#3'1`'#0#1#7'Co'
+  ,'mmand'#7#12'ecSetMarker2'#8'ShortCut'#3'2`'#0#1#7'Command'#7#12'ecSetMarker'
+  +'3'#8'ShortCut'#3'3`'#0#1#7'Command'#7#12'ecSetMarker4'#8'ShortCut'#3'4`'#0#1
+  +#7'Command'#7#12'ecSetMarker5'#8'ShortCut'#3'5`'#0#1#7'Command'#7#12'ecSetMa'
+  +'rker6'#8'ShortCut'#3'6`'#0#1#7'Command'#7#12'ecSetMarker7'#8'ShortCut'#3'7`'
+  +#0#1#7'Command'#7#12'ecSetMarker8'#8'ShortCut'#3'8`'#0#1#7'Command'#7#12'ecS'
+  +'etMarker9'#8'ShortCut'#3'9`'#0#1#7'Command'#7#12'EcFoldLevel1'#8'ShortCut'#4
+  +'1'#160#0#0#0#1#7'Command'#7#12'EcFoldLevel2'#8'ShortCut'#4'2'#160#0#0#0#1#7
+  +'Command'#7#12'EcFoldLevel1'#8'ShortCut'#4'3'#160#0#0#0#1#7'Command'#7#12'Ec'
+  +'FoldLevel1'#8'ShortCut'#4'4'#160#0#0#0#1#7'Command'#7#12'EcFoldLevel1'#8'Sh'
+  +'ortCut'#4'5'#160#0#0#0#1#7'Command'#7#12'EcFoldLevel6'#8'ShortCut'#4'6'#160
+  +#0#0#0#1#7'Command'#7#12'EcFoldLevel7'#8'ShortCut'#4'7'#160#0#0#0#1#7'Comman'
+  +'d'#7#12'EcFoldLevel8'#8'ShortCut'#4'8'#160#0#0#0#1#7'Command'#7#12'EcFoldLe'
+  +'vel9'#8'ShortCut'#4'9'#160#0#0#0#1#7'Command'#7#12'EcFoldLevel0'#8'ShortCut'
+  +#4'0'#160#0#0#0#1#7'Command'#7#13'EcFoldCurrent'#8'ShortCut'#4'-'#160#0#0#0#1
+  +#7'Command'#7#15'EcUnFoldCurrent'#8'ShortCut'#4'+'#160#0#0#0#1#7'Command'#7
+  +#18'EcToggleMarkupWord'#8'ShortCut'#4'M'#128#0#0#0#1#7'Command'#7#14'ecNorma'
+  +'lSelect'#8'ShortCut'#3'N`'#0#1#7'Command'#7#14'ecColumnSelect'#8'ShortCut'#3
+  +'C`'#0#1#7'Command'#7#12'ecLineSelect'#8'ShortCut'#3'L`'#0#1#7'Command'#7#5
+  +'ecTab'#8'ShortCut'#2#9#0#1#7'Command'#7#10'ecShiftTab'#8'ShortCut'#3#9' '#0
+  +#1#7'Command'#7#14'ecMatchBracket'#8'ShortCut'#3'B`'#0#1#7'Command'#7#10'ecC'
+  +'olSelUp'#8'ShortCut'#4'&'#160#0#0#0#1#7'Command'#7#12'ecColSelDown'#8'Short'
+  +'Cut'#4'('#160#0#0#0#1#7'Command'#7#12'ecColSelLeft'#8'ShortCut'#4'%'#160#0#0
+  +#0#1#7'Command'#7#13'ecColSelRight'#8'ShortCut'#4''''#160#0#0#0#1#7'Command'
+  +#7#16'ecColSelPageDown'#8'ShortCut'#4'"'#160#0#0#0#1#7'Command'#7#18'ecColSe'
+  +'lPageBottom'#8'ShortCut'#4'"'#224#0#0#0#1#7'Command'#7#14'ecColSelPageUp'#8
+  +'ShortCut'#4'!'#160#0#0#0#1#7'Command'#7#15'ecColSelPageTop'#8'ShortCut'#4'!'
+  +#224#0#0#0#1#7'Command'#7#17'ecColSelLineStart'#8'ShortCut'#4'$'#160#0#0#0#1
+  +#7'Command'#7#15'ecColSelLineEnd'#8'ShortCut'#4'#'#160#0#0#0#1#7'Command'#7
+  +#17'ecColSelEditorTop'#8'ShortCut'#4'$'#224#0#0#0#1#7'Command'#7#20'ecColSel'
+  +'EditorBottom'#8'ShortCut'#4'#'#224#0#0#0#0#12'MouseActions'#14#1#9'ShiftMas'
+  +'k'#11#7'ssShift'#5'ssAlt'#0#8'ClickDir'#7#6'cdDown'#7'Command'#7#18'emcStar'
+  +'tSelections'#9'MoveCaret'#9#0#1#5'Shift'#11#7'ssShift'#0#9'ShiftMask'#11#7
+  +'ssShift'#5'ssAlt'#0#8'ClickDir'#7#6'cdDown'#7'Command'#7#18'emcStartSelecti'
+  +'ons'#9'MoveCaret'#9#6'Option'#2#1#0#1#5'Shift'#11#5'ssAlt'#0#9'ShiftMask'#11
+  +#7'ssShift'#5'ssAlt'#0#8'ClickDir'#7#6'cdDown'#7'Command'#7#24'emcStartColum'
+  +'nSelections'#9'MoveCaret'#9#0#1#5'Shift'#11#7'ssShift'#5'ssAlt'#0#9'ShiftMa'
+  +'sk'#11#7'ssShift'#5'ssAlt'#0#8'ClickDir'#7#6'cdDown'#7'Command'#7#24'emcSta'
+  +'rtColumnSelections'#9'MoveCaret'#9#6'Option'#2#1#0#1#6'Button'#7#7'mbRight'
+  +#7'Command'#7#14'emcContextMenu'#0#1#10'ClickCount'#7#8'ccDouble'#8'ClickDir'
+  +#7#6'cdDown'#7'Command'#7#13'emcSelectWord'#9'MoveCaret'#9#0#1#10'ClickCount'
+  +#7#8'ccTriple'#8'ClickDir'#7#6'cdDown'#7'Command'#7#13'emcSelectLine'#9'Move'
+  +'Caret'#9#0#1#10'ClickCount'#7#6'ccQuad'#8'ClickDir'#7#6'cdDown'#7'Command'#7
+  +#13'emcSelectPara'#9'MoveCaret'#9#0#1#6'Button'#7#8'mbMiddle'#8'ClickDir'#7#6
+  +'cdDown'#7'Command'#7#17'emcPasteSelection'#9'MoveCaret'#9#0#1#5'Shift'#11#6
+  +'ssCtrl'#0#9'ShiftMask'#11#7'ssShift'#5'ssAlt'#6'ssCtrl'#0#7'Command'#7#12'e'
+  +'mcMouseLink'#0#0#15'MouseSelActions'#14#1#8'ClickDir'#7#6'cdDown'#7'Command'
+  +#7#16'emcStartDragMove'#0#0#19'VisibleSpecialChars'#11#8'vscSpace'#12'vscTab'
+  +'AtLast'#0#8'ReadOnly'#9#9'RightEdge'#2'x'#14'RightEdgeColor'#4#240#205#205#0
+  +#24'SelectedColor.FrameEdges'#7#9'sfeAround'#26'SelectedColor.BackPriority'#2
+  +'2'#26'SelectedColor.ForePriority'#2'2'#27'SelectedColor.FramePriority'#2'2'
+  +#26'SelectedColor.BoldPriority'#2'2'#28'SelectedColor.ItalicPriority'#2'2'#31
+  +'SelectedColor.UnderlinePriority'#2'2'#31'SelectedColor.StrikeOutPriority'#2
+  +'2'#25'IncrementColor.FrameEdges'#7#9'sfeAround'#28'HighlightAllColor.FrameE'
+  +'dges'#7#9'sfeAround'#21'BracketHighlightStyle'#7#8'sbhsBoth'#28'BracketMatc'
+  +'hColor.Background'#7#6'clNone'#28'BracketMatchColor.Foreground'#7#6'clNone'
+  +#28'BracketMatchColor.FrameEdges'#7#9'sfeAround'#23'BracketMatchColor.Style'
+  +#11#6'fsBold'#0#26'FoldedCodeColor.Background'#7#6'clNone'#26'FoldedCodeColo'
+  +'r.Foreground'#7#6'clGray'#26'FoldedCodeColor.FrameColor'#7#6'clGray'#26'Fol'
+  +'dedCodeColor.FrameEdges'#7#9'sfeAround'#25'MouseLinkColor.Background'#7#6'c'
+  +'lNone'#25'MouseLinkColor.Foreground'#7#6'clBlue'#25'MouseLinkColor.FrameEdg'
+  +'es'#7#9'sfeAround'#29'LineHighlightColor.Background'#7#6'clNone'#29'LineHig'
+  +'hlightColor.Foreground'#7#6'clNone'#29'LineHighlightColor.FrameEdges'#7#9's'
+  +'feAround'#0#244#18'TSynGutterPartList'#0#0#20'TSynGutterLineNumber'#0#5'Wid'
+  +'th'#2#17#12'MouseActions'#14#0#21'MarkupInfo.Background'#4#241#226#210#0#21
+  ,'MarkupInfo.Foreground'#7#6'clNone'#21'MarkupInfo.FrameEdges'#7#9'sfeAround'
+  +#10'DigitCount'#2#2#30'ShowOnlyLineNumbersMultiplesOf'#2#1#9'ZeroStart'#8#12
+  +'LeadingZeros'#8#0#0#0#0#5'TEdit'#6'edName'#4'Left'#3#144#0#6'Height'#2#13#3
+  +'Top'#2#15#5'Width'#3#240#0#10'AutoSelect'#8#11'BorderStyle'#7#6'bsNone'#10
+  +'Font.Color'#7#6'clNavy'#10'ParentFont'#8#8'ReadOnly'#9#8'TabOrder'#2#1#4'Te'
+  +'xt'#6#9'edGenName'#0#0#5'TEdit'#7'edOwner'#4'Left'#3#144#0#6'Height'#2#13#3
+  +'Top'#2'0'#5'Width'#3#168#0#10'AutoSelect'#8#11'BorderStyle'#7#6'bsNone'#10
+  +'Font.Color'#7#6'clNavy'#10'ParentFont'#8#8'ReadOnly'#9#8'TabOrder'#2#2#4'Te'
+  +'xt'#6#9'edGenName'#0#0#7'TBitBtn'#7'bbClose'#4'Left'#3#247#1#6'Height'#2#24
+  +#3'Top'#2#3#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#3#0#0#10'TSynSQLSyn'#10'SynSQL'
+  +'Syn1'#13'DefaultFilter'#6#23'SQL Files (*.sql)|*.sql'#7'Enabled'#8#23'Comme'
+  +'ntAttri.Foreground'#7#6'clTeal'#23'CommentAttri.FrameEdges'#7#9'sfeAround'
+  +#24'DataTypeAttri.FrameEdges'#7#9'sfeAround'#30'DefaultPackageAttri.FrameEdg'
+  +'es'#7#9'sfeAround'#25'ExceptionAttri.FrameEdges'#7#9'sfeAround'#24'Function'
+  +'Attri.FrameEdges'#7#9'sfeAround'#26'IdentifierAttri.Foreground'#4'1'#26#255
+  +#0#26'IdentifierAttri.FrameEdges'#7#9'sfeAround'#19'KeyAttri.FrameEdges'#7#9
+  +'sfeAround'#22'NumberAttri.Foreground'#7#9'clMedGray'#22'NumberAttri.FrameEd'
+  +'ges'#7#9'sfeAround'#21'PLSQLAttri.FrameEdges'#7#9'sfeAround'#21'SpaceAttri.'
+  +'FrameEdges'#7#9'sfeAround'#23'SQLPlusAttri.FrameEdges'#7#9'sfeAround'#22'St'
+  +'ringAttri.Foreground'#4#161#16#16#0#22'StringAttri.FrameEdges'#7#9'sfeAroun'
+  +'d'#22'SymbolAttri.Foreground'#4'b'#8#8#0#22'SymbolAttri.FrameEdges'#7#9'sfe'
+  +'Around'#25'TableNameAttri.Foreground'#7#6'clNavy'#25'TableNameAttri.FrameEd'
+  +'ges'#7#9'sfeAround'#20'TableNameAttri.Style'#11#6'fsBold'#0#24'VariableAttr'
+  +'i.FrameEdges'#7#9'sfeAround'#10'SQLDialect'#7#9'sqlSybase'#4'left'#3#168#1#3
+  +'top'#3#228#0#0#0#0
 ]);
 ]);

+ 17 - 1
viewsproc.pas

@@ -6,7 +6,7 @@ interface
 
 
 uses
 uses
   Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
   Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
-  StdCtrls, Buttons, SynEdit, SynHighlighterSQL;
+  StdCtrls, Buttons, SynEdit, SynHighlighterSQL, LCLType;
 
 
 type
 type
 
 
@@ -23,6 +23,7 @@ type
     SynSQLSyn1: TSynSQLSyn;
     SynSQLSyn1: TSynSQLSyn;
     procedure bbCloseClick(Sender: TObject);
     procedure bbCloseClick(Sender: TObject);
     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
+    procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
   private
   private
     { private declarations }
     { private declarations }
   public
   public
@@ -41,6 +42,21 @@ begin
   CloseAction:= caFree;
   CloseAction:= caFree;
 end;
 end;
 
 
+procedure TfmViewSProc.FormKeyDown(Sender: TObject; var Key: Word;
+  Shift: TShiftState);
+begin
+  if (ssCtrl in Shift) and
+    ((Key=VK_F4) or (Key=VK_W)) then
+  begin
+    if MessageDlg('Do you want to close this query window?', mtConfirmation, [mbNo, mbYes], 0) = mrYes then
+    begin
+      // Close when pressing Ctrl-W or Ctrl-F4 (Cmd-W/Cmd-F4 on OSX)
+      Close;
+      Parent.Free;
+    end;
+  end;
+end;
+
 procedure TfmViewSProc.bbCloseClick(Sender: TObject);
 procedure TfmViewSProc.bbCloseClick(Sender: TObject);
 begin
 begin
   Close;
   Close;

+ 68 - 121
viewtrigger.lfm

@@ -6,46 +6,48 @@ object fmViewTrigger: TfmViewTrigger
   Caption = 'fmViewTrigger'
   Caption = 'fmViewTrigger'
   ClientHeight = 300
   ClientHeight = 300
   ClientWidth = 667
   ClientWidth = 667
+  KeyPreview = True
   OnClose = FormClose
   OnClose = FormClose
+  OnKeyDown = FormKeyDown
   Position = poScreenCenter
   Position = poScreenCenter
-  LCLVersion = '0.9.31'
+  LCLVersion = '1.2.0.3'
   object Label1: TLabel
   object Label1: TLabel
     Left = 11
     Left = 11
-    Height = 18
+    Height = 13
     Top = 15
     Top = 15
-    Width = 91
+    Width = 64
     Caption = 'Trigger Name'
     Caption = 'Trigger Name'
     ParentColor = False
     ParentColor = False
   end
   end
   object Label2: TLabel
   object Label2: TLabel
     Left = 11
     Left = 11
-    Height = 18
+    Height = 13
     Top = 96
     Top = 96
-    Width = 35
+    Width = 24
     Caption = 'Body'
     Caption = 'Body'
     ParentColor = False
     ParentColor = False
   end
   end
   object Label3: TLabel
   object Label3: TLabel
     Left = 11
     Left = 11
-    Height = 18
+    Height = 13
     Top = 42
     Top = 42
-    Width = 59
+    Width = 43
     Caption = 'On Table'
     Caption = 'On Table'
     ParentColor = False
     ParentColor = False
   end
   end
   object Label4: TLabel
   object Label4: TLabel
     Left = 397
     Left = 397
-    Height = 18
+    Height = 13
     Top = 15
     Top = 15
-    Width = 60
+    Width = 45
     Caption = 'On Event'
     Caption = 'On Event'
     ParentColor = False
     ParentColor = False
   end
   end
   object laEvent: TLabel
   object laEvent: TLabel
     Left = 474
     Left = 474
-    Height = 18
+    Height = 13
     Top = 15
     Top = 15
-    Width = 100
+    Width = 69
     Caption = 'laTriggerName'
     Caption = 'laTriggerName'
     Font.Color = 10234153
     Font.Color = 10234153
     ParentColor = False
     ParentColor = False
@@ -53,17 +55,17 @@ object fmViewTrigger: TfmViewTrigger
   end
   end
   object Label5: TLabel
   object Label5: TLabel
     Left = 397
     Left = 397
-    Height = 18
+    Height = 13
     Top = 43
     Top = 43
-    Width = 33
+    Width = 24
     Caption = 'Type'
     Caption = 'Type'
     ParentColor = False
     ParentColor = False
   end
   end
   object laType: TLabel
   object laType: TLabel
     Left = 474
     Left = 474
-    Height = 18
+    Height = 13
     Top = 43
     Top = 43
-    Width = 100
+    Width = 69
     Caption = 'laTriggerName'
     Caption = 'laTriggerName'
     Font.Color = 10234153
     Font.Color = 10234153
     ParentColor = False
     ParentColor = False
@@ -71,17 +73,17 @@ object fmViewTrigger: TfmViewTrigger
   end
   end
   object Label6: TLabel
   object Label6: TLabel
     Left = 397
     Left = 397
-    Height = 18
+    Height = 13
     Top = 72
     Top = 72
-    Width = 55
+    Width = 38
     Caption = 'Enabled'
     Caption = 'Enabled'
     ParentColor = False
     ParentColor = False
   end
   end
   object laEnabled: TLabel
   object laEnabled: TLabel
     Left = 474
     Left = 474
-    Height = 18
+    Height = 13
     Top = 72
     Top = 72
-    Width = 100
+    Width = 69
     Caption = 'laTriggerName'
     Caption = 'laTriggerName'
     Font.Color = 10234153
     Font.Color = 10234153
     ParentColor = False
     ParentColor = False
@@ -89,18 +91,18 @@ object fmViewTrigger: TfmViewTrigger
   end
   end
   object Label7: TLabel
   object Label7: TLabel
     Left = 11
     Left = 11
-    Height = 18
+    Height = 13
     Top = 72
     Top = 72
-    Width = 57
+    Width = 37
     Caption = 'Position'
     Caption = 'Position'
     DragCursor = crAppStart
     DragCursor = crAppStart
     ParentColor = False
     ParentColor = False
   end
   end
   object laPos: TLabel
   object laPos: TLabel
     Left = 106
     Left = 106
-    Height = 18
+    Height = 13
     Top = 72
     Top = 72
-    Width = 100
+    Width = 69
     Caption = 'laTriggerName'
     Caption = 'laTriggerName'
     Font.Color = 10234153
     Font.Color = 10234153
     ParentColor = False
     ParentColor = False
@@ -123,50 +125,24 @@ object fmViewTrigger: TfmViewTrigger
     Gutter.Width = 17
     Gutter.Width = 17
     Gutter.MouseActions = <    
     Gutter.MouseActions = <    
       item
       item
-        Shift = []
-        ShiftMask = []
-        Button = mbLeft
         ClickCount = ccAny
         ClickCount = ccAny
         ClickDir = cdDown
         ClickDir = cdDown
-        Command = 13
-        MoveCaret = False
-        Option = 0
-        Priority = 0
+        Command = emcOnMainGutterClick
       end    
       end    
       item
       item
-        Shift = []
-        ShiftMask = []
         Button = mbRight
         Button = mbRight
-        ClickCount = ccSingle
-        ClickDir = cdUp
-        Command = 12
-        MoveCaret = False
-        Option = 0
-        Priority = 0
+        Command = emcContextMenu
       end>
       end>
     RightGutter.Width = 0
     RightGutter.Width = 0
     RightGutter.MouseActions = <    
     RightGutter.MouseActions = <    
       item
       item
-        Shift = []
-        ShiftMask = []
-        Button = mbLeft
         ClickCount = ccAny
         ClickCount = ccAny
         ClickDir = cdDown
         ClickDir = cdDown
-        Command = 13
-        MoveCaret = False
-        Option = 0
-        Priority = 0
+        Command = emcOnMainGutterClick
       end    
       end    
       item
       item
-        Shift = []
-        ShiftMask = []
         Button = mbRight
         Button = mbRight
-        ClickCount = ccSingle
-        ClickDir = cdUp
-        Command = 12
-        MoveCaret = False
-        Option = 0
-        Priority = 0
+        Command = emcContextMenu
       end>
       end>
     Highlighter = SynSQLSyn1
     Highlighter = SynSQLSyn1
     Keystrokes = <    
     Keystrokes = <    
@@ -592,137 +568,108 @@ object fmViewTrigger: TfmViewTrigger
       end>
       end>
     MouseActions = <    
     MouseActions = <    
       item
       item
-        Shift = []
         ShiftMask = [ssShift, ssAlt]
         ShiftMask = [ssShift, ssAlt]
-        Button = mbLeft
-        ClickCount = ccSingle
         ClickDir = cdDown
         ClickDir = cdDown
-        Command = 1
+        Command = emcStartSelections
         MoveCaret = True
         MoveCaret = True
-        Option = 0
-        Priority = 0
       end    
       end    
       item
       item
         Shift = [ssShift]
         Shift = [ssShift]
         ShiftMask = [ssShift, ssAlt]
         ShiftMask = [ssShift, ssAlt]
-        Button = mbLeft
-        ClickCount = ccSingle
         ClickDir = cdDown
         ClickDir = cdDown
-        Command = 1
+        Command = emcStartSelections
         MoveCaret = True
         MoveCaret = True
         Option = 1
         Option = 1
-        Priority = 0
       end    
       end    
       item
       item
         Shift = [ssAlt]
         Shift = [ssAlt]
         ShiftMask = [ssShift, ssAlt]
         ShiftMask = [ssShift, ssAlt]
-        Button = mbLeft
-        ClickCount = ccSingle
         ClickDir = cdDown
         ClickDir = cdDown
-        Command = 3
+        Command = emcStartColumnSelections
         MoveCaret = True
         MoveCaret = True
-        Option = 0
-        Priority = 0
       end    
       end    
       item
       item
         Shift = [ssShift, ssAlt]
         Shift = [ssShift, ssAlt]
         ShiftMask = [ssShift, ssAlt]
         ShiftMask = [ssShift, ssAlt]
-        Button = mbLeft
-        ClickCount = ccSingle
         ClickDir = cdDown
         ClickDir = cdDown
-        Command = 3
+        Command = emcStartColumnSelections
         MoveCaret = True
         MoveCaret = True
         Option = 1
         Option = 1
-        Priority = 0
       end    
       end    
       item
       item
-        Shift = []
-        ShiftMask = []
         Button = mbRight
         Button = mbRight
-        ClickCount = ccSingle
-        ClickDir = cdUp
-        Command = 12
-        MoveCaret = False
-        Option = 0
-        Priority = 0
+        Command = emcContextMenu
       end    
       end    
       item
       item
-        Shift = []
-        ShiftMask = []
-        Button = mbLeft
         ClickCount = ccDouble
         ClickCount = ccDouble
         ClickDir = cdDown
         ClickDir = cdDown
-        Command = 6
+        Command = emcSelectWord
         MoveCaret = True
         MoveCaret = True
-        Option = 0
-        Priority = 0
       end    
       end    
       item
       item
-        Shift = []
-        ShiftMask = []
-        Button = mbLeft
         ClickCount = ccTriple
         ClickCount = ccTriple
         ClickDir = cdDown
         ClickDir = cdDown
-        Command = 7
+        Command = emcSelectLine
         MoveCaret = True
         MoveCaret = True
-        Option = 0
-        Priority = 0
       end    
       end    
       item
       item
-        Shift = []
-        ShiftMask = []
-        Button = mbLeft
         ClickCount = ccQuad
         ClickCount = ccQuad
         ClickDir = cdDown
         ClickDir = cdDown
-        Command = 8
+        Command = emcSelectPara
         MoveCaret = True
         MoveCaret = True
-        Option = 0
-        Priority = 0
       end    
       end    
       item
       item
-        Shift = []
-        ShiftMask = []
         Button = mbMiddle
         Button = mbMiddle
-        ClickCount = ccSingle
         ClickDir = cdDown
         ClickDir = cdDown
-        Command = 10
+        Command = emcPasteSelection
         MoveCaret = True
         MoveCaret = True
-        Option = 0
-        Priority = 0
       end    
       end    
       item
       item
         Shift = [ssCtrl]
         Shift = [ssCtrl]
         ShiftMask = [ssShift, ssAlt, ssCtrl]
         ShiftMask = [ssShift, ssAlt, ssCtrl]
-        Button = mbLeft
-        ClickCount = ccSingle
-        ClickDir = cdUp
-        Command = 11
-        MoveCaret = False
-        Option = 0
-        Priority = 0
+        Command = emcMouseLink
       end>
       end>
     MouseSelActions = <    
     MouseSelActions = <    
       item
       item
-        Shift = []
-        ShiftMask = []
-        Button = mbLeft
-        ClickCount = ccSingle
         ClickDir = cdDown
         ClickDir = cdDown
-        Command = 9
-        MoveCaret = False
-        Option = 0
-        Priority = 0
+        Command = emcStartDragMove
       end>
       end>
+    VisibleSpecialChars = [vscSpace, vscTabAtLast]
     ReadOnly = True
     ReadOnly = True
     RightEdge = 120
     RightEdge = 120
     RightEdgeColor = 13487600
     RightEdgeColor = 13487600
+    SelectedColor.FrameEdges = sfeAround
+    SelectedColor.BackPriority = 50
+    SelectedColor.ForePriority = 50
+    SelectedColor.FramePriority = 50
+    SelectedColor.BoldPriority = 50
+    SelectedColor.ItalicPriority = 50
+    SelectedColor.UnderlinePriority = 50
+    SelectedColor.StrikeOutPriority = 50
+    IncrementColor.FrameEdges = sfeAround
+    HighlightAllColor.FrameEdges = sfeAround
     BracketHighlightStyle = sbhsBoth
     BracketHighlightStyle = sbhsBoth
+    BracketMatchColor.Background = clNone
+    BracketMatchColor.Foreground = clNone
+    BracketMatchColor.FrameEdges = sfeAround
+    BracketMatchColor.Style = [fsBold]
+    FoldedCodeColor.Background = clNone
+    FoldedCodeColor.Foreground = clGray
+    FoldedCodeColor.FrameColor = clGray
+    FoldedCodeColor.FrameEdges = sfeAround
+    MouseLinkColor.Background = clNone
+    MouseLinkColor.Foreground = clBlue
+    MouseLinkColor.FrameEdges = sfeAround
+    LineHighlightColor.Background = clNone
+    LineHighlightColor.Foreground = clNone
+    LineHighlightColor.FrameEdges = sfeAround
     inline TSynGutterPartList
     inline TSynGutterPartList
       object TSynGutterLineNumber
       object TSynGutterLineNumber
         Width = 17
         Width = 17
         MouseActions = <>
         MouseActions = <>
         MarkupInfo.Background = 13820657
         MarkupInfo.Background = 13820657
         MarkupInfo.Foreground = clNone
         MarkupInfo.Foreground = clNone
+        MarkupInfo.FrameEdges = sfeAround
         DigitCount = 2
         DigitCount = 2
         ShowOnlyLineNumbersMultiplesOf = 1
         ShowOnlyLineNumbersMultiplesOf = 1
         ZeroStart = False
         ZeroStart = False
@@ -732,7 +679,7 @@ object fmViewTrigger: TfmViewTrigger
   end
   end
   object edName: TEdit
   object edName: TEdit
     Left = 106
     Left = 106
-    Height = 21
+    Height = 13
     Top = 12
     Top = 12
     Width = 262
     Width = 262
     AutoSelect = False
     AutoSelect = False
@@ -745,7 +692,7 @@ object fmViewTrigger: TfmViewTrigger
   end
   end
   object edOnTable: TEdit
   object edOnTable: TEdit
     Left = 106
     Left = 106
-    Height = 21
+    Height = 13
     Top = 42
     Top = 42
     Width = 214
     Width = 214
     AutoSelect = False
     AutoSelect = False

+ 171 - 169
viewtrigger.lrs

@@ -1,173 +1,175 @@
+{ This is an automatically generated lazarus resource file }
+
 LazarusResources.Add('TfmViewTrigger','FORMDATA',[
 LazarusResources.Add('TfmViewTrigger','FORMDATA',[
   'TPF0'#14'TfmViewTrigger'#13'fmViewTrigger'#4'Left'#3'j'#1#6'Height'#3','#1#3
   'TPF0'#14'TfmViewTrigger'#13'fmViewTrigger'#4'Left'#3'j'#1#6'Height'#3','#1#3
   +'Top'#3#201#0#5'Width'#3#155#2#7'Caption'#6#13'fmViewTrigger'#12'ClientHeigh'
   +'Top'#3#201#0#5'Width'#3#155#2#7'Caption'#6#13'fmViewTrigger'#12'ClientHeigh'
-  +'t'#3','#1#11'ClientWidth'#3#155#2#7'OnClose'#7#9'FormClose'#8'Position'#7#14
-  +'poScreenCenter'#10'LCLVersion'#6#6'0.9.31'#0#6'TLabel'#6'Label1'#4'Left'#2
-  +#11#6'Height'#2#18#3'Top'#2#15#5'Width'#2'['#7'Caption'#6#12'Trigger Name'#11
-  +'ParentColor'#8#0#0#6'TLabel'#6'Label2'#4'Left'#2#11#6'Height'#2#18#3'Top'#2
-  +'`'#5'Width'#2'#'#7'Caption'#6#4'Body'#11'ParentColor'#8#0#0#6'TLabel'#6'Lab'
-  +'el3'#4'Left'#2#11#6'Height'#2#18#3'Top'#2'*'#5'Width'#2';'#7'Caption'#6#8'O'
-  +'n Table'#11'ParentColor'#8#0#0#6'TLabel'#6'Label4'#4'Left'#3#141#1#6'Height'
-  +#2#18#3'Top'#2#15#5'Width'#2'<'#7'Caption'#6#8'On Event'#11'ParentColor'#8#0
-  +#0#6'TLabel'#7'laEvent'#4'Left'#3#218#1#6'Height'#2#18#3'Top'#2#15#5'Width'#2
-  +'d'#7'Caption'#6#13'laTriggerName'#10'Font.Color'#4'))'#156#0#11'ParentColor'
-  +#8#10'ParentFont'#8#0#0#6'TLabel'#6'Label5'#4'Left'#3#141#1#6'Height'#2#18#3
-  +'Top'#2'+'#5'Width'#2'!'#7'Caption'#6#4'Type'#11'ParentColor'#8#0#0#6'TLabel'
-  +#6'laType'#4'Left'#3#218#1#6'Height'#2#18#3'Top'#2'+'#5'Width'#2'd'#7'Captio'
-  +'n'#6#13'laTriggerName'#10'Font.Color'#4'))'#156#0#11'ParentColor'#8#10'Pare'
-  +'ntFont'#8#0#0#6'TLabel'#6'Label6'#4'Left'#3#141#1#6'Height'#2#18#3'Top'#2'H'
-  +#5'Width'#2'7'#7'Caption'#6#7'Enabled'#11'ParentColor'#8#0#0#6'TLabel'#9'laE'
-  +'nabled'#4'Left'#3#218#1#6'Height'#2#18#3'Top'#2'H'#5'Width'#2'd'#7'Caption'
-  +#6#13'laTriggerName'#10'Font.Color'#4'))'#156#0#11'ParentColor'#8#10'ParentF'
-  +'ont'#8#0#0#6'TLabel'#6'Label7'#4'Left'#2#11#6'Height'#2#18#3'Top'#2'H'#5'Wi'
-  +'dth'#2'9'#7'Caption'#6#8'Position'#10'DragCursor'#7#10'crAppStart'#11'Paren'
-  +'tColor'#8#0#0#6'TLabel'#5'laPos'#4'Left'#2'j'#6'Height'#2#18#3'Top'#2'H'#5
-  +'Width'#2'd'#7'Caption'#6#13'laTriggerName'#10'Font.Color'#4'))'#156#0#11'Pa'
-  +'rentColor'#8#10'ParentFont'#8#0#0#244#8'TSynEdit'#8'seScript'#4'Left'#2#11#6
-  +'Height'#3#168#0#3'Top'#2'x'#5'Width'#3'{'#2#7'Anchors'#11#5'akTop'#6'akLeft'
-  +#7'akRight'#8'akBottom'#0#11'Font.Height'#2#243#9'Font.Name'#6#11'Courier Ne'
-  +'w'#10'Font.Pitch'#7#7'fpFixed'#12'Font.Quality'#7#16'fqNonAntialiased'#11'P'
-  +'arentColor'#8#10'ParentFont'#8#8'TabOrder'#2#0#12'Gutter.Color'#4#249#242
-  +#234#0#12'Gutter.Width'#2#17#19'Gutter.MouseActions'#14#1#5'Shift'#11#0#9'Sh'
-  +'iftMask'#11#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#5'ccAny'#8'ClickDir'#7
-  +#6'cdDown'#7'Command'#2#13#9'MoveCaret'#8#6'Option'#2#0#8'Priority'#2#0#0#1#5
-  +'Shift'#11#0#9'ShiftMask'#11#0#6'Button'#7#7'mbRight'#10'ClickCount'#7#8'ccS'
-  +'ingle'#8'ClickDir'#7#4'cdUp'#7'Command'#2#12#9'MoveCaret'#8#6'Option'#2#0#8
-  +'Priority'#2#0#0#0#17'RightGutter.Width'#2#0#24'RightGutter.MouseActions'#14
-  +#1#5'Shift'#11#0#9'ShiftMask'#11#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#5
-  +'ccAny'#8'ClickDir'#7#6'cdDown'#7'Command'#2#13#9'MoveCaret'#8#6'Option'#2#0
-  +#8'Priority'#2#0#0#1#5'Shift'#11#0#9'ShiftMask'#11#0#6'Button'#7#7'mbRight'
-  +#10'ClickCount'#7#8'ccSingle'#8'ClickDir'#7#4'cdUp'#7'Command'#2#12#9'MoveCa'
-  +'ret'#8#6'Option'#2#0#8'Priority'#2#0#0#0#11'Highlighter'#7#10'SynSQLSyn1'#10
-  +'Keystrokes'#14#1#7'Command'#7#4'ecUp'#8'ShortCut'#2'&'#0#1#7'Command'#7#7'e'
-  +'cSelUp'#8'ShortCut'#3'& '#0#1#7'Command'#7#10'ecScrollUp'#8'ShortCut'#3'&@'
-  +#0#1#7'Command'#7#6'ecDown'#8'ShortCut'#2'('#0#1#7'Command'#7#9'ecSelDown'#8
-  +'ShortCut'#3'( '#0#1#7'Command'#7#12'ecScrollDown'#8'ShortCut'#3'(@'#0#1#7'C'
-  +'ommand'#7#6'ecLeft'#8'ShortCut'#2'%'#0#1#7'Command'#7#9'ecSelLeft'#8'ShortC'
-  +'ut'#3'% '#0#1#7'Command'#7#10'ecWordLeft'#8'ShortCut'#3'%@'#0#1#7'Command'#7
-  +#13'ecSelWordLeft'#8'ShortCut'#3'%`'#0#1#7'Command'#7#7'ecRight'#8'ShortCut'
-  +#2''''#0#1#7'Command'#7#10'ecSelRight'#8'ShortCut'#3''' '#0#1#7'Command'#7#11
-  +'ecWordRight'#8'ShortCut'#3'''@'#0#1#7'Command'#7#14'ecSelWordRight'#8'Short'
-  +'Cut'#3'''`'#0#1#7'Command'#7#10'ecPageDown'#8'ShortCut'#2'"'#0#1#7'Command'
-  +#7#13'ecSelPageDown'#8'ShortCut'#3'" '#0#1#7'Command'#7#12'ecPageBottom'#8'S'
-  +'hortCut'#3'"@'#0#1#7'Command'#7#15'ecSelPageBottom'#8'ShortCut'#3'"`'#0#1#7
-  +'Command'#7#8'ecPageUp'#8'ShortCut'#2'!'#0#1#7'Command'#7#11'ecSelPageUp'#8
-  +'ShortCut'#3'! '#0#1#7'Command'#7#9'ecPageTop'#8'ShortCut'#3'!@'#0#1#7'Comma'
-  +'nd'#7#12'ecSelPageTop'#8'ShortCut'#3'!`'#0#1#7'Command'#7#11'ecLineStart'#8
-  +'ShortCut'#2'$'#0#1#7'Command'#7#14'ecSelLineStart'#8'ShortCut'#3'$ '#0#1#7
-  +'Command'#7#11'ecEditorTop'#8'ShortCut'#3'$@'#0#1#7'Command'#7#14'ecSelEdito'
-  +'rTop'#8'ShortCut'#3'$`'#0#1#7'Command'#7#9'ecLineEnd'#8'ShortCut'#2'#'#0#1#7
-  +'Command'#7#12'ecSelLineEnd'#8'ShortCut'#3'# '#0#1#7'Command'#7#14'ecEditorB'
-  +'ottom'#8'ShortCut'#3'#@'#0#1#7'Command'#7#17'ecSelEditorBottom'#8'ShortCut'
-  +#3'#`'#0#1#7'Command'#7#12'ecToggleMode'#8'ShortCut'#2'-'#0#1#7'Command'#7#6
-  +'ecCopy'#8'ShortCut'#3'-@'#0#1#7'Command'#7#7'ecPaste'#8'ShortCut'#3'- '#0#1
-  +#7'Command'#7#12'ecDeleteChar'#8'ShortCut'#2'.'#0#1#7'Command'#7#5'ecCut'#8
-  +'ShortCut'#3'. '#0#1#7'Command'#7#16'ecDeleteLastChar'#8'ShortCut'#2#8#0#1#7
-  ,'Command'#7#16'ecDeleteLastChar'#8'ShortCut'#3#8' '#0#1#7'Command'#7#16'ecDe'
-  +'leteLastWord'#8'ShortCut'#3#8'@'#0#1#7'Command'#7#6'ecUndo'#8'ShortCut'#4#8
-  +#128#0#0#0#1#7'Command'#7#6'ecRedo'#8'ShortCut'#4#8#160#0#0#0#1#7'Command'#7
-  +#11'ecLineBreak'#8'ShortCut'#2#13#0#1#7'Command'#7#11'ecSelectAll'#8'ShortCu'
-  +'t'#3'A@'#0#1#7'Command'#7#6'ecCopy'#8'ShortCut'#3'C@'#0#1#7'Command'#7#13'e'
-  +'cBlockIndent'#8'ShortCut'#3'I`'#0#1#7'Command'#7#11'ecLineBreak'#8'ShortCut'
-  +#3'M@'#0#1#7'Command'#7#12'ecInsertLine'#8'ShortCut'#3'N@'#0#1#7'Command'#7
-  +#12'ecDeleteWord'#8'ShortCut'#3'T@'#0#1#7'Command'#7#15'ecBlockUnindent'#8'S'
-  +'hortCut'#3'U`'#0#1#7'Command'#7#7'ecPaste'#8'ShortCut'#3'V@'#0#1#7'Command'
-  +#7#5'ecCut'#8'ShortCut'#3'X@'#0#1#7'Command'#7#12'ecDeleteLine'#8'ShortCut'#3
-  +'Y@'#0#1#7'Command'#7#11'ecDeleteEOL'#8'ShortCut'#3'Y`'#0#1#7'Command'#7#6'e'
-  +'cUndo'#8'ShortCut'#3'Z@'#0#1#7'Command'#7#6'ecRedo'#8'ShortCut'#3'Z`'#0#1#7
-  +'Command'#7#13'ecGotoMarker0'#8'ShortCut'#3'0@'#0#1#7'Command'#7#13'ecGotoMa'
-  +'rker1'#8'ShortCut'#3'1@'#0#1#7'Command'#7#13'ecGotoMarker2'#8'ShortCut'#3'2'
-  +'@'#0#1#7'Command'#7#13'ecGotoMarker3'#8'ShortCut'#3'3@'#0#1#7'Command'#7#13
-  +'ecGotoMarker4'#8'ShortCut'#3'4@'#0#1#7'Command'#7#13'ecGotoMarker5'#8'Short'
-  +'Cut'#3'5@'#0#1#7'Command'#7#13'ecGotoMarker6'#8'ShortCut'#3'6@'#0#1#7'Comma'
-  +'nd'#7#13'ecGotoMarker7'#8'ShortCut'#3'7@'#0#1#7'Command'#7#13'ecGotoMarker8'
-  +#8'ShortCut'#3'8@'#0#1#7'Command'#7#13'ecGotoMarker9'#8'ShortCut'#3'9@'#0#1#7
-  +'Command'#7#12'ecSetMarker0'#8'ShortCut'#3'0`'#0#1#7'Command'#7#12'ecSetMark'
-  +'er1'#8'ShortCut'#3'1`'#0#1#7'Command'#7#12'ecSetMarker2'#8'ShortCut'#3'2`'#0
-  +#1#7'Command'#7#12'ecSetMarker3'#8'ShortCut'#3'3`'#0#1#7'Command'#7#12'ecSet'
-  +'Marker4'#8'ShortCut'#3'4`'#0#1#7'Command'#7#12'ecSetMarker5'#8'ShortCut'#3
-  +'5`'#0#1#7'Command'#7#12'ecSetMarker6'#8'ShortCut'#3'6`'#0#1#7'Command'#7#12
-  +'ecSetMarker7'#8'ShortCut'#3'7`'#0#1#7'Command'#7#12'ecSetMarker8'#8'ShortCu'
-  +'t'#3'8`'#0#1#7'Command'#7#12'ecSetMarker9'#8'ShortCut'#3'9`'#0#1#7'Command'
-  +#7#12'EcFoldLevel1'#8'ShortCut'#4'1'#160#0#0#0#1#7'Command'#7#12'EcFoldLevel'
-  +'2'#8'ShortCut'#4'2'#160#0#0#0#1#7'Command'#7#12'EcFoldLevel1'#8'ShortCut'#4
-  +'3'#160#0#0#0#1#7'Command'#7#12'EcFoldLevel1'#8'ShortCut'#4'4'#160#0#0#0#1#7
-  +'Command'#7#12'EcFoldLevel1'#8'ShortCut'#4'5'#160#0#0#0#1#7'Command'#7#12'Ec'
-  +'FoldLevel6'#8'ShortCut'#4'6'#160#0#0#0#1#7'Command'#7#12'EcFoldLevel7'#8'Sh'
-  +'ortCut'#4'7'#160#0#0#0#1#7'Command'#7#12'EcFoldLevel8'#8'ShortCut'#4'8'#160
-  +#0#0#0#1#7'Command'#7#12'EcFoldLevel9'#8'ShortCut'#4'9'#160#0#0#0#1#7'Comman'
-  +'d'#7#12'EcFoldLevel0'#8'ShortCut'#4'0'#160#0#0#0#1#7'Command'#7#13'EcFoldCu'
-  +'rrent'#8'ShortCut'#4'-'#160#0#0#0#1#7'Command'#7#15'EcUnFoldCurrent'#8'Shor'
-  +'tCut'#4'+'#160#0#0#0#1#7'Command'#7#18'EcToggleMarkupWord'#8'ShortCut'#4'M'
-  +#128#0#0#0#1#7'Command'#7#14'ecNormalSelect'#8'ShortCut'#3'N`'#0#1#7'Command'
-  +#7#14'ecColumnSelect'#8'ShortCut'#3'C`'#0#1#7'Command'#7#12'ecLineSelect'#8
-  +'ShortCut'#3'L`'#0#1#7'Command'#7#5'ecTab'#8'ShortCut'#2#9#0#1#7'Command'#7
-  +#10'ecShiftTab'#8'ShortCut'#3#9' '#0#1#7'Command'#7#14'ecMatchBracket'#8'Sho'
-  +'rtCut'#3'B`'#0#1#7'Command'#7#10'ecColSelUp'#8'ShortCut'#4'&'#160#0#0#0#1#7
-  +'Command'#7#12'ecColSelDown'#8'ShortCut'#4'('#160#0#0#0#1#7'Command'#7#12'ec'
-  +'ColSelLeft'#8'ShortCut'#4'%'#160#0#0#0#1#7'Command'#7#13'ecColSelRight'#8'S'
-  +'hortCut'#4''''#160#0#0#0#1#7'Command'#7#16'ecColSelPageDown'#8'ShortCut'#4
-  +'"'#160#0#0#0#1#7'Command'#7#18'ecColSelPageBottom'#8'ShortCut'#4'"'#224#0#0
-  +#0#1#7'Command'#7#14'ecColSelPageUp'#8'ShortCut'#4'!'#160#0#0#0#1#7'Command'
-  +#7#15'ecColSelPageTop'#8'ShortCut'#4'!'#224#0#0#0#1#7'Command'#7#17'ecColSel'
-  +'LineStart'#8'ShortCut'#4'$'#160#0#0#0#1#7'Command'#7#15'ecColSelLineEnd'#8
-  +'ShortCut'#4'#'#160#0#0#0#1#7'Command'#7#17'ecColSelEditorTop'#8'ShortCut'#4
-  +'$'#224#0#0#0#1#7'Command'#7#20'ecColSelEditorBottom'#8'ShortCut'#4'#'#224#0
-  +#0#0#0#12'MouseActions'#14#1#5'Shift'#11#0#9'ShiftMask'#11#7'ssShift'#5'ssAl'
-  +'t'#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#8'ccSingle'#8'ClickDir'#7#6'cdD'
-  +'own'#7'Command'#2#1#9'MoveCaret'#9#6'Option'#2#0#8'Priority'#2#0#0#1#5'Shif'
-  +'t'#11#7'ssShift'#0#9'ShiftMask'#11#7'ssShift'#5'ssAlt'#0#6'Button'#7#6'mbLe'
-  +'ft'#10'ClickCount'#7#8'ccSingle'#8'ClickDir'#7#6'cdDown'#7'Command'#2#1#9'M'
-  +'oveCaret'#9#6'Option'#2#1#8'Priority'#2#0#0#1#5'Shift'#11#5'ssAlt'#0#9'Shif'
-  +'tMask'#11#7'ssShift'#5'ssAlt'#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#8'cc'
-  +'Single'#8'ClickDir'#7#6'cdDown'#7'Command'#2#3#9'MoveCaret'#9#6'Option'#2#0
-  +#8'Priority'#2#0#0#1#5'Shift'#11#7'ssShift'#5'ssAlt'#0#9'ShiftMask'#11#7'ssS'
-  +'hift'#5'ssAlt'#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#8'ccSingle'#8'Click'
-  +'Dir'#7#6'cdDown'#7'Command'#2#3#9'MoveCaret'#9#6'Option'#2#1#8'Priority'#2#0
-  +#0#1#5'Shift'#11#0#9'ShiftMask'#11#0#6'Button'#7#7'mbRight'#10'ClickCount'#7
-  +#8'ccSingle'#8'ClickDir'#7#4'cdUp'#7'Command'#2#12#9'MoveCaret'#8#6'Option'#2
-  +#0#8'Priority'#2#0#0#1#5'Shift'#11#0#9'ShiftMask'#11#0#6'Button'#7#6'mbLeft'
-  ,#10'ClickCount'#7#8'ccDouble'#8'ClickDir'#7#6'cdDown'#7'Command'#2#6#9'MoveC'
-  +'aret'#9#6'Option'#2#0#8'Priority'#2#0#0#1#5'Shift'#11#0#9'ShiftMask'#11#0#6
-  +'Button'#7#6'mbLeft'#10'ClickCount'#7#8'ccTriple'#8'ClickDir'#7#6'cdDown'#7
-  +'Command'#2#7#9'MoveCaret'#9#6'Option'#2#0#8'Priority'#2#0#0#1#5'Shift'#11#0
-  +#9'ShiftMask'#11#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#6'ccQuad'#8'ClickD'
-  +'ir'#7#6'cdDown'#7'Command'#2#8#9'MoveCaret'#9#6'Option'#2#0#8'Priority'#2#0
-  +#0#1#5'Shift'#11#0#9'ShiftMask'#11#0#6'Button'#7#8'mbMiddle'#10'ClickCount'#7
-  +#8'ccSingle'#8'ClickDir'#7#6'cdDown'#7'Command'#2#10#9'MoveCaret'#9#6'Option'
-  +#2#0#8'Priority'#2#0#0#1#5'Shift'#11#6'ssCtrl'#0#9'ShiftMask'#11#7'ssShift'#5
-  +'ssAlt'#6'ssCtrl'#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#8'ccSingle'#8'Cli'
-  +'ckDir'#7#4'cdUp'#7'Command'#2#11#9'MoveCaret'#8#6'Option'#2#0#8'Priority'#2
-  +#0#0#0#15'MouseSelActions'#14#1#5'Shift'#11#0#9'ShiftMask'#11#0#6'Button'#7#6
-  +'mbLeft'#10'ClickCount'#7#8'ccSingle'#8'ClickDir'#7#6'cdDown'#7'Command'#2#9
-  +#9'MoveCaret'#8#6'Option'#2#0#8'Priority'#2#0#0#0#8'ReadOnly'#9#9'RightEdge'
-  +#2'x'#14'RightEdgeColor'#4#240#205#205#0#21'BracketHighlightStyle'#7#8'sbhsB'
-  +'oth'#0#244#18'TSynGutterPartList'#0#0#20'TSynGutterLineNumber'#0#5'Width'#2
-  +#17#12'MouseActions'#14#0#21'MarkupInfo.Background'#4#241#226#210#0#21'Marku'
-  +'pInfo.Foreground'#7#6'clNone'#10'DigitCount'#2#2#30'ShowOnlyLineNumbersMult'
-  +'iplesOf'#2#1#9'ZeroStart'#8#12'LeadingZeros'#8#0#0#0#0#5'TEdit'#6'edName'#4
-  +'Left'#2'j'#6'Height'#2#21#3'Top'#2#12#5'Width'#3#6#1#10'AutoSelect'#8#11'Bo'
-  +'rderStyle'#7#6'bsNone'#10'Font.Color'#7#6'clNavy'#10'ParentFont'#8#8'ReadOn'
-  +'ly'#9#8'TabOrder'#2#1#4'Text'#6#9'edGenName'#0#0#5'TEdit'#9'edOnTable'#4'Le'
-  +'ft'#2'j'#6'Height'#2#21#3'Top'#2'*'#5'Width'#3#214#0#10'AutoSelect'#8#11'Bo'
-  +'rderStyle'#7#6'bsNone'#10'Font.Color'#7#6'clNavy'#10'ParentFont'#8#8'ReadOn'
-  +'ly'#9#8'TabOrder'#2#2#4'Text'#6#9'edGenName'#0#0#7'TBitBtn'#7'bbClose'#4'Le'
-  +'ft'#3'~'#2#6'Height'#2#24#3'Top'#2#3#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#3#0#0
-  +#10'TSynSQLSyn'#10'SynSQLSyn1'#13'DefaultFilter'#6#23'SQL Files (*.sql)|*.sq'
-  +'l'#7'Enabled'#8#23'CommentAttri.Foreground'#7#6'clTeal'#23'CommentAttri.Fra'
-  +'meEdges'#7#9'sfeAround'#24'DataTypeAttri.FrameEdges'#7#9'sfeAround'#30'Defa'
-  +'ultPackageAttri.FrameEdges'#7#9'sfeAround'#25'ExceptionAttri.FrameEdges'#7#9
-  +'sfeAround'#24'FunctionAttri.FrameEdges'#7#9'sfeAround'#26'IdentifierAttri.F'
-  +'oreground'#4'1'#26#255#0#26'IdentifierAttri.FrameEdges'#7#9'sfeAround'#19'K'
-  +'eyAttri.FrameEdges'#7#9'sfeAround'#22'NumberAttri.Foreground'#7#9'clMedGray'
-  +#22'NumberAttri.FrameEdges'#7#9'sfeAround'#21'PLSQLAttri.FrameEdges'#7#9'sfe'
-  +'Around'#21'SpaceAttri.FrameEdges'#7#9'sfeAround'#23'SQLPlusAttri.FrameEdges'
-  +#7#9'sfeAround'#22'StringAttri.Foreground'#4#161#16#16#0#22'StringAttri.Fram'
-  +'eEdges'#7#9'sfeAround'#22'SymbolAttri.Foreground'#4'b'#8#8#0#22'SymbolAttri'
-  +'.FrameEdges'#7#9'sfeAround'#25'TableNameAttri.Foreground'#7#6'clNavy'#25'Ta'
-  +'bleNameAttri.FrameEdges'#7#9'sfeAround'#20'TableNameAttri.Style'#11#6'fsBol'
-  +'d'#0#24'VariableAttri.FrameEdges'#7#9'sfeAround'#10'SQLDialect'#7#9'sqlSyba'
-  +'se'#4'left'#3#136#1#3'top'#3#168#0#0#0#0
+  +'t'#3','#1#11'ClientWidth'#3#155#2#10'KeyPreview'#9#7'OnClose'#7#9'FormClose'
+  +#9'OnKeyDown'#7#11'FormKeyDown'#8'Position'#7#14'poScreenCenter'#10'LCLVersi'
+  +'on'#6#7'1.2.0.3'#0#6'TLabel'#6'Label1'#4'Left'#2#11#6'Height'#2#13#3'Top'#2
+  +#15#5'Width'#2'@'#7'Caption'#6#12'Trigger Name'#11'ParentColor'#8#0#0#6'TLab'
+  +'el'#6'Label2'#4'Left'#2#11#6'Height'#2#13#3'Top'#2'`'#5'Width'#2#24#7'Capti'
+  +'on'#6#4'Body'#11'ParentColor'#8#0#0#6'TLabel'#6'Label3'#4'Left'#2#11#6'Heig'
+  +'ht'#2#13#3'Top'#2'*'#5'Width'#2'+'#7'Caption'#6#8'On Table'#11'ParentColor'
+  +#8#0#0#6'TLabel'#6'Label4'#4'Left'#3#141#1#6'Height'#2#13#3'Top'#2#15#5'Widt'
+  +'h'#2'-'#7'Caption'#6#8'On Event'#11'ParentColor'#8#0#0#6'TLabel'#7'laEvent'
+  +#4'Left'#3#218#1#6'Height'#2#13#3'Top'#2#15#5'Width'#2'E'#7'Caption'#6#13'la'
+  +'TriggerName'#10'Font.Color'#4'))'#156#0#11'ParentColor'#8#10'ParentFont'#8#0
+  +#0#6'TLabel'#6'Label5'#4'Left'#3#141#1#6'Height'#2#13#3'Top'#2'+'#5'Width'#2
+  +#24#7'Caption'#6#4'Type'#11'ParentColor'#8#0#0#6'TLabel'#6'laType'#4'Left'#3
+  +#218#1#6'Height'#2#13#3'Top'#2'+'#5'Width'#2'E'#7'Caption'#6#13'laTriggerNam'
+  +'e'#10'Font.Color'#4'))'#156#0#11'ParentColor'#8#10'ParentFont'#8#0#0#6'TLab'
+  +'el'#6'Label6'#4'Left'#3#141#1#6'Height'#2#13#3'Top'#2'H'#5'Width'#2'&'#7'Ca'
+  +'ption'#6#7'Enabled'#11'ParentColor'#8#0#0#6'TLabel'#9'laEnabled'#4'Left'#3
+  +#218#1#6'Height'#2#13#3'Top'#2'H'#5'Width'#2'E'#7'Caption'#6#13'laTriggerNam'
+  +'e'#10'Font.Color'#4'))'#156#0#11'ParentColor'#8#10'ParentFont'#8#0#0#6'TLab'
+  +'el'#6'Label7'#4'Left'#2#11#6'Height'#2#13#3'Top'#2'H'#5'Width'#2'%'#7'Capti'
+  +'on'#6#8'Position'#10'DragCursor'#7#10'crAppStart'#11'ParentColor'#8#0#0#6'T'
+  +'Label'#5'laPos'#4'Left'#2'j'#6'Height'#2#13#3'Top'#2'H'#5'Width'#2'E'#7'Cap'
+  +'tion'#6#13'laTriggerName'#10'Font.Color'#4'))'#156#0#11'ParentColor'#8#10'P'
+  +'arentFont'#8#0#0#244#8'TSynEdit'#8'seScript'#4'Left'#2#11#6'Height'#3#168#0
+  +#3'Top'#2'x'#5'Width'#3'{'#2#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'a'
+  +'kBottom'#0#11'Font.Height'#2#243#9'Font.Name'#6#11'Courier New'#10'Font.Pit'
+  +'ch'#7#7'fpFixed'#12'Font.Quality'#7#16'fqNonAntialiased'#11'ParentColor'#8
+  +#10'ParentFont'#8#8'TabOrder'#2#0#12'Gutter.Color'#4#249#242#234#0#12'Gutter'
+  +'.Width'#2#17#19'Gutter.MouseActions'#14#1#10'ClickCount'#7#5'ccAny'#8'Click'
+  +'Dir'#7#6'cdDown'#7'Command'#7#20'emcOnMainGutterClick'#0#1#6'Button'#7#7'mb'
+  +'Right'#7'Command'#7#14'emcContextMenu'#0#0#17'RightGutter.Width'#2#0#24'Rig'
+  +'htGutter.MouseActions'#14#1#10'ClickCount'#7#5'ccAny'#8'ClickDir'#7#6'cdDow'
+  +'n'#7'Command'#7#20'emcOnMainGutterClick'#0#1#6'Button'#7#7'mbRight'#7'Comma'
+  +'nd'#7#14'emcContextMenu'#0#0#11'Highlighter'#7#10'SynSQLSyn1'#10'Keystrokes'
+  +#14#1#7'Command'#7#4'ecUp'#8'ShortCut'#2'&'#0#1#7'Command'#7#7'ecSelUp'#8'Sh'
+  +'ortCut'#3'& '#0#1#7'Command'#7#10'ecScrollUp'#8'ShortCut'#3'&@'#0#1#7'Comma'
+  +'nd'#7#6'ecDown'#8'ShortCut'#2'('#0#1#7'Command'#7#9'ecSelDown'#8'ShortCut'#3
+  +'( '#0#1#7'Command'#7#12'ecScrollDown'#8'ShortCut'#3'(@'#0#1#7'Command'#7#6
+  +'ecLeft'#8'ShortCut'#2'%'#0#1#7'Command'#7#9'ecSelLeft'#8'ShortCut'#3'% '#0#1
+  +#7'Command'#7#10'ecWordLeft'#8'ShortCut'#3'%@'#0#1#7'Command'#7#13'ecSelWord'
+  +'Left'#8'ShortCut'#3'%`'#0#1#7'Command'#7#7'ecRight'#8'ShortCut'#2''''#0#1#7
+  +'Command'#7#10'ecSelRight'#8'ShortCut'#3''' '#0#1#7'Command'#7#11'ecWordRigh'
+  +'t'#8'ShortCut'#3'''@'#0#1#7'Command'#7#14'ecSelWordRight'#8'ShortCut'#3'''`'
+  +#0#1#7'Command'#7#10'ecPageDown'#8'ShortCut'#2'"'#0#1#7'Command'#7#13'ecSelP'
+  +'ageDown'#8'ShortCut'#3'" '#0#1#7'Command'#7#12'ecPageBottom'#8'ShortCut'#3
+  +'"@'#0#1#7'Command'#7#15'ecSelPageBottom'#8'ShortCut'#3'"`'#0#1#7'Command'#7
+  +#8'ecPageUp'#8'ShortCut'#2'!'#0#1#7'Command'#7#11'ecSelPageUp'#8'ShortCut'#3
+  +'! '#0#1#7'Command'#7#9'ecPageTop'#8'ShortCut'#3'!@'#0#1#7'Command'#7#12'ecS'
+  +'elPageTop'#8'ShortCut'#3'!`'#0#1#7'Command'#7#11'ecLineStart'#8'ShortCut'#2
+  +'$'#0#1#7'Command'#7#14'ecSelLineStart'#8'ShortCut'#3'$ '#0#1#7'Command'#7#11
+  +'ecEditorTop'#8'ShortCut'#3'$@'#0#1#7'Command'#7#14'ecSelEditorTop'#8'ShortC'
+  +'ut'#3'$`'#0#1#7'Command'#7#9'ecLineEnd'#8'ShortCut'#2'#'#0#1#7'Command'#7#12
+  +'ecSelLineEnd'#8'ShortCut'#3'# '#0#1#7'Command'#7#14'ecEditorBottom'#8'Short'
+  +'Cut'#3'#@'#0#1#7'Command'#7#17'ecSelEditorBottom'#8'ShortCut'#3'#`'#0#1#7'C'
+  +'ommand'#7#12'ecToggleMode'#8'ShortCut'#2'-'#0#1#7'Command'#7#6'ecCopy'#8'Sh'
+  +'ortCut'#3'-@'#0#1#7'Command'#7#7'ecPaste'#8'ShortCut'#3'- '#0#1#7'Command'#7
+  +#12'ecDeleteChar'#8'ShortCut'#2'.'#0#1#7'Command'#7#5'ecCut'#8'ShortCut'#3'.'
+  +' '#0#1#7'Command'#7#16'ecDeleteLastChar'#8'ShortCut'#2#8#0#1#7'Command'#7#16
+  +'ecDeleteLastChar'#8'ShortCut'#3#8' '#0#1#7'Command'#7#16'ecDeleteLastWord'#8
+  +'ShortCut'#3#8'@'#0#1#7'Command'#7#6'ecUndo'#8'ShortCut'#4#8#128#0#0#0#1#7'C'
+  +'ommand'#7#6'ecRedo'#8'ShortCut'#4#8#160#0#0#0#1#7'Command'#7#11'ecLineBreak'
+  +#8'ShortCut'#2#13#0#1#7'Command'#7#11'ecSelectAll'#8'ShortCut'#3'A@'#0#1#7'C'
+  ,'ommand'#7#6'ecCopy'#8'ShortCut'#3'C@'#0#1#7'Command'#7#13'ecBlockIndent'#8
+  +'ShortCut'#3'I`'#0#1#7'Command'#7#11'ecLineBreak'#8'ShortCut'#3'M@'#0#1#7'Co'
+  +'mmand'#7#12'ecInsertLine'#8'ShortCut'#3'N@'#0#1#7'Command'#7#12'ecDeleteWor'
+  +'d'#8'ShortCut'#3'T@'#0#1#7'Command'#7#15'ecBlockUnindent'#8'ShortCut'#3'U`'
+  +#0#1#7'Command'#7#7'ecPaste'#8'ShortCut'#3'V@'#0#1#7'Command'#7#5'ecCut'#8'S'
+  +'hortCut'#3'X@'#0#1#7'Command'#7#12'ecDeleteLine'#8'ShortCut'#3'Y@'#0#1#7'Co'
+  +'mmand'#7#11'ecDeleteEOL'#8'ShortCut'#3'Y`'#0#1#7'Command'#7#6'ecUndo'#8'Sho'
+  +'rtCut'#3'Z@'#0#1#7'Command'#7#6'ecRedo'#8'ShortCut'#3'Z`'#0#1#7'Command'#7
+  +#13'ecGotoMarker0'#8'ShortCut'#3'0@'#0#1#7'Command'#7#13'ecGotoMarker1'#8'Sh'
+  +'ortCut'#3'1@'#0#1#7'Command'#7#13'ecGotoMarker2'#8'ShortCut'#3'2@'#0#1#7'Co'
+  +'mmand'#7#13'ecGotoMarker3'#8'ShortCut'#3'3@'#0#1#7'Command'#7#13'ecGotoMark'
+  +'er4'#8'ShortCut'#3'4@'#0#1#7'Command'#7#13'ecGotoMarker5'#8'ShortCut'#3'5@'
+  +#0#1#7'Command'#7#13'ecGotoMarker6'#8'ShortCut'#3'6@'#0#1#7'Command'#7#13'ec'
+  +'GotoMarker7'#8'ShortCut'#3'7@'#0#1#7'Command'#7#13'ecGotoMarker8'#8'ShortCu'
+  +'t'#3'8@'#0#1#7'Command'#7#13'ecGotoMarker9'#8'ShortCut'#3'9@'#0#1#7'Command'
+  +#7#12'ecSetMarker0'#8'ShortCut'#3'0`'#0#1#7'Command'#7#12'ecSetMarker1'#8'Sh'
+  +'ortCut'#3'1`'#0#1#7'Command'#7#12'ecSetMarker2'#8'ShortCut'#3'2`'#0#1#7'Com'
+  +'mand'#7#12'ecSetMarker3'#8'ShortCut'#3'3`'#0#1#7'Command'#7#12'ecSetMarker4'
+  +#8'ShortCut'#3'4`'#0#1#7'Command'#7#12'ecSetMarker5'#8'ShortCut'#3'5`'#0#1#7
+  +'Command'#7#12'ecSetMarker6'#8'ShortCut'#3'6`'#0#1#7'Command'#7#12'ecSetMark'
+  +'er7'#8'ShortCut'#3'7`'#0#1#7'Command'#7#12'ecSetMarker8'#8'ShortCut'#3'8`'#0
+  +#1#7'Command'#7#12'ecSetMarker9'#8'ShortCut'#3'9`'#0#1#7'Command'#7#12'EcFol'
+  +'dLevel1'#8'ShortCut'#4'1'#160#0#0#0#1#7'Command'#7#12'EcFoldLevel2'#8'Short'
+  +'Cut'#4'2'#160#0#0#0#1#7'Command'#7#12'EcFoldLevel1'#8'ShortCut'#4'3'#160#0#0
+  +#0#1#7'Command'#7#12'EcFoldLevel1'#8'ShortCut'#4'4'#160#0#0#0#1#7'Command'#7
+  +#12'EcFoldLevel1'#8'ShortCut'#4'5'#160#0#0#0#1#7'Command'#7#12'EcFoldLevel6'
+  +#8'ShortCut'#4'6'#160#0#0#0#1#7'Command'#7#12'EcFoldLevel7'#8'ShortCut'#4'7'
+  +#160#0#0#0#1#7'Command'#7#12'EcFoldLevel8'#8'ShortCut'#4'8'#160#0#0#0#1#7'Co'
+  +'mmand'#7#12'EcFoldLevel9'#8'ShortCut'#4'9'#160#0#0#0#1#7'Command'#7#12'EcFo'
+  +'ldLevel0'#8'ShortCut'#4'0'#160#0#0#0#1#7'Command'#7#13'EcFoldCurrent'#8'Sho'
+  +'rtCut'#4'-'#160#0#0#0#1#7'Command'#7#15'EcUnFoldCurrent'#8'ShortCut'#4'+'
+  +#160#0#0#0#1#7'Command'#7#18'EcToggleMarkupWord'#8'ShortCut'#4'M'#128#0#0#0#1
+  +#7'Command'#7#14'ecNormalSelect'#8'ShortCut'#3'N`'#0#1#7'Command'#7#14'ecCol'
+  +'umnSelect'#8'ShortCut'#3'C`'#0#1#7'Command'#7#12'ecLineSelect'#8'ShortCut'#3
+  +'L`'#0#1#7'Command'#7#5'ecTab'#8'ShortCut'#2#9#0#1#7'Command'#7#10'ecShiftTa'
+  +'b'#8'ShortCut'#3#9' '#0#1#7'Command'#7#14'ecMatchBracket'#8'ShortCut'#3'B`'
+  +#0#1#7'Command'#7#10'ecColSelUp'#8'ShortCut'#4'&'#160#0#0#0#1#7'Command'#7#12
+  +'ecColSelDown'#8'ShortCut'#4'('#160#0#0#0#1#7'Command'#7#12'ecColSelLeft'#8
+  +'ShortCut'#4'%'#160#0#0#0#1#7'Command'#7#13'ecColSelRight'#8'ShortCut'#4''''
+  +#160#0#0#0#1#7'Command'#7#16'ecColSelPageDown'#8'ShortCut'#4'"'#160#0#0#0#1#7
+  +'Command'#7#18'ecColSelPageBottom'#8'ShortCut'#4'"'#224#0#0#0#1#7'Command'#7
+  +#14'ecColSelPageUp'#8'ShortCut'#4'!'#160#0#0#0#1#7'Command'#7#15'ecColSelPag'
+  +'eTop'#8'ShortCut'#4'!'#224#0#0#0#1#7'Command'#7#17'ecColSelLineStart'#8'Sho'
+  +'rtCut'#4'$'#160#0#0#0#1#7'Command'#7#15'ecColSelLineEnd'#8'ShortCut'#4'#'
+  +#160#0#0#0#1#7'Command'#7#17'ecColSelEditorTop'#8'ShortCut'#4'$'#224#0#0#0#1
+  +#7'Command'#7#20'ecColSelEditorBottom'#8'ShortCut'#4'#'#224#0#0#0#0#12'Mouse'
+  +'Actions'#14#1#9'ShiftMask'#11#7'ssShift'#5'ssAlt'#0#8'ClickDir'#7#6'cdDown'
+  +#7'Command'#7#18'emcStartSelections'#9'MoveCaret'#9#0#1#5'Shift'#11#7'ssShif'
+  +'t'#0#9'ShiftMask'#11#7'ssShift'#5'ssAlt'#0#8'ClickDir'#7#6'cdDown'#7'Comman'
+  +'d'#7#18'emcStartSelections'#9'MoveCaret'#9#6'Option'#2#1#0#1#5'Shift'#11#5
+  +'ssAlt'#0#9'ShiftMask'#11#7'ssShift'#5'ssAlt'#0#8'ClickDir'#7#6'cdDown'#7'Co'
+  +'mmand'#7#24'emcStartColumnSelections'#9'MoveCaret'#9#0#1#5'Shift'#11#7'ssSh'
+  +'ift'#5'ssAlt'#0#9'ShiftMask'#11#7'ssShift'#5'ssAlt'#0#8'ClickDir'#7#6'cdDow'
+  +'n'#7'Command'#7#24'emcStartColumnSelections'#9'MoveCaret'#9#6'Option'#2#1#0
+  +#1#6'Button'#7#7'mbRight'#7'Command'#7#14'emcContextMenu'#0#1#10'ClickCount'
+  +#7#8'ccDouble'#8'ClickDir'#7#6'cdDown'#7'Command'#7#13'emcSelectWord'#9'Move'
+  +'Caret'#9#0#1#10'ClickCount'#7#8'ccTriple'#8'ClickDir'#7#6'cdDown'#7'Command'
+  +#7#13'emcSelectLine'#9'MoveCaret'#9#0#1#10'ClickCount'#7#6'ccQuad'#8'ClickDi'
+  +'r'#7#6'cdDown'#7'Command'#7#13'emcSelectPara'#9'MoveCaret'#9#0#1#6'Button'#7
+  +#8'mbMiddle'#8'ClickDir'#7#6'cdDown'#7'Command'#7#17'emcPasteSelection'#9'Mo'
+  +'veCaret'#9#0#1#5'Shift'#11#6'ssCtrl'#0#9'ShiftMask'#11#7'ssShift'#5'ssAlt'#6
+  +'ssCtrl'#0#7'Command'#7#12'emcMouseLink'#0#0#15'MouseSelActions'#14#1#8'Clic'
+  +'kDir'#7#6'cdDown'#7'Command'#7#16'emcStartDragMove'#0#0#19'VisibleSpecialCh'
+  +'ars'#11#8'vscSpace'#12'vscTabAtLast'#0#8'ReadOnly'#9#9'RightEdge'#2'x'#14'R'
+  ,'ightEdgeColor'#4#240#205#205#0#24'SelectedColor.FrameEdges'#7#9'sfeAround'
+  +#26'SelectedColor.BackPriority'#2'2'#26'SelectedColor.ForePriority'#2'2'#27
+  +'SelectedColor.FramePriority'#2'2'#26'SelectedColor.BoldPriority'#2'2'#28'Se'
+  +'lectedColor.ItalicPriority'#2'2'#31'SelectedColor.UnderlinePriority'#2'2'#31
+  +'SelectedColor.StrikeOutPriority'#2'2'#25'IncrementColor.FrameEdges'#7#9'sfe'
+  +'Around'#28'HighlightAllColor.FrameEdges'#7#9'sfeAround'#21'BracketHighlight'
+  +'Style'#7#8'sbhsBoth'#28'BracketMatchColor.Background'#7#6'clNone'#28'Bracke'
+  +'tMatchColor.Foreground'#7#6'clNone'#28'BracketMatchColor.FrameEdges'#7#9'sf'
+  +'eAround'#23'BracketMatchColor.Style'#11#6'fsBold'#0#26'FoldedCodeColor.Back'
+  +'ground'#7#6'clNone'#26'FoldedCodeColor.Foreground'#7#6'clGray'#26'FoldedCod'
+  +'eColor.FrameColor'#7#6'clGray'#26'FoldedCodeColor.FrameEdges'#7#9'sfeAround'
+  +#25'MouseLinkColor.Background'#7#6'clNone'#25'MouseLinkColor.Foreground'#7#6
+  +'clBlue'#25'MouseLinkColor.FrameEdges'#7#9'sfeAround'#29'LineHighlightColor.'
+  +'Background'#7#6'clNone'#29'LineHighlightColor.Foreground'#7#6'clNone'#29'Li'
+  +'neHighlightColor.FrameEdges'#7#9'sfeAround'#0#244#18'TSynGutterPartList'#0#0
+  +#20'TSynGutterLineNumber'#0#5'Width'#2#17#12'MouseActions'#14#0#21'MarkupInf'
+  +'o.Background'#4#241#226#210#0#21'MarkupInfo.Foreground'#7#6'clNone'#21'Mark'
+  +'upInfo.FrameEdges'#7#9'sfeAround'#10'DigitCount'#2#2#30'ShowOnlyLineNumbers'
+  +'MultiplesOf'#2#1#9'ZeroStart'#8#12'LeadingZeros'#8#0#0#0#0#5'TEdit'#6'edNam'
+  +'e'#4'Left'#2'j'#6'Height'#2#13#3'Top'#2#12#5'Width'#3#6#1#10'AutoSelect'#8
+  +#11'BorderStyle'#7#6'bsNone'#10'Font.Color'#7#6'clNavy'#10'ParentFont'#8#8'R'
+  +'eadOnly'#9#8'TabOrder'#2#1#4'Text'#6#9'edGenName'#0#0#5'TEdit'#9'edOnTable'
+  +#4'Left'#2'j'#6'Height'#2#13#3'Top'#2'*'#5'Width'#3#214#0#10'AutoSelect'#8#11
+  +'BorderStyle'#7#6'bsNone'#10'Font.Color'#7#6'clNavy'#10'ParentFont'#8#8'Read'
+  +'Only'#9#8'TabOrder'#2#2#4'Text'#6#9'edGenName'#0#0#7'TBitBtn'#7'bbClose'#4
+  +'Left'#3'~'#2#6'Height'#2#24#3'Top'#2#3#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#3#0
+  +#0#10'TSynSQLSyn'#10'SynSQLSyn1'#13'DefaultFilter'#6#23'SQL Files (*.sql)|*.'
+  +'sql'#7'Enabled'#8#23'CommentAttri.Foreground'#7#6'clTeal'#23'CommentAttri.F'
+  +'rameEdges'#7#9'sfeAround'#24'DataTypeAttri.FrameEdges'#7#9'sfeAround'#30'De'
+  +'faultPackageAttri.FrameEdges'#7#9'sfeAround'#25'ExceptionAttri.FrameEdges'#7
+  +#9'sfeAround'#24'FunctionAttri.FrameEdges'#7#9'sfeAround'#26'IdentifierAttri'
+  +'.Foreground'#4'1'#26#255#0#26'IdentifierAttri.FrameEdges'#7#9'sfeAround'#19
+  +'KeyAttri.FrameEdges'#7#9'sfeAround'#22'NumberAttri.Foreground'#7#9'clMedGra'
+  +'y'#22'NumberAttri.FrameEdges'#7#9'sfeAround'#21'PLSQLAttri.FrameEdges'#7#9
+  +'sfeAround'#21'SpaceAttri.FrameEdges'#7#9'sfeAround'#23'SQLPlusAttri.FrameEd'
+  +'ges'#7#9'sfeAround'#22'StringAttri.Foreground'#4#161#16#16#0#22'StringAttri'
+  +'.FrameEdges'#7#9'sfeAround'#22'SymbolAttri.Foreground'#4'b'#8#8#0#22'Symbol'
+  +'Attri.FrameEdges'#7#9'sfeAround'#25'TableNameAttri.Foreground'#7#6'clNavy'
+  +#25'TableNameAttri.FrameEdges'#7#9'sfeAround'#20'TableNameAttri.Style'#11#6
+  +'fsBold'#0#24'VariableAttri.FrameEdges'#7#9'sfeAround'#10'SQLDialect'#7#9'sq'
+  +'lSybase'#4'left'#3#136#1#3'top'#3#168#0#0#0#0
 ]);
 ]);

+ 17 - 1
viewtrigger.pas

@@ -6,7 +6,7 @@ interface
 
 
 uses
 uses
   Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
   Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
-  StdCtrls, Buttons, SynEdit, SynHighlighterSQL;
+  StdCtrls, Buttons, SynEdit, SynHighlighterSQL, LCLType;
 
 
 type
 type
 
 
@@ -31,6 +31,7 @@ type
     SynSQLSyn1: TSynSQLSyn;
     SynSQLSyn1: TSynSQLSyn;
     procedure bbCloseClick(Sender: TObject);
     procedure bbCloseClick(Sender: TObject);
     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
+    procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
   private
   private
     { private declarations }
     { private declarations }
   public
   public
@@ -49,6 +50,21 @@ begin
   CloseAction:= caFree;
   CloseAction:= caFree;
 end;
 end;
 
 
+procedure TfmViewTrigger.FormKeyDown(Sender: TObject; var Key: Word;
+  Shift: TShiftState);
+begin
+  if (ssCtrl in Shift) and
+    ((Key=VK_F4) or (Key=VK_W)) then
+  begin
+    if MessageDlg('Do you want to close this query window?', mtConfirmation, [mbNo, mbYes], 0) = mrYes then
+    begin
+      // Close when pressing Ctrl-W or Ctrl-F4 (Cmd-W/Cmd-F4 on OSX)
+      Close;
+      Parent.Free;
+    end;
+  end;
+end;
+
 procedure TfmViewTrigger.bbCloseClick(Sender: TObject);
 procedure TfmViewTrigger.bbCloseClick(Sender: TObject);
 begin
 begin
   Close;
   Close;

+ 49 - 102
viewview.lfm

@@ -7,22 +7,24 @@ object fmViewView: TfmViewView
   Caption = 'fmViewView'
   Caption = 'fmViewView'
   ClientHeight = 300
   ClientHeight = 300
   ClientWidth = 501
   ClientWidth = 501
+  KeyPreview = True
   OnClose = FormClose
   OnClose = FormClose
+  OnKeyDown = FormKeyDown
   Position = poScreenCenter
   Position = poScreenCenter
-  LCLVersion = '0.9.31'
+  LCLVersion = '1.2.0.3'
   object Label1: TLabel
   object Label1: TLabel
     Left = 11
     Left = 11
-    Height = 18
+    Height = 13
     Top = 15
     Top = 15
-    Width = 77
+    Width = 52
     Caption = 'View Name'
     Caption = 'View Name'
     ParentColor = False
     ParentColor = False
   end
   end
   object Label2: TLabel
   object Label2: TLabel
     Left = 11
     Left = 11
-    Height = 18
+    Height = 13
     Top = 48
     Top = 48
-    Width = 35
+    Width = 24
     Caption = 'Body'
     Caption = 'Body'
     ParentColor = False
     ParentColor = False
   end
   end
@@ -43,50 +45,24 @@ object fmViewView: TfmViewView
     Gutter.Width = 17
     Gutter.Width = 17
     Gutter.MouseActions = <    
     Gutter.MouseActions = <    
       item
       item
-        Shift = []
-        ShiftMask = []
-        Button = mbLeft
         ClickCount = ccAny
         ClickCount = ccAny
         ClickDir = cdDown
         ClickDir = cdDown
-        Command = 13
-        MoveCaret = False
-        Option = 0
-        Priority = 0
+        Command = emcOnMainGutterClick
       end    
       end    
       item
       item
-        Shift = []
-        ShiftMask = []
         Button = mbRight
         Button = mbRight
-        ClickCount = ccSingle
-        ClickDir = cdUp
-        Command = 12
-        MoveCaret = False
-        Option = 0
-        Priority = 0
+        Command = emcContextMenu
       end>
       end>
     RightGutter.Width = 0
     RightGutter.Width = 0
     RightGutter.MouseActions = <    
     RightGutter.MouseActions = <    
       item
       item
-        Shift = []
-        ShiftMask = []
-        Button = mbLeft
         ClickCount = ccAny
         ClickCount = ccAny
         ClickDir = cdDown
         ClickDir = cdDown
-        Command = 13
-        MoveCaret = False
-        Option = 0
-        Priority = 0
+        Command = emcOnMainGutterClick
       end    
       end    
       item
       item
-        Shift = []
-        ShiftMask = []
         Button = mbRight
         Button = mbRight
-        ClickCount = ccSingle
-        ClickDir = cdUp
-        Command = 12
-        MoveCaret = False
-        Option = 0
-        Priority = 0
+        Command = emcContextMenu
       end>
       end>
     Highlighter = SynSQLSyn1
     Highlighter = SynSQLSyn1
     Keystrokes = <    
     Keystrokes = <    
@@ -512,137 +488,108 @@ object fmViewView: TfmViewView
       end>
       end>
     MouseActions = <    
     MouseActions = <    
       item
       item
-        Shift = []
         ShiftMask = [ssShift, ssAlt]
         ShiftMask = [ssShift, ssAlt]
-        Button = mbLeft
-        ClickCount = ccSingle
         ClickDir = cdDown
         ClickDir = cdDown
-        Command = 1
+        Command = emcStartSelections
         MoveCaret = True
         MoveCaret = True
-        Option = 0
-        Priority = 0
       end    
       end    
       item
       item
         Shift = [ssShift]
         Shift = [ssShift]
         ShiftMask = [ssShift, ssAlt]
         ShiftMask = [ssShift, ssAlt]
-        Button = mbLeft
-        ClickCount = ccSingle
         ClickDir = cdDown
         ClickDir = cdDown
-        Command = 1
+        Command = emcStartSelections
         MoveCaret = True
         MoveCaret = True
         Option = 1
         Option = 1
-        Priority = 0
       end    
       end    
       item
       item
         Shift = [ssAlt]
         Shift = [ssAlt]
         ShiftMask = [ssShift, ssAlt]
         ShiftMask = [ssShift, ssAlt]
-        Button = mbLeft
-        ClickCount = ccSingle
         ClickDir = cdDown
         ClickDir = cdDown
-        Command = 3
+        Command = emcStartColumnSelections
         MoveCaret = True
         MoveCaret = True
-        Option = 0
-        Priority = 0
       end    
       end    
       item
       item
         Shift = [ssShift, ssAlt]
         Shift = [ssShift, ssAlt]
         ShiftMask = [ssShift, ssAlt]
         ShiftMask = [ssShift, ssAlt]
-        Button = mbLeft
-        ClickCount = ccSingle
         ClickDir = cdDown
         ClickDir = cdDown
-        Command = 3
+        Command = emcStartColumnSelections
         MoveCaret = True
         MoveCaret = True
         Option = 1
         Option = 1
-        Priority = 0
       end    
       end    
       item
       item
-        Shift = []
-        ShiftMask = []
         Button = mbRight
         Button = mbRight
-        ClickCount = ccSingle
-        ClickDir = cdUp
-        Command = 12
-        MoveCaret = False
-        Option = 0
-        Priority = 0
+        Command = emcContextMenu
       end    
       end    
       item
       item
-        Shift = []
-        ShiftMask = []
-        Button = mbLeft
         ClickCount = ccDouble
         ClickCount = ccDouble
         ClickDir = cdDown
         ClickDir = cdDown
-        Command = 6
+        Command = emcSelectWord
         MoveCaret = True
         MoveCaret = True
-        Option = 0
-        Priority = 0
       end    
       end    
       item
       item
-        Shift = []
-        ShiftMask = []
-        Button = mbLeft
         ClickCount = ccTriple
         ClickCount = ccTriple
         ClickDir = cdDown
         ClickDir = cdDown
-        Command = 7
+        Command = emcSelectLine
         MoveCaret = True
         MoveCaret = True
-        Option = 0
-        Priority = 0
       end    
       end    
       item
       item
-        Shift = []
-        ShiftMask = []
-        Button = mbLeft
         ClickCount = ccQuad
         ClickCount = ccQuad
         ClickDir = cdDown
         ClickDir = cdDown
-        Command = 8
+        Command = emcSelectPara
         MoveCaret = True
         MoveCaret = True
-        Option = 0
-        Priority = 0
       end    
       end    
       item
       item
-        Shift = []
-        ShiftMask = []
         Button = mbMiddle
         Button = mbMiddle
-        ClickCount = ccSingle
         ClickDir = cdDown
         ClickDir = cdDown
-        Command = 10
+        Command = emcPasteSelection
         MoveCaret = True
         MoveCaret = True
-        Option = 0
-        Priority = 0
       end    
       end    
       item
       item
         Shift = [ssCtrl]
         Shift = [ssCtrl]
         ShiftMask = [ssShift, ssAlt, ssCtrl]
         ShiftMask = [ssShift, ssAlt, ssCtrl]
-        Button = mbLeft
-        ClickCount = ccSingle
-        ClickDir = cdUp
-        Command = 11
-        MoveCaret = False
-        Option = 0
-        Priority = 0
+        Command = emcMouseLink
       end>
       end>
     MouseSelActions = <    
     MouseSelActions = <    
       item
       item
-        Shift = []
-        ShiftMask = []
-        Button = mbLeft
-        ClickCount = ccSingle
         ClickDir = cdDown
         ClickDir = cdDown
-        Command = 9
-        MoveCaret = False
-        Option = 0
-        Priority = 0
+        Command = emcStartDragMove
       end>
       end>
+    VisibleSpecialChars = [vscSpace, vscTabAtLast]
     ReadOnly = True
     ReadOnly = True
     RightEdge = 120
     RightEdge = 120
     RightEdgeColor = 13487600
     RightEdgeColor = 13487600
+    SelectedColor.FrameEdges = sfeAround
+    SelectedColor.BackPriority = 50
+    SelectedColor.ForePriority = 50
+    SelectedColor.FramePriority = 50
+    SelectedColor.BoldPriority = 50
+    SelectedColor.ItalicPriority = 50
+    SelectedColor.UnderlinePriority = 50
+    SelectedColor.StrikeOutPriority = 50
+    IncrementColor.FrameEdges = sfeAround
+    HighlightAllColor.FrameEdges = sfeAround
     BracketHighlightStyle = sbhsBoth
     BracketHighlightStyle = sbhsBoth
+    BracketMatchColor.Background = clNone
+    BracketMatchColor.Foreground = clNone
+    BracketMatchColor.FrameEdges = sfeAround
+    BracketMatchColor.Style = [fsBold]
+    FoldedCodeColor.Background = clNone
+    FoldedCodeColor.Foreground = clGray
+    FoldedCodeColor.FrameColor = clGray
+    FoldedCodeColor.FrameEdges = sfeAround
+    MouseLinkColor.Background = clNone
+    MouseLinkColor.Foreground = clBlue
+    MouseLinkColor.FrameEdges = sfeAround
+    LineHighlightColor.Background = clNone
+    LineHighlightColor.Foreground = clNone
+    LineHighlightColor.FrameEdges = sfeAround
     inline TSynGutterPartList
     inline TSynGutterPartList
       object TSynGutterLineNumber
       object TSynGutterLineNumber
         Width = 17
         Width = 17
         MouseActions = <>
         MouseActions = <>
         MarkupInfo.Background = 13820657
         MarkupInfo.Background = 13820657
         MarkupInfo.Foreground = clNone
         MarkupInfo.Foreground = clNone
+        MarkupInfo.FrameEdges = sfeAround
         DigitCount = 2
         DigitCount = 2
         ShowOnlyLineNumbersMultiplesOf = 1
         ShowOnlyLineNumbersMultiplesOf = 1
         ZeroStart = False
         ZeroStart = False
@@ -652,7 +599,7 @@ object fmViewView: TfmViewView
   end
   end
   object edName: TEdit
   object edName: TEdit
     Left = 104
     Left = 104
-    Height = 21
+    Height = 13
     Top = 12
     Top = 12
     Width = 280
     Width = 280
     AutoSelect = False
     AutoSelect = False

+ 150 - 149
viewview.lrs

@@ -1,153 +1,154 @@
+{ This is an automatically generated lazarus resource file }
+
 LazarusResources.Add('TfmViewView','FORMDATA',[
 LazarusResources.Add('TfmViewView','FORMDATA',[
   'TPF0'#11'TfmViewView'#10'fmViewView'#4'Left'#3'j'#1#6'Height'#3','#1#3'Top'#3
   'TPF0'#11'TfmViewView'#10'fmViewView'#4'Left'#3'j'#1#6'Height'#3','#1#3'Top'#3
   +#201#0#5'Width'#3#245#1#10'AlphaBlend'#9#7'Caption'#6#10'fmViewView'#12'Clie'
   +#201#0#5'Width'#3#245#1#10'AlphaBlend'#9#7'Caption'#6#10'fmViewView'#12'Clie'
-  +'ntHeight'#3','#1#11'ClientWidth'#3#245#1#7'OnClose'#7#9'FormClose'#8'Positi'
-  +'on'#7#14'poScreenCenter'#10'LCLVersion'#6#6'0.9.31'#0#6'TLabel'#6'Label1'#4
-  +'Left'#2#11#6'Height'#2#18#3'Top'#2#15#5'Width'#2'M'#7'Caption'#6#9'View Nam'
-  +'e'#11'ParentColor'#8#0#0#6'TLabel'#6'Label2'#4'Left'#2#11#6'Height'#2#18#3
-  +'Top'#2'0'#5'Width'#2'#'#7'Caption'#6#4'Body'#11'ParentColor'#8#0#0#244#8'TS'
-  +'ynEdit'#8'seScript'#4'Left'#2#8#6'Height'#3#215#0#3'Top'#2'L'#5'Width'#3#225
-  +#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#11'Font.Height'
-  +#2#243#9'Font.Name'#6#11'Courier New'#10'Font.Pitch'#7#7'fpFixed'#12'Font.Qu'
-  +'ality'#7#16'fqNonAntialiased'#11'ParentColor'#8#10'ParentFont'#8#8'TabOrder'
-  +#2#0#12'Gutter.Color'#4#249#242#234#0#12'Gutter.Width'#2#17#19'Gutter.MouseA'
-  +'ctions'#14#1#5'Shift'#11#0#9'ShiftMask'#11#0#6'Button'#7#6'mbLeft'#10'Click'
-  +'Count'#7#5'ccAny'#8'ClickDir'#7#6'cdDown'#7'Command'#2#13#9'MoveCaret'#8#6
-  +'Option'#2#0#8'Priority'#2#0#0#1#5'Shift'#11#0#9'ShiftMask'#11#0#6'Button'#7
-  +#7'mbRight'#10'ClickCount'#7#8'ccSingle'#8'ClickDir'#7#4'cdUp'#7'Command'#2
-  +#12#9'MoveCaret'#8#6'Option'#2#0#8'Priority'#2#0#0#0#17'RightGutter.Width'#2
-  +#0#24'RightGutter.MouseActions'#14#1#5'Shift'#11#0#9'ShiftMask'#11#0#6'Butto'
-  +'n'#7#6'mbLeft'#10'ClickCount'#7#5'ccAny'#8'ClickDir'#7#6'cdDown'#7'Command'
-  +#2#13#9'MoveCaret'#8#6'Option'#2#0#8'Priority'#2#0#0#1#5'Shift'#11#0#9'Shift'
-  +'Mask'#11#0#6'Button'#7#7'mbRight'#10'ClickCount'#7#8'ccSingle'#8'ClickDir'#7
-  +#4'cdUp'#7'Command'#2#12#9'MoveCaret'#8#6'Option'#2#0#8'Priority'#2#0#0#0#11
-  +'Highlighter'#7#10'SynSQLSyn1'#10'Keystrokes'#14#1#7'Command'#7#4'ecUp'#8'Sh'
-  +'ortCut'#2'&'#0#1#7'Command'#7#7'ecSelUp'#8'ShortCut'#3'& '#0#1#7'Command'#7
-  +#10'ecScrollUp'#8'ShortCut'#3'&@'#0#1#7'Command'#7#6'ecDown'#8'ShortCut'#2'('
-  +#0#1#7'Command'#7#9'ecSelDown'#8'ShortCut'#3'( '#0#1#7'Command'#7#12'ecScrol'
-  +'lDown'#8'ShortCut'#3'(@'#0#1#7'Command'#7#6'ecLeft'#8'ShortCut'#2'%'#0#1#7
-  +'Command'#7#9'ecSelLeft'#8'ShortCut'#3'% '#0#1#7'Command'#7#10'ecWordLeft'#8
-  +'ShortCut'#3'%@'#0#1#7'Command'#7#13'ecSelWordLeft'#8'ShortCut'#3'%`'#0#1#7
-  +'Command'#7#7'ecRight'#8'ShortCut'#2''''#0#1#7'Command'#7#10'ecSelRight'#8'S'
-  +'hortCut'#3''' '#0#1#7'Command'#7#11'ecWordRight'#8'ShortCut'#3'''@'#0#1#7'C'
-  +'ommand'#7#14'ecSelWordRight'#8'ShortCut'#3'''`'#0#1#7'Command'#7#10'ecPageD'
-  +'own'#8'ShortCut'#2'"'#0#1#7'Command'#7#13'ecSelPageDown'#8'ShortCut'#3'" '#0
-  +#1#7'Command'#7#12'ecPageBottom'#8'ShortCut'#3'"@'#0#1#7'Command'#7#15'ecSel'
-  +'PageBottom'#8'ShortCut'#3'"`'#0#1#7'Command'#7#8'ecPageUp'#8'ShortCut'#2'!'
-  +#0#1#7'Command'#7#11'ecSelPageUp'#8'ShortCut'#3'! '#0#1#7'Command'#7#9'ecPag'
-  +'eTop'#8'ShortCut'#3'!@'#0#1#7'Command'#7#12'ecSelPageTop'#8'ShortCut'#3'!`'
-  +#0#1#7'Command'#7#11'ecLineStart'#8'ShortCut'#2'$'#0#1#7'Command'#7#14'ecSel'
-  +'LineStart'#8'ShortCut'#3'$ '#0#1#7'Command'#7#11'ecEditorTop'#8'ShortCut'#3
-  +'$@'#0#1#7'Command'#7#14'ecSelEditorTop'#8'ShortCut'#3'$`'#0#1#7'Command'#7#9
-  +'ecLineEnd'#8'ShortCut'#2'#'#0#1#7'Command'#7#12'ecSelLineEnd'#8'ShortCut'#3
-  +'# '#0#1#7'Command'#7#14'ecEditorBottom'#8'ShortCut'#3'#@'#0#1#7'Command'#7
-  +#17'ecSelEditorBottom'#8'ShortCut'#3'#`'#0#1#7'Command'#7#12'ecToggleMode'#8
-  +'ShortCut'#2'-'#0#1#7'Command'#7#6'ecCopy'#8'ShortCut'#3'-@'#0#1#7'Command'#7
-  +#7'ecPaste'#8'ShortCut'#3'- '#0#1#7'Command'#7#12'ecDeleteChar'#8'ShortCut'#2
-  +'.'#0#1#7'Command'#7#5'ecCut'#8'ShortCut'#3'. '#0#1#7'Command'#7#16'ecDelete'
-  +'LastChar'#8'ShortCut'#2#8#0#1#7'Command'#7#16'ecDeleteLastChar'#8'ShortCut'
-  +#3#8' '#0#1#7'Command'#7#16'ecDeleteLastWord'#8'ShortCut'#3#8'@'#0#1#7'Comma'
-  +'nd'#7#6'ecUndo'#8'ShortCut'#4#8#128#0#0#0#1#7'Command'#7#6'ecRedo'#8'ShortC'
-  +'ut'#4#8#160#0#0#0#1#7'Command'#7#11'ecLineBreak'#8'ShortCut'#2#13#0#1#7'Com'
-  +'mand'#7#11'ecSelectAll'#8'ShortCut'#3'A@'#0#1#7'Command'#7#6'ecCopy'#8'Shor'
-  +'tCut'#3'C@'#0#1#7'Command'#7#13'ecBlockIndent'#8'ShortCut'#3'I`'#0#1#7'Comm'
-  +'and'#7#11'ecLineBreak'#8'ShortCut'#3'M@'#0#1#7'Command'#7#12'ecInsertLine'#8
-  +'ShortCut'#3'N@'#0#1#7'Command'#7#12'ecDeleteWord'#8'ShortCut'#3'T@'#0#1#7'C'
-  +'ommand'#7#15'ecBlockUnindent'#8'ShortCut'#3'U`'#0#1#7'Command'#7#7'ecPaste'
-  +#8'ShortCut'#3'V@'#0#1#7'Command'#7#5'ecCut'#8'ShortCut'#3'X@'#0#1#7'Command'
-  +#7#12'ecDeleteLine'#8'ShortCut'#3'Y@'#0#1#7'Command'#7#11'ecDeleteEOL'#8'Sho'
-  +'rtCut'#3'Y`'#0#1#7'Command'#7#6'ecUndo'#8'ShortCut'#3'Z@'#0#1#7'Command'#7#6
-  +'ecRedo'#8'ShortCut'#3'Z`'#0#1#7'Command'#7#13'ecGotoMarker0'#8'ShortCut'#3
-  +'0@'#0#1#7'Command'#7#13'ecGotoMarker1'#8'ShortCut'#3'1@'#0#1#7'Command'#7#13
-  +'ecGotoMarker2'#8'ShortCut'#3'2@'#0#1#7'Command'#7#13'ecGotoMarker3'#8'Short'
-  +'Cut'#3'3@'#0#1#7'Command'#7#13'ecGotoMarker4'#8'ShortCut'#3'4@'#0#1#7'Comma'
-  +'nd'#7#13'ecGotoMarker5'#8'ShortCut'#3'5@'#0#1#7'Command'#7#13'ecGotoMarker6'
-  +#8'ShortCut'#3'6@'#0#1#7'Command'#7#13'ecGotoMarker7'#8'ShortCut'#3'7@'#0#1#7
-  ,'Command'#7#13'ecGotoMarker8'#8'ShortCut'#3'8@'#0#1#7'Command'#7#13'ecGotoMa'
-  +'rker9'#8'ShortCut'#3'9@'#0#1#7'Command'#7#12'ecSetMarker0'#8'ShortCut'#3'0`'
-  +#0#1#7'Command'#7#12'ecSetMarker1'#8'ShortCut'#3'1`'#0#1#7'Command'#7#12'ecS'
-  +'etMarker2'#8'ShortCut'#3'2`'#0#1#7'Command'#7#12'ecSetMarker3'#8'ShortCut'#3
-  +'3`'#0#1#7'Command'#7#12'ecSetMarker4'#8'ShortCut'#3'4`'#0#1#7'Command'#7#12
-  +'ecSetMarker5'#8'ShortCut'#3'5`'#0#1#7'Command'#7#12'ecSetMarker6'#8'ShortCu'
-  +'t'#3'6`'#0#1#7'Command'#7#12'ecSetMarker7'#8'ShortCut'#3'7`'#0#1#7'Command'
-  +#7#12'ecSetMarker8'#8'ShortCut'#3'8`'#0#1#7'Command'#7#12'ecSetMarker9'#8'Sh'
-  +'ortCut'#3'9`'#0#1#7'Command'#7#12'EcFoldLevel1'#8'ShortCut'#4'1'#160#0#0#0#1
-  +#7'Command'#7#12'EcFoldLevel2'#8'ShortCut'#4'2'#160#0#0#0#1#7'Command'#7#12
-  +'EcFoldLevel1'#8'ShortCut'#4'3'#160#0#0#0#1#7'Command'#7#12'EcFoldLevel1'#8
-  +'ShortCut'#4'4'#160#0#0#0#1#7'Command'#7#12'EcFoldLevel1'#8'ShortCut'#4'5'
-  +#160#0#0#0#1#7'Command'#7#12'EcFoldLevel6'#8'ShortCut'#4'6'#160#0#0#0#1#7'Co'
-  +'mmand'#7#12'EcFoldLevel7'#8'ShortCut'#4'7'#160#0#0#0#1#7'Command'#7#12'EcFo'
-  +'ldLevel8'#8'ShortCut'#4'8'#160#0#0#0#1#7'Command'#7#12'EcFoldLevel9'#8'Shor'
-  +'tCut'#4'9'#160#0#0#0#1#7'Command'#7#12'EcFoldLevel0'#8'ShortCut'#4'0'#160#0
-  +#0#0#1#7'Command'#7#13'EcFoldCurrent'#8'ShortCut'#4'-'#160#0#0#0#1#7'Command'
-  +#7#15'EcUnFoldCurrent'#8'ShortCut'#4'+'#160#0#0#0#1#7'Command'#7#18'EcToggle'
-  +'MarkupWord'#8'ShortCut'#4'M'#128#0#0#0#1#7'Command'#7#14'ecNormalSelect'#8
-  +'ShortCut'#3'N`'#0#1#7'Command'#7#14'ecColumnSelect'#8'ShortCut'#3'C`'#0#1#7
-  +'Command'#7#12'ecLineSelect'#8'ShortCut'#3'L`'#0#1#7'Command'#7#5'ecTab'#8'S'
-  +'hortCut'#2#9#0#1#7'Command'#7#10'ecShiftTab'#8'ShortCut'#3#9' '#0#1#7'Comma'
-  +'nd'#7#14'ecMatchBracket'#8'ShortCut'#3'B`'#0#1#7'Command'#7#10'ecColSelUp'#8
-  +'ShortCut'#4'&'#160#0#0#0#1#7'Command'#7#12'ecColSelDown'#8'ShortCut'#4'('
-  +#160#0#0#0#1#7'Command'#7#12'ecColSelLeft'#8'ShortCut'#4'%'#160#0#0#0#1#7'Co'
-  +'mmand'#7#13'ecColSelRight'#8'ShortCut'#4''''#160#0#0#0#1#7'Command'#7#16'ec'
-  +'ColSelPageDown'#8'ShortCut'#4'"'#160#0#0#0#1#7'Command'#7#18'ecColSelPageBo'
-  +'ttom'#8'ShortCut'#4'"'#224#0#0#0#1#7'Command'#7#14'ecColSelPageUp'#8'ShortC'
-  +'ut'#4'!'#160#0#0#0#1#7'Command'#7#15'ecColSelPageTop'#8'ShortCut'#4'!'#224#0
-  +#0#0#1#7'Command'#7#17'ecColSelLineStart'#8'ShortCut'#4'$'#160#0#0#0#1#7'Com'
-  +'mand'#7#15'ecColSelLineEnd'#8'ShortCut'#4'#'#160#0#0#0#1#7'Command'#7#17'ec'
-  +'ColSelEditorTop'#8'ShortCut'#4'$'#224#0#0#0#1#7'Command'#7#20'ecColSelEdito'
-  +'rBottom'#8'ShortCut'#4'#'#224#0#0#0#0#12'MouseActions'#14#1#5'Shift'#11#0#9
-  +'ShiftMask'#11#7'ssShift'#5'ssAlt'#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#8
-  +'ccSingle'#8'ClickDir'#7#6'cdDown'#7'Command'#2#1#9'MoveCaret'#9#6'Option'#2
-  +#0#8'Priority'#2#0#0#1#5'Shift'#11#7'ssShift'#0#9'ShiftMask'#11#7'ssShift'#5
-  +'ssAlt'#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#8'ccSingle'#8'ClickDir'#7#6
-  +'cdDown'#7'Command'#2#1#9'MoveCaret'#9#6'Option'#2#1#8'Priority'#2#0#0#1#5'S'
-  +'hift'#11#5'ssAlt'#0#9'ShiftMask'#11#7'ssShift'#5'ssAlt'#0#6'Button'#7#6'mbL'
-  +'eft'#10'ClickCount'#7#8'ccSingle'#8'ClickDir'#7#6'cdDown'#7'Command'#2#3#9
-  +'MoveCaret'#9#6'Option'#2#0#8'Priority'#2#0#0#1#5'Shift'#11#7'ssShift'#5'ssA'
-  +'lt'#0#9'ShiftMask'#11#7'ssShift'#5'ssAlt'#0#6'Button'#7#6'mbLeft'#10'ClickC'
-  +'ount'#7#8'ccSingle'#8'ClickDir'#7#6'cdDown'#7'Command'#2#3#9'MoveCaret'#9#6
-  +'Option'#2#1#8'Priority'#2#0#0#1#5'Shift'#11#0#9'ShiftMask'#11#0#6'Button'#7
-  +#7'mbRight'#10'ClickCount'#7#8'ccSingle'#8'ClickDir'#7#4'cdUp'#7'Command'#2
-  +#12#9'MoveCaret'#8#6'Option'#2#0#8'Priority'#2#0#0#1#5'Shift'#11#0#9'ShiftMa'
-  +'sk'#11#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#8'ccDouble'#8'ClickDir'#7#6
-  +'cdDown'#7'Command'#2#6#9'MoveCaret'#9#6'Option'#2#0#8'Priority'#2#0#0#1#5'S'
-  +'hift'#11#0#9'ShiftMask'#11#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#8'ccTri'
-  +'ple'#8'ClickDir'#7#6'cdDown'#7'Command'#2#7#9'MoveCaret'#9#6'Option'#2#0#8
-  +'Priority'#2#0#0#1#5'Shift'#11#0#9'ShiftMask'#11#0#6'Button'#7#6'mbLeft'#10
-  +'ClickCount'#7#6'ccQuad'#8'ClickDir'#7#6'cdDown'#7'Command'#2#8#9'MoveCaret'
-  +#9#6'Option'#2#0#8'Priority'#2#0#0#1#5'Shift'#11#0#9'ShiftMask'#11#0#6'Butto'
-  +'n'#7#8'mbMiddle'#10'ClickCount'#7#8'ccSingle'#8'ClickDir'#7#6'cdDown'#7'Com'
-  +'mand'#2#10#9'MoveCaret'#9#6'Option'#2#0#8'Priority'#2#0#0#1#5'Shift'#11#6's'
-  +'sCtrl'#0#9'ShiftMask'#11#7'ssShift'#5'ssAlt'#6'ssCtrl'#0#6'Button'#7#6'mbLe'
-  +'ft'#10'ClickCount'#7#8'ccSingle'#8'ClickDir'#7#4'cdUp'#7'Command'#2#11#9'Mo'
-  +'veCaret'#8#6'Option'#2#0#8'Priority'#2#0#0#0#15'MouseSelActions'#14#1#5'Shi'
-  +'ft'#11#0#9'ShiftMask'#11#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#8'ccSingl'
-  +'e'#8'ClickDir'#7#6'cdDown'#7'Command'#2#9#9'MoveCaret'#8#6'Option'#2#0#8'Pr'
-  +'iority'#2#0#0#0#8'ReadOnly'#9#9'RightEdge'#2'x'#14'RightEdgeColor'#4#240#205
-  +#205#0#21'BracketHighlightStyle'#7#8'sbhsBoth'#0#244#18'TSynGutterPartList'#0
-  +#0#20'TSynGutterLineNumber'#0#5'Width'#2#17#12'MouseActions'#14#0#21'MarkupI'
-  +'nfo.Background'#4#241#226#210#0#21'MarkupInfo.Foreground'#7#6'clNone'#10'Di'
-  ,'gitCount'#2#2#30'ShowOnlyLineNumbersMultiplesOf'#2#1#9'ZeroStart'#8#12'Lead'
-  +'ingZeros'#8#0#0#0#0#5'TEdit'#6'edName'#4'Left'#2'h'#6'Height'#2#21#3'Top'#2
-  +#12#5'Width'#3#24#1#10'AutoSelect'#8#11'BorderStyle'#7#6'bsNone'#10'Font.Col'
-  +'or'#7#6'clNavy'#10'ParentFont'#8#8'ReadOnly'#9#8'TabOrder'#2#1#4'Text'#6#9
-  +'edGenName'#0#0#7'TBitBtn'#7'bbClose'#4'Left'#3#218#1#6'Height'#2#24#3'Top'#2
-  +#4#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#2#0#0#10'TSynSQLSyn'#10'SynSQLSyn1'
-  +#13'DefaultFilter'#6#23'SQL Files (*.sql)|*.sql'#7'Enabled'#8#23'CommentAttr'
-  +'i.Foreground'#7#6'clTeal'#23'CommentAttri.FrameEdges'#7#9'sfeAround'#24'Dat'
-  +'aTypeAttri.FrameEdges'#7#9'sfeAround'#30'DefaultPackageAttri.FrameEdges'#7#9
-  +'sfeAround'#25'ExceptionAttri.FrameEdges'#7#9'sfeAround'#24'FunctionAttri.Fr'
-  +'ameEdges'#7#9'sfeAround'#26'IdentifierAttri.Foreground'#4'1'#26#255#0#26'Id'
-  +'entifierAttri.FrameEdges'#7#9'sfeAround'#19'KeyAttri.FrameEdges'#7#9'sfeAro'
-  +'und'#22'NumberAttri.Foreground'#7#9'clMedGray'#22'NumberAttri.FrameEdges'#7
-  +#9'sfeAround'#21'PLSQLAttri.FrameEdges'#7#9'sfeAround'#21'SpaceAttri.FrameEd'
-  +'ges'#7#9'sfeAround'#23'SQLPlusAttri.FrameEdges'#7#9'sfeAround'#22'StringAtt'
-  +'ri.Foreground'#4#161#16#16#0#22'StringAttri.FrameEdges'#7#9'sfeAround'#22'S'
-  +'ymbolAttri.Foreground'#4'b'#8#8#0#22'SymbolAttri.FrameEdges'#7#9'sfeAround'
-  +#25'TableNameAttri.Foreground'#7#6'clNavy'#25'TableNameAttri.FrameEdges'#7#9
-  +'sfeAround'#20'TableNameAttri.Style'#11#6'fsBold'#0#24'VariableAttri.FrameEd'
-  +'ges'#7#9'sfeAround'#10'SQLDialect'#7#9'sqlSybase'#4'left'#3#253#0#3'top'#3
-  +#152#0#0#0#0
+  +'ntHeight'#3','#1#11'ClientWidth'#3#245#1#10'KeyPreview'#9#7'OnClose'#7#9'Fo'
+  +'rmClose'#9'OnKeyDown'#7#11'FormKeyDown'#8'Position'#7#14'poScreenCenter'#10
+  +'LCLVersion'#6#7'1.2.0.3'#0#6'TLabel'#6'Label1'#4'Left'#2#11#6'Height'#2#13#3
+  +'Top'#2#15#5'Width'#2'4'#7'Caption'#6#9'View Name'#11'ParentColor'#8#0#0#6'T'
+  +'Label'#6'Label2'#4'Left'#2#11#6'Height'#2#13#3'Top'#2'0'#5'Width'#2#24#7'Ca'
+  +'ption'#6#4'Body'#11'ParentColor'#8#0#0#244#8'TSynEdit'#8'seScript'#4'Left'#2
+  +#8#6'Height'#3#215#0#3'Top'#2'L'#5'Width'#3#225#1#7'Anchors'#11#5'akTop'#6'a'
+  +'kLeft'#7'akRight'#8'akBottom'#0#11'Font.Height'#2#243#9'Font.Name'#6#11'Cou'
+  +'rier New'#10'Font.Pitch'#7#7'fpFixed'#12'Font.Quality'#7#16'fqNonAntialiase'
+  +'d'#11'ParentColor'#8#10'ParentFont'#8#8'TabOrder'#2#0#12'Gutter.Color'#4#249
+  +#242#234#0#12'Gutter.Width'#2#17#19'Gutter.MouseActions'#14#1#10'ClickCount'
+  +#7#5'ccAny'#8'ClickDir'#7#6'cdDown'#7'Command'#7#20'emcOnMainGutterClick'#0#1
+  +#6'Button'#7#7'mbRight'#7'Command'#7#14'emcContextMenu'#0#0#17'RightGutter.W'
+  +'idth'#2#0#24'RightGutter.MouseActions'#14#1#10'ClickCount'#7#5'ccAny'#8'Cli'
+  +'ckDir'#7#6'cdDown'#7'Command'#7#20'emcOnMainGutterClick'#0#1#6'Button'#7#7
+  +'mbRight'#7'Command'#7#14'emcContextMenu'#0#0#11'Highlighter'#7#10'SynSQLSyn'
+  +'1'#10'Keystrokes'#14#1#7'Command'#7#4'ecUp'#8'ShortCut'#2'&'#0#1#7'Command'
+  +#7#7'ecSelUp'#8'ShortCut'#3'& '#0#1#7'Command'#7#10'ecScrollUp'#8'ShortCut'#3
+  +'&@'#0#1#7'Command'#7#6'ecDown'#8'ShortCut'#2'('#0#1#7'Command'#7#9'ecSelDow'
+  +'n'#8'ShortCut'#3'( '#0#1#7'Command'#7#12'ecScrollDown'#8'ShortCut'#3'(@'#0#1
+  +#7'Command'#7#6'ecLeft'#8'ShortCut'#2'%'#0#1#7'Command'#7#9'ecSelLeft'#8'Sho'
+  +'rtCut'#3'% '#0#1#7'Command'#7#10'ecWordLeft'#8'ShortCut'#3'%@'#0#1#7'Comman'
+  +'d'#7#13'ecSelWordLeft'#8'ShortCut'#3'%`'#0#1#7'Command'#7#7'ecRight'#8'Shor'
+  +'tCut'#2''''#0#1#7'Command'#7#10'ecSelRight'#8'ShortCut'#3''' '#0#1#7'Comman'
+  +'d'#7#11'ecWordRight'#8'ShortCut'#3'''@'#0#1#7'Command'#7#14'ecSelWordRight'
+  +#8'ShortCut'#3'''`'#0#1#7'Command'#7#10'ecPageDown'#8'ShortCut'#2'"'#0#1#7'C'
+  +'ommand'#7#13'ecSelPageDown'#8'ShortCut'#3'" '#0#1#7'Command'#7#12'ecPageBot'
+  +'tom'#8'ShortCut'#3'"@'#0#1#7'Command'#7#15'ecSelPageBottom'#8'ShortCut'#3'"'
+  +'`'#0#1#7'Command'#7#8'ecPageUp'#8'ShortCut'#2'!'#0#1#7'Command'#7#11'ecSelP'
+  +'ageUp'#8'ShortCut'#3'! '#0#1#7'Command'#7#9'ecPageTop'#8'ShortCut'#3'!@'#0#1
+  +#7'Command'#7#12'ecSelPageTop'#8'ShortCut'#3'!`'#0#1#7'Command'#7#11'ecLineS'
+  +'tart'#8'ShortCut'#2'$'#0#1#7'Command'#7#14'ecSelLineStart'#8'ShortCut'#3'$ '
+  +#0#1#7'Command'#7#11'ecEditorTop'#8'ShortCut'#3'$@'#0#1#7'Command'#7#14'ecSe'
+  +'lEditorTop'#8'ShortCut'#3'$`'#0#1#7'Command'#7#9'ecLineEnd'#8'ShortCut'#2'#'
+  +#0#1#7'Command'#7#12'ecSelLineEnd'#8'ShortCut'#3'# '#0#1#7'Command'#7#14'ecE'
+  +'ditorBottom'#8'ShortCut'#3'#@'#0#1#7'Command'#7#17'ecSelEditorBottom'#8'Sho'
+  +'rtCut'#3'#`'#0#1#7'Command'#7#12'ecToggleMode'#8'ShortCut'#2'-'#0#1#7'Comma'
+  +'nd'#7#6'ecCopy'#8'ShortCut'#3'-@'#0#1#7'Command'#7#7'ecPaste'#8'ShortCut'#3
+  +'- '#0#1#7'Command'#7#12'ecDeleteChar'#8'ShortCut'#2'.'#0#1#7'Command'#7#5'e'
+  +'cCut'#8'ShortCut'#3'. '#0#1#7'Command'#7#16'ecDeleteLastChar'#8'ShortCut'#2
+  +#8#0#1#7'Command'#7#16'ecDeleteLastChar'#8'ShortCut'#3#8' '#0#1#7'Command'#7
+  +#16'ecDeleteLastWord'#8'ShortCut'#3#8'@'#0#1#7'Command'#7#6'ecUndo'#8'ShortC'
+  +'ut'#4#8#128#0#0#0#1#7'Command'#7#6'ecRedo'#8'ShortCut'#4#8#160#0#0#0#1#7'Co'
+  +'mmand'#7#11'ecLineBreak'#8'ShortCut'#2#13#0#1#7'Command'#7#11'ecSelectAll'#8
+  +'ShortCut'#3'A@'#0#1#7'Command'#7#6'ecCopy'#8'ShortCut'#3'C@'#0#1#7'Command'
+  +#7#13'ecBlockIndent'#8'ShortCut'#3'I`'#0#1#7'Command'#7#11'ecLineBreak'#8'Sh'
+  +'ortCut'#3'M@'#0#1#7'Command'#7#12'ecInsertLine'#8'ShortCut'#3'N@'#0#1#7'Com'
+  +'mand'#7#12'ecDeleteWord'#8'ShortCut'#3'T@'#0#1#7'Command'#7#15'ecBlockUnind'
+  +'ent'#8'ShortCut'#3'U`'#0#1#7'Command'#7#7'ecPaste'#8'ShortCut'#3'V@'#0#1#7
+  +'Command'#7#5'ecCut'#8'ShortCut'#3'X@'#0#1#7'Command'#7#12'ecDeleteLine'#8'S'
+  +'hortCut'#3'Y@'#0#1#7'Command'#7#11'ecDeleteEOL'#8'ShortCut'#3'Y`'#0#1#7'Com'
+  +'mand'#7#6'ecUndo'#8'ShortCut'#3'Z@'#0#1#7'Command'#7#6'ecRedo'#8'ShortCut'#3
+  +'Z`'#0#1#7'Command'#7#13'ecGotoMarker0'#8'ShortCut'#3'0@'#0#1#7'Command'#7#13
+  +'ecGotoMarker1'#8'ShortCut'#3'1@'#0#1#7'Command'#7#13'ecGotoMarker2'#8'Short'
+  +'Cut'#3'2@'#0#1#7'Command'#7#13'ecGotoMarker3'#8'ShortCut'#3'3@'#0#1#7'Comma'
+  +'nd'#7#13'ecGotoMarker4'#8'ShortCut'#3'4@'#0#1#7'Command'#7#13'ecGotoMarker5'
+  +#8'ShortCut'#3'5@'#0#1#7'Command'#7#13'ecGotoMarker6'#8'ShortCut'#3'6@'#0#1#7
+  +'Command'#7#13'ecGotoMarker7'#8'ShortCut'#3'7@'#0#1#7'Command'#7#13'ecGotoMa'
+  +'rker8'#8'ShortCut'#3'8@'#0#1#7'Command'#7#13'ecGotoMarker9'#8'ShortCut'#3'9'
+  +'@'#0#1#7'Command'#7#12'ecSetMarker0'#8'ShortCut'#3'0`'#0#1#7'Command'#7#12
+  +'ecSetMarker1'#8'ShortCut'#3'1`'#0#1#7'Command'#7#12'ecSetMarker2'#8'ShortCu'
+  +'t'#3'2`'#0#1#7'Command'#7#12'ecSetMarker3'#8'ShortCut'#3'3`'#0#1#7'Command'
+  ,#7#12'ecSetMarker4'#8'ShortCut'#3'4`'#0#1#7'Command'#7#12'ecSetMarker5'#8'Sh'
+  +'ortCut'#3'5`'#0#1#7'Command'#7#12'ecSetMarker6'#8'ShortCut'#3'6`'#0#1#7'Com'
+  +'mand'#7#12'ecSetMarker7'#8'ShortCut'#3'7`'#0#1#7'Command'#7#12'ecSetMarker8'
+  +#8'ShortCut'#3'8`'#0#1#7'Command'#7#12'ecSetMarker9'#8'ShortCut'#3'9`'#0#1#7
+  +'Command'#7#12'EcFoldLevel1'#8'ShortCut'#4'1'#160#0#0#0#1#7'Command'#7#12'Ec'
+  +'FoldLevel2'#8'ShortCut'#4'2'#160#0#0#0#1#7'Command'#7#12'EcFoldLevel1'#8'Sh'
+  +'ortCut'#4'3'#160#0#0#0#1#7'Command'#7#12'EcFoldLevel1'#8'ShortCut'#4'4'#160
+  +#0#0#0#1#7'Command'#7#12'EcFoldLevel1'#8'ShortCut'#4'5'#160#0#0#0#1#7'Comman'
+  +'d'#7#12'EcFoldLevel6'#8'ShortCut'#4'6'#160#0#0#0#1#7'Command'#7#12'EcFoldLe'
+  +'vel7'#8'ShortCut'#4'7'#160#0#0#0#1#7'Command'#7#12'EcFoldLevel8'#8'ShortCut'
+  +#4'8'#160#0#0#0#1#7'Command'#7#12'EcFoldLevel9'#8'ShortCut'#4'9'#160#0#0#0#1
+  +#7'Command'#7#12'EcFoldLevel0'#8'ShortCut'#4'0'#160#0#0#0#1#7'Command'#7#13
+  +'EcFoldCurrent'#8'ShortCut'#4'-'#160#0#0#0#1#7'Command'#7#15'EcUnFoldCurrent'
+  +#8'ShortCut'#4'+'#160#0#0#0#1#7'Command'#7#18'EcToggleMarkupWord'#8'ShortCut'
+  +#4'M'#128#0#0#0#1#7'Command'#7#14'ecNormalSelect'#8'ShortCut'#3'N`'#0#1#7'Co'
+  +'mmand'#7#14'ecColumnSelect'#8'ShortCut'#3'C`'#0#1#7'Command'#7#12'ecLineSel'
+  +'ect'#8'ShortCut'#3'L`'#0#1#7'Command'#7#5'ecTab'#8'ShortCut'#2#9#0#1#7'Comm'
+  +'and'#7#10'ecShiftTab'#8'ShortCut'#3#9' '#0#1#7'Command'#7#14'ecMatchBracket'
+  +#8'ShortCut'#3'B`'#0#1#7'Command'#7#10'ecColSelUp'#8'ShortCut'#4'&'#160#0#0#0
+  +#1#7'Command'#7#12'ecColSelDown'#8'ShortCut'#4'('#160#0#0#0#1#7'Command'#7#12
+  +'ecColSelLeft'#8'ShortCut'#4'%'#160#0#0#0#1#7'Command'#7#13'ecColSelRight'#8
+  +'ShortCut'#4''''#160#0#0#0#1#7'Command'#7#16'ecColSelPageDown'#8'ShortCut'#4
+  +'"'#160#0#0#0#1#7'Command'#7#18'ecColSelPageBottom'#8'ShortCut'#4'"'#224#0#0
+  +#0#1#7'Command'#7#14'ecColSelPageUp'#8'ShortCut'#4'!'#160#0#0#0#1#7'Command'
+  +#7#15'ecColSelPageTop'#8'ShortCut'#4'!'#224#0#0#0#1#7'Command'#7#17'ecColSel'
+  +'LineStart'#8'ShortCut'#4'$'#160#0#0#0#1#7'Command'#7#15'ecColSelLineEnd'#8
+  +'ShortCut'#4'#'#160#0#0#0#1#7'Command'#7#17'ecColSelEditorTop'#8'ShortCut'#4
+  +'$'#224#0#0#0#1#7'Command'#7#20'ecColSelEditorBottom'#8'ShortCut'#4'#'#224#0
+  +#0#0#0#12'MouseActions'#14#1#9'ShiftMask'#11#7'ssShift'#5'ssAlt'#0#8'ClickDi'
+  +'r'#7#6'cdDown'#7'Command'#7#18'emcStartSelections'#9'MoveCaret'#9#0#1#5'Shi'
+  +'ft'#11#7'ssShift'#0#9'ShiftMask'#11#7'ssShift'#5'ssAlt'#0#8'ClickDir'#7#6'c'
+  +'dDown'#7'Command'#7#18'emcStartSelections'#9'MoveCaret'#9#6'Option'#2#1#0#1
+  +#5'Shift'#11#5'ssAlt'#0#9'ShiftMask'#11#7'ssShift'#5'ssAlt'#0#8'ClickDir'#7#6
+  +'cdDown'#7'Command'#7#24'emcStartColumnSelections'#9'MoveCaret'#9#0#1#5'Shif'
+  +'t'#11#7'ssShift'#5'ssAlt'#0#9'ShiftMask'#11#7'ssShift'#5'ssAlt'#0#8'ClickDi'
+  +'r'#7#6'cdDown'#7'Command'#7#24'emcStartColumnSelections'#9'MoveCaret'#9#6'O'
+  +'ption'#2#1#0#1#6'Button'#7#7'mbRight'#7'Command'#7#14'emcContextMenu'#0#1#10
+  +'ClickCount'#7#8'ccDouble'#8'ClickDir'#7#6'cdDown'#7'Command'#7#13'emcSelect'
+  +'Word'#9'MoveCaret'#9#0#1#10'ClickCount'#7#8'ccTriple'#8'ClickDir'#7#6'cdDow'
+  +'n'#7'Command'#7#13'emcSelectLine'#9'MoveCaret'#9#0#1#10'ClickCount'#7#6'ccQ'
+  +'uad'#8'ClickDir'#7#6'cdDown'#7'Command'#7#13'emcSelectPara'#9'MoveCaret'#9#0
+  +#1#6'Button'#7#8'mbMiddle'#8'ClickDir'#7#6'cdDown'#7'Command'#7#17'emcPasteS'
+  +'election'#9'MoveCaret'#9#0#1#5'Shift'#11#6'ssCtrl'#0#9'ShiftMask'#11#7'ssSh'
+  +'ift'#5'ssAlt'#6'ssCtrl'#0#7'Command'#7#12'emcMouseLink'#0#0#15'MouseSelActi'
+  +'ons'#14#1#8'ClickDir'#7#6'cdDown'#7'Command'#7#16'emcStartDragMove'#0#0#19
+  +'VisibleSpecialChars'#11#8'vscSpace'#12'vscTabAtLast'#0#8'ReadOnly'#9#9'Righ'
+  +'tEdge'#2'x'#14'RightEdgeColor'#4#240#205#205#0#24'SelectedColor.FrameEdges'
+  +#7#9'sfeAround'#26'SelectedColor.BackPriority'#2'2'#26'SelectedColor.ForePri'
+  +'ority'#2'2'#27'SelectedColor.FramePriority'#2'2'#26'SelectedColor.BoldPrior'
+  +'ity'#2'2'#28'SelectedColor.ItalicPriority'#2'2'#31'SelectedColor.UnderlineP'
+  +'riority'#2'2'#31'SelectedColor.StrikeOutPriority'#2'2'#25'IncrementColor.Fr'
+  +'ameEdges'#7#9'sfeAround'#28'HighlightAllColor.FrameEdges'#7#9'sfeAround'#21
+  +'BracketHighlightStyle'#7#8'sbhsBoth'#28'BracketMatchColor.Background'#7#6'c'
+  +'lNone'#28'BracketMatchColor.Foreground'#7#6'clNone'#28'BracketMatchColor.Fr'
+  +'ameEdges'#7#9'sfeAround'#23'BracketMatchColor.Style'#11#6'fsBold'#0#26'Fold'
+  +'edCodeColor.Background'#7#6'clNone'#26'FoldedCodeColor.Foreground'#7#6'clGr'
+  +'ay'#26'FoldedCodeColor.FrameColor'#7#6'clGray'#26'FoldedCodeColor.FrameEdge'
+  +'s'#7#9'sfeAround'#25'MouseLinkColor.Background'#7#6'clNone'#25'MouseLinkCol'
+  +'or.Foreground'#7#6'clBlue'#25'MouseLinkColor.FrameEdges'#7#9'sfeAround'#29
+  +'LineHighlightColor.Background'#7#6'clNone'#29'LineHighlightColor.Foreground'
+  +#7#6'clNone'#29'LineHighlightColor.FrameEdges'#7#9'sfeAround'#0#244#18'TSynG'
+  +'utterPartList'#0#0#20'TSynGutterLineNumber'#0#5'Width'#2#17#12'MouseActions'
+  +#14#0#21'MarkupInfo.Background'#4#241#226#210#0#21'MarkupInfo.Foreground'#7#6
+  +'clNone'#21'MarkupInfo.FrameEdges'#7#9'sfeAround'#10'DigitCount'#2#2#30'Show'
+  ,'OnlyLineNumbersMultiplesOf'#2#1#9'ZeroStart'#8#12'LeadingZeros'#8#0#0#0#0#5
+  +'TEdit'#6'edName'#4'Left'#2'h'#6'Height'#2#13#3'Top'#2#12#5'Width'#3#24#1#10
+  +'AutoSelect'#8#11'BorderStyle'#7#6'bsNone'#10'Font.Color'#7#6'clNavy'#10'Par'
+  +'entFont'#8#8'ReadOnly'#9#8'TabOrder'#2#1#4'Text'#6#9'edGenName'#0#0#7'TBitB'
+  +'tn'#7'bbClose'#4'Left'#3#218#1#6'Height'#2#24#3'Top'#2#4#5'Width'#2#27#7'An'
+  +'chors'#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#2#0#0#10'TSynSQLSyn'#10'SynSQLSyn1'#13'DefaultFilter'#6#23
+  +'SQL Files (*.sql)|*.sql'#7'Enabled'#8#23'CommentAttri.Foreground'#7#6'clTea'
+  +'l'#23'CommentAttri.FrameEdges'#7#9'sfeAround'#24'DataTypeAttri.FrameEdges'#7
+  +#9'sfeAround'#30'DefaultPackageAttri.FrameEdges'#7#9'sfeAround'#25'Exception'
+  +'Attri.FrameEdges'#7#9'sfeAround'#24'FunctionAttri.FrameEdges'#7#9'sfeAround'
+  +#26'IdentifierAttri.Foreground'#4'1'#26#255#0#26'IdentifierAttri.FrameEdges'
+  +#7#9'sfeAround'#19'KeyAttri.FrameEdges'#7#9'sfeAround'#22'NumberAttri.Foregr'
+  +'ound'#7#9'clMedGray'#22'NumberAttri.FrameEdges'#7#9'sfeAround'#21'PLSQLAttr'
+  +'i.FrameEdges'#7#9'sfeAround'#21'SpaceAttri.FrameEdges'#7#9'sfeAround'#23'SQ'
+  +'LPlusAttri.FrameEdges'#7#9'sfeAround'#22'StringAttri.Foreground'#4#161#16#16
+  +#0#22'StringAttri.FrameEdges'#7#9'sfeAround'#22'SymbolAttri.Foreground'#4'b'
+  +#8#8#0#22'SymbolAttri.FrameEdges'#7#9'sfeAround'#25'TableNameAttri.Foregroun'
+  +'d'#7#6'clNavy'#25'TableNameAttri.FrameEdges'#7#9'sfeAround'#20'TableNameAtt'
+  +'ri.Style'#11#6'fsBold'#0#24'VariableAttri.FrameEdges'#7#9'sfeAround'#10'SQL'
+  +'Dialect'#7#9'sqlSybase'#4'left'#3#253#0#3'top'#3#152#0#0#0#0
 ]);
 ]);

+ 17 - 1
viewview.pas

@@ -6,7 +6,7 @@ interface
 
 
 uses
 uses
   Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
   Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
-  StdCtrls, Buttons, SynEdit, SynHighlighterSQL;
+  StdCtrls, Buttons, SynEdit, SynHighlighterSQL, LCLType;
 
 
 type
 type
 
 
@@ -21,6 +21,7 @@ type
     SynSQLSyn1: TSynSQLSyn;
     SynSQLSyn1: TSynSQLSyn;
     procedure bbCloseClick(Sender: TObject);
     procedure bbCloseClick(Sender: TObject);
     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
+    procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
   private
   private
     { private declarations }
     { private declarations }
   public
   public
@@ -39,6 +40,21 @@ begin
   CloseAction:= caFree;
   CloseAction:= caFree;
 end;
 end;
 
 
+procedure TfmViewView.FormKeyDown(Sender: TObject; var Key: Word;
+  Shift: TShiftState);
+begin
+  if (ssCtrl in Shift) and
+    ((Key=VK_F4) or (Key=VK_W)) then
+  begin
+    if MessageDlg('Do you want to close this query window?', mtConfirmation, [mbNo, mbYes], 0) = mrYes then
+    begin
+      // Close when pressing Ctrl-W or Ctrl-F4 (Cmd-W/Cmd-F4 on OSX)
+      Close;
+      Parent.Free;
+    end;
+  end;
+end;
+
 procedure TfmViewView.bbCloseClick(Sender: TObject);
 procedure TfmViewView.bbCloseClick(Sender: TObject);
 begin
 begin
   Close;
   Close;

Some files were not shown because too many files changed in this diff