Autor Beitrag
iPaule
Hält's aus hier
Beiträge: 7

Win XP
Delphi 5 Prof
BeitragVerfasst: Di 22.08.06 12:21 
Habe überall gesucht - jedoch nichts gefunden: Ich suche den Style wie z.B. [fsBold], der den Text im TRichEdit hoch, bzw. tief stellt. Zwar habe ich bereits einen Beitrag gefunden, in dem sich ein Link zu einem mit Delphi programmierten Editor befindet, der genau das kann, jedoch gibt der Programmierer nur die EXE raus. Im Beispiel von Delphi "RichEdit" fehlt auch diese Funktion.

Kann mir jemand helfen???


Moderiert von user profile iconChristian S.: Topic aus Sonstiges (Delphi) verschoben am Do 24.08.2006 um 18:45
alias5000
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2145

WinXP Prof SP2, Ubuntu 9.04
C/C++(Code::Blocks, VS.NET),A51(Keil),Object Pascal(D2005PE, Turbo Delphi Explorer) C# (VS 2008 Express)
BeitragVerfasst: Di 22.08.06 12:49 
Dazu brauchst du eine andere Komponente als TRichEdit, die kann das nicht. IMHO kann das das TJvRichEdit aus der JVCL
wenn das nicht geht, kann es das TRichEdit98 aber auf jeden Fall

_________________
Programmers never die, they just GOSUB without RETURN
Flocke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 54

Win 2000, Win XP, Win 2003, Linux
Delphi 2006 Prof.
BeitragVerfasst: Di 22.08.06 12:54 
Das geht über EM_SETCHARFORMAT direkt:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
uses
  RichEdit;

type
  TSubSuper = (ssNone, ssSubscript, ssSuperScript);

procedure SetSubSuper(RichEdit: TCustomRichEdit; SubSuper: TSubSuper);
const
  CEffect: array [TSubSuper] of DWORD = (0, CFE_SUBSCRIPT, CFE_SUPERSCRIPT);
var
  Format: TCharFormat;
begin
  FillChar(Format, SizeOf(Format), 0);
  Format.cbSize := SizeOf(Format);
  Format.dwMask := CFM_SUBSCRIPT;
  Format.dwEffects := CEffect[SubSuper];
  SendMessage(RichEdit.Handle, EM_SETCHARFORMAT, SCF_SELECTION, Integer(@Format));
end;


Zuletzt bearbeitet von Flocke am Di 22.08.06 15:47, insgesamt 2-mal bearbeitet
elundril
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: Di 22.08.06 12:54 
tschuldige aber wo bekomme ich beide her?

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.
alias5000
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2145

WinXP Prof SP2, Ubuntu 9.04
C/C++(Code::Blocks, VS.NET),A51(Keil),Object Pascal(D2005PE, Turbo Delphi Explorer) C# (VS 2008 Express)
BeitragVerfasst: Di 22.08.06 13:18 
Flockes Lösung iss besser, wenn du nur diese Funktion brauchst, ansonsten ist Google immer dein Freund....

TRichEdit98: www.torry.net -> Suche: TRichEdit98 (wenn du D6 oder höher verwendest musst du mal bei Google nach sowas suchen Suche bei Google TRICHEDIT98 DELPHI 6 oder so)

TJvRichEdit. Mensch, ich hab doch JVCL hingeschrieben, iss die imme noch nicht bekannt??? *komisch guck* :D
jvcl.sourcefogre.net

Gruß alias5000

_________________
Programmers never die, they just GOSUB without RETURN
iPaule Threadstarter
Hält's aus hier
Beiträge: 7

Win XP
Delphi 5 Prof
BeitragVerfasst: Di 22.08.06 16:11 
Besten Dank!!!!
elundril
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: Di 22.08.06 16:48 
leider funktioniert flockes Procedure nicht bei mir! da is ihm was unbekannt!

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Di 22.08.06 18:33 
Hallo,

was fehlt ihm denn?

In uses die Unit RichEdit eingebunden?

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
iPaule Threadstarter
Hält's aus hier
Beiträge: 7

