فهرست منبع

* Fix buttons that didn't show.

git-svn-id: trunk@3371 -
daniel 19 سال پیش
والد
کامیت
1ec04be995
2فایلهای تغییر یافته به همراه30 افزوده شده و 22 حذف شده
  1. 29 21
      fv/dialogs.pas
  2. 1 1
      fv/strtxt.inc

+ 29 - 21
fv/dialogs.pas

@@ -1831,7 +1831,16 @@ BEGIN
            Bc := GetColor($0703) Else                 { Set selected colour }
              If AmDefault Then Bc := GetColor($0602); { Set is default colour }
      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 }
        I := CTextWidth(Title^);                        { Fetch title width }
        I := (Size.X - I) DIV 2;                    { Centre in button }
@@ -1850,26 +1859,25 @@ BEGIN
      MoveCStr(Db[I+pos], Title^, Bc);                        { Move title to buffer }
      For j:=pos+CStrLen(Title^)+I to size.X-2 do
        MoveChar(Db[j],' ',Bc,1);
-     If not DownFlag then
-       Bc:=GetColor(8);
-     MoveChar(Db[Size.X-1],' ',Bc,1);
-     WriteLine(0, 0, Size.X,
-       1, Db);                  { Write the title }
-     If Size.Y>1 then Begin
-       Bc:=GetColor(8);
-       if not DownFlag then
-         begin
-           c:='Ü';
-           MoveChar(Db,c,Bc,1);
-           WriteLine(Size.X-1, 0, 1, 1, Db);
-         end;
-       MoveChar(Db,' ',Bc,1);
-       if DownFlag then c:=' '
-       else c:='ß';
-       MoveChar(Db[1],c,Bc,Size.X-1);
-       WriteLine(0, 1, Size.X, 1, Db);
-     End;
-   End;
+    end;
+    If not DownFlag then
+      Bc:=GetColor(8);
+    MoveChar(Db[Size.X-1],' ',Bc,1);
+    WriteLine(0, 0, Size.X,1, Db);                  { Write the title }
+    If Size.Y>1 then Begin
+      Bc:=GetColor(8);
+      if not DownFlag then
+        begin
+          c:='Ü';
+          MoveChar(Db,c,Bc,1);
+          WriteLine(Size.X-1, 0, 1, 1, Db);
+        end;
+      MoveChar(Db,' ',Bc,1);
+      if DownFlag then c:=' '
+      else c:='ß';
+      MoveChar(Db[1],c,Bc,Size.X-1);
+      WriteLine(0, 1, Size.X, 1, Db);
+    End;
 END;
 
 {--TButton------------------------------------------------------------------}

+ 1 - 1
fv/strtxt.inc

@@ -211,5 +211,5 @@ var i:word;
 
 begin
   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;