|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
J'ai cherché dans la JVCL, j'ai pas trouvé de "RotatedLabel"...
Alors j'ai adapté un bout de code trouvé dans l'aide W32... procedure TFenAppMutes.PaintBox1Paint(Sender: TObject); var plf : TLogFont; hfnt, oldh : HFONT; ALV : TVersionInfo; AText : string; begin FillChar(plf, SizeOf(plf), 0); StrPCopy(plf.lfFaceName, 'Arial'); plf.lfHeight := -MulDiv(8, GetDeviceCaps(PaintBox1.Canvas.Handle, LOGPIXELSY), 72); plf.lfWeight := FW_NORMAL; plf.lfEscapement := 900; hfnt := CreateFontIndirect(plf); try //PaintBox1.Canvas.Font.Handle := hfnt; oldh := SelectObject(PaintBox1.Canvas.Handle, hfnt); try ALV := TVersionInfo.Create(Application.ExeName); try AText := 'Version ' + LongVersionToString(ALV.FileLongVersion); PaintBox1.Canvas.TextOut(PaintBox1.Width - PaintBox1.Canvas.TextHeight(AText), PaintBox1.Height {PaintBox1.Canvas.TextWidth(AText)}, AText); finally ALV.Free; end; finally SelectObject(PaintBox1.Canvas.Handle, oldh); end; finally DeleteObject(hfnt); end; end; |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
BigGrizzly wrote:
> J'ai cherché dans la JVCL, j'ai pas trouvé de "RotatedLabel"... C'est marrant, j'étais persuadé d'en avoir vu un... faut que je retrouve... |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
J'avoue ne pas avoir tout installé... mais j'ai bien installé l'onglet
"Labels"... et à l'intérieur, je ne trouve rien qui y ressemble. OBones <obones_dfd_@_zeea_altern.org> :: BigGrizzly wrote: ::: J'ai cherché dans la JVCL, j'ai pas trouvé de "RotatedLabel"... :: :: C'est marrant, j'étais persuadé d'en avoir vu un... faut que je :: retrouve... |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
réponse au titre: je fais comme ton code, à savoir création d'une
nouvelle font avec rotation, utilisation de la font... un jour peut-être que la VCL connaitra ce paramètre (ce qui serait plutôt bien) /_BigGrizzly_ a couché sur son écran/ : > J'ai cherché dans la JVCL, j'ai pas trouvé de "RotatedLabel"... > Alors j'ai adapté un bout de code trouvé dans l'aide W32... > procedure TFenAppMutes.PaintBox1Paint(Sender: TObject); > var > plf : TLogFont; > hfnt, oldh : HFONT; > ALV : TVersionInfo; > AText : string; > begin > FillChar(plf, SizeOf(plf), 0); > StrPCopy(plf.lfFaceName, 'Arial'); > plf.lfHeight := -MulDiv(8, GetDeviceCaps(PaintBox1.Canvas.Handle, > LOGPIXELSY), 72); > plf.lfWeight := FW_NORMAL; > plf.lfEscapement := 900; > hfnt := CreateFontIndirect(plf); > try > //PaintBox1.Canvas.Font.Handle := hfnt; > oldh := SelectObject(PaintBox1.Canvas.Handle, hfnt); > try > ALV := TVersionInfo.Create(Application.ExeName); > try > AText := 'Version ' + LongVersionToString(ALV.FileLongVersion); > PaintBox1.Canvas.TextOut(PaintBox1.Width - > PaintBox1.Canvas.TextHeight(AText), PaintBox1.Height > {PaintBox1.Canvas.TextWidth(AText)}, AText); > finally > ALV.Free; > end; > finally > SelectObject(PaintBox1.Canvas.Handle, oldh); > end; > finally > DeleteObject(hfnt); > end; > end; -- Faust "Une âme en peine peut en cacher une autre" |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
+1
Faust a écrit : > réponse au titre: je fais comme ton code, à savoir création d'une > nouvelle font avec rotation, utilisation de la font... > > un jour peut-être que la VCL connaitra ce paramètre (ce qui serait > plutôt bien) > > /_BigGrizzly_ a couché sur son écran/ : >> J'ai cherché dans la JVCL, j'ai pas trouvé de "RotatedLabel"... > >> Alors j'ai adapté un bout de code trouvé dans l'aide W32... > >> procedure TFenAppMutes.PaintBox1Paint(Sender: TObject); >> var >> plf : TLogFont; >> hfnt, oldh : HFONT; >> ALV : TVersionInfo; >> AText : string; >> begin >> FillChar(plf, SizeOf(plf), 0); >> StrPCopy(plf.lfFaceName, 'Arial'); >> plf.lfHeight := -MulDiv(8, GetDeviceCaps(PaintBox1.Canvas.Handle, >> LOGPIXELSY), 72); >> plf.lfWeight := FW_NORMAL; >> plf.lfEscapement := 900; >> hfnt := CreateFontIndirect(plf); >> try >> //PaintBox1.Canvas.Font.Handle := hfnt; >> oldh := SelectObject(PaintBox1.Canvas.Handle, hfnt); >> try >> ALV := TVersionInfo.Create(Application.ExeName); >> try >> AText := 'Version ' + LongVersionToString(ALV.FileLongVersion); >> PaintBox1.Canvas.TextOut(PaintBox1.Width - >> PaintBox1.Canvas.TextHeight(AText), PaintBox1.Height >> {PaintBox1.Canvas.TextWidth(AText)}, AText); >> finally >> ALV.Free; >> end; >> finally >> SelectObject(PaintBox1.Canvas.Handle, oldh); >> end; >> finally >> DeleteObject(hfnt); >> end; >> end; > |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
"OBones" <obones_dfd_@_zeea_altern.org> a écrit dans le message de news:fdssmo$q8q$1@sd-6498.dedibox.fr... > C'est marrant, j'étais persuadé d'en avoir vu un... faut que je retrouve... tu vois, c'est ça le problème... y'a tellement de compos, qu'on ne sait plus à quoi ils servent... Faudrait une petite liste résumée... |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
BigGrizzly a écrit :
> J'ai cherché dans la JVCL, j'ai pas trouvé de "RotatedLabel"... > > Alors j'ai adapté un bout de code trouvé dans l'aide W32... > > procedure TFenAppMutes.PaintBox1Paint(Sender: TObject); > var > plf : TLogFont; > hfnt, oldh : HFONT; > ALV : TVersionInfo; > AText : string; > begin > FillChar(plf, SizeOf(plf), 0); > StrPCopy(plf.lfFaceName, 'Arial'); > plf.lfHeight := -MulDiv(8, GetDeviceCaps(PaintBox1.Canvas.Handle, > LOGPIXELSY), 72); > plf.lfWeight := FW_NORMAL; > plf.lfEscapement := 900; > hfnt := CreateFontIndirect(plf); > try > //PaintBox1.Canvas.Font.Handle := hfnt; > oldh := SelectObject(PaintBox1.Canvas.Handle, hfnt); > try > ALV := TVersionInfo.Create(Application.ExeName); > try > AText := 'Version ' + LongVersionToString(ALV.FileLongVersion); > PaintBox1.Canvas.TextOut(PaintBox1.Width - > PaintBox1.Canvas.TextHeight(AText), PaintBox1.Height > {PaintBox1.Canvas.TextWidth(AText)}, AText); > finally > ALV.Free; > end; > finally > SelectObject(PaintBox1.Canvas.Handle, oldh); > end; > finally > DeleteObject(hfnt); > end; > end; > > oxLabel de la Venus Lib (des fois c'est utile d'avoir 25 libs :-) Mais qui doit faire la même chose que ton code. |
|
|
|
#8 |
|
Messages: n/a
Hébergeur: |
Tu as raison. Je suis bigleux.
waskol <wilfrid.avrillon@club-internet.fr> :: "OBones" <obones_dfd_@_zeea_altern.org> a écrit dans le message de :: news:fdssmo$q8q$1@sd-6498.dedibox.fr... ::: BigGrizzly wrote: :::: J'ai cherché dans la JVCL, j'ai pas trouvé de "RotatedLabel"... ::: ::: C'est marrant, j'étais persuadé d'en avoir vu un... faut que je ::: retrouve... :: :: TJVLabel possède une propriété angle. C'est pas ça par hasard ? |
|
![]() |
| Outils de la discussion | |
|
|