home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 October / Chip_1997-10_cd.bin / tema / sw602 / wintext / disk1 / data.1 / _UPCASE.TXT < prev    next >
Text File  |  1995-02-13  |  937b  |  41 lines

  1. program UPCASE;
  2.  
  3. //  Makro prevede oznaceny text do velkych pismen
  4. // s tim, ze pocatky slov budou mit o const vetsi
  5. // velikost, nez zbytek slova
  6.  
  7. const 
  8.    rozdil   =  2;
  9.    aux_size = 12;
  10.  
  11. var 
  12.   startsel, endsel, vel : integer;
  13.  
  14. begin
  15.   if not IsBlockSelected then
  16.   begin
  17.     Info_Box("Zprßva", "Nenφ oznaΦen blok");
  18.     halt;
  19.   end;
  20.  
  21.   if GetSelEndPos = GetCaretPos then
  22.     ChangeSelRanges; 
  23.   startsel := GetSelStartPos;
  24.   endsel := GetSelEndPos;
  25.   UnselectBlock;
  26.   vel := GetFormatFont(kCHPSize);
  27.   { casti oznaceneho textu mohou mit ruzne velikosti pisma : }
  28.   if vel = kAmbiguous then
  29.     vel := aux_size;
  30.   while GetSelStartPos < endsel do
  31.   begin
  32.     CharRight(1, TRUE);
  33.     SetFormatFont(kCHPsize, vel);
  34.     SetFormatFont(kCHPcaps, kOn);
  35.     UnselectBlock;
  36.     RightOfWord(TRUE);
  37.     SetFormatFont(kCHPsize, vel - rozdil);
  38.     SetFormatFont(kCHPcaps, kOn);
  39.     WordRight;
  40.   end;
  41. end.