Win XP
Delphi 5 Prof
BeitragVerfasst: Mi 23.08.06 07:34 
Titel: klappt bei mir auch nicht
... geht mir so wie elundril:

in uses wurde alles eingebunden. es fängt aber schon bei der Typendeklaration an.

Entweder klappt das mit Delphi 5 grundsätzlich nicht oder ich mache etwas falsch oder die Syntax ist nicht korrekt...

gruß
iPaule Threadstarter
Hält's aus hier
Beiträge: 7

Win XP
Delphi 5 Prof
BeitragVerfasst: Mi 23.08.06 07:53 
Titel: TRichEdit98 kann nicht kompiliert werden
Auch die Variante, die Komponente TRichEdit98 einzubinden scheitert.

Ich bin genau so vorgegangen, wie in der readme beschrieben. beim versuch die RichEdit2.pas zu kompilieren gibt es die meldung: "class TRichEdit98 not found" ....


kann jemand helfen?
Flocke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 54

Win 2000, Win XP, Win 2003, Linux
Delphi 2006 Prof.
BeitragVerfasst: Mi 23.08.06 08:48 
user profile iconelundril hat folgendes geschrieben:
leider funktioniert flockes Procedure nicht bei mir! da is ihm was unbekannt!

Es würde sehr helfen wenn du sagen würdest, welcher Fehler genau kommt (das Betrifft übrigens auch iPaule).
iPaule Threadstarter
Hält's aus hier
Beiträge: 7

Win XP
Delphi 5 Prof
BeitragVerfasst: Mi 23.08.06 09:18 
Titel: ok - hier eine Fehlermeldung:
z.B.:
Type
TSubSuper = .... => hier wird ein ":" erwartet anstatt "="
Flocke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 54

Win 2000, Win XP, Win 2003, Linux
Delphi 2006 Prof.
BeitragVerfasst: Mi 23.08.06 09:35 
@iPaule: das kann nicht sein. Wenn du diese Zeilen:
ausblenden Delphi-Quelltext
1:
2:
type
  TSubSuper = (ssNone, ssSubscript, ssSuperScript);

irgendwo außerhalb eines begin..end hinschreibst, dann ist das gültiges Object-Pascal.

Was ich gerade beim Ausprobieren feststellen musste ist allerdings: das "alte" RichEdit (RICHED32.DLL), das von Delphi standardmäßig benutzt wird, unterstützt keine Hoch- und Tiefstellung. Man müsste also über die vertikale Position und ggf. die Schriftgröße gehen.

Angepasste Funktion:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
uses
  RichEdit;

type
  TSubSuper = (ssNone, ssSubscript, ssSuperScript);

procedure SetSubSuper(RichEdit: TCustomRichEdit; SubSuper: TSubSuper);
const
  COffset: array [TSubSuper] of integer = (0, -60, 60);
var
  Format: TCharFormat;
begin
  FillChar(Format, SizeOf(Format), 0);
  Format.cbSize := SizeOf(Format);
  Format.dwMask := CFM_OFFSET;
  Format.yOffset := COffset[SubSuper];
  SendMessage(RichEdit.Handle, EM_SETCHARFORMAT, SCF_SELECTION, Integer(@Format));
end;


...das sieht aber nicht sooo schön aus (weil die Schriftgröße bleibt).

Das ist's wohl besser ein TRichEdit98 oder TJvRichEdit zu nehmen, dass die "neue" RICHED20.DLL benutzt.
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Mi 23.08.06 14:12 
Hallo,

die alte riched32.dll wird zwar von Delphi benutzt, aber diese verlinkt IMHO ab (Windos2000 u. XP) auf riched20.dll.

Im Code (Variante 1) wird TCharFormat deklariert, wenn man TCharFormat2 benutzt, funktioniert es, vorrausgesetzt das Betriebssystem ist nicht älter als Windos2000 u. XP.

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
elundril
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: Do 24.08.06 14:10 
is egal! ich nehm JvRichedit!!

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.