Autor Beitrag
Andreas L.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Sa 01.02.03 12:16 
Hi,
einen Text fügt man mit Memo1.lines.add ('text'); ein, jedoch möchte ich das der Text hinter den Curser eingetragen wird! Also keine neue Zeile und nicht am Anfang der neuen Zeile. Wie muss der Befehl lauten?
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mo 03.02.03 10:23 
Versuch es mal mit folgenden Code:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
procedure TForm1.Button1Click(Sender: TObject);
Var
  Line: String;
begin
  Line := Memo1.Lines [Memo1.CaretPos.y];
  Insert ('Neuer Text', Line, Memo1.CaretPos.x +1);
  Memo1.Lines [Memo1.CaretPos.y] := Line;
end;

Gruß
TINO
Andreas L. Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Mi 05.02.03 14:59 
DANKE
Andreas L. Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Mi 05.02.03 15:36 
Ich hab diese procedure in einen neuen Projekt getestet. Hat auch funktioniert. Aber wenn ich die procedure in meinen existierenden Projekt verwende kommt der Fehler: Undefinierter Bezeichner:CaretPos

Was ist da los?
Shadowdragon
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 143

Win 2000
Delphi 6 Pers., Delphi 7
BeitragVerfasst: Mi 05.02.03 16:34 
Du hast wahrscheins irgendwo einen Schreibfehler drin, Punkt vergessen oder so. :wink:

_________________
Ein Programm gleicht dem Prinzip von Jenga:
Viele Bestandteile, wird nach oben hin immer besser, nach unten hin immer instabiler und wenn man was falsch macht klappt der ganze Mist zusammen.
Andreas L. Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Mi 05.02.03 16:43 
Ich hab keinen Schreibfehler drin. Vielleicht muss ich was in die USES-Klausel schreiben. Aber in den leeren Projekt musste ich das auch nicht!
smiegel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 992
Erhaltene Danke: 1

WIN 7
D7 Prof., C#, RAD XE Prof.
BeitragVerfasst: Mi 05.02.03 16:50 
Hallo,

poste 'mal den Code wo der Fehler vorkommt.

CaretPos ist eine Eigenschaft des Memos. Also sollte diese, sofern sich ein Memo auf der Form befindet, auch verfügbar sein.

_________________
Gruß Smiegel
Ich weiß, daß ich nichts weiß, aber ich weiß mehr als die, die nicht wissen, daß sie nichts wissen. (Sokrates)
Andreas L. Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Mi 05.02.03 17:23 
Hier ist die procedure:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
procedure TMain.SpeedButton4Click(Sender: TObject);
Var
  Line: String;
begin
  Line := Memo1.Lines [Memo1.CaretPos.y];
  Insert ('<a name="Anker"></a>', Line, Memo1.CaretPos.x +1);
  Memo1.Lines [Memo1.CaretPos.y] := Line;
end;


Ich brauch den CODE für einen HTML-Editor. Ich verwende das ADVMEMO von TMS-Software, müsste aber die gleichen Eigenschaften wie das normale Memo haben.
BungeeBug
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 901



BeitragVerfasst: Mi 05.02.03 17:32 
Hi ...
sollte muss aber nicht ... aber wenn du nen "Pos1" - tastendruck simulierst ... sollte das auch gehen, da das ja dann ne Windows Funktion is die immer und überall zurverfügung steht ...

MfG BungeeBug
Andreas L. Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Mi 05.02.03 17:59 
Wie meinst du das?
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mi 05.02.03 18:01 
onlinehome hat folgendes geschrieben:
Ich verwende das ADVMEMO von TMS-Software, müsste aber die gleichen Eigenschaften wie das normale Memo haben.

Wie kommst Du darauf wenn Dir der Compiler sagt das er die Eigenschaft CaretPos nicht kennt. Schau Dir doch mal die Hilfe von dieser Komponenten an und such mal einer einer ähnlichen Eigenschaft!

Gruß
TINO
Andreas L. Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Mi 05.02.03 18:43 
Ich konnte mein Problem lösen. Hab an TMS-Software eine Mail geschickt.

Man muss Memo1.CaretPos.Y durch Memo1.curY austauschen. (Das gleiche auch mit caretPos.X

Trotzdem DANKE an alle für die Hilfe!
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Do 06.02.03 09:29 
onlinehome hat folgendes geschrieben:
Hab an TMS-Software eine Mail geschickt.

Haben die TMS-Software Komponenten denn keine Hilfedatei in der man hätte nachschauen können?

Gruß
TINO
Andreas L. Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Do 06.02.03 11:48 
Ich hab keine Hilfe gesehen!
Andreas L. Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Do 06.03.03 10:37 
Und wie kann ich das jetzt mit den SynMemo von den SynEdit Komponenten machen? Hab schon alles mögliche ausprobiert geht net!
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Do 06.03.03 10:55 
onlinehome hat folgendes geschrieben:
Hab schon alles mögliche ausprobiert geht net!

Du hast Die Komponenten doch erst seit ein paar Minuten installiert ?!?! Schau Dir mal den Quelltext von der tSynEdit-Komponente (Unit SynEdit.pas) an. Im Interface-Abschnitt kannst Du Dir die ganzen Eigenschaften dieser Komponente ansehen.

Gruß
TINO
Andreas L. Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Do 06.03.03 11:29 
OK! Mit alles ausprobiert meinte ich das ich alle in diesen Topic genannten Proceduren ausprobiert hab!
Andreas L. Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Do 06.03.03 14:46 
ich ahb jetzt ewig versucht heraus zu finden wie ich mitr den SynEdit nen Text hinterm Curser einfügen kann! Weiß den keiner den CODE?
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Do 06.03.03 15:05 
Also ich habe folgende Eigenschaften gefunden:
ausblenden Quelltext
1:
2:
3:
property CaretX: Integer read fCaretX write SetCaretX;
property CaretY: Integer read fCaretY write SetCaretY;
property CaretXY: TPoint read GetCaretXY write SetCaretXY;

Diese sollten doch das sein was Du suchst, oder?

Gruß
TINO
Andreas L. Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Do 06.03.03 15:09 
Also müsste der Code dann so heißen:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
procedure Tstart.SpeedButton1Click(Sender: TObject);
Var 
  Line: String; 
begin 
  Line := SynMemo1.Lines [SynMemo1.carety];
  Insert ('Neuer Text', Line, SynMemo1.Caretx +1);
  SynMemo1.Lines [SynMemo1.Carety] := Line;
  end;

Geht aber auch net! Kann es sein das ich zu dumm bin, dass zu kapieren!

Moderiert von user profile iconTino: Code-Tags hinzugefügt.