ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/branches/journaling/design/ibsqleditor.pas
(Generate patch)

Comparing:
ibx/trunk/design/ibsqleditor.pas (file contents), Revision 80 by tony, Mon Jan 1 11:31:07 2018 UTC vs.
ibx/branches/journaling/design/ibsqleditor.pas (file contents), Revision 362 by tony, Tue Dec 7 13:27:39 2021 UTC

# Line 31 | Line 31 | unit ibsqleditor;
31   interface
32  
33   uses
34 <  Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
35 <  StdCtrls, ComCtrls, ibselectsqleditor, IBSQLEditFrame, IBLookupComboEditBox,
36 <  IBDynamicGrid, IBDatabase, IBSQL, IB;
34 >  Classes, SysUtils, FileUtil, SynEdit, LResources, Forms, Controls, Graphics,
35 >  Dialogs, StdCtrls, ComCtrls, ibinsertsqleditor, IBSQLEditFrame,
36 >  IBDatabase, IBSQL, IB, db;
37  
38   type
39  
40    { TIBSQLEditorForm }
41  
42 <  TIBSQLEditorForm = class(TIBSelectSQLEditorForm)
42 >  TIBSQLEditorForm = class(TIBInsertSQLEditorForm)
43      IncludePrimaryKeys: TCheckBox;
44 +    SelectProcedure: TLabel;
45      TabControl1: TTabControl;
46      procedure FormShow(Sender: TObject);
47      procedure GenerateBtnClick(Sender: TObject);
47    procedure IncludePrimaryKeysChange(Sender: TObject);
48      procedure TabControl1Change(Sender: TObject);
49 +    procedure UserProceduresAfterScroll(DataSet: TDataSet);
50    private
51      procedure SetupFlags;
52    protected
# Line 82 | Line 83 | begin
83      end;
84      with IBSQLEditFrame1 do
85      begin
86 <      IncludePrimaryKeys := true;
87 <      IncludeReadOnlyFields := true;
88 <      ExecuteOnlyProcs := false;
86 >      IncludeReadOnlyFields := false;
87 >      ExecuteOnlyProcs := true;
88 >      SelectProcs := true;
89        SQLText.Lines.Assign(aIBSQL.SQL);
90      end;
91      IncludePrimaryKeys.Checked := false;
# Line 113 | Line 114 | begin
114    SetupFlags;
115   end;
116  
117 + procedure TIBSQLEditorForm.UserProceduresAfterScroll(DataSet: TDataSet);
118 + begin
119 +    SelectProcedure.Visible := (DataSet.FieldByName('RDB$PROCEDURE_TYPE').AsInteger = 1)
120 +      and (Dataset.FieldByName('RDB$PROCEDURE_OUTPUTS').AsInteger > 0);
121 +    if SelectProcedure.Visible then
122 +      OutputProcGrid.Columns[0].Width := 30
123 +    else
124 +      OutputProcGrid.Columns[0].Width := 0;
125 + end;
126 +
127   procedure TIBSQLEditorForm.FormShow(Sender: TObject);
128   begin
129    inherited;
# Line 123 | Line 134 | procedure TIBSQLEditorForm.GenerateBtnCl
134   begin
135    case TabControl1.TabIndex of
136    0:
137 <    IBSQLEditFrame1.GenerateSelectSQL(QuoteFields.Checked);
137 >    IBSQLEditFrame1.GenerateSelectSQL(QuoteFields.Checked,true);
138    1:
139      IBSQLEditFrame1.GenerateInsertSQL(QuoteFields.Checked);
140    2:
141 <    IBSQLEditFrame1.GenerateModifySQL(QuoteFields.Checked);
141 >    IBSQLEditFrame1.GenerateModifySQL(QuoteFields.Checked,IncludePrimaryKeys.Checked);
142    3:
143      IBSQLEditFrame1.GenerateDeleteSQL(QuoteFields.Checked);
144    4:
# Line 135 | Line 146 | begin
146    end;
147   end;
148  
138 procedure TIBSQLEditorForm.IncludePrimaryKeysChange(Sender: TObject);
139 begin
140  IBSQLEditFrame1.IncludePrimaryKeys := IncludePrimaryKeys.Checked;
141 end;
142
149   procedure TIBSQLEditorForm.SetupFlags;
150   begin
145  IBSQLEditFrame1.IncludePrimaryKeys := (TabControl1.TabIndex <= 1) or ((TabControl1.TabIndex = 2) and IncludePrimaryKeys.Checked);
146  IBSQLEditFrame1.IncludeReadOnlyFields := (TabControl1.TabIndex = 0);
151    IncludePrimaryKeys.Visible := TabControl1.TabIndex = 2;
152    FieldNamesGrid.Visible := TabControl1.TabIndex <> 3;
153    Label2.Visible := TabControl1.TabIndex <> 3;
154 <  PrimaryKeysGrid.Visible := TabControl1.TabIndex <> 1;
155 <  Label4.Visible := TabControl1.TabIndex <> 1;
154 >  IdentityGrid.Visible := TabControl1.TabIndex <> 3;
155 >  Label6.Visible := TabControl1.TabIndex <> 3;
156 >  ReadOnlyGrid.Visible := TabControl1.TabIndex <> 3;
157 >  Label5.Visible := TabControl1.TabIndex <> 3;
158    SelectSelectAll.Visible := TabControl1.TabIndex <> 3;
159   end;
160  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines