Potrebujem zistit vlastnosti triedy ColorDialog, vytlacit obsah Memo1...
C++ builder, print dialog, a funkcie inych dialogov
-
vivaSlovakia
Guru wannabe
- Príspevky: 2119
- Registrovaný: 29 júl 2006, 10:30
C++ builder, print dialog, a funkcie inych dialogov
Zdravim, potreboval by som s niecim pomoct
Potrebujem zistit vlastnosti triedy ColorDialog, vytlacit obsah Memo1...
Potrebujem zistit vlastnosti triedy ColorDialog, vytlacit obsah Memo1...
-
mastermind
VIP
- Príspevky: 4810
- Registrovaný: 09 feb 2005, 13:17
-
vivaSlovakia
Guru wannabe
- Príspevky: 2119
- Registrovaný: 29 júl 2006, 10:30
-
oborpeto
Medium Expert
- Príspevky: 129
- Registrovaný: 21 jún 2006, 17:00
- Bydlisko: cadca
- Kontaktovať používateľa:
no namiesto mema pouzi RichEdit...
inak tu je to zapisane v delphi verim ze dokazes prepisat...
//-----------------------------------------------------
RichEdit1.Print(MenoSuboru); -> tlac
//-----------------------------------------------------
if PrinterSetupDialog1.Execute then -> tlac aj so setupom
RichEdit1.Print(MenoSuboru);
//-----------------------------------------------------
if colordialog1.Execute then -> zmena farby
begin
richedit1.SelAttributes.Color:=colordialog1.Color
end;
//-----------------------------------------------------
if fontdialog1.Execute then -> font
begin
RichEdit1.SelAttributes.Assign(fontdialog1.Font);
end;
//----------------------------------------------------- vyhladanie
procedure TEditor.hladatClick(Sender: TObject);
begin
Finddlg.FindText:=RichEdit1.SelText;
Finddlg.Execute;
end;
procedure TEditor.FindDlgFind(Sender: TObject);
begin
with RichEdit1 do
begin
if (Poz.Text = FindDlg.FindText) then
Inc(Poz.Pos)
else
begin
Poz.Pos := 0;
Poz.Text := FindDlg.FindText;
end;
Pozicia := RichEdit1.FindText(FindDlg.FindText, Poz.Pos, Length(text), []);
// Label1.Caption := IntToStr(Pozicia);
if Pozicia >= 0 then
begin
SetFocus;
SelStart := Pozicia;
SelLength := Length(FindDlg.FindText);
Poz.Pos := Pozicia+1;
end
else
begin
MessageDlg('Text nebol nájdený', mtError, [mbOk], 0);
poz.Pos:=-1;
FindDlg.CloseDialog;
end;
end;
end;
//----------------------------------------------------- nahradenie
procedure TEditor.NahraditClick(Sender: TObject);
begin
replacedlg.FindText:=RichEdit1.SelText;
replacedlg.execute;
end;
procedure TEditor.ReplaceDlgFind(Sender: TObject);
begin
with RichEdit1 do
begin
if (Poz.Text = ReplaceDlg.FindText) then
Inc(Poz.Pos)
else
begin
Poz.Pos := 0;
Poz.Text := ReplaceDlg.FindText;
end;
Pozicia := RichEdit1.FindText(ReplaceDlg.FindText, Poz.Pos, Length(text), []);
if Pozicia >= 0 then
begin
SetFocus;
SelStart := Pozicia;
SelLength := Length(ReplaceDlg.FindText);
Poz.Pos := Pozicia+1;
end
else
begin
MessageDlg('Text nebol nájdený', mtError, [mbOk], 0);
poz.Pos:=-1;
ReplaceDlg.CloseDialog;
end;
end;
end;
procedure TEditor.ReplaceDlgReplace(Sender: TObject);
begin
with RichEdit1 do
begin
if (Poz.Text = ReplaceDlg.FindText) then
Inc(Poz.Pos)
else
begin
Poz.Pos := 0;
Poz.Text := ReplaceDlg.FindText;
end;
Pozicia := RichEdit1.FindText(ReplaceDlg.FindText, Poz.Pos, Length(text), []);
if Pozicia >= 0 then
begin
SetFocus;
SelStart := Pozicia;
SelLength := Length(ReplaceDlg.FindText);
SelText:=ReplaceDlg.ReplaceText;
Poz.Pos := Pozicia+1;
end
else
begin
MessageDlg('Text nebol nájdený', mtError, [mbOk], 0);
poz.Pos:=-1;
ReplaceDlg.CloseDialog;
end;
end;
end;
no prepisat by ti to nemal byt problem... ak by ano tak napis...
inak tu je to zapisane v delphi verim ze dokazes prepisat...
//-----------------------------------------------------
RichEdit1.Print(MenoSuboru); -> tlac
//-----------------------------------------------------
if PrinterSetupDialog1.Execute then -> tlac aj so setupom
RichEdit1.Print(MenoSuboru);
//-----------------------------------------------------
if colordialog1.Execute then -> zmena farby
begin
richedit1.SelAttributes.Color:=colordialog1.Color
end;
//-----------------------------------------------------
if fontdialog1.Execute then -> font
begin
RichEdit1.SelAttributes.Assign(fontdialog1.Font);
end;
//----------------------------------------------------- vyhladanie
procedure TEditor.hladatClick(Sender: TObject);
begin
Finddlg.FindText:=RichEdit1.SelText;
Finddlg.Execute;
end;
procedure TEditor.FindDlgFind(Sender: TObject);
begin
with RichEdit1 do
begin
if (Poz.Text = FindDlg.FindText) then
Inc(Poz.Pos)
else
begin
Poz.Pos := 0;
Poz.Text := FindDlg.FindText;
end;
Pozicia := RichEdit1.FindText(FindDlg.FindText, Poz.Pos, Length(text), []);
// Label1.Caption := IntToStr(Pozicia);
if Pozicia >= 0 then
begin
SetFocus;
SelStart := Pozicia;
SelLength := Length(FindDlg.FindText);
Poz.Pos := Pozicia+1;
end
else
begin
MessageDlg('Text nebol nájdený', mtError, [mbOk], 0);
poz.Pos:=-1;
FindDlg.CloseDialog;
end;
end;
end;
//----------------------------------------------------- nahradenie
procedure TEditor.NahraditClick(Sender: TObject);
begin
replacedlg.FindText:=RichEdit1.SelText;
replacedlg.execute;
end;
procedure TEditor.ReplaceDlgFind(Sender: TObject);
begin
with RichEdit1 do
begin
if (Poz.Text = ReplaceDlg.FindText) then
Inc(Poz.Pos)
else
begin
Poz.Pos := 0;
Poz.Text := ReplaceDlg.FindText;
end;
Pozicia := RichEdit1.FindText(ReplaceDlg.FindText, Poz.Pos, Length(text), []);
if Pozicia >= 0 then
begin
SetFocus;
SelStart := Pozicia;
SelLength := Length(ReplaceDlg.FindText);
Poz.Pos := Pozicia+1;
end
else
begin
MessageDlg('Text nebol nájdený', mtError, [mbOk], 0);
poz.Pos:=-1;
ReplaceDlg.CloseDialog;
end;
end;
end;
procedure TEditor.ReplaceDlgReplace(Sender: TObject);
begin
with RichEdit1 do
begin
if (Poz.Text = ReplaceDlg.FindText) then
Inc(Poz.Pos)
else
begin
Poz.Pos := 0;
Poz.Text := ReplaceDlg.FindText;
end;
Pozicia := RichEdit1.FindText(ReplaceDlg.FindText, Poz.Pos, Length(text), []);
if Pozicia >= 0 then
begin
SetFocus;
SelStart := Pozicia;
SelLength := Length(ReplaceDlg.FindText);
SelText:=ReplaceDlg.ReplaceText;
Poz.Pos := Pozicia+1;
end
else
begin
MessageDlg('Text nebol nájdený', mtError, [mbOk], 0);
poz.Pos:=-1;
ReplaceDlg.CloseDialog;
end;
end;
end;
no prepisat by ti to nemal byt problem... ak by ano tak napis...
-
vivaSlovakia
Guru wannabe
- Príspevky: 2119
- Registrovaný: 29 júl 2006, 10:30
-
mastermind
VIP
- Príspevky: 4810
- Registrovaný: 09 feb 2005, 13:17