You've already forked lazarus-ccr
richmemo: additional paragraph configurations
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3723 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@@ -62,6 +62,9 @@ type
|
|||||||
|
|
||||||
function GetParaAllignment(TextStart: Integer; var AAlign: TParaAlignment): Boolean; virtual;
|
function GetParaAllignment(TextStart: Integer; var AAlign: TParaAlignment): Boolean; virtual;
|
||||||
procedure SetParaAlignment(TextStart, TextLen: Integer; AAlign: TParaAlignment); virtual;
|
procedure SetParaAlignment(TextStart, TextLen: Integer; AAlign: TParaAlignment); virtual;
|
||||||
|
function GetParaMetric(TextStart: Integer; var AMetric: TParaMetric): Boolean; virtual;
|
||||||
|
procedure SetParaMetric(TextStart, TextLen: Integer; const AMetric: TParaMetric); virtual;
|
||||||
|
procedure SetParaNumbering(TextStart, TextLen: Integer; const ANumber: TParaNumbering); virtual;
|
||||||
|
|
||||||
procedure SetTextAttributes(TextStart, TextLen: Integer; AFont: TFont);
|
procedure SetTextAttributes(TextStart, TextLen: Integer; AFont: TFont);
|
||||||
procedure SetRangeColor(TextStart, TextLength: Integer; FontColor: TColor);
|
procedure SetRangeColor(TextStart, TextLength: Integer; FontColor: TColor);
|
||||||
@@ -263,6 +266,28 @@ begin
|
|||||||
TWSCustomRichMemoClass(WidgetSetClass).SetParaAlignment(Self, TextStart, TextLen, ParaAlignCode[AAlign]);
|
TWSCustomRichMemoClass(WidgetSetClass).SetParaAlignment(Self, TextStart, TextLen, ParaAlignCode[AAlign]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TCustomRichMemo.GetParaMetric(TextStart: Integer;
|
||||||
|
var AMetric: TParaMetric): Boolean;
|
||||||
|
begin
|
||||||
|
if HandleAllocated then
|
||||||
|
TWSCustomRichMemoClass(WidgetSetClass).GetParaMetric(Self, TextStart, AMetric);
|
||||||
|
Result:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCustomRichMemo.SetParaMetric(TextStart, TextLen: Integer;
|
||||||
|
const AMetric: TParaMetric);
|
||||||
|
begin
|
||||||
|
if HandleAllocated then
|
||||||
|
TWSCustomRichMemoClass(WidgetSetClass).SetParaMetric(Self, TextStart, TextLen, AMetric);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCustomRichMemo.SetParaNumbering(TextStart, TextLen: Integer;
|
||||||
|
const ANumber: TParaNumbering);
|
||||||
|
begin
|
||||||
|
if HandleAllocated then
|
||||||
|
TWSCustomRichMemoClass(WidgetSetClass).SetParaNumbering(Self, TextStart, TextLen, ANumber);
|
||||||
|
end;
|
||||||
|
|
||||||
function TCustomRichMemo.GetContStyleLength(TextStart: Integer): Integer;
|
function TCustomRichMemo.GetContStyleLength(TextStart: Integer): Integer;
|
||||||
var
|
var
|
||||||
ofs, len : Integer;
|
ofs, len : Integer;
|
||||||
|
@@ -1,19 +1,21 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<CONFIG>
|
<CONFIG>
|
||||||
<ProjectOptions>
|
<ProjectOptions>
|
||||||
<Version Value="7"/>
|
<Version Value="9"/>
|
||||||
<General>
|
<General>
|
||||||
<Flags>
|
<Flags>
|
||||||
<SaveOnlyProjectUnits Value="True"/>
|
<SaveOnlyProjectUnits Value="True"/>
|
||||||
</Flags>
|
</Flags>
|
||||||
<SessionStorage Value="InProjectDir"/>
|
<SessionStorage Value="InProjectDir"/>
|
||||||
<MainUnit Value="0"/>
|
<MainUnit Value="0"/>
|
||||||
<TargetFileExt Value=""/>
|
|
||||||
<UseXPManifest Value="True"/>
|
<UseXPManifest Value="True"/>
|
||||||
</General>
|
</General>
|
||||||
<VersionInfo>
|
<VersionInfo>
|
||||||
<StringTable Comments="" CompanyName="" FileDescription="" FileVersion="0.0.0.0" InternalName="" LegalCopyright="" LegalTrademarks="" OriginalFilename="" ProductName="" ProductVersion=""/>
|
<StringTable ProductVersion=""/>
|
||||||
</VersionInfo>
|
</VersionInfo>
|
||||||
|
<BuildModes Count="1">
|
||||||
|
<Item1 Name="default" Default="True"/>
|
||||||
|
</BuildModes>
|
||||||
<PublishOptions>
|
<PublishOptions>
|
||||||
<Version Value="2"/>
|
<Version Value="2"/>
|
||||||
<IgnoreBinaries Value="False"/>
|
<IgnoreBinaries Value="False"/>
|
||||||
@@ -39,31 +41,35 @@
|
|||||||
<Unit0>
|
<Unit0>
|
||||||
<Filename Value="project1.lpr"/>
|
<Filename Value="project1.lpr"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<UnitName Value="project1"/>
|
|
||||||
</Unit0>
|
</Unit0>
|
||||||
<Unit1>
|
<Unit1>
|
||||||
<Filename Value="unit1.pas"/>
|
<Filename Value="unit1.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<ComponentName Value="Form1"/>
|
<ComponentName Value="Form1"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<UnitName Value="Unit1"/>
|
<UnitName Value="Unit1"/>
|
||||||
</Unit1>
|
</Unit1>
|
||||||
<Unit2>
|
<Unit2>
|
||||||
<Filename Value="C:/wnlibsvn/CarbonPaste.pas"/>
|
<Filename Value="../../../../../wnlibsvn/CarbonPaste.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<UnitName Value="CarbonPaste"/>
|
|
||||||
</Unit2>
|
</Unit2>
|
||||||
</Units>
|
</Units>
|
||||||
</ProjectOptions>
|
</ProjectOptions>
|
||||||
<CompilerOptions>
|
<CompilerOptions>
|
||||||
<Version Value="8"/>
|
<Version Value="11"/>
|
||||||
<Target>
|
<Target>
|
||||||
<Filename Value="project1"/>
|
<Filename Value="project1"/>
|
||||||
</Target>
|
</Target>
|
||||||
<SearchPaths>
|
<SearchPaths>
|
||||||
<IncludeFiles Value="$(ProjOutDir)/"/>
|
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||||
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
|
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
|
||||||
</SearchPaths>
|
</SearchPaths>
|
||||||
|
<Parsing>
|
||||||
|
<SyntaxOptions>
|
||||||
|
<UseAnsiStrings Value="False"/>
|
||||||
|
</SyntaxOptions>
|
||||||
|
</Parsing>
|
||||||
<Linking>
|
<Linking>
|
||||||
<Options>
|
<Options>
|
||||||
<Win32>
|
<Win32>
|
||||||
@@ -71,13 +77,6 @@
|
|||||||
</Win32>
|
</Win32>
|
||||||
</Options>
|
</Options>
|
||||||
</Linking>
|
</Linking>
|
||||||
<Other>
|
|
||||||
<CompilerMessages>
|
|
||||||
<UseMsgFile Value="True"/>
|
|
||||||
<MsgFileName Value="/home/dmitry/FPC_Laz/fpc/compiler/msg/errore.msg"/>
|
|
||||||
</CompilerMessages>
|
|
||||||
<CompilerPath Value="$(CompPath)"/>
|
|
||||||
</Other>
|
|
||||||
</CompilerOptions>
|
</CompilerOptions>
|
||||||
<Debugging>
|
<Debugging>
|
||||||
<Exceptions Count="3">
|
<Exceptions Count="3">
|
||||||
|
@@ -1,19 +1,19 @@
|
|||||||
object Form1: TForm1
|
object Form1: TForm1
|
||||||
Left = 295
|
Left = 281
|
||||||
Height = 457
|
Height = 457
|
||||||
Top = 168
|
Top = 198
|
||||||
Width = 634
|
Width = 634
|
||||||
ActiveControl = RichMemo1
|
ActiveControl = RichMemo1
|
||||||
Caption = 'Form1'
|
Caption = 'Form1'
|
||||||
ClientHeight = 457
|
ClientHeight = 457
|
||||||
ClientWidth = 634
|
ClientWidth = 634
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
LCLVersion = '0.9.29'
|
LCLVersion = '1.3'
|
||||||
object RichMemo1: TRichMemo
|
object RichMemo1: TRichMemo
|
||||||
Left = 15
|
Left = 15
|
||||||
Height = 358
|
Height = 264
|
||||||
Top = 16
|
Top = 96
|
||||||
Width = 619
|
Width = 609
|
||||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
Font.Height = -13
|
Font.Height = -13
|
||||||
Font.Name = 'Tahoma'
|
Font.Name = 'Tahoma'
|
||||||
@@ -22,6 +22,8 @@ object Form1: TForm1
|
|||||||
'RichMemo1'
|
'RichMemo1'
|
||||||
)
|
)
|
||||||
OnChange = RichMemo1Change
|
OnChange = RichMemo1Change
|
||||||
|
OnKeyUp = RichMemo1KeyUp
|
||||||
|
OnMouseUp = RichMemo1MouseUp
|
||||||
ParentFont = False
|
ParentFont = False
|
||||||
ScrollBars = ssVertical
|
ScrollBars = ssVertical
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
@@ -92,6 +94,100 @@ object Form1: TForm1
|
|||||||
TabOrder = 6
|
TabOrder = 6
|
||||||
TabStop = False
|
TabStop = False
|
||||||
end
|
end
|
||||||
|
object Button7: TButton
|
||||||
|
Left = 15
|
||||||
|
Height = 25
|
||||||
|
Top = 16
|
||||||
|
Width = 51
|
||||||
|
Caption = 'Left'
|
||||||
|
OnClick = Button7Click
|
||||||
|
TabOrder = 7
|
||||||
|
end
|
||||||
|
object Button8: TButton
|
||||||
|
Left = 72
|
||||||
|
Height = 25
|
||||||
|
Top = 16
|
||||||
|
Width = 53
|
||||||
|
Caption = 'Center'
|
||||||
|
OnClick = Button8Click
|
||||||
|
TabOrder = 8
|
||||||
|
end
|
||||||
|
object Button9: TButton
|
||||||
|
Left = 131
|
||||||
|
Height = 25
|
||||||
|
Top = 16
|
||||||
|
Width = 53
|
||||||
|
Caption = 'Right'
|
||||||
|
OnClick = Button9Click
|
||||||
|
TabOrder = 9
|
||||||
|
end
|
||||||
|
object Button10: TButton
|
||||||
|
Left = 192
|
||||||
|
Height = 25
|
||||||
|
Top = 16
|
||||||
|
Width = 53
|
||||||
|
Caption = 'Justify'
|
||||||
|
OnClick = Button10Click
|
||||||
|
TabOrder = 10
|
||||||
|
end
|
||||||
|
object StartIdent: TFloatSpinEdit
|
||||||
|
Left = 344
|
||||||
|
Height = 21
|
||||||
|
Top = 18
|
||||||
|
Width = 78
|
||||||
|
Increment = 1
|
||||||
|
MaxValue = 100
|
||||||
|
MinValue = 0
|
||||||
|
OnChange = StartIdentChange
|
||||||
|
TabOrder = 11
|
||||||
|
Value = 0
|
||||||
|
end
|
||||||
|
object Label1: TLabel
|
||||||
|
Left = 304
|
||||||
|
Height = 13
|
||||||
|
Top = 18
|
||||||
|
Width = 27
|
||||||
|
Caption = 'Start '
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object Label2: TLabel
|
||||||
|
Left = 304
|
||||||
|
Height = 13
|
||||||
|
Top = 48
|
||||||
|
Width = 31
|
||||||
|
Caption = 'Offset'
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object OffsetIdent: TFloatSpinEdit
|
||||||
|
Left = 344
|
||||||
|
Height = 21
|
||||||
|
Top = 46
|
||||||
|
Width = 78
|
||||||
|
Increment = 1
|
||||||
|
MaxValue = 100
|
||||||
|
MinValue = 0
|
||||||
|
OnChange = StartIdentChange
|
||||||
|
TabOrder = 12
|
||||||
|
Value = 0
|
||||||
|
end
|
||||||
|
object Button11: TButton
|
||||||
|
Left = 16
|
||||||
|
Height = 25
|
||||||
|
Top = 52
|
||||||
|
Width = 75
|
||||||
|
Caption = 'Bullet'
|
||||||
|
OnClick = Button11Click
|
||||||
|
TabOrder = 13
|
||||||
|
end
|
||||||
|
object Button12: TButton
|
||||||
|
Left = 104
|
||||||
|
Height = 25
|
||||||
|
Top = 52
|
||||||
|
Width = 75
|
||||||
|
Caption = 'Number'
|
||||||
|
OnClick = Button12Click
|
||||||
|
TabOrder = 14
|
||||||
|
end
|
||||||
object FontDialog1: TFontDialog
|
object FontDialog1: TFontDialog
|
||||||
MinFontSize = 0
|
MinFontSize = 0
|
||||||
MaxFontSize = 0
|
MaxFontSize = 0
|
||||||
|
@@ -1,35 +1,59 @@
|
|||||||
{ This is an automatically generated lazarus resource file }
|
{ This is an automatically generated lazarus resource file }
|
||||||
|
|
||||||
LazarusResources.Add('TForm1','FORMDATA',[
|
LazarusResources.Add('TForm1','FORMDATA',[
|
||||||
'TPF0'#6'TForm1'#5'Form1'#4'Left'#3''''#1#6'Height'#3#201#1#3'Top'#3#168#0#5
|
'TPF0'#6'TForm1'#5'Form1'#4'Left'#3#25#1#6'Height'#3#201#1#3'Top'#3#198#0#5'W'
|
||||||
+'Width'#3'z'#2#13'ActiveControl'#7#9'RichMemo1'#7'Caption'#6#5'Form1'#12'Cli'
|
+'idth'#3'z'#2#13'ActiveControl'#7#9'RichMemo1'#7'Caption'#6#5'Form1'#12'Clie'
|
||||||
+'entHeight'#3#201#1#11'ClientWidth'#3'z'#2#8'OnCreate'#7#10'FormCreate'#10'L'
|
+'ntHeight'#3#201#1#11'ClientWidth'#3'z'#2#8'OnCreate'#7#10'FormCreate'#10'LC'
|
||||||
+'CLVersion'#6#6'0.9.29'#0#9'TRichMemo'#9'RichMemo1'#4'Left'#2#15#6'Height'#3
|
+'LVersion'#6#3'1.3'#0#9'TRichMemo'#9'RichMemo1'#4'Left'#2#15#6'Height'#3#8#1
|
||||||
+'f'#1#3'Top'#2#16#5'Width'#3'k'#2#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'
|
+#3'Top'#2'`'#5'Width'#3'a'#2#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'a'
|
||||||
+#8'akBottom'#0#11'Font.Height'#2#243#9'Font.Name'#6#6'Tahoma'#13'HideSelecti'
|
+'kBottom'#0#11'Font.Height'#2#243#9'Font.Name'#6#6'Tahoma'#13'HideSelection'
|
||||||
+'on'#8#13'Lines.Strings'#1#6#9'RichMemo1'#0#8'OnChange'#7#15'RichMemo1Change'
|
+#8#13'Lines.Strings'#1#6#9'RichMemo1'#0#8'OnChange'#7#15'RichMemo1Change'#7
|
||||||
+#10'ParentFont'#8#10'ScrollBars'#7#10'ssVertical'#8'TabOrder'#2#0#0#0#7'TBut'
|
+'OnKeyUp'#7#14'RichMemo1KeyUp'#9'OnMouseUp'#7#16'RichMemo1MouseUp'#10'Parent'
|
||||||
+'ton'#7'Button1'#4'Left'#2#24#6'Height'#2#25#3'Top'#3'~'#1#5'Width'#3#160#0#7
|
+'Font'#8#10'ScrollBars'#7#10'ssVertical'#8'TabOrder'#2#0#0#0#7'TButton'#7'Bu'
|
||||||
+'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Caption'#6#17'Make Bold and Red'#7'On'
|
+'tton1'#4'Left'#2#24#6'Height'#2#25#3'Top'#3'~'#1#5'Width'#3#160#0#7'Anchors'
|
||||||
+'Click'#7#12'Button1Click'#8'TabOrder'#2#1#7'TabStop'#8#0#0#7'TButton'#7'But'
|
+#11#6'akLeft'#8'akBottom'#0#7'Caption'#6#17'Make Bold and Red'#7'OnClick'#7
|
||||||
+'ton2'#4'Left'#3#192#0#6'Height'#2#25#3'Top'#3'~'#1#5'Width'#2'a'#7'Anchors'
|
+#12'Button1Click'#8'TabOrder'#2#1#7'TabStop'#8#0#0#7'TButton'#7'Button2'#4'L'
|
||||||
+#11#6'akLeft'#8'akBottom'#0#7'Caption'#6#11'Get Attribs'#7'OnClick'#7#12'But'
|
+'eft'#3#192#0#6'Height'#2#25#3'Top'#3'~'#1#5'Width'#2'a'#7'Anchors'#11#6'akL'
|
||||||
+'ton2Click'#8'TabOrder'#2#2#7'TabStop'#8#0#0#7'TButton'#7'Button3'#4'Left'#3
|
+'eft'#8'akBottom'#0#7'Caption'#6#11'Get Attribs'#7'OnClick'#7#12'Button2Clic'
|
||||||
+'0'#1#6'Height'#2#25#3'Top'#3'~'#1#5'Width'#2'`'#7'Anchors'#11#6'akLeft'#8'a'
|
+'k'#8'TabOrder'#2#2#7'TabStop'#8#0#0#7'TButton'#7'Button3'#4'Left'#3'0'#1#6
|
||||||
+'kBottom'#0#7'Caption'#6#11'Select Font'#7'OnClick'#7#12'Button3Click'#8'Tab'
|
+'Height'#2#25#3'Top'#3'~'#1#5'Width'#2'`'#7'Anchors'#11#6'akLeft'#8'akBottom'
|
||||||
+'Order'#2#3#7'TabStop'#8#0#0#7'TButton'#7'Button4'#4'Left'#3#16#2#6'Height'#2
|
+#0#7'Caption'#6#11'Select Font'#7'OnClick'#7#12'Button3Click'#8'TabOrder'#2#3
|
||||||
+#25#3'Top'#3'~'#1#5'Width'#2'K'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Capt'
|
+#7'TabStop'#8#0#0#7'TButton'#7'Button4'#4'Left'#3#16#2#6'Height'#2#25#3'Top'
|
||||||
+'ion'#6#8'Save RTF'#7'OnClick'#7#12'Button4Click'#8'TabOrder'#2#4#7'TabStop'
|
+#3'~'#1#5'Width'#2'K'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Caption'#6#8'S'
|
||||||
+#8#0#0#7'TButton'#7'Button5'#4'Left'#3#184#1#6'Height'#2#25#3'Top'#3'~'#1#5
|
+'ave RTF'#7'OnClick'#7#12'Button4Click'#8'TabOrder'#2#4#7'TabStop'#8#0#0#7'T'
|
||||||
+'Width'#2'K'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Caption'#6#8'Load RTF'#7
|
+'Button'#7'Button5'#4'Left'#3#184#1#6'Height'#2#25#3'Top'#3'~'#1#5'Width'#2
|
||||||
+'OnClick'#7#12'Button5Click'#8'TabOrder'#2#5#7'TabStop'#8#0#0#7'TButton'#7'B'
|
+'K'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Caption'#6#8'Load RTF'#7'OnClick'
|
||||||
+'utton6'#4'Left'#2#24#6'Height'#2#25#3'Top'#3#159#1#5'Width'#3#160#0#7'Ancho'
|
+#7#12'Button5Click'#8'TabOrder'#2#5#7'TabStop'#8#0#0#7'TButton'#7'Button6'#4
|
||||||
+'rs'#11#6'akLeft'#8'akBottom'#0#7'Caption'#6#16'Next Style Range'#7'OnClick'
|
+'Left'#2#24#6'Height'#2#25#3'Top'#3#159#1#5'Width'#3#160#0#7'Anchors'#11#6'a'
|
||||||
+#7#12'Button6Click'#8'TabOrder'#2#6#7'TabStop'#8#0#0#11'TFontDialog'#11'Font'
|
+'kLeft'#8'akBottom'#0#7'Caption'#6#16'Next Style Range'#7'OnClick'#7#12'Butt'
|
||||||
+'Dialog1'#11'MinFontSize'#2#0#11'MaxFontSize'#2#0#4'left'#3'`'#1#3'top'#3#173
|
+'on6Click'#8'TabOrder'#2#6#7'TabStop'#8#0#0#7'TButton'#7'Button7'#4'Left'#2
|
||||||
+#1#0#0#11'TSaveDialog'#11'SaveDialog1'#10'DefaultExt'#6#4'.rtf'#6'Filter'#6
|
+#15#6'Height'#2#25#3'Top'#2#16#5'Width'#2'3'#7'Caption'#6#4'Left'#7'OnClick'
|
||||||
+#27'RichText file (*.rtf)|*.rtf'#7'Options'#11#17'ofOverwritePrompt'#14'ofEn'
|
+#7#12'Button7Click'#8'TabOrder'#2#7#0#0#7'TButton'#7'Button8'#4'Left'#2'H'#6
|
||||||
+'ableSizing'#12'ofViewDetail'#0#4'left'#3#24#1#3'top'#3#173#1#0#0#11'TOpenDi'
|
+'Height'#2#25#3'Top'#2#16#5'Width'#2'5'#7'Caption'#6#6'Center'#7'OnClick'#7
|
||||||
+'alog'#11'OpenDialog1'#10'DefaultExt'#6#4'.rtf'#6'Filter'#6#27'RichText file'
|
+#12'Button8Click'#8'TabOrder'#2#8#0#0#7'TButton'#7'Button9'#4'Left'#3#131#0#6
|
||||||
+' (*.rtf)|*.rtf'#4'left'#3#208#0#3'top'#3#173#1#0#0#0
|
+'Height'#2#25#3'Top'#2#16#5'Width'#2'5'#7'Caption'#6#5'Right'#7'OnClick'#7#12
|
||||||
|
+'Button9Click'#8'TabOrder'#2#9#0#0#7'TButton'#8'Button10'#4'Left'#3#192#0#6
|
||||||
|
+'Height'#2#25#3'Top'#2#16#5'Width'#2'5'#7'Caption'#6#7'Justify'#7'OnClick'#7
|
||||||
|
+#13'Button10Click'#8'TabOrder'#2#10#0#0#14'TFloatSpinEdit'#10'StartIdent'#4
|
||||||
|
+'Left'#3'X'#1#6'Height'#2#21#3'Top'#2#18#5'Width'#2'N'#9'Increment'#5#0#0#0#0
|
||||||
|
+#0#0#0#128#255'?'#8'MaxValue'#5#0#0#0#0#0#0#0#200#5'@'#8'MinValue'#5#0#0#0#0
|
||||||
|
+#0#0#0#0#0#0#8'OnChange'#7#16'StartIdentChange'#8'TabOrder'#2#11#5'Value'#5#0
|
||||||
|
+#0#0#0#0#0#0#0#0#0#0#0#6'TLabel'#6'Label1'#4'Left'#3'0'#1#6'Height'#2#13#3'T'
|
||||||
|
+'op'#2#18#5'Width'#2#27#7'Caption'#6#6'Start '#11'ParentColor'#8#0#0#6'TLabe'
|
||||||
|
+'l'#6'Label2'#4'Left'#3'0'#1#6'Height'#2#13#3'Top'#2'0'#5'Width'#2#31#7'Capt'
|
||||||
|
+'ion'#6#6'Offset'#11'ParentColor'#8#0#0#14'TFloatSpinEdit'#11'OffsetIdent'#4
|
||||||
|
+'Left'#3'X'#1#6'Height'#2#21#3'Top'#2'.'#5'Width'#2'N'#9'Increment'#5#0#0#0#0
|
||||||
|
+#0#0#0#128#255'?'#8'MaxValue'#5#0#0#0#0#0#0#0#200#5'@'#8'MinValue'#5#0#0#0#0
|
||||||
|
+#0#0#0#0#0#0#8'OnChange'#7#16'StartIdentChange'#8'TabOrder'#2#12#5'Value'#5#0
|
||||||
|
+#0#0#0#0#0#0#0#0#0#0#0#7'TButton'#8'Button11'#4'Left'#2#16#6'Height'#2#25#3
|
||||||
|
+'Top'#2'4'#5'Width'#2'K'#7'Caption'#6#6'Bullet'#7'OnClick'#7#13'Button11Clic'
|
||||||
|
+'k'#8'TabOrder'#2#13#0#0#7'TButton'#8'Button12'#4'Left'#2'h'#6'Height'#2#25#3
|
||||||
|
+'Top'#2'4'#5'Width'#2'K'#7'Caption'#6#6'Number'#7'OnClick'#7#13'Button12Clic'
|
||||||
|
+'k'#8'TabOrder'#2#14#0#0#11'TFontDialog'#11'FontDialog1'#11'MinFontSize'#2#0
|
||||||
|
+#11'MaxFontSize'#2#0#4'left'#3'`'#1#3'top'#3#173#1#0#0#11'TSaveDialog'#11'Sa'
|
||||||
|
+'veDialog1'#10'DefaultExt'#6#4'.rtf'#6'Filter'#6#27'RichText file (*.rtf)|*.'
|
||||||
|
+'rtf'#7'Options'#11#17'ofOverwritePrompt'#14'ofEnableSizing'#12'ofViewDetail'
|
||||||
|
+#0#4'left'#3#24#1#3'top'#3#173#1#0#0#11'TOpenDialog'#11'OpenDialog1'#10'Defa'
|
||||||
|
+'ultExt'#6#4'.rtf'#6'Filter'#6#27'RichText file (*.rtf)|*.rtf'#4'left'#3#208
|
||||||
|
+#0#3'top'#3#173#1#0#0#0
|
||||||
]);
|
]);
|
||||||
|
@@ -6,7 +6,7 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
|
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
|
||||||
StdCtrls, ExtCtrls, ComCtrls,
|
StdCtrls, ExtCtrls, ComCtrls, Spin,
|
||||||
RichMemo;
|
RichMemo;
|
||||||
|
|
||||||
type
|
type
|
||||||
@@ -15,25 +15,47 @@ type
|
|||||||
|
|
||||||
TForm1 = class(TForm)
|
TForm1 = class(TForm)
|
||||||
Button1: TButton;
|
Button1: TButton;
|
||||||
|
Button10: TButton;
|
||||||
|
Button11: TButton;
|
||||||
|
Button12: TButton;
|
||||||
Button2: TButton;
|
Button2: TButton;
|
||||||
Button3: TButton;
|
Button3: TButton;
|
||||||
Button4: TButton;
|
Button4: TButton;
|
||||||
Button5: TButton;
|
Button5: TButton;
|
||||||
Button6: TButton;
|
Button6: TButton;
|
||||||
|
Button7: TButton;
|
||||||
|
Button8: TButton;
|
||||||
|
Button9: TButton;
|
||||||
|
StartIdent: TFloatSpinEdit;
|
||||||
FontDialog1: TFontDialog;
|
FontDialog1: TFontDialog;
|
||||||
|
Label1: TLabel;
|
||||||
|
Label2: TLabel;
|
||||||
OpenDialog1: TOpenDialog;
|
OpenDialog1: TOpenDialog;
|
||||||
RichMemo1: TRichMemo;
|
RichMemo1: TRichMemo;
|
||||||
SaveDialog1: TSaveDialog;
|
SaveDialog1: TSaveDialog;
|
||||||
|
OffsetIdent: TFloatSpinEdit;
|
||||||
|
procedure Button10Click(Sender: TObject);
|
||||||
|
procedure Button11Click(Sender: TObject);
|
||||||
|
procedure Button12Click(Sender: TObject);
|
||||||
procedure Button1Click(Sender: TObject);
|
procedure Button1Click(Sender: TObject);
|
||||||
procedure Button2Click(Sender: TObject);
|
procedure Button2Click(Sender: TObject);
|
||||||
procedure Button3Click(Sender: TObject);
|
procedure Button3Click(Sender: TObject);
|
||||||
procedure Button4Click(Sender: TObject);
|
procedure Button4Click(Sender: TObject);
|
||||||
procedure Button5Click(Sender: TObject);
|
procedure Button5Click(Sender: TObject);
|
||||||
procedure Button6Click(Sender: TObject);
|
procedure Button6Click(Sender: TObject);
|
||||||
|
procedure Button7Click(Sender: TObject);
|
||||||
|
procedure Button8Click(Sender: TObject);
|
||||||
|
procedure Button9Click(Sender: TObject);
|
||||||
|
procedure RichMemo1MouseUp(Sender: TObject; Button: TMouseButton;
|
||||||
|
Shift: TShiftState; X, Y: Integer);
|
||||||
|
procedure StartIdentChange(Sender: TObject);
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
procedure RichMemo1Change(Sender: TObject);
|
procedure RichMemo1Change(Sender: TObject);
|
||||||
|
procedure RichMemo1KeyUp(Sender: TObject; var Key: Word; Shift: TShiftState
|
||||||
|
);
|
||||||
private
|
private
|
||||||
{ private declarations }
|
{ private declarations }
|
||||||
|
procedure ParaMetricRead;
|
||||||
public
|
public
|
||||||
{ public declarations }
|
{ public declarations }
|
||||||
end;
|
end;
|
||||||
@@ -56,6 +78,27 @@ begin
|
|||||||
RichMemo1.SetTextAttributes(RichMemo1.SelStart, RichMemo1.SelLength, fp);
|
RichMemo1.SetTextAttributes(RichMemo1.SelStart, RichMemo1.SelLength, fp);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.Button10Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
RichMemo1.SetParaAlignment( RichMemo1.SelStart, RichMemo1.SelLength, paJustify);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.Button11Click(Sender: TObject);
|
||||||
|
var
|
||||||
|
Num : TParaNumbering;
|
||||||
|
begin
|
||||||
|
Num.Numbering:=TParaNumStyle(1);
|
||||||
|
RichMemo1.SetParaNumbering(RichMemo1.SelStart, RichMEmo1.SelLength, Num);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.Button12Click(Sender: TObject);
|
||||||
|
var
|
||||||
|
Num : TParaNumbering;
|
||||||
|
begin
|
||||||
|
Num.Numbering:=TParaNumStyle(3);
|
||||||
|
RichMemo1.SetParaNumbering(RichMemo1.SelStart, RichMEmo1.SelLength, Num);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TForm1.Button2Click(Sender: TObject);
|
procedure TForm1.Button2Click(Sender: TObject);
|
||||||
var
|
var
|
||||||
prm : TFontParams;
|
prm : TFontParams;
|
||||||
@@ -121,6 +164,39 @@ begin
|
|||||||
RichMemo1.SelLength := len;
|
RichMemo1.SelLength := len;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.Button7Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
RichMemo1.SetParaAlignment( RichMemo1.SelStart, RichMemo1.SelLength, paLeft);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.Button8Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
RichMemo1.SetParaAlignment( RichMemo1.SelStart, RichMemo1.SelLength, paCenter);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.Button9Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
RichMemo1.SetParaAlignment( RichMemo1.SelStart, RichMemo1.SelLength, paRight);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.RichMemo1MouseUp(Sender: TObject; Button: TMouseButton;
|
||||||
|
Shift: TShiftState; X, Y: Integer);
|
||||||
|
begin
|
||||||
|
ParaMetricRead;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.StartIdentChange(Sender: TObject);
|
||||||
|
var
|
||||||
|
m: TParaMetric;
|
||||||
|
begin
|
||||||
|
RichMemo1.GetParaMetric(RichMemo1.SelStart, m);
|
||||||
|
|
||||||
|
m.StartIndent:=StartIdent.Value;
|
||||||
|
m.Offset:=OffsetIdent.Value;
|
||||||
|
|
||||||
|
RichMemo1.SetParaMetric(RichMemo1.SelStart, RichMemo1.SelLength, m);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TForm1.FormCreate(Sender: TObject);
|
procedure TForm1.FormCreate(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
@@ -131,6 +207,27 @@ begin
|
|||||||
if length(CAption)>20 then Caption:='';
|
if length(CAption)>20 then Caption:='';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.RichMemo1KeyUp(Sender: TObject; var Key: Word;
|
||||||
|
Shift: TShiftState);
|
||||||
|
begin
|
||||||
|
ParaMetricRead;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.ParaMetricRead;
|
||||||
|
var
|
||||||
|
m: TParaMetric;
|
||||||
|
begin
|
||||||
|
RichMemo1.GetParaMetric(RichMemo1.SelStart, m);
|
||||||
|
StartIdent.OnChange:=nil;
|
||||||
|
OffsetIdent.OnChange:=nil;
|
||||||
|
|
||||||
|
StartIdent.Value:=m.StartIndent;
|
||||||
|
OffsetIdent.Value:=m.Offset;
|
||||||
|
|
||||||
|
StartIdent.OnChange:=@StartIdentChange;
|
||||||
|
OffsetIdent.OnChange:=@StartIdentChange;
|
||||||
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
{$I unit1.lrs}
|
{$I unit1.lrs}
|
||||||
|
|
||||||
|
@@ -66,8 +66,14 @@ type
|
|||||||
class procedure SetParaAlignment(const AWinControl: TWinControl; TextStart, TextLen: Integer;
|
class procedure SetParaAlignment(const AWinControl: TWinControl; TextStart, TextLen: Integer;
|
||||||
const AAlign: Integer); override;
|
const AAlign: Integer); override;
|
||||||
|
|
||||||
class function GetParaMatrics(const AWinControl: TWinControl; TextStart: Integer;
|
class function GetParaMetric(const AWinControl: TWinControl; TextStart: Integer;
|
||||||
var AMetrics: TIntParaMetric): Boolean; override;
|
var AMetrics: TIntParaMetric): Boolean; override;
|
||||||
|
class procedure SetParaMetric(const AWinControl: TWinControl; TextStart, TextLength: Integer;
|
||||||
|
const AMetrics: TIntParaMetric); override;
|
||||||
|
|
||||||
|
class procedure SetParaNumbering(const AWinControl: TWinControl; TextStart, TextLen: Integer;
|
||||||
|
const ANumber: TIntParaNumbering); override;
|
||||||
|
|
||||||
class procedure InDelText(const AWinControl: TWinControl; const TextUTF8: String; DstStart, DstLen: Integer); override;
|
class procedure InDelText(const AWinControl: TWinControl; const TextUTF8: String; DstStart, DstLen: Integer); override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -372,7 +378,7 @@ begin
|
|||||||
RichEditManager.SetPara2(AWinControl.Handle, TextStart, TextLen, para);
|
RichEditManager.SetPara2(AWinControl.Handle, TextStart, TextLen, para);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class function TWin32WSCustomRichMemo.GetParaMatrics(
|
class function TWin32WSCustomRichMemo.GetParaMetric(
|
||||||
const AWinControl: TWinControl; TextStart: Integer;
|
const AWinControl: TWinControl; TextStart: Integer;
|
||||||
var AMetrics: TIntParaMetric): Boolean;
|
var AMetrics: TIntParaMetric): Boolean;
|
||||||
var
|
var
|
||||||
@@ -381,6 +387,76 @@ begin
|
|||||||
Result:=false;
|
Result:=false;
|
||||||
if not Assigned(RichEditManager) or not Assigned(AWinControl) then Exit;
|
if not Assigned(RichEditManager) or not Assigned(AWinControl) then Exit;
|
||||||
RichEditManager.GetPara2(AWinControl.Handle, TextStart, para);
|
RichEditManager.GetPara2(AWinControl.Handle, TextStart, para);
|
||||||
|
|
||||||
|
AMetrics.StartIndent:=para.dxStartIndent/20;
|
||||||
|
AMetrics.EndIndent:=para.dxRightIndent/20;
|
||||||
|
AMetrics.Offset:=para.dxOffset/20;
|
||||||
|
AMetrics.SpaceAfter:=para.dySpaceAfter/20;
|
||||||
|
AMetrics.SpaceBefore:=para.dySpaceBefore/20;
|
||||||
|
AMetrics.LineSpacing:=para.dyLineSpacing/20;
|
||||||
|
end;
|
||||||
|
|
||||||
|
class procedure TWin32WSCustomRichMemo.SetParaMetric(
|
||||||
|
const AWinControl: TWinControl; TextStart, TextLength: Integer;
|
||||||
|
const AMetrics: TIntParaMetric);
|
||||||
|
var
|
||||||
|
para : PARAFORMAT2;
|
||||||
|
begin
|
||||||
|
if not Assigned(RichEditManager) or not Assigned(AWinControl) then Exit;
|
||||||
|
FillChar(para, SizeOf(para), 0);
|
||||||
|
|
||||||
|
para.cbSize:=sizeof(para);
|
||||||
|
para.dwMask:=
|
||||||
|
PFM_STARTINDENT or PFM_RIGHTINDENT
|
||||||
|
or PFM_OFFSET
|
||||||
|
or PFM_SPACEAFTER or PFM_SPACEBEFORE
|
||||||
|
or PFM_LINESPACING;
|
||||||
|
para.dxStartIndent:=round(AMetrics.StartIndent*20);
|
||||||
|
para.dxRightIndent:=round(AMetrics.EndIndent*20);
|
||||||
|
para.dxOffset:=round(AMetrics.Offset*20);
|
||||||
|
para.dySpaceAfter:=round(AMetrics.SpaceAfter*20);
|
||||||
|
para.dySpaceBefore:=round(AMetrics.SpaceBefore*20);
|
||||||
|
para.dyLineSpacing:=round(AMetrics.LineSpacing*20);
|
||||||
|
RichEditManager.SetPara2(AWinControl.Handle, TextStart, TextLength, para);
|
||||||
|
end;
|
||||||
|
|
||||||
|
const
|
||||||
|
PFN_ARABIC = 1;
|
||||||
|
PFN_LCLETTER = 2;
|
||||||
|
PFN_LCROMAN = 3;
|
||||||
|
PFN_UCLETTER = 4;
|
||||||
|
PFN_UCROMAN = 5;
|
||||||
|
PFN_CUSTOM = 7;
|
||||||
|
|
||||||
|
class procedure TWin32WSCustomRichMemo.SetParaNumbering(
|
||||||
|
const AWinControl: TWinControl; TextStart, TextLen: Integer;
|
||||||
|
const ANumber: TIntParaNumbering);
|
||||||
|
var
|
||||||
|
para : PARAFORMAT2;
|
||||||
|
begin
|
||||||
|
if not Assigned(RichEditManager) or not Assigned(AWinControl) then Exit;
|
||||||
|
FillChar(para, SizeOf(para), 0);
|
||||||
|
|
||||||
|
para.cbSize:=sizeof(para);
|
||||||
|
para.dwMask:=
|
||||||
|
PFM_NUMBERING or PFM_NUMBERINGTAB;
|
||||||
|
case ANumber.Numbering of
|
||||||
|
pnNone: para.wNumbering:=0;
|
||||||
|
pnBullet: para.wNumbering:=PFN_BULLET;
|
||||||
|
pnNumber: para.wNumbering:=PFN_ARABIC;
|
||||||
|
pnLowLetter: para.wNumbering:=PFN_LCLETTER;
|
||||||
|
pnLowRoman: para.wNumbering:=PFN_LCROMAN;
|
||||||
|
pnUpLetter: para.wNumbering:=PFN_UCLETTER;
|
||||||
|
pnUpRoman: para.wNumbering:=PFN_UCROMAN;
|
||||||
|
pnCustomChar: begin
|
||||||
|
para.wNumbering:=PFN_CUSTOM;
|
||||||
|
para.wNumberingStart:=Word(ANumber.NumCustom);
|
||||||
|
para.dwMask:=para.dwMask or PFM_NUMBERINGSTART;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
para.wNumberingTab:=round(ANumber.NumIndent*20);
|
||||||
|
RichEditManager.SetPara2(AWinControl.Handle, TextStart, TextLen, para);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class procedure TWin32WSCustomRichMemo.InDelText(const AWinControl:TWinControl;
|
class procedure TWin32WSCustomRichMemo.InDelText(const AWinControl:TWinControl;
|
||||||
|
@@ -48,7 +48,7 @@ const
|
|||||||
type
|
type
|
||||||
TIntParaMetric = record
|
TIntParaMetric = record
|
||||||
StartIndent : Double; // in points
|
StartIndent : Double; // in points
|
||||||
RightIndent : Double; // in points
|
EndIndent : Double; // in points
|
||||||
Offset : Double; // in points
|
Offset : Double; // in points
|
||||||
SpaceBefore : Double; // in points
|
SpaceBefore : Double; // in points
|
||||||
SpaceAfter : Double; // in points
|
SpaceAfter : Double; // in points
|
||||||
@@ -61,6 +61,7 @@ type
|
|||||||
TIntParaNumbering = record
|
TIntParaNumbering = record
|
||||||
Numbering : TParaNumStyle;
|
Numbering : TParaNumStyle;
|
||||||
NumCustom : WideChar;
|
NumCustom : WideChar;
|
||||||
|
NumIndent : Double;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TTabAlignment = (taLeft, taCenter, taRight, taDecimal, taWordBar);
|
TTabAlignment = (taLeft, taCenter, taRight, taDecimal, taWordBar);
|
||||||
@@ -96,8 +97,12 @@ type
|
|||||||
var AAlign: Integer): Boolean; virtual;
|
var AAlign: Integer): Boolean; virtual;
|
||||||
class procedure SetParaAlignment(const AWinControl: TWinControl; TextStart, TextLen: Integer;
|
class procedure SetParaAlignment(const AWinControl: TWinControl; TextStart, TextLen: Integer;
|
||||||
const AAlign: Integer); virtual;
|
const AAlign: Integer); virtual;
|
||||||
class function GetParaMatrics(const AWinControl: TWinControl; TextStart: Integer;
|
class function GetParaMetric(const AWinControl: TWinControl; TextStart: Integer;
|
||||||
var AMetrics: TIntParaMetric): Boolean; virtual;
|
var AMetric: TIntParaMetric): Boolean; virtual;
|
||||||
|
class procedure SetParaMetric(const AWinControl: TWinControl; TextStart, TextLen: Integer;
|
||||||
|
const AMetric: TIntParaMetric); virtual;
|
||||||
|
class procedure SetParaNumbering(const AWinControl: TWinControl; TextStart, TextLen: Integer;
|
||||||
|
const ANumber: TIntParaNumbering); virtual;
|
||||||
class procedure InDelText(const AWinControl: TWinControl; const TextUTF8: String; DstStart, DstLen: Integer); virtual;
|
class procedure InDelText(const AWinControl: TWinControl; const TextUTF8: String; DstStart, DstLen: Integer); virtual;
|
||||||
class procedure SetHideSelection(const ACustomEdit: TCustomEdit; AHideSelection: Boolean); override;
|
class procedure SetHideSelection(const ACustomEdit: TCustomEdit; AHideSelection: Boolean); override;
|
||||||
class function LoadRichText(const AWinControl: TWinControl; Source: TStream): Boolean; virtual;
|
class function LoadRichText(const AWinControl: TWinControl; Source: TStream): Boolean; virtual;
|
||||||
@@ -160,12 +165,26 @@ begin
|
|||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class function TWSCustomRichMemo.GetParaMatrics(const AWinControl: TWinControl;
|
class function TWSCustomRichMemo.GetParaMetric(const AWinControl: TWinControl;
|
||||||
TextStart: Integer; var AMetrics: TIntParaMetric): Boolean;
|
TextStart: Integer; var AMetric: TIntParaMetric): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := false;
|
Result := false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
class procedure TWSCustomRichMemo.SetParaMetric(
|
||||||
|
const AWinControl: TWinControl; TextStart, TextLen: Integer;
|
||||||
|
const AMetric: TIntParaMetric);
|
||||||
|
begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
class procedure TWSCustomRichMemo.SetParaNumbering(
|
||||||
|
const AWinControl: TWinControl; TextStart, TextLen: Integer;
|
||||||
|
const ANumber: TIntParaNumbering);
|
||||||
|
begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
class procedure TWSCustomRichMemo.InDelText(const AWinControl: TWinControl; const TextUTF8: String; DstStart, DstLen: Integer);
|
class procedure TWSCustomRichMemo.InDelText(const AWinControl: TWinControl; const TextUTF8: String; DstStart, DstLen: Integer);
|
||||||
begin
|
begin
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user