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

Comparing ibx/trunk/design/ibselectsqleditor.pas (file contents):
Revision 80 by tony, Mon Jan 1 11:31:07 2018 UTC vs.
Revision 107 by tony, Thu Jan 18 14:37:40 2018 UTC

# Line 42 | Line 42 | type
42    TIBSelectSQLEditorForm = class(TForm)
43      Button1: TButton;
44      Button2: TButton;
45 +    PackageNames: TIBLookupComboEditBox;
46      InputProcGrid: TIBDynamicGrid;
47 +    PackageNameLabel: TLabel;
48      OutputProcGrid: TIBDynamicGrid;
49      IncludeSysTables: TCheckBox;
50      GenerateBtn: TButton;
# Line 51 | Line 53 | type
53      PrimaryKeysGrid: TIBDynamicGrid;
54      IBSQLEditFrame1: TIBSQLEditFrame;
55      ProcedureNames: TIBLookupComboEditBox;
54    SelectProcedure: TLabel;
56      SelectSelectAll: TCheckBox;
57      SelectTableNames: TIBLookupComboEditBox;
58      TestBtn: TButton;
# Line 71 | Line 72 | type
72      procedure IncludeSysTablesChange(Sender: TObject);
73      procedure InputProcGridDblClick(Sender: TObject);
74      procedure OutputProcGridDblClick(Sender: TObject);
75 +    procedure PackageNamesDblClick(Sender: TObject);
76      procedure PrimaryKeysGridDblClick(Sender: TObject);
77      procedure ProcedureNamesDblClick(Sender: TObject);
78      procedure SelectSelectAllChange(Sender: TObject);
# Line 81 | Line 83 | type
83      procedure FormShow(Sender: TObject);
84      procedure PrimaryKeyListDblClick(Sender: TObject);
85      procedure SelectPageShow(Sender: TObject);
84    procedure UserProceduresAfterScroll(DataSet: TDataSet);
86    private
87      { private declarations }
88      procedure HandleUserTablesOpened(Sender: TObject);
# Line 113 | Line 114 | begin
114    try
115      if assigned(DataSet) then
116      begin
117 <        IBSQLEditFrame1.Database := DataSet.Database;
118 <        GenerateParams.Checked := DataSet.GenerateParamNames;
117 >      IBSQLEditFrame1.Database := DataSet.Database;
118 >      GenerateParams.Checked := DataSet.GenerateParamNames;
119      end;
120      IBSQLEditFrame1.SQLText.Lines.Assign(SelectSQL);
121 +    IBSQLEditFrame1.SelectProcs := true;
122      Result := ShowModal = mrOK;
123      if Result then
124      begin
# Line 151 | Line 153 | end;
153  
154   procedure TIBSelectSQLEditorForm.SelectPageShow(Sender: TObject);
155   begin
156 <  IBSQLEditFrame1.UserTables.Active := true;
157 < end;
156 <
157 < procedure TIBSelectSQLEditorForm.UserProceduresAfterScroll(DataSet: TDataSet);
158 < begin
159 <  SelectProcedure.Visible := DataSet.FieldByName('RDB$PROCEDURE_TYPE').AsInteger = 2;
156 >  if (IBSQLEditFrame1.Database <> nil) and IBSQLEditFrame1.Database.Connected then
157 >    IBSQLEditFrame1.UserTables.Active := true;
158   end;
159  
160   procedure TIBSelectSQLEditorForm.FieldListDblClick(Sender: TObject);
# Line 192 | Line 190 | begin
190    IBSQLEditFrame1.InsertSelectedOutputParam;
191   end;
192  
193 + procedure TIBSelectSQLEditorForm.PackageNamesDblClick(Sender: TObject);
194 + begin
195 +  IBSQLEditFrame1.InsertPackageName;
196 + end;
197 +
198   procedure TIBSelectSQLEditorForm.PrimaryKeysGridDblClick(Sender: TObject);
199   begin
200    IBSQLEditFrame1.InsertSelectedPrimaryKey;
# Line 219 | Line 222 | end;
222  
223   procedure TIBSelectSQLEditorForm.ExecutePageShow(Sender: TObject);
224   begin
225 <  IBSQLEditFrame1.UserProcedures.Active := true;
225 >  if (IBSQLEditFrame1.Database <> nil) and IBSQLEditFrame1.Database.Connected then
226 >    IBSQLEditFrame1.OpenUserProcedures;
227   end;
228  
229   procedure TIBSelectSQLEditorForm.HandleUserTablesOpened(Sender: TObject);
230   begin
231    SelectSelectAll.Checked := true;
228  SelectProcedure.Visible := false;
232   end;
233  
234   procedure TIBSelectSQLEditorForm.Loaded;
# Line 233 | Line 236 | begin
236    inherited Loaded;
237    if IBSQLEditFrame1 <> nil then
238    begin
239 +    if PageControl <> nil then
240 +      PageControl.ActivePage := SelectPage;
241      IBSQLEditFrame1.OnUserTablesOpened := @HandleUserTablesOpened;
242      if SelectTableNames <> nil then
243        SelectTableNames.ListSource :=  IBSQLEditFrame1.UserTableSource;
# Line 240 | Line 245 | begin
245        FieldNamesGrid.DataSource := IBSQLEditFrame1.FieldsSource;
246      if PrimaryKeysGrid <> nil then
247        PrimaryKeysGrid.DataSource := IBSQLEditFrame1.PrimaryKeySource;
248 +    if PackageNames <> nil then
249 +      PackageNames.ListSource := IBSQLEditFrame1.PackageNameSource;
250      if ProcedureNames <> nil then
251        ProcedureNames.ListSource := IBSQLEditFrame1.UserProcSource;
252      if InputProcGrid <> nil then

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines