* compatibility fixes for FV

This commit is contained in:
peter 1999-02-19 15:43:20 +00:00
parent 604875d93b
commit ed7953a581
3 changed files with 80 additions and 64 deletions

View File

@ -761,9 +761,9 @@ end;
procedure TBrowserWindow.SelectTab(BrowserTab: Sw_integer);
var Tabs: Sw_integer;
PB : PBreakpoint;
{ PB : PBreakpoint;
PS :PString;
l : longint;
l : longint; }
begin
(* case BrowserTab of
btScope :
@ -863,7 +863,10 @@ end;
END.
{
$Log$
Revision 1.9 1999-02-18 13:44:34 peter
Revision 1.10 1999-02-19 15:43:20 peter
* compatibility fixes for FV
Revision 1.9 1999/02/18 13:44:34 peter
* search fixed
+ backward search
* help fixes

View File

@ -42,7 +42,7 @@ type
PToolListBox = ^TToolListBox;
TToolListBox = object(TAdvancedListBox)
function GetText(Item: sw_integer; MaxLen: Integer): String; virtual;
function GetText(Item,MaxLen: sw_integer): String; virtual;
end;
PToolParamValidator = ^TToolParamValidator;
@ -78,16 +78,16 @@ type
end;
procedure InitTools;
function GetToolCount: integer;
function GetToolName(Idx: integer): string;
function AddTool(Title, ProgramPath, Params: string; HotKey: word): integer;
procedure GetToolParams(Idx: integer; var Title, ProgramPath, Params: string; var HotKey: word);
procedure SetToolParams(Idx: integer; Title, ProgramPath, Params: string; HotKey: word);
function GetToolCount: Sw_integer;
function GetToolName(Idx: Sw_integer): string;
function AddTool(Title, ProgramPath, Params: string; HotKey: word): Sw_integer;
procedure GetToolParams(Idx: Sw_integer; var Title, ProgramPath, Params: string; var HotKey: word);
procedure SetToolParams(Idx: Sw_integer; Title, ProgramPath, Params: string; HotKey: word);
procedure DoneTools;
function GetHotKeyName(Key: word): string;
function ParseToolParams(var Params: string; CheckOnly: boolean): integer;
function ParseToolParams(var Params: string; CheckOnly: boolean): Sw_integer;
implementation
@ -116,18 +116,18 @@ const
Tools : PToolCollection = nil;
function GetHotKeyCount: integer;
function GetHotKeyCount: Sw_integer;
begin
GetHotKeyCount:=ord(High(HotKeys))-ord(Low(HotKeys))+1;
end;
function GetHotKeyNameByIdx(Idx: integer): string;
function GetHotKeyNameByIdx(Idx: Sw_integer): string;
begin
GetHotKeyNameByIdx:=HotKeys[Idx].Name;
end;
function HotKeyToIdx(Key: word): integer;
var Count,I: integer;
function HotKeyToIdx(Key: word): Sw_integer;
var Count,I: Sw_integer;
Found: boolean;
begin
Count:=GetHotKeyCount; Found:=false;
@ -142,8 +142,8 @@ begin
HotKeyToIdx:=I;
end;
function IdxToHotKey(Idx: integer): word;
var Count: integer;
function IdxToHotKey(Idx: Sw_integer): word;
var Count: Sw_integer;
Key: word;
begin
Count:=GetHotKeyCount;
@ -155,7 +155,7 @@ begin
end;
function GetHotKeyName(Key: word): string;
var Idx: integer;
var Idx: Sw_integer;
S: string;
begin
Idx:=HotKeyToIdx(Key);
@ -206,7 +206,7 @@ begin
At:=inherited At(Index);
end;
function TToolListBox.GetText(Item: sw_integer; MaxLen: Integer): String;
function TToolListBox.GetText(Item,MaxLen: sw_integer): String;
var S: string;
P: PTool;
begin
@ -221,15 +221,15 @@ begin
New(Tools, Init(10,20));
end;
function GetToolCount: integer;
var Count: integer;
function GetToolCount: Sw_integer;
var Count: Sw_integer;
begin
if Tools=nil then Count:=0 else
Count:=Tools^.Count;
GetToolCount:=Count;
end;
function GetToolName(Idx: integer): string;
function GetToolName(Idx: Sw_integer): string;
var S1,S2: string;
W: word;
begin
@ -237,7 +237,7 @@ begin
GetToolName:=KillTilde(S1);
end;
function AddTool(Title, ProgramPath, Params: string; HotKey: word): integer;
function AddTool(Title, ProgramPath, Params: string; HotKey: word): Sw_integer;
var P: PTool;
begin
if Tools=nil then InitTools;
@ -246,14 +246,14 @@ begin
AddTool:=Tools^.IndexOf(P);
end;
procedure GetToolParams(Idx: integer; var Title, ProgramPath, Params: string; var HotKey: word);
procedure GetToolParams(Idx: Sw_integer; var Title, ProgramPath, Params: string; var HotKey: word);
var P: PTool;
begin
P:=Tools^.At(Idx);
P^.GetParams(Title,ProgramPath,Params,HotKey);
end;
procedure SetToolParams(Idx: integer; Title, ProgramPath, Params: string; HotKey: word);
procedure SetToolParams(Idx: Sw_integer; Title, ProgramPath, Params: string; HotKey: word);
var P: PTool;
begin
P:=Tools^.At(Idx);
@ -282,8 +282,7 @@ end;
constructor TToolItemDialog.Init(ATool: PTool);
var R,R2,R3: TRect;
Items: PSItem;
I: integer;
KeyCount: integer;
I,KeyCount: Sw_integer;
begin
KeyCount:=GetHotKeyCount;
@ -474,7 +473,7 @@ begin
end;
procedure ReplaceStr(var S: string; const What,NewS: string);
var I : integer;
var I : Sw_integer;
begin
repeat
I:=Pos(What,S);
@ -501,11 +500,11 @@ begin
until I=0;
end;
function ParseToolParams(var Params: string; CheckOnly: boolean): integer;
function ParseToolParams(var Params: string; CheckOnly: boolean): Sw_integer;
var Err: integer;
W: PSourceWindow;
procedure ParseParams(Pass: integer);
var I: integer;
var I: Sw_integer;
function IsAlpha(Ch: char): boolean;
begin
IsAlpha:=(Upcase(Ch) in['A'..'Z','_','$']);
@ -539,7 +538,7 @@ begin
end;
var C,PrevC: char;
WordS: string;
LastWordStart: integer;
LastWordStart: Sw_integer;
L: longint;
S: string;
D: DirStr; N: NameStr; E: ExtStr;
@ -718,7 +717,7 @@ begin
Inc(I);
end;
end;
var Pass: integer;
var Pass: Sw_integer;
begin
W:=FirstEditorWindow;
Err:=0;
@ -733,7 +732,10 @@ end;
END.
{
$Log$
Revision 1.1 1999-01-21 11:54:25 peter
Revision 1.2 1999-02-19 15:43:21 peter
* compatibility fixes for FV
Revision 1.1 1999/01/21 11:54:25 peter
+ tools menu
+ speedsearch in symbolbrowser
* working run command

View File

@ -96,11 +96,11 @@ type
Entries : record end;
end;
THLPKeywordDescriptor = record
THLPKeywordDescriptor = packed record
KwContext : word;
end;
THLPKeyWordRecord = record
THLPKeyWordRecord = packed record
UpContext : word;
DownContext : word;
KeyWordCount : word;
@ -130,7 +130,7 @@ type
TKeywordDescriptors = array[0..10900] of TKeywordDescriptor;
PTopic = ^TTopic;
TTopic = record
TTopic = packed record
HelpCtx : THelpCtx;
FileOfs : longint;
TextSize : word;
@ -145,13 +145,13 @@ type
PUnsortedStringCollection = ^TUnsortedStringCollection;
TUnsortedStringCollection = object(TCollection)
function At(Index: Integer): PString;
function At(Index: Sw_Integer): PString;
procedure FreeItem(Item: Pointer); virtual;
end;
PTopicCollection = ^TTopicCollection;
TTopicCollection = object(TCollection)
function At(Index: Integer): PTopic;
function At(Index: Sw_Integer): PTopic;
procedure FreeItem(Item: Pointer); virtual;
function SearchTopic(AHelpCtx: THelpCtx): PTopic;
end;
@ -210,7 +210,7 @@ type
PHelpFacility = ^THelpFacility;
THelpFacility = object(TObject)
HelpFiles: PHelpFileCollection;
IndexTabSize: integer;
IndexTabSize: Sw_integer;
constructor Init;
function AddOAHelpFile(FileName: string): boolean;
function AddHTMLHelpFile(FileName, TOCEntry: string): boolean;
@ -226,8 +226,8 @@ type
function AddFile(H: PHelpFile): boolean;
end;
const TopicCacheSize : integer = 10;
HelpStreamBufSize : integer = 4096;
const TopicCacheSize : Sw_integer = 10;
HelpStreamBufSize : Sw_integer = 4096;
HelpFacility : PHelpFacility = nil;
MaxHelpTopicSize : word = 65520;
@ -264,7 +264,7 @@ begin
end;
function UpcaseStr(S: string): string;
var I: integer;
var I: Sw_integer;
begin
for I:=1 to length(S) do
S[I]:=Upcase(S[I]);
@ -332,7 +332,7 @@ begin
end;
end;
function TUnsortedStringCollection.At(Index: Integer): PString;
function TUnsortedStringCollection.At(Index: Sw_Integer): PString;
begin
At:=inherited At(Index);
end;
@ -342,7 +342,7 @@ begin
if Item<>nil then DisposeStr(Item);
end;
function TTopicCollection.At(Index: Integer): PTopic;
function TTopicCollection.At(Index: Sw_Integer): PTopic;
begin
At:=inherited At(Index);
end;
@ -424,7 +424,7 @@ begin
end;
procedure THelpFile.MaintainTopicCache;
var Count: integer;
var Count: Sw_integer;
MinP: PTopic;
MinLRU: longint;
procedure CountThem(P: PTopic); {$ifndef FPC}far;{$endif}
@ -811,25 +811,33 @@ function THelpFacility.BuildIndexTopic: PTopic;
var T: PTopic;
Keywords: PIndexEntryCollection;
Lines: PUnsortedStringCollection;
procedure InsertKeywordsOfFile(H: PHelpFile); {$ifndef FPC}far;{$endif}
function InsertKeywords(P: PIndexEntry): boolean; {$ifndef FPC}far;{$endif}
begin
Keywords^.Insert(P);
InsertKeywords:=Keywords^.Count>=MaxCollectionSize;
end;
begin
H^.LoadIndex;
if Keywords^.Count<MaxCollectionSize then
H^.IndexEntries^.FirstThat(@InsertKeywords);
end;
procedure AddLine(S: string);
begin
if S='' then S:=' ';
Lines^.Insert(NewStr(S));
end;
procedure InsertKeywordsOfFile(H: PHelpFile); {$ifndef FPC}far;{$endif}
function InsertKeywords(P: PIndexEntry): boolean; {$ifndef FPC}far;{$endif}
begin
Keywords^.Insert(P);
InsertKeywords:=Keywords^.Count>=MaxCollectionSize;
end;
var
l1,l2 : longint;
begin
H^.LoadIndex;
l1:=MaxCollectionSize;
l2:=Keywords^.count;
if Keywords^.Count<MaxCollectionSize then
H^.IndexEntries^.FirstThat(@InsertKeywords);
end;
procedure AddLine(S: string);
begin
if S='' then S:=' ';
Lines^.Insert(NewStr(S));
end;
procedure RenderTopic;
var Size,CurPtr,I: word;
S: string;
S: string;
function CountSize(P: PString): boolean; {$ifndef FPC}far;{$endif} begin Inc(Size, length(P^)+1); CountSize:=Size>65200; end;
begin
Size:=0; Lines^.FirstThat(@CountSize);
@ -849,7 +857,7 @@ procedure FlushLine;
begin
if Line<>'' then AddLine(Line); Line:='';
end;
var KWCount,NLFlag: integer;
var KWCount,NLFlag: Sw_integer;
LastFirstChar: char;
procedure NewSection(FirstChar: char);
begin
@ -876,7 +884,7 @@ begin
Inc(NLFlag);
end;
var KW: PIndexEntry;
I: integer;
I: Sw_integer;
begin
New(Keywords, Init(5000,1000));
HelpFiles^.ForEach(@InsertKeywordsOfFile);
@ -935,7 +943,10 @@ end;
END.
{
$Log$
Revision 1.4 1999-02-18 13:44:37 peter
Revision 1.5 1999-02-19 15:43:22 peter
* compatibility fixes for FV
Revision 1.4 1999/02/18 13:44:37 peter
* search fixed
+ backward search
* help fixes