![]() |
kleines D8 Programm
Hi,
wer D8 hat soll/kann sich das hier mal ansehen :
Delphi-Quellcode:
Das ist ein Teil eines D7 Programmes. Und zwar ein Stringgrid auf einer Form, sonst nichts. Das einzige was erreicht werden soll : manche Zellen sollen wegen Zahlen rechtsbündig dargestellt werden. Compilieren tut es nicht. Das @ stört wohl auch und ich will gerne nach und nach solchen Sachen auf die Spur kommen. Wer da Lust hat, kann es mal versuchen zu compilieren und seinen Kommentar über neue Erkenntnisse hier abgeben.
unit Unit1;
interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs; type TForm1 = class(TForm) StringGrid1: TStringGrid; procedure StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState); private { Private-Deklarationen } public { Public-Deklarationen } end; var Form1: TForm1; implementation {$R *.nfm} procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState); procedure TfrmRegis.sgRegisDrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState); procedure WriteText(StringGrid: TStringGrid; ACanvas: TCanvas; const ARect: TRect; const Text: string); const DY = 2; var S: array[0..255] of Char; begin with Stringgrid, ACanvas, ARect do begin ExtTextOut(Handle, Right - TextWidth(Text) - 3, Top + DY, ETO_OPAQUE or ETO_CLIPPED, @ARect, StrPCopy(S, Text), Length(Text), nil); end; end; procedure Display(StringGrid: TStringGrid; const S: string); begin WriteText(StringGrid, StringGrid.Canvas, Rect, S); end; begin inherited; if (ACol in [1,4,6,7]) then Display(sgRegis, sgRegis.Cells[ACol, ARow]); end; end. [EDIT]Tipfvela vrbressert |
Re: kleines D8 Programm
Works for me (in D8):
Delphi-Quellcode:
...:cat:...
procedure TForm1.sgRegisDrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState); procedure WriteText(StringGrid: TStringGrid; ACanvas: TCanvas; const ARect: TRect; const Text: string); const DY = 2; var S: array[0..255] of Char; begin with Stringgrid, ACanvas, ARect do begin ExtTextOut(Handle, Right - TextWidth(Text) - 3, Top + DY, 0, ARect, Text, Length(Text), nil); end; end; procedure Display(StringGrid: TStringGrid; const S: string); begin WriteText(StringGrid, StringGrid.Canvas, Rect, S); end; begin if (ACol in [1,4,6,7]) then Display(sgRegis, sgRegis.Cells[ACol, ARow]); end; |
Re: kleines D8 Programm
Zitat:
|
Re: kleines D8 Programm
Zitat:
STATUS Delphi-PRAXiS.net has confirmed that this is a bug in the Delphi-PRAXiS.net products that are listed (or not) at the beginning of this article. :mrgreen: Ich kann das so abändern, dass ein Leerzeichen davor und dahinter gefordert wird. |
Re: kleines D8 Programm
Ist zwar off-topic, aber gibt´s nicht andere Möglichkeiten? Wie wäre es statt Kürzel mit einem Begriff à la ": evil :" .... meinetwegen ":glasses:", oder so.
|
Re: kleines D8 Programm
:warn: Müßt ihr meinen schönen Thread direkt schon versauen ? :mrgreen: Wegen den paar 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) Nur Neulinge wie Sakura fallen noch darauf rein. :stupid: Mal sehen ob sein (D 8) Programm läuft. Gut aussehen tut es auf den ersten Blick. .Net scheint allerdings sehr langsam zu sein (oder eben D 8). :lol:
|
Re: kleines D8 Programm
Zitat:
Der erste Aufruf eines Programms kann dauern (Startzeit von .NET-Framework). D8 mit VCL ist prinzipbedingt langsam (sehr viele P/Invoke-Aufrufe in VCL nötig. Und die dauern aufgrund der Sicherheitsüberprüfung). |
Re: kleines D8 Programm
Die Programme an sich sind wirklich nicht langsam, im Gegenteil. Aber D8 selber ist es :mrgreen: :roll:
|
Re: kleines D8 Programm
Das stimmt. Aber mit 2,6 GHz und 2 GB Ram merkt man sowas nicht so schnell 8)
|
Re: kleines D8 Programm
Das hier wird jetzt der 8) Thread. 8) :mrgreen: Denn eines ist schoon klar 8) Sakuras Programm läßt sich zwar compilieren, aber es macht nicht was die Vorgabe war. 8) Rechtsbündig ist da nix. 8)
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 09:19 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz