Форум: "Основная";
Текущий архив: 2002.02.25;
Скачать: [xml.tar.bz2];
ВнизСимволы в TCaption Найти похожие ветки
← →
Lena (2002-02-08 09:31) [0]Lena (08.02.02 04:17)
Подскажите пожалуйста, как заставить Caption отображать специальные символы?
Те, которые видны в программе CharacterMap. Я хотела бы отобразить два символа, которые в программе CharacterMap называются U+2193 и U+2193 в
tdbgrid.columns.items[].title.caption
(примерно также как это делает WindowsCommander)
-----------------------------------------------------------------Mbo © (08.02.02 07:47)
а что это за символы и где они живут?
в каком шрифте?
-----------------------------------------------------------------Lena (08.02.02 08:09)
в Ariale, например, Arrows там всякие,
скопировав вставляю в RichEdit - вижу нужный мне иероглиф,
а в Сaption он превращается в "?"
:( как быть?
-----------------------------------------------------------------MBo © (08.02.02 08:21)
а ты поставила этот шрифт в font для Label?
-----------------------------------------------------------------
Lena
естесственно Font.Name:="Arial";,
я пыталась загонять туда символы в виде разных char"ов,
wideChar"oв, но вижу либы вопросы("?")либо квадраты...
За что грохнули?
← →
модератор (2002-02-08 09:36) [1]За спам.
Читайте внимательнее правила.
← →
MBo (2002-02-08 09:44) [2]я не вижу в arial стрелок
но, например,
label1.font.Name:="Wingdings";
label1.caption:=#239;
работает
← →
Lena (2002-02-08 14:15) [3]Если бы я могла сделать половину caption одним шрифтом,
а другую половину другим, то меня это вполне бы устроило
но в Windings нету букв, а мне надо использовать спец. символы совмесно с буквами
>>>я не вижу в arial стрелок
в ariale полно стрелок и куча других полезных символов,
включите программу CharacterMap и убедитесь.
Canvas.textout не предлагать
неужели никто не знает как это делается?
← →
Lena (2002-02-08 14:25) [4]Как из ariala выцарапать кучу полезных закорёчек и иерогливов
и загнать их в Caption?
to :модератор ©
Поясните пожалуйста что именно Вам не понравилось в моих действиях?
← →
IronHawk (2002-02-08 14:52) [5]>>> Lena
надо открыть тот масив чарактеров в котором лежат все твои закарючки !
← →
MBo (2002-02-08 15:02) [6]>Lena попробуй
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ComCtrls;
type
TCLabel=class(TGraphicControl)
private
FCaption:string;
FColor:TColor;
FFont,FSmallFont,TempFont:TFont;
VShift:integer;
FTransparent:Boolean;
public
constructor create(AOwner:TComponent);override;
destructor Destroy;override;
procedure Paint;override;
published
property Caption:String read FCaption write FCaption;
property Color:Tcolor read FColor write FColor;
property Font:TFont read FFont write FFont;
property SmallFont:TFont read FSmallFont write FSmallFont;
property Transparent:Boolean read FTransparent write FTransparent;
end;
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
end;
var
Form1: TForm1;
cl:TCLabel;
implementation
{$R *.DFM}
{ TCLabel }
constructor TCLabel.create(AOwner: TComponent);
begin
inherited;
FColor:=clBtnFace;
FFont:=TFont.create;
FSmallFont:=TFont.create;
TempFont:=TFont.create;
setbounds(10,10,150,30);
end;
destructor TCLabel.Destroy;
begin
FFont.Free;
FSmallFont.Free;
TempFont.Free;
inherited;
end;
procedure TCLabel.Paint;
var
xpos,ypos,curypos:integer;
tagend:integer;
tags,temps:string;
procedure setfnt;
var c,c2:char;
l:integer;
begin
l:=length(tags);
if l>0 then begin
c:=tags[1];
case c of
"/":begin
if l>1 then begin
c2:=tags[2];
case c2 of
"b":TempFont.Style:=TempFont.Style - [fsBold];
"g":TempFont.name:=FFont.name;
"i":TempFont.Style:=TempFont.Style - [fsItalic];
"s":TempFont.size:=FFont.size;
"v":begin TempFont.assign(FFont); VShift:=0; end;
"n":begin TempFont.assign(FFont); VShift:=0; end;
end;
end;
end;
"b":TempFont.Style:=TempFont.Style + [fsBold];
"g":TempFont.name:="Symbol";
"v":begin TempFont.assign(FSmallFont); VShift:=-5; end;
"n":begin TempFont.assign(FSmallFont); VShift:=5; end;
"i":TempFont.Style:=TempFont.Style + [fsItalic];
"s": if l>1 then TempFont.Size:=StrToIntDef(Copy(tags,2,l-1),FFont.Size);
end;
end;
end;
function findtag:integer;
var i,j:integer;
begin
result:=0;
i:=pos("<",temps);
j:=pos(">",temps);
if (i>0) and (j>i) then begin
result:=i;tagend:=j;tags:=copy(temps,i+1,j-i-1);
end;
end;
begin
inherited;
if not FTransparent then begin
canvas.Brush.Color := FColor;
Canvas.Brush.Style := bsSolid;
Canvas.FillRect(ClientRect);
end;
Canvas.Brush.Style:=bsClear;
tempfont.assign(ffont);
temps:=fcaption;
xpos:=0;ypos:=height div 2;
while length(temps)>0 do begin
if findtag<>1 then begin
Canvas.Font.assign(TempFont);
curypos:=ypos-TempFont.size*3 div 4+Vshift;
canvas.TextOut(xpos,curypos,temps[1]);
xpos:=xpos+canvas.TextWidth(temps[1]);
delete(temps,1,1);
end else begin
setfnt;
delete(temps,1,tagend);
end;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
cl:=tclabel.create(self);
cl.Parent:=self;
cl.caption:=
"<g> <s18>S</g></s><v> i</v><n>j</n>H<n>2</n>SO<n>4";
cl.Font.name:="Arial";
cl.Font.size:=12;
cl.SmallFont.name:="Arial";
cl.SmallFont.size:=8;
cl.SmallFont.Color:=clGreen;
end;
end.
Страницы: 1 вся ветка
Форум: "Основная";
Текущий архив: 2002.02.25;
Скачать: [xml.tar.bz2];
Память: 0.47 MB
Время: 0.007 c