Autor Beitrag
Sithlord
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 172



BeitragVerfasst: Sa 13.09.08 11:09 
Hallo!

Habe schon gesucht - und auch vom Titel her eben beim eingeben des Titelthemas (127 Ergebnisse :
www.delphi-forum.de/...?search_id=736092062

Was ich für ein Problem habe ist folgendes :

Und zwar möchte ich einen HTML Editor programmieren.
Links ist die Memo, rechts der Webbrowser (Beide teilen sich die Form).

Wenn ich nun links was eingebe, erscheint es auch rechts korrekt im Webbrowser.
Wenn ich nun aber einmal im Webbrowser reinklicke (Egal ob Link oder nicht),

und ich anschließend den Quellcode im memo (links) erweitern will, wandert der cursor nach dem drücken einer beliebigen Taste aus der Memo raus - sodass ich nur einen Buchstaben/Zahl/taste drücken kann, und dann erst wieder mit der Maus den Cursor ins MemoFeld positionieren muss.

Warum ist das so ?
Was verändert der Webbrowser (Standardkomponente von Delphi) denn ?
Wie kann man das ändern ?

Bin für jede hilfe Dankbar!

Mfg Sithlord
Einloggen, um Attachments anzusehen!
_________________
Heut ist nicht alle Tage, ich hab wieder ein Problem, keine Frage...
Jakob_Ullmann
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1747
Erhaltene Danke: 15

Win 7, *Ubuntu GNU/Linux*
*Anjuta* (C, C++, Python), Geany (Vala), Lazarus (Pascal), Eclipse (Java)
BeitragVerfasst: Sa 13.09.08 11:13 
Vielleicht liegt das daran, dass TWebbrowser eine ActiveX-Komponente ist?
Sithlord Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 172



BeitragVerfasst: Sa 13.09.08 11:36 
Weiß ich nicht?!

Ich meine, ins Onchange Ereignis des Memofeldes wurde hereingeschrieben, das er seinen INhalt an den WEbbrowser schickt

_________________
Heut ist nicht alle Tage, ich hab wieder ein Problem, keine Frage...
Jakob_Ullmann
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1747
Erhaltene Danke: 15

Win 7, *Ubuntu GNU/Linux*
*Anjuta* (C, C++, Python), Geany (Vala), Lazarus (Pascal), Eclipse (Java)
BeitragVerfasst: Sa 13.09.08 12:04 
Dann setze vor dem Anzeigen die Visible-Eigenschaft des Webbrowsers auf true, zeichne danach auf ein Image und setze dann den Webbrowser.Visible auf false.

Aber: Ich glaube, dadurch wird dein Editor ziemlich langsam. Mache es wenn schon nur nach OnKeyUp und probier mal native VCL-Komponenten -> www.pbear.com
Sithlord Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 172



BeitragVerfasst: Sa 13.09.08 12:50 
Danke !

Habe die Freewarekomponente (Liteversion) vom angegebenen Link genommen!

Jetzt geht es!

Danke sehr ;)

_________________
Heut ist nicht alle Tage, ich hab wieder ein Problem, keine Frage...
wazup
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 101

Windows XP
Delphi 2009
BeitragVerfasst: Sa 13.09.08 15:30 
---
Jakob_Ullmann
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1747
Erhaltene Danke: 15

Win 7, *Ubuntu GNU/Linux*
*Anjuta* (C, C++, Python), Geany (Vala), Lazarus (Pascal), Eclipse (Java)
BeitragVerfasst: Sa 13.09.08 16:26 
user profile iconSithlord hat folgendes geschrieben:
Danke !

Habe die Freewarekomponente (Liteversion) vom angegebenen Link genommen!

Jetzt geht es!

Danke sehr ;)


Noch ein Hinweis: Sollte dein Editor irgendeinmal auch CSS beherrschen, nimm lieber den HTMLViewer als den HTMLLite. :wink: (beides ist Freeware, Lite ist halt nur abgespeckt und interpretiert zum Beispiel kein CSS)
Sithlord Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 172



BeitragVerfasst: Do 02.10.08 20:43 
Danke.

Habe ich auch bemerkt und gewechselt ;)

Vielen herzlichen Dank!

mfg Sithlord

_________________
Heut ist nicht alle Tage, ich hab wieder ein Problem, keine Frage...
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19315
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Do 02.10.08 23:45 
Übrigens kann man den TWebbrowser auch in einen Modus versetzen, bei dem man ihn als visuellen HTML-Editor verwenden kann:
www.delphipraxis.net...st567323.html#567323
Jakob_Ullmann
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1747
Erhaltene Danke: 15

Win 7, *Ubuntu GNU/Linux*
*Anjuta* (C, C++, Python), Geany (Vala), Lazarus (Pascal), Eclipse (Java)
BeitragVerfasst: Fr 03.10.08 08:56 
Auch wenn der herauskommende Code mehr oder weniger sauschlecht ist. :wink:
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19315
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Fr 03.10.08 09:19 
Dass das Ding nicht grad so guten Code erzeugt wie die neuen Tools (Expression und so) von MS, das dachte ich mir. Angeschaut habe ich mir den Code nicht bisher.
Es dürfte aber die einzige Möglichkeit darstellen einen WYSIWYG-Editor selbst in einem Programm anzubieten (kostenlos). ;-)
Sithlord Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 172



BeitragVerfasst: So 05.10.08 16:18 
Ja, thx ;)

_________________
Heut ist nicht alle Tage, ich hab wieder ein Problem, keine Frage...
Jakob_Ullmann
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1747
Erhaltene Danke: 15

Win 7, *Ubuntu GNU/Linux*
*Anjuta* (C, C++, Python), Geany (Vala), Lazarus (Pascal), Eclipse (Java)
BeitragVerfasst: So 05.10.08 16:46 
Nicht unbedingt. Ich hab das auch mal mit der THTMLViewer-Kompo probiert, war ziemlich buggy, da ich da noch nicht so lange programmiert hatte und auch nicht die nötige Zeit reingesteckt habe, aber es lief (wenn ich mich nochmal dransetzen würde, bin ich mir sicher, würde es laufen).
Nachteil an dem TWebbrowser-Teil ist nämlich der: Er macht den Code nicht nur unsauber, sondern kommt anscheinend auch schlecht mit Entities zurecht.

Eine Kostprobe vom IE-WYSIWYG-Code:

ausblenden XML-Daten
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Homepage</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="MSHTML 6.00.2900.2180" name=GENERATOR></HEAD>
<BODY vLink=purple aLink=orange link=blue>
<P>Neue Seite</P>
<UL>
  <LI><STRONG>aaa<EM>ii<U>ou</U></EM></STRONG></LI>
  <LI><STRONG><EM><U>dd</U></EM></STRONG></LI></UL>
<OL>
  <LI><STRONG><EM><U>ddd</U></EM></STRONG></LI>
  <LI><STRONG><EM><U>C<SUB>O<SUP>3</SUP></SUB><SUP>4<SUB>Q</SUB></SUP><SUB>a</SUB>V
  <HR id=0>
  </U></EM></STRONG></LI>
  <LI><STRONG><EM><U>ggg</U></EM></STRONG></LI></OL></BODY></HTML>