Autor Beitrag
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: So 03.12.06 13:05 
hallihallo!
Ihr kenn doch sicher alle Microsoft WordPad oder?
weiß irgendjemand wie ich das umsetzten könnte das man so wie beim WordPad nur bis zum Blattrand schreiben kann. Ich mein den Blattrand vom A4 Blatt so halt wie beim WordPad das mitten im RichEdit ein zeilenumbruch kommt.

lg el

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.
elundril Threadstarter
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: So 03.12.06 14:43 
*push*
weiß keiner was ich meine oder wills mir keiner sagen oder weiß jeder was gemeint is nur die Lösung nicht? wär wirklich net wenn ich vorschläge bekommen könnte.

lg mike

_________________
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: So 03.12.06 16:30 
Hallo,

ob das beim jvrichedit auch so ist?

Beim Standard-RichEdit kann man mit
ausblenden Delphi-Quelltext
1:
2:
  RichEdit1.Clear;
  RichEdit1.Paragraph.RightIndent := 100;

einen rechten Rand von z.B. 100 Pixel setzen.

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
elundril Threadstarter
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 05.12.06 13:37 
d.h. ich muss mir ausrechnen wie breit ein A4 Blatt am bildschirm ist?

lg el

_________________
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 05.12.06 22:18 
Hallo,

ja, ermitteln wie groß der Druckbereich des Druckers ist und dann rechnen.
Dazu findest Du hier im Forum oder an anderen geeigneten Stellen bestimmt was.

Übrigends ist bei jeder Delphi-Version(zumindest bei denen die ich kenne) ein RichEdit-Demo dabei, da wird soweit ich mich erinnere auch mit Paragraph.RightIndent gearbeitet.

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
elundril Threadstarter
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 05.12.06 22:25 
thx. mal sehen was ich finde!! :lupe:

jop stimmt. bei D7 ist eine Demo dabei die damit arbeitet, aber ich dachte das geht irgenwie besser / einfacher.

lg el

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.
elundril Threadstarter
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 07.12.06 16:13 
also mit printer.pagewidth bekomme ich die breite des blattes oder??

lg el

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

Win 2000, Win XP, Win 2003, Linux
Delphi 2006 Prof.
BeitragVerfasst: Fr 08.12.06 10:35 
Also normalerweise nimmt man für die Darstellung mit Zeilenumbruch nach Drucker (quasi WYSIWYG) die Meldung EM_SETTARGETDEVICE (auf jeden Fall macht's Wordpad so).

ausblenden Delphi-Quelltext
1:
SendMessage(RichEdit1.Handle, EM_SETTARGETDEVICE, hdc_des_Druckers, zeilenbreite_in_Twips);					


Mit dem Parameter "hdc_des_Druckers" ist's allerdings nicht ganz trivial - man kann nicht einfach "Printer.Handle" angebeben, da Delphi dies frei verwaltet und durchaus schon mal zwischendurch freigibt und neu erzeugt. Man sollte sich dazu also sein eigenes Handle mit den Informationen von "Printer.Getprinter" erzeugen.

Mit Printer.PageWidth bekommst du übrigens nicht die Breite des Blattes sondern die Breite des druckbaren Bereichs (kann durchaus schon mal bis zu einen Zentimeter weniger sein). Mit der Funktion GetDeviceCaps bekommst du genauere Informationen:
ausblenden Delphi-Quelltext
1:
2:
blattbreite_in_Pixel := GetDeviceCaps(hdc_des_Druckers, PHYSICALWIDTH);
linker_Rand_in_Pixel := GetDeviceCaps(hdc_des_Druckers, PHYSICALOFFSETX);

Hier ist "link_Rand_in_Pixel" die Breite des Bereichs links, der nicht bedruckt werden kann.


Zuletzt bearbeitet von Flocke am Fr 08.12.06 14:05, insgesamt 1-mal bearbeitet
elundril Threadstarter
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: Fr 08.12.06 13:53 
ok danke!

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.
elundril Threadstarter
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: Mo 18.12.06 17:58 
das heißt der Code ist folgender:

ausblenden Delphi-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:
var Prnthndl: THandle;   //Handle für den printer definieren

{...}

procedure TForm1.Create(var Sender: TObject);
var blattbreite, left: integer
begin
try
  prnthndl:=Printer.gethandle;
  blattbreite:= GetDeviceCaps(prnthndl, PHYSICALWIDTH);
  left:= Get DeviceCaps(prnthndl, PHYSICALOFFSETX);
  SendMessage(RichEdit1.Handle, EM_SETTARGETDEVICE, prnthndl, ((blattbreite/HorizontalResolution)*1440));
finally
  
end;
end;

{...}

function HorizontalResolution: integer;
var
  dc: HDC;
begin
  dc := GetDC(0);
  Result := GetDeviceCaps(dc, LOGPIXELSX);
  ReleaseDC(0, dc);
end;


das ist halt mal mein gedanke so! (unkompiliert usw da mein PC in Work ist!)

lg el

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.
elundril Threadstarter
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 19.12.06 13:08 
ok habs mal getestet.
bin auf folgendes Draufgekommen:
*) EM_SETTARGETDEVICE gibts bei mir nicht
*) Printer.Gethandle verlangt diverse Parameter die ich nicht weiß was reinkommt.

kann mir wer helfen??

lg el

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Di 19.12.06 13:19 
Darf ich dich an MSDN erinnern?

1. msdn.microsoft.com/l..._settargetdevice.asp
=> Definiert in der Unit RichtEdit -> RichtEdit in uses -> Funktioniert.

2. Das klingt logischer für mich:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
uses
  Printers;

begin
  PrntHndl := Printer.Handle;
end;

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
elundril Threadstarter
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 19.12.06 13:29 
aso mit
ausblenden Delphi-Quelltext
1:
  Prnthndl:=printer.handle					

gehts auch??

is es egal ob ich ein Richedit verwende oder ein jvRichedit??

lg el

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Di 19.12.06 13:30 
Vermutlich ja, weil das die Druckerunterstützung von Delphi ist.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
elundril Threadstarter
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 19.12.06 13:35 
ok GROßES THX!!!!!!!!! :flehan:

lg el

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.
elundril Threadstarter
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 21.12.06 17:48 
ich hab auf meinem PC auf dem ich progge keinen Drucker angeschlossen und es ist so das wenn ich eine Zeile schreibe und zum ende des Fensters komme, das er einfach "stehen" bleibt. er bricht weder die zeile um noch scrollt er nach links. und ich kann mir auch nicht denken das ein a4 blatt genausobreit ist wie mein Bildschirm.

ist das nur weil ich keinen Drucker habe oder liegt das an etwas anderem???

lg el

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Do 21.12.06 19:07 
Du könntest dir einfach mal den Wert, der der Drucker auf dem "funktionierenden" Computer ausgibt angucken und falls kein Drucker angeschlossen ist, einfach den Wert allgemein benutzen, vllt. ist der auch immer gleich :nixweiss:

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)