From: Pavel C. <pc...@us...> - 2000-09-21 14:57:25
|
Update of /cvsroot/firebird/ibconsole In directory slayer.i.sourceforge.net:/tmp/cvs-serv9775 Modified Files: IBConsole.cfg IBConsole.dof IBConsole.res IBConsole.todo IBExtract.pas frmuDBCreate.pas frmuMain.pas frmuObjectWindow.dfm frmuObjectWindow.pas wisql.dfm wisql.pas Log Message: Update to version 319 Index: IBConsole.cfg =================================================================== RCS file: /cvsroot/firebird/ibconsole/IBConsole.cfg,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** IBConsole.cfg 2000/09/04 14:18:40 1.3 --- IBConsole.cfg 2000/09/21 14:57:20 1.4 *************** *** 2,6 **** -$B- -$C+ ! -$D- -$E- -$F- --- 2,6 ---- -$B- -$C+ ! -$D+ -$E- -$F- Index: IBConsole.dof =================================================================== RCS file: /cvsroot/firebird/ibconsole/IBConsole.dof,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** IBConsole.dof 2000/09/04 14:18:40 1.4 --- IBConsole.dof 2000/09/21 14:57:20 1.5 *************** *** 3,7 **** B=0 C=1 ! D=0 E=0 F=0 --- 3,7 ---- B=0 C=1 ! D=1 E=0 F=0 *************** *** 58,62 **** MinorVer=0 Release=0 ! Build=315 Debug=0 PreRelease=0 --- 58,62 ---- MinorVer=0 Release=0 ! Build=319 Debug=0 PreRelease=0 *************** *** 69,73 **** CompanyName=Inprise Corporation FileDescription=IBConsole.exe ! FileVersion=1.0.0.315 InternalName= LegalCopyright=Copyright © 2000 Inprise Corporation --- 69,73 ---- CompanyName=Inprise Corporation FileDescription=IBConsole.exe ! FileVersion=1.0.0.319 InternalName= LegalCopyright=Copyright © 2000 Inprise Corporation *************** *** 81,105 **** $(DELPHI)\Projects\Bpl\rbIP45.bpl=ReportBuilder wwRichEdit support $(DELPHI)\Projects\Bpl\GxComponents5.bpl=GExperts source components ! [HistoryLists\hlConditionals] Count=1 Item0=DEBUG_ONLY;IB6_ONLY [HistoryLists\hlUnitAliases] Count=1 Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; [HistoryLists\hlSearchPath] ! Count=4 Item0=$(DELPHI)\ibx\packages ! Item1=$(DELPHI)\Lib\Debug;$(DELPHI)\ibx\packages ! Item2=C:\Program Files\Borland\Delphi5\IBX\Packages ! Item3=$(DELPHI)\DOA\Delphi4 [HistoryLists\hlUnitOutputDirectory] Count=2 ! Item0=$(DELPHI)\lib ! Item1=$(DELPHI)\lib\debug [HistoryLists\hlBPLOutput] ! Count=1 Item0=c:\winnt\system32 [HistoryLists\hlDCPOutput] ! Count=2 Item0=$(DELPHI)\lib ! Item1=$(DELPHI)\lib\debug --- 81,111 ---- $(DELPHI)\Projects\Bpl\rbIP45.bpl=ReportBuilder wwRichEdit support $(DELPHI)\Projects\Bpl\GxComponents5.bpl=GExperts source components ! [HistoryLists\hlDebugSourcePath] Count=1 + Item0=$(DELPHI)\ibdac;$(DELPHI)\db;$(DELPHI)\midas + [HistoryLists\hlConditionals] + Count=2 Item0=DEBUG_ONLY;IB6_ONLY + Item1=DEBUG_ONLY [HistoryLists\hlUnitAliases] Count=1 Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; [HistoryLists\hlSearchPath] ! Count=3 Item0=$(DELPHI)\ibx\packages ! Item1=$(DELPHI)\Experts\GExperts ! Item2=$(DELPHI)\ibdac;$(DELPHI)\db;$(DELPHI)\midas [HistoryLists\hlUnitOutputDirectory] Count=2 ! Item0=$(DELPHI)\Lib ! Item1=$(DELPHI)\Lib\Debug [HistoryLists\hlBPLOutput] ! Count=3 Item0=c:\winnt\system32 + Item1=$(DELPHI)\bin + Item2=c:\windows\system32 [HistoryLists\hlDCPOutput] ! Count=3 Item0=$(DELPHI)\lib ! Item1=$(DELPHI)\lib\Debug ! Item2=$DELPHI)\lib Index: IBConsole.res =================================================================== RCS file: /cvsroot/firebird/ibconsole/IBConsole.res,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 Binary files /tmp/cvsj6GIMv and /tmp/cvsapIQrR differ Index: IBConsole.todo =================================================================== RCS file: /cvsroot/firebird/ibconsole/IBConsole.todo,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** IBConsole.todo 2000/08/21 11:11:23 1.1 --- IBConsole.todo 2000/09/21 14:57:20 1.2 *************** *** 1 **** ! {TODO : Remove certificates from IBConsole as IB 6.0 no longer requires nor has this functionality} \ No newline at end of file --- 1 ---- ! {TODO : Remove certificates from IBConsole as IB 6.0 no longer requires nor has this functionality} Index: IBExtract.pas =================================================================== RCS file: /cvsroot/firebird/ibconsole/IBExtract.pas,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** IBExtract.pas 2000/09/04 14:18:40 1.3 --- IBExtract.pas 2000/09/21 14:57:20 1.4 *************** *** 9,16 **** { express or implied. See the License for the specific language } { governing rights and limitations under the License. } ! { The Original Code was created by InterBase Software Corporation } ! { and its successors. } ! { Portions created by Inprise Corporation are Copyright (C) Inprise } ! { Corporation. All Rights Reserved. } { IBX Version 4.2 or higher required } { Contributor(s): Jeff Overcash } --- 9,17 ---- { express or implied. See the License for the specific language } { governing rights and limitations under the License. } ! { } ! { The Original Code was created by Jeff Overcash. } ! { Portions based upon code by Inprise Corporation are Copyright (C) } ! { Inprise Corporation. All Rights Reserved. } ! { } { IBX Version 4.2 or higher required } { Contributor(s): Jeff Overcash } *************** *** 27,38 **** type ! TExtractObjectTypes = ! (eoDatabase, eoDomain, eoTable, eoView, eoProcedure, eoFunction, ! eoGenerator, eoException, eoBLOBFilter, eoRole, eoTrigger, eoForeign, ! eoIndexes, eoChecks, eoData); TExtractType = ! (etDomain, etTable, etRole, etTrigger, etForeign, ! etIndex, etData, etGrant, etCheck); TExtractTypes = Set of TExtractType; --- 28,39 ---- type ! TExtractObjectTypes = ! (eoDatabase, eoDomain, eoTable, eoView, eoProcedure, eoFunction, ! eoGenerator, eoException, eoBLOBFilter, eoRole, eoTrigger, eoForeign, ! eoIndexes, eoChecks, eoData); TExtractType = ! (etDomain, etTable, etRole, etTrigger, etForeign, ! etIndex, etData, etGrant, etCheck); TExtractTypes = Set of TExtractType; *************** *** 213,218 **** obj_sql_role = 13; - procedure Register; - implementation --- 214,217 ---- *************** *** 247,266 **** 'ORDER BY FDIM.RDB$DIMENSION'; - procedure Register; - begin - RegisterComponents('InterBase', [TIBExtract]); - end; - - function QuoteIdentifier(Dialect: Integer; Value: String): String; - begin - Value := Trim(Value); - if Dialect = 1 then - Value := AnsiUpperCase(Value) - else - Value := '"' + Value + '"'; - Result := Value; - end; - - { TIBExtract } --- 246,249 ---- *************** *** 471,474 **** --- 454,459 ---- else begin + FieldType := qryTables.FieldByName('RDB$FIELD_TYPE').AsInteger; + FieldScale := qryTables.FieldByName('RDB$FIELD_SCALE').AsInteger; if not ((Copy(qryTables.FieldByName('RDB$FIELD_NAME1').AsString, 1, 4) = 'RDB$') and (qryTables.FieldByName('RDB$FIELD_NAME1').AsString[5] in ['0'..'9'])) and *************** *** 485,490 **** Collation, true); end; - if qryTables.FieldByName('RDB$NULL_FLAG').AsInteger = 1 then - Column := Column + ' NOT NULL'; end else --- 470,473 ---- *************** *** 494,499 **** begin PrecisionKnown := false; - FieldType := qryTables.FieldByName('RDB$FIELD_TYPE').AsInteger; - FieldScale := qryTables.FieldByName('RDB$FIELD_SCALE').AsInteger; if qryTables.FieldByname('RDB$FIELD_TYPE').AsShort = ColumnTypes[i].SQLType then begin --- 477,480 ---- *************** *** 542,546 **** end; end; ! end; if FieldType in [blr_text, blr_varying] then if qryTables.FieldByName('RDB$CHARACTER_LENGTH').IsNull then --- 523,527 ---- end; end; ! end; if FieldType in [blr_text, blr_varying] then if qryTables.FieldByName('RDB$CHARACTER_LENGTH').IsNull then *************** *** 581,636 **** intchar := 1; end; - { Handle defaults for columns } - { Originally This called PrintMetadataTextBlob, - should no longer need } - if not qryTables.FieldByName('RDB$DEFAULT_SOURCE').IsNull then - Column := Column + ' ' + qryTables.FieldByName('RDB$DEFAULT_SOURCE').AsString; ! { The null flag is either 1 or null (for nullable) . if there is ! a constraint name, print that too. Domains cannot have named ! constraints. The column name is in rdb$trigger_name in ! rdb$check_constraints. We hope we get at most one row back. } ! if qryTables.FieldByName('RDB$NULL_FLAG').AsInteger = 1 then begin ! qryConstraints.Params.ByName('FIELDNAME').AsString := qryTables.FieldByName('RDB$FIELD_NAME').AsString; ! qryConstraints.Params.ByName('RELATIONNAME').AsString := qryTables.FieldByName('RDB$RELATION_NAME').AsString; ! qryConstraints.ExecQuery; ! ! while not qryConstraints.Eof do ! begin ! if Pos('INTEG', qryConstraints.FieldByName('RDB$CONSTRAINT_NAME').AsString) <> 1 then ! Column := Column + Format(' CONSTRAINT %s', ! [ QuoteIdentifier( FDatabase.SQLDialect, ! qryConstraints.FieldByName('RDB$CONSTRAINT_NAME').AsString)]); ! qryConstraints.Next; ! end; ! qryConstraints.Close; ! Column := Column + ' NOT NULL'; end; ! ! if ((FieldType in [blr_text, blr_varying]) or ! (FieldType = blr_blob)) and ! (not qryTables.FieldByName('RDB$CHARACTER_SET_ID').IsNull) and ! (qryTables.FieldByName('RDB$CHARACTER_SET_ID').AsInteger <> 0) and ! (intchar <> 0) then ! begin ! Collation := 0; ! if not qryTables.FieldByName('RDB$COLLATION_ID1').IsNull then ! Collation := qryTables.FieldByName('RDB$COLLATION_ID1').AsInteger ! else ! if not qryTables.FieldByName('RDB$COLLATION_ID').IsNull then ! Collation := qryTables.FieldByName('RDB$COLLATION_ID').AsInteger; ! ! CharSetId := 0; ! if not qryTables.FieldByName('RDB$CHARACTER_SET_ID').IsNull then ! CharSetId := qryTables.FieldByName('RDB$CHARACTER_SET_ID').AsInteger; ! if Collation <> 0 then ! Column := Column + GetCharacterSets(CharSetId, Collation, true); ! end; end; end; --- 562,616 ---- intchar := 1; end; + end; + { Handle defaults for columns } + { Originally This called PrintMetadataTextBlob, + should no longer need } + if not qryTables.FieldByName('RDB$DEFAULT_SOURCE').IsNull then + Column := Column + ' ' + qryTables.FieldByName('RDB$DEFAULT_SOURCE').AsString; + { The null flag is either 1 or null (for nullable) . if there is + a constraint name, print that too. Domains cannot have named + constraints. The column name is in rdb$trigger_name in + rdb$check_constraints. We hope we get at most one row back. } ! if qryTables.FieldByName('RDB$NULL_FLAG').AsInteger = 1 then ! begin ! qryConstraints.Params.ByName('FIELDNAME').AsString := qryTables.FieldByName('RDB$FIELD_NAME').AsString; ! qryConstraints.Params.ByName('RELATIONNAME').AsString := qryTables.FieldByName('RDB$RELATION_NAME').AsString; ! qryConstraints.ExecQuery; ! while not qryConstraints.Eof do begin ! if Pos('INTEG', qryConstraints.FieldByName('RDB$CONSTRAINT_NAME').AsString) <> 1 then ! Column := Column + Format(' CONSTRAINT %s', ! [ QuoteIdentifier( FDatabase.SQLDialect, ! qryConstraints.FieldByName('RDB$CONSTRAINT_NAME').AsString)]); ! qryConstraints.Next; end; ! qryConstraints.Close; ! Column := Column + ' NOT NULL'; ! end; ! ! if ((FieldType in [blr_text, blr_varying]) or ! (FieldType = blr_blob)) and ! (not qryTables.FieldByName('RDB$CHARACTER_SET_ID').IsNull) and ! (qryTables.FieldByName('RDB$CHARACTER_SET_ID').AsInteger <> 0) and ! (intchar <> 0) then ! begin ! Collation := 0; ! if not qryTables.FieldByName('RDB$COLLATION_ID1').IsNull then ! Collation := qryTables.FieldByName('RDB$COLLATION_ID1').AsInteger ! else ! if not qryTables.FieldByName('RDB$COLLATION_ID').IsNull then ! Collation := qryTables.FieldByName('RDB$COLLATION_ID').AsInteger; ! ! CharSetId := 0; ! if not qryTables.FieldByName('RDB$CHARACTER_SET_ID').IsNull then ! CharSetId := qryTables.FieldByName('RDB$CHARACTER_SET_ID').AsInteger; ! if Collation <> 0 then ! Column := Column + GetCharacterSets(CharSetId, Collation, true); end; end; Index: frmuDBCreate.pas =================================================================== RCS file: /cvsroot/firebird/ibconsole/frmuDBCreate.pas,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** frmuDBCreate.pas 2000/08/03 20:15:01 1.1.1.1 --- frmuDBCreate.pas 2000/09/21 14:57:20 1.2 *************** *** 390,394 **** sgOptions.Cells[OPTION_NAME_COL,PAGE_SIZE_ROW] := 'Page Size'; ! sgOptions.Cells[OPTION_VALUE_COL,PAGE_SIZE_ROW] := '1024'; sgOptions.Cells[OPTION_NAME_COL,DEFAULT_CHARSET_ROW] := 'Default Character Set'; --- 390,394 ---- sgOptions.Cells[OPTION_NAME_COL,PAGE_SIZE_ROW] := 'Page Size'; ! sgOptions.Cells[OPTION_VALUE_COL,PAGE_SIZE_ROW] := '4096'; sgOptions.Cells[OPTION_NAME_COL,DEFAULT_CHARSET_ROW] := 'Default Character Set'; Index: frmuMain.pas =================================================================== RCS file: /cvsroot/firebird/ibconsole/frmuMain.pas,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** frmuMain.pas 2000/09/04 14:18:40 1.3 --- frmuMain.pas 2000/09/21 14:57:20 1.4 *************** *** 820,824 **** end; ! FCurrSelDatabase.ObjectViewer.InitDlg (FCurrSelTreeNode.NodeType,FCurrSelTreeNode.ObjectList, Selected.Caption, FCurrSelDatabase.Database, Icon, FViewSystemData, FRefetch); FRefetch := false; --- 820,824 ---- end; ! FCurrSelDatabase.ObjectViewer.InitDlg(FCurrSelTreeNode.NodeType,FCurrSelTreeNode.ObjectList, Selected.Caption, FCurrSelDatabase.Database, Icon, FViewSystemData, FRefetch); FRefetch := false; Index: frmuObjectWindow.dfm =================================================================== RCS file: /cvsroot/firebird/ibconsole/frmuObjectWindow.dfm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** frmuObjectWindow.dfm 2000/08/21 11:11:24 1.2 --- frmuObjectWindow.dfm 2000/09/21 14:57:20 1.3 *************** *** 282,286 **** Top = 171 Width = 615 ! Height = 177 Align = alClient Columns = <> --- 282,286 ---- Top = 171 Width = 615 ! Height = 176 Align = alClient Columns = <> *************** *** 509,513 **** Top = 0 Width = 623 ! Height = 376 Align = alClient Font.Charset = ANSI_CHARSET --- 509,513 ---- Top = 0 Width = 623 ! Height = 375 Align = alClient Font.Charset = ANSI_CHARSET *************** *** 531,535 **** Top = 0 Width = 623 ! Height = 335 Align = alClient Columns = < --- 531,535 ---- Top = 0 Width = 623 ! Height = 334 Align = alClient Columns = < Index: frmuObjectWindow.pas =================================================================== RCS file: /cvsroot/firebird/ibconsole/frmuObjectWindow.pas,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** frmuObjectWindow.pas 2000/08/21 11:11:24 1.2 --- frmuObjectWindow.pas 2000/09/21 14:57:20 1.3 *************** *** 29,33 **** type ! TTblData = record Columns, Indexes, --- 29,34 ---- type ! TTblData = class ! public Columns, Indexes, *************** *** 36,51 **** UniqueConst, RefConst: TStringList; end; ! TProcedureData = record Params: TStringList; Source: TStringList; end; ! TFunctionData = record Params: TStringList; ReturnVal, EntryPoint, ModuleName: String; end; --- 37,60 ---- UniqueConst, RefConst: TStringList; + constructor Create; + destructor Destroy; override; end; ! TProcedureData = class ! public Params: TStringList; Source: TStringList; + constructor Create; + destructor Destroy; override; end; ! TFunctionData = class ! public Params: TStringList; ReturnVal, EntryPoint, ModuleName: String; + constructor Create; + destructor Destroy; override; end; *************** *** 179,183 **** FMetadataRefreshList: array of boolean; FRefreshList: array of boolean; ! FIndex, FObjType: Integer; --- 188,192 ---- FMetadataRefreshList: array of boolean; FRefreshList: array of boolean; ! FIndex, FObjType: Integer; *************** *** 276,318 **** FObjectArray.Free; ! for lCnt := 0 to High(FTableData) do ! begin ! with FTableData[lCnt] do ! begin ! if Assigned (Columns) then Columns.Free; ! if Assigned (Indexes) then Indexes.Free; ! if Assigned (TriggerS) then Triggers.Free; ! if Assigned (CheckConst) then CheckConst.Free; ! if Assigned (UniqueConst) then UniqueConst.Free; ! if Assigned (RefConst) then RefConst.Free; ! end; ! end; ! ! for lCnt := 0 to High(FProcedureData) do ! begin ! with FProcedureData[lCnt] do ! begin ! if Assigned(Params) then Params.Free; ! if Assigned(Source) then Source.Free; ! end; ! end; ! for lCnt := 0 to High(FFunctionData) do ! if Assigned (FFunctionData[lCnt].Params) then FFunctionData[lCnt].Params.Free; if Assigned(FFilterData) then FFilterData.Free; ! if Assigned (FRoleData) then FRoleData.Free; ! if Assigned (FExceptionData) then FExceptionData.Free; ! if Assigned (FViewData) then FViewData.Free; ! if Assigned (FGenData) then FGenData.Free; ! if Assigned (FDomainData) then FDomainData.Free; ! if Assigned (FDataSet) then FDataSet.Free; ! if Assigned (FTransaction) then begin if FTransaction.InTransaction then --- 285,315 ---- FObjectArray.Free; ! for lCnt := Low(FTableData) to High(FTableData) do ! FreeAndNil(FTableData[lCnt]); ! for lCnt := Low(FProcedureData) to High(FProcedureData) do ! FreeAndNil(FProcedureData[lCnt]); + for lCnt := Low(FFunctionData) to High(FFunctionData) do + FreeAndNil(FFunctionData[lCnt]); if Assigned(FFilterData) then FFilterData.Free; ! if Assigned(FRoleData) then ! FRoleData.Free; ! if Assigned(FExceptionData) then ! FExceptionData.Free; ! if Assigned(FViewData) then ! FViewData.Free; ! if Assigned(FGenData) then ! FGenData.Free; ! if Assigned(FDomainData) then ! FDomainData.Free; ! if Assigned(FDataSet) then FDataSet.Free; ! if Assigned(FTransaction) then begin if FTransaction.InTransaction then *************** *** 321,325 **** end; ! inherited; end; --- 318,322 ---- end; ! inherited Destroy; end; *************** *** 346,351 **** Caption := Format('Properties for: %s',[Trim(ObjName)]); Icon := ObjIcon; ! FObjNameList := TStringList.Create; ! FObjectArray := TStringList.Create; cbObjectList.Items.Clear; reMetadata.Clear; --- 343,355 ---- Caption := Format('Properties for: %s',[Trim(ObjName)]); Icon := ObjIcon; ! if not Assigned(FObjNameList) then ! FObjNameList := TStringList.Create ! else ! FObjNameList.Clear; ! if not Assigned(FObjectArray) then ! FObjectArray := TStringList.Create ! else ! FObjectArray.Clear; ! cbObjectList.Items.Clear; reMetadata.Clear; *************** *** 453,457 **** reMetadata.Clear; pgcPropertiesChange(pgcProperties); ! frmMain.UpdateWindowList(Caption, Self); end; --- 457,461 ---- reMetadata.Clear; pgcPropertiesChange(pgcProperties); ! frmMain.UpdateWindowList(Caption, Self); end; *************** *** 461,465 **** Visible := false; ! FDataSet := TIBDataSet.Create (self); with FDataSet do begin --- 465,469 ---- Visible := false; ! FDataSet := TIBDataSet.Create(nil); with FDataSet do begin *************** *** 469,473 **** SparseArrays := true; end; - end; --- 473,476 ---- *************** *** 966,979 **** end; TmpList := TStringList.create; ! TmpList.Add(Format('Type%sCharacter Set%sCollation%sDefault Value%sAllow Nulls', [DEL,DEL,DEL,DEL])); ! TmpList.Add (FDomainData.Strings[FIdx]); ! FillList (lVDomains, TmpList); ! ! tmpString := FDomainData.Strings[FIdx]; ! for cnt := 0 to lvDomains.Items[0].SubItems.Count - 1 do ! GetNextField (tmpString, DEL); ! ! reConstraint.Text := GetNextField(tmpString, DEL); ! TmpList.Free; end; --- 969,985 ---- end; TmpList := TStringList.create; ! try ! TmpList.Add(Format('Type%sCharacter Set%sCollation%sDefault Value%sAllow Nulls', [DEL,DEL,DEL,DEL])); ! TmpList.Add(FDomainData.Strings[FIdx]); ! FillList(lVDomains, TmpList); ! ! tmpString := FDomainData.Strings[FIdx]; ! for cnt := 0 to lvDomains.Items[0].SubItems.Count - 1 do ! GetNextField(tmpString, DEL); ! ! reConstraint.Text := GetNextField(tmpString, DEL); ! finally ! TmpList.Free; ! end; end; *************** *** 989,994 **** end; ! if not Assigned (FTableData[Fidx].Columns) then ! FTableData[Fidx].Columns := TStringList.Create; if (FTableData[Fidx].Columns.Count <= 0) or FRefreshList[FIdx] = true then --- 995,1000 ---- end; ! if not Assigned(FTableData[Fidx]) then ! FTableData[Fidx] := TTblData.Create; if (FTableData[Fidx].Columns.Count <= 0) or FRefreshList[FIdx] = true then *************** *** 999,1003 **** end; ! FillList (lvTableObjects, FTableData[Fidx].Columns); if FObjType = NODE_VIEWS then --- 1005,1009 ---- end; ! FillList(lvTableObjects, FTableData[Fidx].Columns); if FObjType = NODE_VIEWS then *************** *** 1032,1067 **** lsCurrLine: string; i: integer; begin ! ListObject.Items.BeginUpdate; ! ListObject.Items.Clear; ! ! ListObject.Columns.Clear; ! ListObject.AllocBy := StringList.Count; ! { The column Headers are stored in element 0 } ! lsCurrLine := StringList.Strings[0]; ! while Length(lsCurrLine) > 0 do ! begin ! loListColumn := ListObject.Columns.Add; ! loListColumn.Caption := GetNextField(lsCurrLine, DEL); ! loListColumn.Width := ColumnHeaderWidth; ! end; ! for i := 1 to StringList.Count - 1 do ! begin ! lsCurrLine := StringList.Strings[i]; ! loListItem := ListObject.Items.Add; ! loListItem.Caption := GetNextField(lsCurrLine, DEL); while Length(lsCurrLine) > 0 do begin ! loListItem.SubItems.Add(GetNextField(lsCurrLine, DEL)); end; end; - ListObject.Items.EndUpdate; - if ListObject.Items.Count > 0 then - ListObject.Items[0].Selected := true; end; --- 1038,1082 ---- lsCurrLine: string; i: integer; + WasVisible: boolean; begin ! // to prevent delay ! WasVisible := ListObject.Visible; ! ListObject.Visible := FALSE; ! try ! ListObject.Items.BeginUpdate; ! ListObject.Items.Clear; ! ListObject.Columns.Clear; ! ListObject.AllocBy := StringList.Count; + { The column Headers are stored in element 0 } + lsCurrLine := StringList.Strings[0]; while Length(lsCurrLine) > 0 do begin ! loListColumn := ListObject.Columns.Add; ! loListColumn.Caption := GetNextField(lsCurrLine, DEL); ! loListColumn.Width := ColumnHeaderWidth; end; + + for i := 1 to StringList.Count - 1 do + begin + lsCurrLine := StringList.Strings[i]; + loListItem := ListObject.Items.Add; + loListItem.Caption := GetNextField(lsCurrLine, DEL); + + while Length(lsCurrLine) > 0 do + begin + loListItem.SubItems.Add(GetNextField(lsCurrLine, DEL)); + end; + end; + ListObject.Items.EndUpdate; + if ListObject.Items.Count > 0 then + ListObject.Items[0].Selected := true; + finally + ListObject.Visible := WasVisible; end; end; *************** *** 1076,1081 **** SplitterWnd.Visible := true; SplitterWnd.Top := lvTableObjects.Height + lvTableObjects.Top; ! if not Assigned (FTableData[Fidx].Triggers) then ! FTableData[Fidx].Triggers := TStringList.Create; if (FTableData[Fidx].Triggers.Count <= 0) or FRefreshList[FIdx] = true then --- 1091,1096 ---- SplitterWnd.Visible := true; SplitterWnd.Top := lvTableObjects.Height + lvTableObjects.Top; ! if not Assigned(FTableData[Fidx]) then ! FTableData[Fidx] := TTblData.Create; if (FTableData[Fidx].Triggers.Count <= 0) or FRefreshList[FIdx] = true then *************** *** 1118,1123 **** SplitterWnd.Visible := true; SplitterWnd.Top := lvTableObjects.Height + lvTableObjects.Top; ! if not Assigned (FTableData[Fidx].CheckConst) then ! FTableData[Fidx].CheckConst := TStringList.Create; if (FTableData[Fidx].CheckConst.Count <= 0) or FRefreshList[FIdx] = true then --- 1133,1138 ---- SplitterWnd.Visible := true; SplitterWnd.Top := lvTableObjects.Height + lvTableObjects.Top; ! if not Assigned(FTableData[Fidx]) then ! FTableData[Fidx] := TTblData.Create; if (FTableData[Fidx].CheckConst.Count <= 0) or FRefreshList[FIdx] = true then *************** *** 1141,1146 **** lvTableObjects.OnChange := nil; SplitterWnd.Visible := false; ! if not Assigned (FTableData[Fidx].Indexes) then ! FTableData[Fidx].Indexes := TStringList.Create; if (FTableData[Fidx].Indexes.Count <= 0) or FRefreshList[FIdx] = true then --- 1156,1161 ---- lvTableObjects.OnChange := nil; SplitterWnd.Visible := false; ! if not Assigned(FTableData[Fidx]) then ! FTableData[Fidx] := TTblData.Create; if (FTableData[Fidx].Indexes.Count <= 0) or FRefreshList[FIdx] = true then *************** *** 1158,1166 **** tbUnique.Down := true; reTriggerSource.Visible := false; ! lvTableObjects.Align := alClient; lvTableObjects.OnChange := nil; SplitterWnd.Visible := false; ! if not Assigned (FTableData[Fidx].UniqueConst) then ! FTableData[Fidx].UniqueConst := TStringList.Create; if (FTableData[Fidx].UniqueConst.Count <= 0) or FRefreshList[FIdx] = true then --- 1173,1181 ---- tbUnique.Down := true; reTriggerSource.Visible := false; ! lvTableObjects.Align := alClient; lvTableObjects.OnChange := nil; SplitterWnd.Visible := false; ! if not Assigned(FTableData[Fidx]) then ! FTableData[Fidx] := TTblData.Create; if (FTableData[Fidx].UniqueConst.Count <= 0) or FRefreshList[FIdx] = true then *************** *** 1183,1188 **** lvTableObjects.OnChange := nil; SplitterWnd.Visible := false; ! if not Assigned (FTableData[Fidx].RefConst) then ! FTableData[Fidx].RefConst := TStringList.Create; if (FTableData[Fidx].RefConst.Count <= 0) or FRefreshList[FIdx] = true then --- 1198,1203 ---- lvTableObjects.OnChange := nil; SplitterWnd.Visible := false; ! if not Assigned(FTableData[Fidx]) then ! FTableData[Fidx] := TTblData.Create; if (FTableData[Fidx].RefConst.Count <= 0) or FRefreshList[FIdx] = true then *************** *** 1198,1206 **** procedure TfrmObjectView.GetProcedureProperties; begin ! if not Assigned (FProcedureData[Fidx].Params) then ! begin ! FProcedureData[Fidx].Params := TStringList.Create; ! FProcedureData[Fidx].Source := TStringList.Create; ! end; if (FProcedureData[Fidx].Source.Count = 0) or FRefreshList[FIdx] = true then --- 1213,1218 ---- procedure TfrmObjectView.GetProcedureProperties; begin ! if not Assigned(FProcedureData[Fidx]) then ! FProcedureData[Fidx] := TProcedureData.Create; if (FProcedureData[Fidx].Source.Count = 0) or FRefreshList[FIdx] = true then *************** *** 1230,1234 **** reProcSource.Lines.BeginUpdate; reProcSource.Lines.Clear; ! reProcSource.Lines.AddStrings (FProcedureData[Fidx].Source); reProcSource.Lines.EndUpdate end; --- 1242,1247 ---- reProcSource.Lines.BeginUpdate; reProcSource.Lines.Clear; ! if Assigned(FProcedureData[Fidx]) then ! reProcSource.Lines.AddStrings(FProcedureData[Fidx].Source); reProcSource.Lines.EndUpdate end; *************** *** 1236,1241 **** procedure TfrmObjectView.GetFunctionProperties; begin ! if not Assigned(FFunctionData[FIdx].Params) then ! FFunctionData[Fidx].Params := TStringList.Create; if (Length(FFunctionData[FIdx].ModuleName) = 0) or FRefreshList[FIdx] = true then --- 1249,1254 ---- procedure TfrmObjectView.GetFunctionProperties; begin ! if not Assigned(FFunctionData[FIdx]) then ! FFunctionData[Fidx] := TFunctionData.Create; if (Length(FFunctionData[FIdx].ModuleName) = 0) or FRefreshList[FIdx] = true then *************** *** 1384,1391 **** end; Reg := TRegistry.Create; ! with Reg do begin OpenKey(gRegSettingsKey,false); WriteBinaryData('ObjState', State, sizeof(State)); CloseKey; Free; end; --- 1397,1406 ---- end; Reg := TRegistry.Create; ! with Reg do ! try OpenKey(gRegSettingsKey,false); WriteBinaryData('ObjState', State, sizeof(State)); CloseKey; + finally Free; end; *************** *** 1400,1403 **** --- 1415,1469 ---- FRefreshList[lCnt] := true; pgcPropertiesChange(pgcProperties); + end; + + { TTblData } + + constructor TTblData.Create; + begin + Columns := TStringList.Create; + Indexes := TStringList.Create; + Triggers := TStringList.Create; + CheckConst := TStringList.Create; + UniqueConst := TStringList.Create; + RefConst := TStringList.Create; + end; + + destructor TTblData.Destroy; + begin + Columns.Free; + Indexes.Free; + Triggers.Free; + CheckConst.Free; + UniqueConst.Free; + RefConst.Free; + inherited Destroy; + end; + + { TProcedureData } + + constructor TProcedureData.Create; + begin + Params := TStringList.Create; + Source := TStringList.Create; + end; + + destructor TProcedureData.Destroy; + begin + Params.Free; + Source.Free; + inherited; + end; + + { TFunctionData } + + constructor TFunctionData.Create; + begin + Params := TStringList.Create; + end; + + destructor TFunctionData.Destroy; + begin + Params.Free; + inherited; end; Index: wisql.dfm =================================================================== RCS file: /cvsroot/firebird/ibconsole/wisql.dfm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** wisql.dfm 2000/09/04 14:18:41 1.3 --- wisql.dfm 2000/09/21 14:57:20 1.4 *************** *** 44,48 **** Width = 634 Height = 226 ! ActivePage = TabResults Align = alClient DockSite = True --- 44,48 ---- Width = 634 Height = 226 ! ActivePage = TabData Align = alClient DockSite = True *************** *** 144,148 **** WordWrap = False OnEnter = UpdateCursor - OnKeyDown = reSqlInputKeyDown OnKeyPress = reSqlInputKeyPress OnSelectionChange = UpdateCursor --- 144,147 ---- Index: wisql.pas =================================================================== RCS file: /cvsroot/firebird/ibconsole/wisql.pas,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** wisql.pas 2000/09/04 14:18:41 1.3 --- wisql.pas 2000/09/21 14:57:20 1.4 *************** *** 179,184 **** procedure UpdateCursor(Sender: TObject); procedure reSqlInputKeyPress(Sender: TObject; var Key: Char); - procedure reSqlInputKeyDown(Sender: TObject; var Key: Word; - Shift: TShiftState); procedure TransactionExecute(Sender: TObject); procedure cbServersChange(Sender: TObject); --- 179,182 ---- *************** *** 271,275 **** type ! TWinState = record _Top, _Left, --- 269,273 ---- type ! TWinState = packed record _Top, _Left, *************** *** 284,288 **** {$R *.DFM} - /////////////////////////////////////////////////////////////// procedure TdlgWisql.UpdateTransactionStatus(const active: boolean); begin --- 282,285 ---- *************** *** 291,304 **** stbISQL.Panels[3].Text := 'Transaction is ACTIVE.'; TransactionCommit.Enabled := true; ! TransactionRollback.Enabled := true; end else begin stbISQL.Panels[3].Text := 'No active transaction.'; TransactionCommit.Enabled := false; ! TransactionRollback.Enabled := false; end end; - //////////////////////////////////////////////////////////// procedure TdlgWisql.QuerySaveOutputExecute(Sender: TObject); begin --- 288,300 ---- stbISQL.Panels[3].Text := 'Transaction is ACTIVE.'; TransactionCommit.Enabled := true; ! TransactionRollback.Enabled := true; end else begin stbISQL.Panels[3].Text := 'No active transaction.'; TransactionCommit.Enabled := false; ! TransactionRollback.Enabled := false; end end; procedure TdlgWisql.QuerySaveOutputExecute(Sender: TObject); begin *************** *** 306,310 **** end; - ///////////////////////////////////////////////////////////// procedure TdlgWisql.QueryNextExecute(Sender: TObject); begin --- 302,305 ---- *************** *** 316,320 **** end; - ///////////////////////////////////////////////////////////// procedure TdlgWisql.QueryPreviousExecute(Sender: TObject); begin --- 311,314 ---- *************** *** 326,330 **** end; - ///////////////////////////////////////////////////////////// procedure TdlgWisql.QuerySaveScriptExecute(Sender: TObject); var --- 320,323 ---- *************** *** 353,357 **** end; - ///////////////////////////////////////////////////////////// procedure TdlgWisql.QueryLoadScriptExecute(Sender: TObject); var --- 346,349 ---- *************** *** 389,393 **** end; - ///////////////////////////////////////////////////////////// procedure TdlgWisql.QueryExecuteExecute(Sender: TObject); var --- 381,384 ---- *************** *** 496,500 **** end; - ///////////////////////////////////////////////////////////// procedure TdlgWisql.UpdateOutputWindow(const Data: String); begin --- 487,490 ---- *************** *** 502,506 **** end; - ///////////////////////////////////////////////////////////// procedure TdlgWisql.DialectChange(Sender: TObject); var --- 492,495 ---- *************** *** 527,531 **** end; - ///////////////////////////////////////////////////////////// procedure TdlgWisql.DialectUpdate(Sender: TObject); begin --- 516,519 ---- *************** *** 534,538 **** end; - ///////////////////////////////////////////////////////////// procedure TdlgWisql.ShowDialog; begin --- 522,525 ---- *************** *** 573,577 **** end; - ///////////////////////////////////////////////////////////// procedure TdlgWisql.UpdateCursor(Sender: TObject); const --- 560,563 ---- *************** *** 589,599 **** end; - ///////////////////////////////////////////////////////////// procedure TdlgWisql.reSqlInputKeyPress(Sender: TObject; var Key: Char); begin ! UpdateCursor(Sender); end; - ///////////////////////////////////////////////////////////// procedure TdlgWisql.ProcessISQLEvent(const ISQLEvent: TSQLEvent; const SubEvent: TSQLSubEvent; const Data: Variant; const Database: TIBDatabase); --- 575,589 ---- end; procedure TdlgWisql.reSqlInputKeyPress(Sender: TObject; var Key: Char); begin ! if (Key = #10) and (GetKeyState(VK_CONTROL) < 0) then ! begin ! QueryExecuteExecute(Sender); ! Key := #0; ! end ! else ! UpdateCursor(Sender); end; procedure TdlgWisql.ProcessISQLEvent(const ISQLEvent: TSQLEvent; const SubEvent: TSQLSubEvent; const Data: Variant; const Database: TIBDatabase); *************** *** 648,652 **** FCurrSQLDialect := FDatabase.SQLDialect; FConnected := true; ! UpdateConnectStatus(true); end else --- 638,642 ---- FCurrSQLDialect := FDatabase.SQLDialect; FConnected := true; ! UpdateConnectStatus(true); end else *************** *** 713,725 **** end; - ///////////////////////////////////////////////////////////// - procedure TdlgWisql.reSqlInputKeyDown(Sender: TObject; var Key: Word; - Shift: TShiftState); - begin - if (Key = VK_RETURN) and (ssCtrl in Shift) then - QueryExecuteExecute (Sender); - end; - - //////////////////////////////////////////////////////////////// procedure TdlgWisql.TransactionExecute(Sender: TObject); begin --- 703,706 ---- *************** *** 753,757 **** end; - ////////////////////////////////////////////////////////// constructor TdlgWisql.Create(AOwner: TComponent); begin --- 734,737 ---- *************** *** 768,772 **** end; - ////////////////////////////////////////////////////////// destructor TdlgWisql.Destroy; begin --- 748,751 ---- *************** *** 776,780 **** end; - ////////////////////////////////////////////////////////// procedure TdlgWisql.cbServersChange(Sender: TObject); --- 755,758 ---- *************** *** 787,791 **** end; - ////////////////////////////////////////////////////////// procedure TdlgWisql.FileOptionsExecute(Sender: TObject); var --- 765,768 ---- *************** *** 807,811 **** end; - ////////////////////////////////////////////////////////// procedure TdlgWisql.EditFindExecute(Sender: TObject); begin --- 784,787 ---- *************** *** 813,817 **** end; - ////////////////////////////////////////////////////////// procedure TdlgWisql.EditFindUpdate(Sender: TObject); begin --- 789,792 ---- *************** *** 819,823 **** end; - ///////////////////////////////////////////////////////////// procedure TdlgWisql.QueryUpdate(Sender: TObject); begin --- 794,797 ---- *************** *** 829,833 **** end; - ///////////////////////////////////////////////////////////// procedure TdlgWisql.QueryPrepareExecute(Sender: TObject); var --- 803,806 ---- *************** *** 865,869 **** end; - ///////////////////////////////////////////////////////////// procedure TdlgWisql.dbgSQLResultsCellClick(Column: TColumn); begin --- 838,841 ---- *************** *** 872,876 **** end; - ///////////////////////////////////////////////////////////// procedure TdlgWisql.dbgSQLResultsDrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; --- 844,847 ---- *************** *** 878,882 **** var DisplayStr: String; ! begin with Sender as TDBGrid do begin --- 849,853 ---- var DisplayStr: String; ! begin with Sender as TDBGrid do begin *************** *** 915,919 **** end; - ///////////////////////////////////////////////////////////// procedure TdlgWisql.dbgSQLResultsEditButtonClick(Sender: TObject); var --- 886,889 ---- *************** *** 938,942 **** end; - ///////////////////////////////////////////////////////////// procedure TdlgWisql.EditFontExecute(Sender: TObject); begin --- 908,911 ---- *************** *** 951,955 **** end; - ///////////////////////////////////////////////////////////// procedure TdlgWisql.SetAutoDDL(const Value: boolean); begin --- 920,923 ---- *************** *** 961,965 **** end; - ///////////////////////////////////////////////////////////// procedure TdlgWisql.SQLReference1Click(Sender: TObject); var --- 929,932 ---- *************** *** 967,975 **** begin inherited; ! hlpPath := Format('%s\%s',[ExtractFilePath(Application.ExeName), SQL_REFERENCE]); WinHelp(WindowHandle, PChar(hlpPath),HELP_FINDER,0); end; - ///////////////////////////////////////////////////////////// procedure TdlgWisql.FormClose(Sender: TObject; var Action: TCloseAction); var --- 934,941 ---- begin inherited; ! hlpPath := Format('%s%s',[ExtractFilePath(Application.ExeName), SQL_REFERENCE]); WinHelp(WindowHandle, PChar(hlpPath),HELP_FINDER,0); end; procedure TdlgWisql.FormClose(Sender: TObject; var Action: TCloseAction); var *************** *** 1002,1006 **** end; - ///////////////////////////////////////////////////////////// procedure TdlgWisql.FileCloseExecute(Sender: TObject); begin --- 968,971 ---- *************** *** 1008,1012 **** end; - ///////////////////////////////////////////////////////////// procedure TdlgWisql.Print1Click(Sender: TObject); var --- 973,976 ---- *************** *** 1039,1043 **** end; - ///////////////////////////////////////////////////////////// procedure TdlgWisql.Drop1Click(Sender: TObject); begin --- 1003,1006 ---- *************** *** 1061,1065 **** end; - ///////////////////////////////////////////////////////////// procedure TdlgWisql.Disconnect1Click(Sender: TObject); begin --- 1024,1027 ---- *************** *** 1081,1085 **** end; - ///////////////////////////////////////////////////////////// procedure TdlgWisql.Connect1Click(Sender: TObject); begin --- 1043,1046 ---- *************** *** 1098,1102 **** end; - ///////////////////////////////////////////////////////////// procedure TdlgWisql.Create1Click(Sender: TObject); begin --- 1059,1062 ---- *************** *** 1115,1119 **** end; - ///////////////////////////////////////////////////////////// function TdlgWisql.CheckTransactionStatus (const Closing: boolean): boolean; var --- 1075,1078 ---- *************** *** 1200,1204 **** end; - ///////////////////////////////////////////////////////////// procedure TdlgWisql.FormResize(Sender: TObject); begin --- 1159,1162 ---- *************** *** 1208,1212 **** end; - ///////////////////////////////////////////////////////////// procedure TdlgWisql.UpdateConnectStatus(const Connected: boolean); var --- 1166,1169 ---- *************** *** 1233,1237 **** end; - ///////////////////////////////////////////////////////////// procedure TdlgWisql.Windows1Click(Sender: TObject); begin --- 1190,1193 ---- *************** *** 1239,1243 **** end; - ///////////////////////////////////////////////////////////// procedure TdlgWisql.SetClientDialect(const Value: integer); begin --- 1195,1198 ---- *************** *** 1246,1250 **** end; - ///////////////////////////////////////////////////////////// { TQryList } --- 1201,1204 ---- *************** *** 1263,1267 **** end; - ///////////////////////////////////////////////////////////// function TQryList.AtFirstQuery: boolean; begin --- 1217,1220 ---- *************** *** 1269,1273 **** end; - ///////////////////////////////////////////////////////////// function TQryList.AtLastQuery: boolean; begin --- 1222,1225 ---- *************** *** 1275,1279 **** end; - ///////////////////////////////////////////////////////////// procedure TQryList.ClearList; var --- 1227,1230 ---- *************** *** 1289,1293 **** end; - ///////////////////////////////////////////////////////////// constructor TQryList.Create; begin --- 1240,1243 ---- *************** *** 1297,1301 **** end; - ///////////////////////////////////////////////////////////// destructor TQryList.Destroy; var --- 1247,1250 ---- *************** *** 1307,1311 **** end; - ///////////////////////////////////////////////////////////// function TQryList.GetNextQuery: TStrings; begin --- 1256,1259 ---- *************** *** 1323,1327 **** end; - ///////////////////////////////////////////////////////////// function TQryList.GetPrevQuery: TStrings; begin --- 1271,1274 ---- *************** *** 1339,1343 **** end; - ///////////////////////////////////////////////////////////// procedure TdlgWisql.QueryPreviousUpdate(Sender: TObject); begin --- 1286,1289 ---- *************** *** 1345,1349 **** end; - ///////////////////////////////////////////////////////////// procedure TdlgWisql.QueryNextUpdate(Sender: TObject); begin --- 1291,1294 ---- *************** *** 1351,1355 **** end; - ///////////////////////////////////////////////////////////// procedure TdlgWisql.ShowStatistics(const Stats: TStringList); var --- 1296,1299 ---- *************** *** 1377,1381 **** end; - ///////////////////////////////////////////////////////////// procedure TdlgWisql.FormShow(Sender: TObject); begin --- 1321,1324 ---- *************** *** 1383,1387 **** end; - ///////////////////////////////////////////////////////////// procedure TdlgWisql.CheckDisconnect(Sender: TObject); begin --- 1326,1329 ---- *************** *** 1391,1395 **** end; - ///////////////////////////////////////////////////////////// procedure TdlgWisql.SaveOutput; var --- 1333,1336 ---- |