diff --git a/components/richmemo/samples/testsimple/project1.lpi b/components/richmemo/samples/testsimple/project1.lpi
index dac13d5e9..320001841 100644
--- a/components/richmemo/samples/testsimple/project1.lpi
+++ b/components/richmemo/samples/testsimple/project1.lpi
@@ -6,7 +6,7 @@
-
+
@@ -32,12 +32,16 @@
-
+
-
+
+
+
+
+
@@ -45,10 +49,10 @@
-
-
+
+
-
+
@@ -56,84 +60,84 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -144,7 +148,7 @@
-
+
@@ -155,105 +159,281 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/richmemo/samples/testsimple/unit1.lfm b/components/richmemo/samples/testsimple/unit1.lfm
index 4ed2fe24c..14f323bc2 100644
--- a/components/richmemo/samples/testsimple/unit1.lfm
+++ b/components/richmemo/samples/testsimple/unit1.lfm
@@ -1,7 +1,7 @@
object Form1: TForm1
- Left = 332
+ Left = 234
Height = 592
- Top = 117
+ Top = 220
Width = 752
Align = alNone
AllowDropFiles = False
@@ -27,10 +27,10 @@ object Form1: TForm1
LCLVersion = '0.9.27'
WindowState = wsNormal
object RichMemo1: TRichMemo
- Left = 24
+ Left = 32
Height = 518
Top = 24
- Width = 704
+ Width = 288
Align = alNone
Alignment = taLeftJustify
Anchors = [akTop, akLeft, akRight, akBottom]
@@ -133,10 +133,87 @@ object Form1: TForm1
TabStop = True
Visible = True
end
+ object Button4: TButton
+ Left = 512
+ Height = 25
+ Top = 548
+ Width = 75
+ Align = alNone
+ AutoSize = False
+ Cancel = False
+ Caption = 'Export'
+ Color = clBtnFace
+ Default = False
+ DragCursor = crDrag
+ DragKind = dkDrag
+ DragMode = dmManual
+ Enabled = True
+ ParentBidiMode = True
+ ModalResult = 0
+ OnClick = Button4Click
+ ParentFont = True
+ ParentShowHint = True
+ TabOrder = 4
+ TabStop = True
+ Visible = True
+ end
+ object Memo1: TMemo
+ Left = 328
+ Height = 506
+ Top = 24
+ Width = 408
+ Align = alNone
+ Alignment = taLeftJustify
+ BorderStyle = bsSingle
+ Color = clWindow
+ DragCursor = crDrag
+ DragKind = dkDrag
+ DragMode = dmManual
+ Enabled = True
+ Lines.Strings = (
+ 'Memo1'
+ )
+ MaxLength = 0
+ ParentBidiMode = True
+ ParentColor = False
+ ParentFont = True
+ ParentShowHint = True
+ ReadOnly = False
+ ScrollBars = ssBoth
+ TabOrder = 5
+ TabStop = True
+ Visible = True
+ WantReturns = True
+ WantTabs = False
+ end
+ object Button5: TButton
+ Left = 600
+ Height = 25
+ Top = 547
+ Width = 75
+ Align = alNone
+ AutoSize = False
+ Cancel = False
+ Caption = 'Import'
+ Color = clBtnFace
+ Default = False
+ DragCursor = crDrag
+ DragKind = dkDrag
+ DragMode = dmManual
+ Enabled = True
+ ParentBidiMode = True
+ ModalResult = 0
+ OnClick = Button5Click
+ ParentFont = True
+ ParentShowHint = True
+ TabOrder = 6
+ TabStop = True
+ Visible = True
+ end
object FontDialog1: TFontDialog
MinFontSize = 0
MaxFontSize = 0
- left = 376
- top = 256
+ left = 328
+ top = 368
end
end
diff --git a/components/richmemo/samples/testsimple/unit1.lrs b/components/richmemo/samples/testsimple/unit1.lrs
index 73384bfcd..f0be76d70 100644
--- a/components/richmemo/samples/testsimple/unit1.lrs
+++ b/components/richmemo/samples/testsimple/unit1.lrs
@@ -1,40 +1,60 @@
+{ This is an automatically generated lazarus resource file }
+
LazarusResources.Add('TForm1','FORMDATA',[
- 'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'L'#1#6'Height'#3'P'#2#3'Top'#2'u'#5'Width'
- +#3#240#2#5'Align'#7#6'alNone'#14'AllowDropFiles'#8#10'AutoScroll'#9#8'AutoSi'
- +'ze'#8#11'BorderIcons'#11#12'biSystemMenu'#10'biMinimize'#10'biMaximize'#0#11
- +'BorderStyle'#7#10'bsSizeable'#11'BorderWidth'#2#0#7'Caption'#6#5'Form1'#12
- +'ClientHeight'#3'P'#2#11'ClientWidth'#3#240#2#14'DefaultMonitor'#7#12'dmActi'
- +'veForm'#8'DockSite'#8#8'DragKind'#7#6'dkDrag'#8'DragMode'#7#8'dmManual'#7'E'
- +'nabled'#9#9'FormStyle'#7#8'fsNormal'#14'ParentBiDiMode'#9#10'ParentFont'#8#8
- +'Position'#7#10'poDesigned'#13'ShowInTaskBar'#7#9'stDefault'#14'UseDockManag'
- +'er'#8#10'LCLVersion'#6#6'0.9.27'#11'WindowState'#7#8'wsNormal'#0#9'TRichMem'
- +'o'#9'RichMemo1'#4'Left'#2#24#6'Height'#3#6#2#3'Top'#2#24#5'Width'#3#192#2#5
- +'Align'#7#6'alNone'#9'Alignment'#7#13'taLeftJustify'#7'Anchors'#11#5'akTop'#6
- +'akLeft'#7'akRight'#8'akBottom'#0#11'BorderStyle'#7#8'bsSingle'#5'Color'#7#8
- +'clWindow'#10'DragCursor'#7#6'crDrag'#8'DragKind'#7#6'dkDrag'#8'DragMode'#7#8
- +'dmManual'#7'Enabled'#9#13'HideSelection'#8#13'Lines.Strings'#1#6#9'RichMemo'
- +'1'#0#9'MaxLength'#2#0#14'ParentBidiMode'#9#11'ParentColor'#8#10'ParentFont'
- +#9#14'ParentShowHint'#9#8'ReadOnly'#8#10'ScrollBars'#7#6'ssBoth'#8'TabOrder'
- +#2#0#7'TabStop'#9#7'Visible'#9#11'WantReturns'#9#8'WantTabs'#8#8'WordWrap'#8
- +#0#0#7'TButton'#7'Button1'#4'Left'#2#24#6'Height'#2#25#3'Top'#3'$'#2#5'Width'
- +#3#152#0#5'Align'#7#6'alNone'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#8'AutoSi'
- +'ze'#8#6'Cancel'#8#7'Caption'#6#17'Make Bold and Red'#5'Color'#7#9'clBtnFace'
- +#7'Default'#8#10'DragCursor'#7#6'crDrag'#8'DragKind'#7#6'dkDrag'#8'DragMode'
- +#7#8'dmManual'#7'Enabled'#9#14'ParentBidiMode'#9#11'ModalResult'#2#0#7'OnCli'
- +'ck'#7#12'Button1Click'#10'ParentFont'#9#14'ParentShowHint'#9#8'TabOrder'#2#1
- +#7'TabStop'#9#7'Visible'#9#0#0#7'TButton'#7'Button2'#4'Left'#3#184#0#6'Heigh'
- +'t'#2#25#3'Top'#3'$'#2#5'Width'#3#136#0#5'Align'#7#6'alNone'#7'Anchors'#11#6
- +'akLeft'#8'akBottom'#0#8'AutoSize'#8#6'Cancel'#8#7'Caption'#6#11'Get Attribs'
- +#5'Color'#7#9'clBtnFace'#7'Default'#8#10'DragCursor'#7#6'crDrag'#8'DragKind'
- +#7#6'dkDrag'#8'DragMode'#7#8'dmManual'#7'Enabled'#9#14'ParentBidiMode'#9#11
- +'ModalResult'#2#0#7'OnClick'#7#12'Button2Click'#10'ParentFont'#9#14'ParentSh'
- +'owHint'#9#8'TabOrder'#2#2#7'TabStop'#9#7'Visible'#9#0#0#7'TButton'#7'Button'
- +'3'#4'Left'#3'H'#1#6'Height'#2#25#3'Top'#3'$'#2#5'Width'#3#168#0#5'Align'#7#6
- +'alNone'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#8'AutoSize'#8#6'Cancel'#8#7'C'
- +'aption'#6#11'Select Font'#5'Color'#7#9'clBtnFace'#7'Default'#8#10'DragCurso'
- +'r'#7#6'crDrag'#8'DragKind'#7#6'dkDrag'#8'DragMode'#7#8'dmManual'#7'Enabled'
- +#9#14'ParentBidiMode'#9#11'ModalResult'#2#0#7'OnClick'#7#12'Button3Click'#10
- +'ParentFont'#9#14'ParentShowHint'#9#8'TabOrder'#2#3#7'TabStop'#9#7'Visible'#9
- +#0#0#11'TFontDialog'#11'FontDialog1'#11'MinFontSize'#2#0#11'MaxFontSize'#2#0
- +#4'left'#3'x'#1#3'top'#3#0#1#0#0#0
+ 'TPF0'#6'TForm1'#5'Form1'#4'Left'#3#234#0#6'Height'#3'P'#2#3'Top'#3#220#0#5'W'
+ +'idth'#3#240#2#5'Align'#7#6'alNone'#14'AllowDropFiles'#8#10'AutoScroll'#9#8
+ +'AutoSize'#8#11'BorderIcons'#11#12'biSystemMenu'#10'biMinimize'#10'biMaximiz'
+ +'e'#0#11'BorderStyle'#7#10'bsSizeable'#11'BorderWidth'#2#0#7'Caption'#6#5'Fo'
+ +'rm1'#12'ClientHeight'#3'P'#2#11'ClientWidth'#3#240#2#14'DefaultMonitor'#7#12
+ +'dmActiveForm'#8'DockSite'#8#8'DragKind'#7#6'dkDrag'#8'DragMode'#7#8'dmManua'
+ +'l'#7'Enabled'#9#9'FormStyle'#7#8'fsNormal'#14'ParentBiDiMode'#9#10'ParentFo'
+ +'nt'#8#8'Position'#7#10'poDesigned'#13'ShowInTaskBar'#7#9'stDefault'#14'UseD'
+ +'ockManager'#8#10'LCLVersion'#6#6'0.9.27'#11'WindowState'#7#8'wsNormal'#0#9
+ +'TRichMemo'#9'RichMemo1'#4'Left'#2' '#6'Height'#3#6#2#3'Top'#2#24#5'Width'#3
+ +' '#1#5'Align'#7#6'alNone'#9'Alignment'#7#13'taLeftJustify'#7'Anchors'#11#5
+ +'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#11'BorderStyle'#7#8'bsSingle'#5'C'
+ +'olor'#7#8'clWindow'#10'DragCursor'#7#6'crDrag'#8'DragKind'#7#6'dkDrag'#8'Dr'
+ +'agMode'#7#8'dmManual'#7'Enabled'#9#13'HideSelection'#8#13'Lines.Strings'#1#6
+ +#9'RichMemo1'#0#9'MaxLength'#2#0#14'ParentBidiMode'#9#11'ParentColor'#8#10'P'
+ +'arentFont'#9#14'ParentShowHint'#9#8'ReadOnly'#8#10'ScrollBars'#7#6'ssBoth'#8
+ +'TabOrder'#2#0#7'TabStop'#9#7'Visible'#9#11'WantReturns'#9#8'WantTabs'#8#8'W'
+ +'ordWrap'#8#0#0#7'TButton'#7'Button1'#4'Left'#2#24#6'Height'#2#25#3'Top'#3'$'
+ +#2#5'Width'#3#152#0#5'Align'#7#6'alNone'#7'Anchors'#11#6'akLeft'#8'akBottom'
+ +#0#8'AutoSize'#8#6'Cancel'#8#7'Caption'#6#17'Make Bold and Red'#5'Color'#7#9
+ +'clBtnFace'#7'Default'#8#10'DragCursor'#7#6'crDrag'#8'DragKind'#7#6'dkDrag'#8
+ +'DragMode'#7#8'dmManual'#7'Enabled'#9#14'ParentBidiMode'#9#11'ModalResult'#2
+ +#0#7'OnClick'#7#12'Button1Click'#10'ParentFont'#9#14'ParentShowHint'#9#8'Tab'
+ +'Order'#2#1#7'TabStop'#9#7'Visible'#9#0#0#7'TButton'#7'Button2'#4'Left'#3#184
+ +#0#6'Height'#2#25#3'Top'#3'$'#2#5'Width'#3#136#0#5'Align'#7#6'alNone'#7'Anch'
+ +'ors'#11#6'akLeft'#8'akBottom'#0#8'AutoSize'#8#6'Cancel'#8#7'Caption'#6#11'G'
+ +'et Attribs'#5'Color'#7#9'clBtnFace'#7'Default'#8#10'DragCursor'#7#6'crDrag'
+ +#8'DragKind'#7#6'dkDrag'#8'DragMode'#7#8'dmManual'#7'Enabled'#9#14'ParentBid'
+ +'iMode'#9#11'ModalResult'#2#0#7'OnClick'#7#12'Button2Click'#10'ParentFont'#9
+ +#14'ParentShowHint'#9#8'TabOrder'#2#2#7'TabStop'#9#7'Visible'#9#0#0#7'TButto'
+ +'n'#7'Button3'#4'Left'#3'H'#1#6'Height'#2#25#3'Top'#3'$'#2#5'Width'#3#168#0#5
+ +'Align'#7#6'alNone'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#8'AutoSize'#8#6'Ca'
+ +'ncel'#8#7'Caption'#6#11'Select Font'#5'Color'#7#9'clBtnFace'#7'Default'#8#10
+ +'DragCursor'#7#6'crDrag'#8'DragKind'#7#6'dkDrag'#8'DragMode'#7#8'dmManual'#7
+ +'Enabled'#9#14'ParentBidiMode'#9#11'ModalResult'#2#0#7'OnClick'#7#12'Button3'
+ +'Click'#10'ParentFont'#9#14'ParentShowHint'#9#8'TabOrder'#2#3#7'TabStop'#9#7
+ +'Visible'#9#0#0#7'TButton'#7'Button4'#4'Left'#3#0#2#6'Height'#2#25#3'Top'#3
+ +'$'#2#5'Width'#2'K'#5'Align'#7#6'alNone'#8'AutoSize'#8#6'Cancel'#8#7'Caption'
+ +#6#6'Export'#5'Color'#7#9'clBtnFace'#7'Default'#8#10'DragCursor'#7#6'crDrag'
+ +#8'DragKind'#7#6'dkDrag'#8'DragMode'#7#8'dmManual'#7'Enabled'#9#14'ParentBid'
+ +'iMode'#9#11'ModalResult'#2#0#7'OnClick'#7#12'Button4Click'#10'ParentFont'#9
+ +#14'ParentShowHint'#9#8'TabOrder'#2#4#7'TabStop'#9#7'Visible'#9#0#0#5'TMemo'
+ +#5'Memo1'#4'Left'#3'H'#1#6'Height'#3#250#1#3'Top'#2#24#5'Width'#3#152#1#5'Al'
+ +'ign'#7#6'alNone'#9'Alignment'#7#13'taLeftJustify'#11'BorderStyle'#7#8'bsSin'
+ +'gle'#5'Color'#7#8'clWindow'#10'DragCursor'#7#6'crDrag'#8'DragKind'#7#6'dkDr'
+ +'ag'#8'DragMode'#7#8'dmManual'#7'Enabled'#9#13'Lines.Strings'#1#6#5'Memo1'#0
+ +#9'MaxLength'#2#0#14'ParentBidiMode'#9#11'ParentColor'#8#10'ParentFont'#9#14
+ +'ParentShowHint'#9#8'ReadOnly'#8#10'ScrollBars'#7#6'ssBoth'#8'TabOrder'#2#5#7
+ +'TabStop'#9#7'Visible'#9#11'WantReturns'#9#8'WantTabs'#8#0#0#7'TButton'#7'Bu'
+ +'tton5'#4'Left'#3'X'#2#6'Height'#2#25#3'Top'#3'#'#2#5'Width'#2'K'#5'Align'#7
+ +#6'alNone'#8'AutoSize'#8#6'Cancel'#8#7'Caption'#6#6'Import'#5'Color'#7#9'clB'
+ +'tnFace'#7'Default'#8#10'DragCursor'#7#6'crDrag'#8'DragKind'#7#6'dkDrag'#8'D'
+ +'ragMode'#7#8'dmManual'#7'Enabled'#9#14'ParentBidiMode'#9#11'ModalResult'#2#0
+ +#7'OnClick'#7#12'Button5Click'#10'ParentFont'#9#14'ParentShowHint'#9#8'TabOr'
+ +'der'#2#6#7'TabStop'#9#7'Visible'#9#0#0#11'TFontDialog'#11'FontDialog1'#11'M'
+ +'inFontSize'#2#0#11'MaxFontSize'#2#0#4'left'#3'H'#1#3'top'#3'p'#1#0#0#0
]);
diff --git a/components/richmemo/samples/testsimple/unit1.pas b/components/richmemo/samples/testsimple/unit1.pas
index 9f0962465..57ea0eb24 100644
--- a/components/richmemo/samples/testsimple/unit1.pas
+++ b/components/richmemo/samples/testsimple/unit1.pas
@@ -17,11 +17,16 @@ type
Button1: TButton;
Button2: TButton;
Button3: TButton;
+ Button4: TButton;
+ Button5: TButton;
FontDialog1: TFontDialog;
+ Memo1: TMemo;
RichMemo1: TRichMemo;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
+ procedure Button4Click(Sender: TObject);
+ procedure Button5Click(Sender: TObject);
private
{ private declarations }
public
@@ -64,6 +69,34 @@ begin
end;
end;
+procedure TForm1.Button4Click(Sender: TObject);
+var
+ m : TMemoryStream;
+begin
+ m := TMemoryStream.Create;
+ try
+ RichMemo1.SaveRichText(m);
+ m.Position:=0;
+ Memo1.Lines.LoadFromStream(m);
+ except
+ m.Free;
+ end;
+end;
+
+procedure TForm1.Button5Click(Sender: TObject);
+var
+ m : TMemoryStream;
+begin
+ m := TMemoryStream.Create;
+ try
+ Memo1.Lines.SaveToStream(m);
+ m.Position := 0;
+ RichMemo1.LoadRichText(m);
+ finally
+ m.free;
+ end;
+end;
+
initialization
{$I unit1.lrs}