* Fix buttons that didn't show.

git-svn-id: trunk@3371 -
This commit is contained in:
daniel 2006-04-29 20:18:44 +00:00
parent 20e73384ae
commit 1ec04be995
2 changed files with 30 additions and 22 deletions

View File

@ -1831,7 +1831,16 @@ BEGIN
Bc := GetColor($0703) Else { Set selected colour } Bc := GetColor($0703) Else { Set selected colour }
If AmDefault Then Bc := GetColor($0602); { Set is default colour } If AmDefault Then Bc := GetColor($0602); { Set is default colour }
End; End;
If (Title <> Nil) Then Begin { We have a title } if title=nil then
begin
MoveChar(Db[0],' ',GetColor(8),1);
{No title, draw an empty button.}
for j:=sw_integer(downflag) to size.x-2 do
MoveChar(Db[j],' ',Bc,1);
end
else
{We have a title.}
begin
If (Flags AND bfLeftJust = 0) Then Begin { Not left set title } If (Flags AND bfLeftJust = 0) Then Begin { Not left set title }
I := CTextWidth(Title^); { Fetch title width } I := CTextWidth(Title^); { Fetch title width }
I := (Size.X - I) DIV 2; { Centre in button } I := (Size.X - I) DIV 2; { Centre in button }
@ -1850,26 +1859,25 @@ BEGIN
MoveCStr(Db[I+pos], Title^, Bc); { Move title to buffer } MoveCStr(Db[I+pos], Title^, Bc); { Move title to buffer }
For j:=pos+CStrLen(Title^)+I to size.X-2 do For j:=pos+CStrLen(Title^)+I to size.X-2 do
MoveChar(Db[j],' ',Bc,1); MoveChar(Db[j],' ',Bc,1);
If not DownFlag then end;
Bc:=GetColor(8); If not DownFlag then
MoveChar(Db[Size.X-1],' ',Bc,1); Bc:=GetColor(8);
WriteLine(0, 0, Size.X, MoveChar(Db[Size.X-1],' ',Bc,1);
1, Db); { Write the title } WriteLine(0, 0, Size.X,1, Db); { Write the title }
If Size.Y>1 then Begin If Size.Y>1 then Begin
Bc:=GetColor(8); Bc:=GetColor(8);
if not DownFlag then if not DownFlag then
begin begin
c:='Ü'; c:='Ü';
MoveChar(Db,c,Bc,1); MoveChar(Db,c,Bc,1);
WriteLine(Size.X-1, 0, 1, 1, Db); WriteLine(Size.X-1, 0, 1, 1, Db);
end; end;
MoveChar(Db,' ',Bc,1); MoveChar(Db,' ',Bc,1);
if DownFlag then c:=' ' if DownFlag then c:=' '
else c:='ß'; else c:='ß';
MoveChar(Db[1],c,Bc,Size.X-1); MoveChar(Db[1],c,Bc,Size.X-1);
WriteLine(0, 1, Size.X, 1, Db); WriteLine(0, 1, Size.X, 1, Db);
End; End;
End;
END; END;
{--TButton------------------------------------------------------------------} {--TButton------------------------------------------------------------------}

View File

@ -211,5 +211,5 @@ var i:word;
begin begin
for i:=0 to standard_label_count-1 do for i:=0 to standard_label_count-1 do
strings^.put(standard_labels[i].nr,strpas(standard_labels[i].text)); labels^.put(standard_labels[i].nr,strpas(standard_labels[i].text));
end; end;