Autor Beitrag
DoppelX
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 27



BeitragVerfasst: Do 02.01.03 04:20 
Hi leute,

ich habe folgendes vor:

Ich will einen htmlEditor basteln ;) naja.. nun habe ich eine variable die bgfarbe heisst. Diese wird in einem neuen form aktualisiert. Nur aktualisiert sich die variable im memo nicht. Ich muss vorher wieder den button drücken, der das grundgegrüsst baut, und somit alles neu ins memo schreibt.

Wie kann man ein Memo aktualisieren?

habs schon so probiert:
ausblenden Quelltext
1:
form1.editor.repaint;					

oder auch so:
ausblenden Quelltext
1:
form1.editor.update;					

geht aber beides nicht.

jemand nen tip?

(02.01. 09:17 Tino) Code-Tags hinzugefügt.
torstenheinze
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: Do 02.01.03 18:29 
schreib einfach statt
ausblenden Quelltext
1:
2:
form1.editor.repaint;
form1.button1.click;

dann wird ein klick auf den butten simuliert, und das grundgerüst neu erstellt

(03.01. 09:28 Tino) Code-Tags hinzugefügt.
DoppelX Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 27



BeitragVerfasst: Do 02.01.03 18:58 
Zitat:
[Error] Unit2.pas(33): Undeclared identifier: 'Button1'

Also geht net :)

Es muss doch eine möglichkeit geben ein memo zu aktualisieren.
torstenheinze
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: Do 02.01.03 19:01 
du musst schreiben FORM1.button1.click;

Form1 muss die form sein, auf der der schalter ist
torstenheinze
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: Do 02.01.03 19:02 
soll ich dir mal ne demo schicken?
torstenheinze
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: Do 02.01.03 19:05 
sag mir deine email
DoppelX Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 27



BeitragVerfasst: Do 02.01.03 19:11 
service@yoursolutions-webdesign.de

aber ich habe sowieso schon From1 davor. bzw. gui.Button1.click; da das form ja gui heisst.

aber schick ruhig mal ;)
torstenheinze
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: Do 02.01.03 19:33 
müsste angekommen sein
DoppelX Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 27



