home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 October / Chip_1997-10_cd.bin / tema / sw602 / wintext / disk1 / data.1 / SETSIZE2.TXT < prev    next >
Text File  |  1996-12-17  |  1KB  |  54 lines

  1. program ZmenÜit_font;
  2.  
  3. const
  4.   pojm_blok = 'pojm_blok';
  5.  
  6. var
  7.   iSize, x, iPos : integer;
  8.   iStart, iEnd : integer;
  9.   bSelect, bKonec : boolean;
  10.  
  11. begin
  12.   if (IsBlockSelected) then begin
  13.     bSelect := true;
  14.     LabelBlock(false, pojm_blok, true);
  15.     iStart := GetSelStartPos;
  16.     iEnd := GetSelEndPos;
  17.     if (GetCaretPos >= iEnd) then ChangeSelRanges;
  18.     UnselectBlock;
  19.   end
  20.   else begin
  21.     CaretEnd;
  22.     iEnd := GetCaretPos;
  23.     CaretHome;
  24.   end;
  25.  
  26.   iPos := GetCaretPos;
  27.   while (iPos < iEnd) do begin
  28.     iSize := GetFormatFont(kCHPSize);
  29.     x := iPos;
  30.     bKonec := false;
  31.     while (iPos <= iEnd) and not(bKonec) do begin
  32.       iPos := GetCaretPos;
  33.       if (iSize <> GetFormatFont(kCHPSize)) or (iPos = iEnd) 
  34. then begin
  35.         bKonec := true;
  36.         if (iPos <> iEnd) then begin    // pozdeji zmenit 
  37. !!!!!!!!!!!
  38.           CharLeft(1);
  39.           CharLeft(iPos-x, true);
  40.         end
  41.         else
  42.           CharLeft(iPos-x+1, true);
  43.         SetFormatFont(kChPSize, iSize-(Round(iSize/6)));
  44.         ChangeSelRanges;
  45.         UnselectBlock;
  46.       end
  47.       else
  48.         CharRight(1);
  49.     end;
  50.   end;
  51.  
  52.   if (bSelect) then
  53.     UnlabelBlock(pojm_blok);
  54. end.