From 92ba95ec4f19fbfca89cd227fc88020750462c63 Mon Sep 17 00:00:00 2001 From: daniel Date: Sat, 27 May 2006 21:43:14 +0000 Subject: [PATCH] * Further development git-svn-id: trunk@3710 - --- fv/outline.pas | 60 +++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 55 insertions(+), 5 deletions(-) diff --git a/fv/outline.pas b/fv/outline.pas index d23623d9ce..cbe0539728 100644 --- a/fv/outline.pas +++ b/fv/outline.pas @@ -79,7 +79,7 @@ type TMyFunc = function(_EBP: Pointer; Cur: Pointer; function newnode(const Atext:string;Achildren,Anext:Pnode):Pnode; begin - new(newnode); + newnode:=new(Pnode); with newnode^ do begin next:=Anext; @@ -179,19 +179,17 @@ begin if EndWidth > 0 then begin for I := 1 to EndWidth do - begin Graph[I]:= Chars[StraightOrTee+1]; - end; J := J + EndWidth; end; Inc(J); - if Children <> False then + if Children then Graph[J] := Chars[StraightOrTee+2] else Graph[J] := Chars[StraightOrTee+1]; end; Inc(J); - if Expanded <> False then + if Expanded then Graph[J] := Chars[Retracted+2] else Graph[J] := Chars[Retracted+1]; @@ -203,7 +201,59 @@ end; procedure Toutlineviewer.draw; +var c_normal,c_normal_x,c_select,c_focus:byte; + maxpos:sw_integer; + b:Tdrawbuffer; + + function draw_item(cur:pointer;level,position:sw_integer; + lines:longint;flags:word):boolean; + + var c,i:byte; + s,t:string; + + begin + draw_item:=position>=delta.y+size.y; + if (position0) then + c:=c_focus + else if flags and ovexpanded<>0 then + c:=c_normal_x + else + c:=c_normal; + + {Fill drawbuffer with graph and text to draw.} + for i:=0 to size.x-1 do + begin + wordrec(b[i]).hi:=c; + if i+delta.x<=length(s) then + wordrec(b[i]).lo:=byte(s[i+delta.x]) + else if i+delta.x-length(s)