BeitragVerfasst: Do 02.01.03 21:00 
keiner mehr eine idee? Das beispiel von torstenheinze funktioniert zwar aber nicht bei mir. :(
torstenheinze
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: Do 02.01.03 21:10 
die exe datei geht, aber das project nicht? oder wie
DoppelX Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 27



BeitragVerfasst: Do 02.01.03 21:22 
ne du musst mal deine email checken da steht alles. Das geht alles bei dir. Nur ich habe es genau so bei mir und es geht nicht.
torstenheinze
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: Do 02.01.03 21:40 
gui ist die 1. form
schreibe mal für form2 den namen der 2. form

schreibe in gui.button2:
ausblenden Quelltext
1:
gui.bgfarbe := form2.bgcolor					


die form2 soll nicht den wert im gui-form ändern, es soll der button2 im gui fenster auf den wert (color des colordialogs oder edit, etc) im form2 fenster zugreifen.

ist bgcolor ein edit oder oder eine variable, für den color wert des colodialogs?

schicke mir mal bitte den gesammten quelltext der 1. und 2. unit, und ich schau mir das mal an.
DoppelX Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 27



BeitragVerfasst: Do 02.01.03 21:46 
Unit2 (editBG heisst das form)(Nur das nötige)
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
procedure TeditBG.Button1Click(Sender: TObject);
begin
gui.bgfarbe := editBG.bgcolor.text;
gui.Button2.click;
editBG.close;
end;


Uni1(gui heisst das Form)(hpffe das ist nicht zuviel)
ausblenden volle Höhe Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Menus, ExtDlgs;

type
  Tgui = class(TForm)
    editor: TMemo;
    Button2: TButton;
    Button3: TButton;
    Button4: TButton;
    Button5: TButton;
    MainMenu1: TMainMenu;
    Datei1: TMenuItem;
    Beenden1: TMenuItem;
    Beenden2: TMenuItem;
    Beenden3: TMenuItem;
    Button6: TButton;
    Bearbeiten1: TMenuItem;
    Hilfe1: TMenuItem;
    Info1: TMenuItem;
    SaveDialog1: TSaveDialog;
    ffnen1: TMenuItem;
    AllesMakieren1: TMenuItem;
    Lschen1: TMenuItem;
    Kopieren1: TMenuItem;
    Einfgen1: TMenuItem;
    OpenDialog1: TOpenDialog;
    procedure Beenden3Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button6Click(Sender: TObject);
    procedure Beenden1Click(Sender: TObject);
    procedure Beenden2Click(Sender: TObject);
    procedure ffnen1Click(Sender: TObject);
    procedure AllesMakieren1Click(Sender: TObject);
    procedure Lschen1Click(Sender: TObject);
    procedure Kopieren1Click(Sender: TObject);
    procedure Einfgen1Click(Sender: TObject);
    procedure Info1Click(Sender: TObject);
  private
 {Private}
  public
    titel: string;
    bgfarbe: string;
    textfarbe: string;
    link: string;
    alink: string;
    vlink: string;
    kopfzeile: string;
    grund: integer;
  end;

var
  gui: Tgui;

implementation

uses Unit2, Unit3, Unit4, Unit5;

{$R *.dfm}

procedure Tgui.Beenden3Click(Sender: TObject);
begin
Close;
end;

procedure Tgui.FormCreate(Sender: TObject);
begin
grund := 0;

titel := 'Unbenannte Seite';
kopfzeile := '<!-- Inhalt des Headers! -->';
bgfarbe := '#ffffff';
textfarbe := '#000000';
link := '#333333';
alink := '#333333';
vlink := '#333333';

editor.Lines.text := '';
end;

procedure Tgui.Button2Click(Sender: TObject);
begin
editBG.show;
end;

procedure Tgui.Button6Click(Sender: TObject);
begin
createTAG.show;
end;

procedure Tgui.Beenden1Click(Sender: TObject);
begin
neu.Show;
end;

procedure Tgui.Beenden2Click(Sender: TObject);
begin
If SaveDialog1.Execute = True Then editor.Lines.SaveToFile(SaveDialog1.Filename);
end;

procedure Tgui.ffnen1Click(Sender: TObject);
begin
If Opendialog1.Execute = True Then editor.Lines.LoadFromFile(Opendialog1.FileName);
end;

procedure Tgui.AllesMakieren1Click(Sender: TObject);
begin
editor.SelectAll;
end;

procedure Tgui.Lschen1Click(Sender: TObject);
begin
editor.clearSelection;
end;

procedure Tgui.Kopieren1Click(Sender: TObject);
begin
editor.CopyToClipboard;
end;

procedure Tgui.Einfgen1Click(Sender: TObject);
begin
editor.PasteFromClipboard;
end;

procedure Tgui.Info1Click(Sender: TObject);
begin
info.show;
end;

end.
torstenheinze
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: Do 02.01.03 22:01 
wenn du im editgb fenster sagst, das er auf den button2 im guifenster klicken soll, dann offnet sich ja das fenster editgb wieder, weil das so in der procedure des button 2 steht. du musst ihm außerdem sagen, was mit dem wert passiert, dem du übergeben hast. das was dann passieren soll schreibst du dann in die procedure des button2 im gui fenster
[code]procedure TeditBG.Button1Click(Sender: TObject);
begin
gui.bgfarbe := editBG.bgcolor.text;
gui.Button2.click; //du öffnest damit noch mal das selbe fenster!!!
editBG.close;
end;

procedure Tgui.Button2Click(Sender: TObject);
begin
editBG.show; // hier müsste stehen, was mit dem wert bgfarbe passiert;*
end;[code]
* editBG.show ist überflüssig, du öfnest damit das fenster, welches du zuvor geschlossen hast!!!

(03.01. 09:30 Tino) Code-Tags hinzugefügt.
DoppelX Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 27



BeitragVerfasst: Do 02.01.03 22:06 
ja natürlich öffne ich das damit. weil das ja der button ist um dort hinzugelangen. hast du aber auch so.
torstenheinze
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: Do 02.01.03 22:16 
nein, mit butten1 gelange ich bei mir zu der anderen form
in button 2 steht, was mit den werten passiert.
schicke mir mal dein project per email (incl. readme, wo steht was mit den werten passiert) und ich werde mal versuch das richtig zu stellen
DoppelX Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 27



BeitragVerfasst: Do 02.01.03 23:32 
torsten du hast post :!:
torstenheinze
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: Do 02.01.03 23:34 
ok, ich schau mal
torstenheinze
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: Do 02.01.03 23:36 
bei mir ist keine email angekommen

noch mal zur sicherheit:
meine email ist:

torsten.heinze.de@web.de

viele vergessen den punkt zw. torsten und heinze
DoppelX Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 27



BeitragVerfasst: Fr 03.01.03 00:50 
ach misst. hab die mail nun einen kunden von mir geschickt :oops:

Nun hast du aber post .. hoffe ich :roll: