You've already forked lazarus-ccr
added style-range selection (carbon-only for now), updated test for the new feature
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@839 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -23,6 +23,10 @@ type
|
|||||||
protected
|
protected
|
||||||
function GetCreationOptions: TXNFrameOptions; override;
|
function GetCreationOptions: TXNFrameOptions; override;
|
||||||
public
|
public
|
||||||
|
function GetIndexedRunInfoFromRange(iIndex: ItemCount; iStartOffset, iEndOffset: TXNOffset;
|
||||||
|
var oRunStartOffset, oRunEndOffset: TXNOffset;
|
||||||
|
oRunDataType: TXNDataTypePtr; iTypeAttributeCount: ItemCount;
|
||||||
|
ioTypeAttributes: TXNTypeAttributesPtr): Boolean;
|
||||||
function GetContinuousTypeAttributes(var oContinuousFlags: TXNContinuousFlags;
|
function GetContinuousTypeAttributes(var oContinuousFlags: TXNContinuousFlags;
|
||||||
iCount: ItemCount; var ioTypeAttributes: array of TXNTypeAttributes): Boolean;
|
iCount: ItemCount; var ioTypeAttributes: array of TXNTypeAttributes): Boolean;
|
||||||
function SetTypeAttributes(iCount: ItemCount; const iTypeAttributes: array of TXNTypeAttributes;
|
function SetTypeAttributes(iCount: ItemCount; const iTypeAttributes: array of TXNTypeAttributes;
|
||||||
@ -33,6 +37,8 @@ type
|
|||||||
|
|
||||||
TCarbonWSCustomRichMemo = class(TWSCustomRichMemo)
|
TCarbonWSCustomRichMemo = class(TWSCustomRichMemo)
|
||||||
class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): HWND; override;
|
class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): HWND; override;
|
||||||
|
class function GetStyleRange(const AWinControl: TWinControl; TextStart: Integer;
|
||||||
|
var RangeStart, RangeLen: Integer): Boolean; override;
|
||||||
class function GetTextAttributes(const AWinControl: TWinControl; TextStart: Integer;
|
class function GetTextAttributes(const AWinControl: TWinControl; TextStart: Integer;
|
||||||
var Params: TFontParams): Boolean; override;
|
var Params: TFontParams): Boolean; override;
|
||||||
class procedure SetTextAttributes(const AWinControl: TWinControl; TextStart, TextLen: Integer;
|
class procedure SetTextAttributes(const AWinControl: TWinControl; TextStart, TextLen: Integer;
|
||||||
@ -114,9 +120,12 @@ begin
|
|||||||
if b then Include(Result, fsStrikeOut);
|
if b then Include(Result, fsStrikeOut);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function IsValidControlHandle(AWinControl: TWinControl): Boolean;
|
function GetValidRichEdit(AWinControl: TWinControl): TCarbonRichEdit;
|
||||||
begin
|
begin
|
||||||
Result := Assigned(AWinControl) and (AWinControl.Handle<>0);
|
if Assigned(AWinControl) and (AWinControl.Handle<>0) and (TObject(AWinControl.Handle) is TCarbonRichEdit) then
|
||||||
|
Result := TCarbonRichEdit(AWinControl.Handle)
|
||||||
|
else
|
||||||
|
Result := nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure AttrSetFontName(const FontName: String; var Attr: TXNTypeAttributes);
|
procedure AttrSetFontName(const FontName: String; var Attr: TXNTypeAttributes);
|
||||||
@ -190,6 +199,101 @@ begin
|
|||||||
Result := TLCLIntfHandle(TCarbonRichEdit.Create(AWinControl, AParams));
|
Result := TLCLIntfHandle(TCarbonRichEdit.Create(AWinControl, AParams));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
class function TCarbonWSCustomRichMemo.GetStyleRange(const AWinControl: TWinControl;
|
||||||
|
TextStart: Integer; var RangeStart, RangeLen: Integer): Boolean;
|
||||||
|
var
|
||||||
|
edit : TCarbonRichEdit;
|
||||||
|
obj : TXNObject;
|
||||||
|
sst, slen : Integer;
|
||||||
|
st, len : Integer;
|
||||||
|
send : Integer;
|
||||||
|
fndstyle : Boolean;
|
||||||
|
wattr : array [0..1] of TXNTypeAttributes;
|
||||||
|
attr : array [0..1] of TXNTypeAttributes;
|
||||||
|
astyle : ATSUStyle;
|
||||||
|
flags : TXNContinuousFlags;
|
||||||
|
d : Integer;
|
||||||
|
macrgb : RGBColor;
|
||||||
|
RngStart : TXNOffset;
|
||||||
|
RngEnd : TXNOffset;
|
||||||
|
begin
|
||||||
|
Result := false;
|
||||||
|
edit := GetValidRichEdit(AWinControl);
|
||||||
|
if not Assigned(edit) then Exit;
|
||||||
|
|
||||||
|
Result := edit.GetIndexedRunInfoFromRange(0, TextStart, TextStart+1, RngStart, RngEnd, nil, 0, nil);
|
||||||
|
if Result then begin
|
||||||
|
RangeStart := RngStart;
|
||||||
|
RangeLen := RngEnd - RngStart;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ edit.GetSelStart(sst);
|
||||||
|
edit.GetSelLength(slen);
|
||||||
|
|
||||||
|
edit.SetSelStart(TextStart);
|
||||||
|
edit.SetSelLength(1);
|
||||||
|
|
||||||
|
ATSUCreateStyle(astyle);
|
||||||
|
AttrSetATSUStyle(nil, wattr[0]);
|
||||||
|
AttrSetColor(macrgb, wattr[1]);
|
||||||
|
edit.GetContinuousTypeAttributes(flags, 2, wattr[0]);
|
||||||
|
|
||||||
|
GetTextLen(AWinControl, len);
|
||||||
|
dec(len, TextStart);
|
||||||
|
st:=TextStart;
|
||||||
|
|
||||||
|
writeln('TextStart = ', TextStart);
|
||||||
|
writeln('TextLength = ', 2);
|
||||||
|
edit.SetSelStart(TextStart);
|
||||||
|
edit.SetSelLength(2);//send-TextStart);
|
||||||
|
attr := wattr;
|
||||||
|
edit.GetContinuousTypeAttributes(flags, 2, attr);
|
||||||
|
|
||||||
|
writeln('contflags ',flags);
|
||||||
|
|
||||||
|
Result := true;}
|
||||||
|
|
||||||
|
{ fndstyle := false;
|
||||||
|
while not fndstyle do begin
|
||||||
|
edit.SetSelStart(st);
|
||||||
|
edit.SetSelLength(len);
|
||||||
|
attr := wattr;
|
||||||
|
|
||||||
|
send := st + len;
|
||||||
|
repeat
|
||||||
|
writeln(st,' ', send);
|
||||||
|
d := (st+send) div 2; {разделить пополам интервал просмотра}
|
||||||
|
edit.SetSelStart(TextStart);
|
||||||
|
edit.SetSelLength(send-TextStart);
|
||||||
|
attr := wattr;
|
||||||
|
edit.GetContinuousTypeAttributes(flags, 2, attr);
|
||||||
|
if flags = (kTXNColorContinuousMask or kTXNATSUIStyleContinuousMask) then
|
||||||
|
st := st+1
|
||||||
|
else
|
||||||
|
send := d-1;
|
||||||
|
until (st>send);}
|
||||||
|
|
||||||
|
{ while send > st do begin
|
||||||
|
writeln(st, ' ', send, ' ', send - st, ' ', (send - st) div 2);
|
||||||
|
attr := wattr;
|
||||||
|
edit.SetSelStart(st);
|
||||||
|
edit.SetSelLength(st+len);
|
||||||
|
edit.GetContinuousTypeAttributes(flags, 2, attr);
|
||||||
|
writeln(' flags = ', flags);
|
||||||
|
{d := (send - st) div 2;
|
||||||
|
if d = 0 then d := 1;}
|
||||||
|
if flags = (kTXNColorContinuousMask or kTXNATSUIStyleContinuousMask)
|
||||||
|
then st := send
|
||||||
|
else dec(send, d);
|
||||||
|
end;
|
||||||
|
Result := send - TextStart;}
|
||||||
|
// end;
|
||||||
|
|
||||||
|
{ edit.SetSelStart(sst);
|
||||||
|
edit.SetSelLength(slen);
|
||||||
|
ATSUDisposeStyle(astyle);}
|
||||||
|
end;
|
||||||
|
|
||||||
class function TCarbonWSCustomRichMemo.GetTextAttributes(const AWinControl: TWinControl;
|
class function TCarbonWSCustomRichMemo.GetTextAttributes(const AWinControl: TWinControl;
|
||||||
TextStart: Integer; var Params: TFontParams): Boolean;
|
TextStart: Integer; var Params: TFontParams): Boolean;
|
||||||
var
|
var
|
||||||
@ -202,9 +306,9 @@ var
|
|||||||
astyle : ATSUStyle;
|
astyle : ATSUStyle;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Result := IsValidControlHandle(AWinControl);
|
Result := false;
|
||||||
if not Result then Exit;
|
memo := GetValidRichEdit(AWinControl);
|
||||||
memo := TCarbonRichEdit(AWinControl.Handle);
|
if not Assigned(memo) then Exit;
|
||||||
|
|
||||||
memo.GetSelStart(sstart);
|
memo.GetSelStart(sstart);
|
||||||
memo.GetSelLength(slen);
|
memo.GetSelLength(slen);
|
||||||
@ -237,8 +341,8 @@ var
|
|||||||
Count : Integer;
|
Count : Integer;
|
||||||
maccolor : RGBColor;
|
maccolor : RGBColor;
|
||||||
begin
|
begin
|
||||||
if not IsValidControlHandle(AWinControl) then Exit;
|
memo := GetValidRichEdit(AWinControl);
|
||||||
memo := TCarbonRichEdit(AWinControl.Handle);
|
if not Assigned(memo) then Exit;
|
||||||
|
|
||||||
ParamsToTXNAttribs(Mask, Params, attr, Count, maccolor);
|
ParamsToTXNAttribs(Mask, Params, attr, Count, maccolor);
|
||||||
|
|
||||||
@ -276,9 +380,9 @@ var
|
|||||||
url : CFURLRef;
|
url : CFURLRef;
|
||||||
res : integer;
|
res : integer;
|
||||||
begin
|
begin
|
||||||
Result := IsValidControlHandle(AWinControl);
|
Result := false;
|
||||||
if not Result then Exit;
|
edit := GetValidRichEdit(AWinControl);
|
||||||
edit := TCarbonRichEdit(AWinControl.Handle);
|
if not Assigned(edit) then Exit;
|
||||||
|
|
||||||
Result := false;
|
Result := false;
|
||||||
filename := GetTempFileUniqueName;
|
filename := GetTempFileUniqueName;
|
||||||
@ -317,9 +421,8 @@ var
|
|||||||
ptr : PByteArray;
|
ptr : PByteArray;
|
||||||
begin
|
begin
|
||||||
Result := false;
|
Result := false;
|
||||||
if not IsValidControlHandle(AWinControl) then Exit;
|
edit := GetValidRichEdit(AWinControl);
|
||||||
edit := TCarbonRichEdit(AWinControl.Handle);
|
if not Assigned(edit) or not Assigned(Dst) then Exit;
|
||||||
if not Assigned(Dst) then Exit;
|
|
||||||
|
|
||||||
Result := TXNFlattenObjectToCFDataRef(HITextViewGetTXNObject(edit.Widget), kTXNRichTextFormatData, data) = noErr;
|
Result := TXNFlattenObjectToCFDataRef(HITextViewGetTXNObject(edit.Widget), kTXNRichTextFormatData, data) = noErr;
|
||||||
if not Result and Assigned(data) then Exit;
|
if not Result and Assigned(data) then Exit;
|
||||||
@ -343,9 +446,22 @@ begin
|
|||||||
Result := kOutputTextInUnicodeEncodingMask;
|
Result := kOutputTextInUnicodeEncodingMask;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TCarbonRichEdit.GetIndexedRunInfoFromRange(iIndex: ItemCount;
|
||||||
|
iStartOffset, iEndOffset: TXNOffset;
|
||||||
|
var oRunStartOffset, oRunEndOffset: TXNOffset;
|
||||||
|
oRunDataType: TXNDataTypePtr; iTypeAttributeCount: ItemCount;
|
||||||
|
ioTypeAttributes: TXNTypeAttributesPtr): Boolean;
|
||||||
|
begin
|
||||||
|
Result := TXNGetIndexedRunInfoFromRange( HITextViewGetTXNObject(Widget),
|
||||||
|
iIndex, iStartOffset, iEndOffset, @oRunStartOffset, @oRunEndOffset,
|
||||||
|
oRunDataType, iTypeAttributeCount, ioTypeAttributes ) = noErr;
|
||||||
|
end;
|
||||||
|
|
||||||
function TCarbonRichEdit.GetContinuousTypeAttributes(
|
function TCarbonRichEdit.GetContinuousTypeAttributes(
|
||||||
var oContinuousFlags: TXNContinuousFlags; iCount: ItemCount;
|
var oContinuousFlags: TXNContinuousFlags; iCount: ItemCount;
|
||||||
var ioTypeAttributes: array of TXNTypeAttributes): Boolean;
|
var ioTypeAttributes: array of TXNTypeAttributes): Boolean;
|
||||||
|
var
|
||||||
|
res : OSStatus;
|
||||||
begin
|
begin
|
||||||
Result := TXNGetContinuousTypeAttributes(HITextViewGetTXNObject(Widget),
|
Result := TXNGetContinuousTypeAttributes(HITextViewGetTXNObject(Widget),
|
||||||
oContinuousFlags, iCount, @ioTypeAttributes[0]) = noErr;
|
oContinuousFlags, iCount, @ioTypeAttributes[0]) = noErr;
|
||||||
|
@ -21,9 +21,12 @@ type
|
|||||||
procedure UpdateRichMemo; virtual;
|
procedure UpdateRichMemo; virtual;
|
||||||
procedure SetHideSelection(AValue: Boolean);
|
procedure SetHideSelection(AValue: Boolean);
|
||||||
public
|
public
|
||||||
procedure SetTextAttributes(TextStart, TextLen: Integer; AFont: TFont);
|
|
||||||
procedure SetTextAttributes(TextStart, TextLen: Integer; SetMask: TTextStyleMask; const TextParams: TFontParams); virtual;
|
procedure SetTextAttributes(TextStart, TextLen: Integer; SetMask: TTextStyleMask; const TextParams: TFontParams); virtual;
|
||||||
function GetTextAttributes(TextStart: Integer; var TextParams: TFontParams): Boolean; virtual;
|
function GetTextAttributes(TextStart: Integer; var TextParams: TFontParams): Boolean; virtual;
|
||||||
|
function GetStyleRange(TextStart: Integer; var RangeStart, RangeLen: Integer): Boolean; virtual;
|
||||||
|
|
||||||
|
procedure SetTextAttributes(TextStart, TextLen: Integer; AFont: TFont);
|
||||||
|
function GetStyleLength(TextStart: Integer): Integer;
|
||||||
|
|
||||||
function LoadRichText(Source: TStream): Boolean; virtual;
|
function LoadRichText(Source: TStream): Boolean; virtual;
|
||||||
function SaveRichText(Dest: TStream): Boolean; virtual;
|
function SaveRichText(Dest: TStream): Boolean; virtual;
|
||||||
@ -175,6 +178,29 @@ begin
|
|||||||
Result := false;
|
Result := false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TCustomRichMemo.GetStyleRange(TextStart: Integer; var RangeStart,
|
||||||
|
RangeLen: Integer): Boolean;
|
||||||
|
begin
|
||||||
|
if HandleAllocated then
|
||||||
|
Result := TWSCustomRichMemoClass(WidgetSetClass).GetStyleRange(Self, TextStart, RangeStart, RangeLen)
|
||||||
|
else begin
|
||||||
|
RangeStart := -1;
|
||||||
|
RangeLen := -1;
|
||||||
|
Result := false;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TCustomRichMemo.GetStyleLength(TextStart: Integer): Integer;
|
||||||
|
var
|
||||||
|
ofs, len : Integer;
|
||||||
|
begin
|
||||||
|
if GetStyleRange(TextStart, ofs, len) then
|
||||||
|
Result := len - (TextStart-ofs)
|
||||||
|
else
|
||||||
|
Result := 0;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
function TCustomRichMemo.LoadRichText(Source: TStream): Boolean;
|
function TCustomRichMemo.LoadRichText(Source: TStream): Boolean;
|
||||||
begin
|
begin
|
||||||
if Assigned(Source) and HandleAllocated then
|
if Assigned(Source) and HandleAllocated then
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<MainUnit Value="0"/>
|
<MainUnit Value="0"/>
|
||||||
<TargetFileExt Value=""/>
|
<TargetFileExt Value=""/>
|
||||||
<UseXPManifest Value="True"/>
|
<UseXPManifest Value="True"/>
|
||||||
<ActiveEditorIndexAtStart Value="2"/>
|
<ActiveEditorIndexAtStart Value="0"/>
|
||||||
</General>
|
</General>
|
||||||
<VersionInfo>
|
<VersionInfo>
|
||||||
<ProjectVersion Value=""/>
|
<ProjectVersion Value=""/>
|
||||||
@ -32,7 +32,7 @@
|
|||||||
<PackageName Value="LCL"/>
|
<PackageName Value="LCL"/>
|
||||||
</Item2>
|
</Item2>
|
||||||
</RequiredPackages>
|
</RequiredPackages>
|
||||||
<Units Count="36">
|
<Units Count="37">
|
||||||
<Unit0>
|
<Unit0>
|
||||||
<Filename Value="project1.lpr"/>
|
<Filename Value="project1.lpr"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
@ -40,7 +40,7 @@
|
|||||||
<CursorPos X="32" Y="12"/>
|
<CursorPos X="32" Y="12"/>
|
||||||
<TopLine Value="1"/>
|
<TopLine Value="1"/>
|
||||||
<EditorIndex Value="1"/>
|
<EditorIndex Value="1"/>
|
||||||
<UsageCount Value="37"/>
|
<UsageCount Value="46"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit0>
|
</Unit0>
|
||||||
<Unit1>
|
<Unit1>
|
||||||
@ -49,10 +49,10 @@
|
|||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<UnitName Value="Unit1"/>
|
<UnitName Value="Unit1"/>
|
||||||
<CursorPos X="21" Y="93"/>
|
<CursorPos X="62" Y="83"/>
|
||||||
<TopLine Value="75"/>
|
<TopLine Value="76"/>
|
||||||
<EditorIndex Value="0"/>
|
<EditorIndex Value="0"/>
|
||||||
<UsageCount Value="37"/>
|
<UsageCount Value="46"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit1>
|
</Unit1>
|
||||||
<Unit2>
|
<Unit2>
|
||||||
@ -137,7 +137,7 @@
|
|||||||
<UnitName Value="CarbonGDIObjects"/>
|
<UnitName Value="CarbonGDIObjects"/>
|
||||||
<CursorPos X="3" Y="1109"/>
|
<CursorPos X="3" Y="1109"/>
|
||||||
<TopLine Value="1100"/>
|
<TopLine Value="1100"/>
|
||||||
<UsageCount Value="18"/>
|
<UsageCount Value="22"/>
|
||||||
<Bookmarks Count="1">
|
<Bookmarks Count="1">
|
||||||
<Item0 X="25" Y="150" ID="1"/>
|
<Item0 X="25" Y="150" ID="1"/>
|
||||||
</Bookmarks>
|
</Bookmarks>
|
||||||
@ -192,7 +192,7 @@
|
|||||||
<UnitName Value="CarbonPrivate"/>
|
<UnitName Value="CarbonPrivate"/>
|
||||||
<CursorPos X="17" Y="649"/>
|
<CursorPos X="17" Y="649"/>
|
||||||
<TopLine Value="640"/>
|
<TopLine Value="640"/>
|
||||||
<UsageCount Value="17"/>
|
<UsageCount Value="21"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit20>
|
</Unit20>
|
||||||
<Unit21>
|
<Unit21>
|
||||||
@ -238,65 +238,60 @@
|
|||||||
<Unit27>
|
<Unit27>
|
||||||
<Filename Value="../../richmemo.pas"/>
|
<Filename Value="../../richmemo.pas"/>
|
||||||
<UnitName Value="RichMemo"/>
|
<UnitName Value="RichMemo"/>
|
||||||
<CursorPos X="1" Y="1"/>
|
<CursorPos X="14" Y="29"/>
|
||||||
<TopLine Value="1"/>
|
<TopLine Value="19"/>
|
||||||
<EditorIndex Value="7"/>
|
<EditorIndex Value="5"/>
|
||||||
<UsageCount Value="14"/>
|
<UsageCount Value="18"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit27>
|
</Unit27>
|
||||||
<Unit28>
|
<Unit28>
|
||||||
<Filename Value="../../wsrichmemo.pas"/>
|
<Filename Value="../../wsrichmemo.pas"/>
|
||||||
<UnitName Value="WSRichMemo"/>
|
<UnitName Value="WSRichMemo"/>
|
||||||
<CursorPos X="3" Y="57"/>
|
<CursorPos X="66" Y="42"/>
|
||||||
<TopLine Value="57"/>
|
<TopLine Value="41"/>
|
||||||
<EditorIndex Value="8"/>
|
<EditorIndex Value="6"/>
|
||||||
<UsageCount Value="14"/>
|
<UsageCount Value="18"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit28>
|
</Unit28>
|
||||||
<Unit29>
|
<Unit29>
|
||||||
<Filename Value="../../carbon/carbonrichmemo.pas"/>
|
<Filename Value="../../carbon/carbonrichmemo.pas"/>
|
||||||
<UnitName Value="CarbonRichMemo"/>
|
<UnitName Value="CarbonRichMemo"/>
|
||||||
<CursorPos X="1" Y="267"/>
|
<CursorPos X="24" Y="222"/>
|
||||||
<TopLine Value="249"/>
|
<TopLine Value="262"/>
|
||||||
<EditorIndex Value="2"/>
|
<EditorIndex Value="2"/>
|
||||||
<UsageCount Value="13"/>
|
<UsageCount Value="17"/>
|
||||||
|
<Bookmarks Count="2">
|
||||||
|
<Item0 X="16" Y="230" ID="2"/>
|
||||||
|
<Item1 X="33" Y="467" ID="4"/>
|
||||||
|
</Bookmarks>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit29>
|
</Unit29>
|
||||||
<Unit30>
|
<Unit30>
|
||||||
<Filename Value="../../../fpc/packages/univint/src/MacOSAll.pas"/>
|
<Filename Value="../../../fpc/packages/univint/src/MacOSAll.pas"/>
|
||||||
<UnitName Value="MacOSAll"/>
|
<UnitName Value="MacOSAll"/>
|
||||||
<CursorPos X="1" Y="218294"/>
|
<CursorPos X="39" Y="220678"/>
|
||||||
<TopLine Value="218272"/>
|
<TopLine Value="220670"/>
|
||||||
<EditorIndex Value="6"/>
|
<EditorIndex Value="3"/>
|
||||||
<UsageCount Value="12"/>
|
<UsageCount Value="16"/>
|
||||||
<Bookmarks Count="1">
|
|
||||||
<Item0 X="32" Y="83842" ID="2"/>
|
|
||||||
</Bookmarks>
|
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit30>
|
</Unit30>
|
||||||
<Unit31>
|
<Unit31>
|
||||||
<Filename Value="../../../fpc/rtl/objpas/sysutils/osutilsh.inc"/>
|
<Filename Value="../../../fpc/rtl/objpas/sysutils/osutilsh.inc"/>
|
||||||
<CursorPos X="10" Y="34"/>
|
<CursorPos X="10" Y="34"/>
|
||||||
<TopLine Value="18"/>
|
<TopLine Value="20"/>
|
||||||
<EditorIndex Value="5"/>
|
<UsageCount Value="11"/>
|
||||||
<UsageCount Value="10"/>
|
|
||||||
<Loaded Value="True"/>
|
|
||||||
</Unit31>
|
</Unit31>
|
||||||
<Unit32>
|
<Unit32>
|
||||||
<Filename Value="../../../fpc/rtl/objpas/classes/classesh.inc"/>
|
<Filename Value="../../../fpc/rtl/objpas/classes/classesh.inc"/>
|
||||||
<CursorPos X="19" Y="728"/>
|
<CursorPos X="19" Y="728"/>
|
||||||
<TopLine Value="709"/>
|
<TopLine Value="714"/>
|
||||||
<EditorIndex Value="3"/>
|
<UsageCount Value="11"/>
|
||||||
<UsageCount Value="10"/>
|
|
||||||
<Loaded Value="True"/>
|
|
||||||
</Unit32>
|
</Unit32>
|
||||||
<Unit33>
|
<Unit33>
|
||||||
<Filename Value="../../../fpc/rtl/objpas/classes/streams.inc"/>
|
<Filename Value="../../../fpc/rtl/objpas/classes/streams.inc"/>
|
||||||
<CursorPos X="8" Y="147"/>
|
<CursorPos X="8" Y="147"/>
|
||||||
<TopLine Value="140"/>
|
<TopLine Value="140"/>
|
||||||
<EditorIndex Value="4"/>
|
<UsageCount Value="11"/>
|
||||||
<UsageCount Value="10"/>
|
|
||||||
<Loaded Value="True"/>
|
|
||||||
</Unit33>
|
</Unit33>
|
||||||
<Unit34>
|
<Unit34>
|
||||||
<Filename Value="../../../../wnlibsvn/CarbonPaste.pas"/>
|
<Filename Value="../../../../wnlibsvn/CarbonPaste.pas"/>
|
||||||
@ -304,7 +299,7 @@
|
|||||||
<UnitName Value="CarbonPaste"/>
|
<UnitName Value="CarbonPaste"/>
|
||||||
<CursorPos X="43" Y="9"/>
|
<CursorPos X="43" Y="9"/>
|
||||||
<TopLine Value="1"/>
|
<TopLine Value="1"/>
|
||||||
<UsageCount Value="21"/>
|
<UsageCount Value="30"/>
|
||||||
</Unit34>
|
</Unit34>
|
||||||
<Unit35>
|
<Unit35>
|
||||||
<Filename Value="../../../fpc/rtl/objpas/sysutils/sysutilh.inc"/>
|
<Filename Value="../../../fpc/rtl/objpas/sysutils/sysutilh.inc"/>
|
||||||
@ -312,127 +307,136 @@
|
|||||||
<TopLine Value="169"/>
|
<TopLine Value="169"/>
|
||||||
<UsageCount Value="10"/>
|
<UsageCount Value="10"/>
|
||||||
</Unit35>
|
</Unit35>
|
||||||
|
<Unit36>
|
||||||
|
<Filename Value="../../../lazarus/lcl/widgetset/wsstdctrls.pp"/>
|
||||||
|
<UnitName Value="WSStdCtrls"/>
|
||||||
|
<CursorPos X="20" Y="145"/>
|
||||||
|
<TopLine Value="138"/>
|
||||||
|
<EditorIndex Value="4"/>
|
||||||
|
<UsageCount Value="13"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit36>
|
||||||
</Units>
|
</Units>
|
||||||
<JumpHistory Count="30" HistoryIndex="29">
|
<JumpHistory Count="30" HistoryIndex="29">
|
||||||
<Position1>
|
<Position1>
|
||||||
<Filename Value="../../carbon/carbonrichmemo.pas"/>
|
<Filename Value="../../carbon/carbonrichmemo.pas"/>
|
||||||
<Caret Line="332" Column="3" TopLine="330"/>
|
<Caret Line="451" Column="48" TopLine="439"/>
|
||||||
</Position1>
|
</Position1>
|
||||||
<Position2>
|
<Position2>
|
||||||
<Filename Value="../../carbon/carbonrichmemo.pas"/>
|
<Filename Value="unit1.pas"/>
|
||||||
<Caret Line="362" Column="5" TopLine="340"/>
|
<Caret Line="25" Column="21" TopLine="15"/>
|
||||||
</Position2>
|
</Position2>
|
||||||
<Position3>
|
<Position3>
|
||||||
<Filename Value="../../carbon/carbonrichmemo.pas"/>
|
<Filename Value="unit1.pas"/>
|
||||||
<Caret Line="349" Column="1" TopLine="345"/>
|
<Caret Line="110" Column="1" TopLine="94"/>
|
||||||
</Position3>
|
</Position3>
|
||||||
<Position4>
|
<Position4>
|
||||||
<Filename Value="../../carbon/carbonrichmemo.pas"/>
|
<Filename Value="unit1.pas"/>
|
||||||
<Caret Line="336" Column="34" TopLine="325"/>
|
<Caret Line="109" Column="45" TopLine="99"/>
|
||||||
</Position4>
|
</Position4>
|
||||||
<Position5>
|
<Position5>
|
||||||
<Filename Value="../../carbon/carbonrichmemo.pas"/>
|
<Filename Value="unit1.pas"/>
|
||||||
<Caret Line="327" Column="15" TopLine="316"/>
|
<Caret Line="25" Column="26" TopLine="9"/>
|
||||||
</Position5>
|
</Position5>
|
||||||
<Position6>
|
<Position6>
|
||||||
<Filename Value="../../carbon/carbonrichmemo.pas"/>
|
<Filename Value="unit1.pas"/>
|
||||||
<Caret Line="355" Column="37" TopLine="344"/>
|
<Caret Line="24" Column="18" TopLine="9"/>
|
||||||
</Position6>
|
</Position6>
|
||||||
<Position7>
|
<Position7>
|
||||||
<Filename Value="../../carbon/carbonrichmemo.pas"/>
|
<Filename Value="unit1.pas"/>
|
||||||
<Caret Line="347" Column="18" TopLine="344"/>
|
<Caret Line="25" Column="32" TopLine="9"/>
|
||||||
</Position7>
|
</Position7>
|
||||||
<Position8>
|
<Position8>
|
||||||
<Filename Value="../../carbon/carbonrichmemo.pas"/>
|
<Filename Value="unit1.pas"/>
|
||||||
<Caret Line="358" Column="18" TopLine="347"/>
|
<Caret Line="24" Column="18" TopLine="9"/>
|
||||||
</Position8>
|
</Position8>
|
||||||
<Position9>
|
<Position9>
|
||||||
<Filename Value="../../carbon/carbonrichmemo.pas"/>
|
<Filename Value="unit1.pas"/>
|
||||||
<Caret Line="372" Column="3" TopLine="352"/>
|
<Caret Line="26" Column="30" TopLine="9"/>
|
||||||
</Position9>
|
</Position9>
|
||||||
<Position10>
|
<Position10>
|
||||||
<Filename Value="../../carbon/carbonrichmemo.pas"/>
|
<Filename Value="unit1.pas"/>
|
||||||
<Caret Line="371" Column="3" TopLine="351"/>
|
<Caret Line="25" Column="26" TopLine="9"/>
|
||||||
</Position10>
|
</Position10>
|
||||||
<Position11>
|
<Position11>
|
||||||
<Filename Value="../../carbon/carbonrichmemo.pas"/>
|
<Filename Value="unit1.pas"/>
|
||||||
<Caret Line="362" Column="22" TopLine="351"/>
|
<Caret Line="24" Column="18" TopLine="9"/>
|
||||||
</Position11>
|
</Position11>
|
||||||
<Position12>
|
<Position12>
|
||||||
<Filename Value="../../carbon/carbonrichmemo.pas"/>
|
<Filename Value="unit1.pas"/>
|
||||||
<Caret Line="384" Column="38" TopLine="375"/>
|
<Caret Line="23" Column="30" TopLine="9"/>
|
||||||
</Position12>
|
</Position12>
|
||||||
<Position13>
|
<Position13>
|
||||||
<Filename Value="../../carbon/carbonrichmemo.pas"/>
|
<Filename Value="unit1.pas"/>
|
||||||
<Caret Line="392" Column="3" TopLine="388"/>
|
<Caret Line="111" Column="29" TopLine="101"/>
|
||||||
</Position13>
|
</Position13>
|
||||||
<Position14>
|
<Position14>
|
||||||
<Filename Value="../../carbon/carbonrichmemo.pas"/>
|
<Filename Value="unit1.pas"/>
|
||||||
<Caret Line="381" Column="18" TopLine="373"/>
|
<Caret Line="74" Column="1" TopLine="71"/>
|
||||||
</Position14>
|
</Position14>
|
||||||
<Position15>
|
<Position15>
|
||||||
<Filename Value="../../carbon/carbonrichmemo.pas"/>
|
<Filename Value="unit1.pas"/>
|
||||||
<Caret Line="404" Column="5" TopLine="382"/>
|
<Caret Line="78" Column="1" TopLine="73"/>
|
||||||
</Position15>
|
</Position15>
|
||||||
<Position16>
|
<Position16>
|
||||||
<Filename Value="../../carbon/carbonrichmemo.pas"/>
|
<Filename Value="unit1.pas"/>
|
||||||
<Caret Line="240" Column="16" TopLine="229"/>
|
<Caret Line="88" Column="33" TopLine="80"/>
|
||||||
</Position16>
|
</Position16>
|
||||||
<Position17>
|
<Position17>
|
||||||
<Filename Value="../../carbon/carbonrichmemo.pas"/>
|
<Filename Value="unit1.pas"/>
|
||||||
<Caret Line="60" Column="14" TopLine="52"/>
|
<Caret Line="75" Column="1" TopLine="73"/>
|
||||||
</Position17>
|
</Position17>
|
||||||
<Position18>
|
<Position18>
|
||||||
<Filename Value="../../carbon/carbonrichmemo.pas"/>
|
<Filename Value="unit1.pas"/>
|
||||||
<Caret Line="449" Column="36" TopLine="429"/>
|
<Caret Line="25" Column="30" TopLine="25"/>
|
||||||
</Position18>
|
</Position18>
|
||||||
<Position19>
|
<Position19>
|
||||||
<Filename Value="../../carbon/carbonrichmemo.pas"/>
|
<Filename Value="unit1.pas"/>
|
||||||
<Caret Line="445" Column="20" TopLine="437"/>
|
<Caret Line="26" Column="52" TopLine="25"/>
|
||||||
</Position19>
|
</Position19>
|
||||||
<Position20>
|
<Position20>
|
||||||
<Filename Value="../../carbon/carbonrichmemo.pas"/>
|
<Filename Value="unit1.pas"/>
|
||||||
<Caret Line="462" Column="7" TopLine="448"/>
|
<Caret Line="25" Column="30" TopLine="25"/>
|
||||||
</Position20>
|
</Position20>
|
||||||
<Position21>
|
<Position21>
|
||||||
<Filename Value="../../carbon/carbonrichmemo.pas"/>
|
<Filename Value="unit1.pas"/>
|
||||||
<Caret Line="426" Column="17" TopLine="415"/>
|
<Caret Line="24" Column="30" TopLine="24"/>
|
||||||
</Position21>
|
</Position21>
|
||||||
<Position22>
|
<Position22>
|
||||||
<Filename Value="../../carbon/carbonrichmemo.pas"/>
|
<Filename Value="unit1.pas"/>
|
||||||
<Caret Line="440" Column="13" TopLine="410"/>
|
<Caret Line="88" Column="33" TopLine="81"/>
|
||||||
</Position22>
|
</Position22>
|
||||||
<Position23>
|
<Position23>
|
||||||
<Filename Value="../../carbon/carbonrichmemo.pas"/>
|
<Filename Value="unit1.pas"/>
|
||||||
<Caret Line="418" Column="48" TopLine="410"/>
|
<Caret Line="80" Column="7" TopLine="75"/>
|
||||||
</Position23>
|
</Position23>
|
||||||
<Position24>
|
<Position24>
|
||||||
<Filename Value="../../carbon/carbonrichmemo.pas"/>
|
<Filename Value="unit1.pas"/>
|
||||||
<Caret Line="309" Column="71" TopLine="301"/>
|
<Caret Line="88" Column="1" TopLine="75"/>
|
||||||
</Position24>
|
</Position24>
|
||||||
<Position25>
|
<Position25>
|
||||||
<Filename Value="../../carbon/carbonrichmemo.pas"/>
|
<Filename Value="unit1.pas"/>
|
||||||
<Caret Line="348" Column="32" TopLine="324"/>
|
<Caret Line="79" Column="3" TopLine="75"/>
|
||||||
</Position25>
|
</Position25>
|
||||||
<Position26>
|
<Position26>
|
||||||
<Filename Value="../../../fpc/packages/univint/src/MacOSAll.pas"/>
|
<Filename Value="unit1.pas"/>
|
||||||
<Caret Line="224096" Column="91" TopLine="224080"/>
|
<Caret Line="33" Column="44" TopLine="33"/>
|
||||||
</Position26>
|
</Position26>
|
||||||
<Position27>
|
<Position27>
|
||||||
<Filename Value="../../carbon/carbonrichmemo.pas"/>
|
<Filename Value="unit1.pas"/>
|
||||||
<Caret Line="351" Column="1" TopLine="340"/>
|
<Caret Line="110" Column="3" TopLine="108"/>
|
||||||
</Position27>
|
</Position27>
|
||||||
<Position28>
|
<Position28>
|
||||||
<Filename Value="../../carbon/carbonrichmemo.pas"/>
|
<Filename Value="unit1.pas"/>
|
||||||
<Caret Line="340" Column="1" TopLine="324"/>
|
<Caret Line="93" Column="1" TopLine="91"/>
|
||||||
</Position28>
|
</Position28>
|
||||||
<Position29>
|
<Position29>
|
||||||
<Filename Value="../../carbon/carbonrichmemo.pas"/>
|
<Filename Value="unit1.pas"/>
|
||||||
<Caret Line="274" Column="1" TopLine="260"/>
|
<Caret Line="89" Column="1" TopLine="76"/>
|
||||||
</Position29>
|
</Position29>
|
||||||
<Position30>
|
<Position30>
|
||||||
<Filename Value="../../carbon/carbonrichmemo.pas"/>
|
<Filename Value="unit1.pas"/>
|
||||||
<Caret Line="269" Column="9" TopLine="247"/>
|
<Caret Line="104" Column="1" TopLine="91"/>
|
||||||
</Position30>
|
</Position30>
|
||||||
</JumpHistory>
|
</JumpHistory>
|
||||||
</ProjectOptions>
|
</ProjectOptions>
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
object Form1: TForm1
|
object Form1: TForm1
|
||||||
Left = 234
|
Left = 333
|
||||||
Height = 592
|
Height = 596
|
||||||
Top = 220
|
Top = 22
|
||||||
Width = 752
|
Width = 751
|
||||||
Align = alNone
|
Align = alNone
|
||||||
AllowDropFiles = False
|
AllowDropFiles = False
|
||||||
AutoScroll = True
|
AutoScroll = True
|
||||||
@ -11,14 +11,15 @@ object Form1: TForm1
|
|||||||
BorderStyle = bsSizeable
|
BorderStyle = bsSizeable
|
||||||
BorderWidth = 0
|
BorderWidth = 0
|
||||||
Caption = 'Form1'
|
Caption = 'Form1'
|
||||||
ClientHeight = 592
|
ClientHeight = 596
|
||||||
ClientWidth = 752
|
ClientWidth = 751
|
||||||
DefaultMonitor = dmActiveForm
|
DefaultMonitor = dmActiveForm
|
||||||
DockSite = False
|
DockSite = False
|
||||||
DragKind = dkDrag
|
DragKind = dkDrag
|
||||||
DragMode = dmManual
|
DragMode = dmManual
|
||||||
Enabled = True
|
Enabled = True
|
||||||
FormStyle = fsNormal
|
FormStyle = fsNormal
|
||||||
|
OnCreate = FormCreate
|
||||||
ParentBiDiMode = True
|
ParentBiDiMode = True
|
||||||
ParentFont = False
|
ParentFont = False
|
||||||
Position = poDesigned
|
Position = poDesigned
|
||||||
@ -27,10 +28,10 @@ object Form1: TForm1
|
|||||||
LCLVersion = '0.9.27'
|
LCLVersion = '0.9.27'
|
||||||
WindowState = wsNormal
|
WindowState = wsNormal
|
||||||
object RichMemo1: TRichMemo
|
object RichMemo1: TRichMemo
|
||||||
Left = 32
|
Left = 40
|
||||||
Height = 518
|
Height = 432
|
||||||
Top = 24
|
Top = 32
|
||||||
Width = 288
|
Width = 704
|
||||||
Align = alNone
|
Align = alNone
|
||||||
Alignment = taLeftJustify
|
Alignment = taLeftJustify
|
||||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
@ -61,8 +62,8 @@ object Form1: TForm1
|
|||||||
object Button1: TButton
|
object Button1: TButton
|
||||||
Left = 24
|
Left = 24
|
||||||
Height = 25
|
Height = 25
|
||||||
Top = 548
|
Top = 472
|
||||||
Width = 152
|
Width = 160
|
||||||
Align = alNone
|
Align = alNone
|
||||||
Anchors = [akLeft, akBottom]
|
Anchors = [akLeft, akBottom]
|
||||||
AutoSize = False
|
AutoSize = False
|
||||||
@ -84,10 +85,10 @@ object Form1: TForm1
|
|||||||
Visible = True
|
Visible = True
|
||||||
end
|
end
|
||||||
object Button2: TButton
|
object Button2: TButton
|
||||||
Left = 184
|
Left = 192
|
||||||
Height = 25
|
Height = 25
|
||||||
Top = 548
|
Top = 472
|
||||||
Width = 136
|
Width = 97
|
||||||
Align = alNone
|
Align = alNone
|
||||||
Anchors = [akLeft, akBottom]
|
Anchors = [akLeft, akBottom]
|
||||||
AutoSize = False
|
AutoSize = False
|
||||||
@ -109,10 +110,10 @@ object Form1: TForm1
|
|||||||
Visible = True
|
Visible = True
|
||||||
end
|
end
|
||||||
object Button3: TButton
|
object Button3: TButton
|
||||||
Left = 328
|
Left = 304
|
||||||
Height = 25
|
Height = 25
|
||||||
Top = 548
|
Top = 472
|
||||||
Width = 168
|
Width = 96
|
||||||
Align = alNone
|
Align = alNone
|
||||||
Anchors = [akLeft, akBottom]
|
Anchors = [akLeft, akBottom]
|
||||||
AutoSize = False
|
AutoSize = False
|
||||||
@ -134,9 +135,9 @@ object Form1: TForm1
|
|||||||
Visible = True
|
Visible = True
|
||||||
end
|
end
|
||||||
object Button4: TButton
|
object Button4: TButton
|
||||||
Left = 512
|
Left = 112
|
||||||
Height = 25
|
Height = 25
|
||||||
Top = 548
|
Top = 552
|
||||||
Width = 75
|
Width = 75
|
||||||
Align = alNone
|
Align = alNone
|
||||||
AutoSize = False
|
AutoSize = False
|
||||||
@ -157,39 +158,10 @@ object Form1: TForm1
|
|||||||
TabStop = True
|
TabStop = True
|
||||||
Visible = True
|
Visible = True
|
||||||
end
|
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
|
object Button5: TButton
|
||||||
Left = 600
|
Left = 24
|
||||||
Height = 25
|
Height = 25
|
||||||
Top = 547
|
Top = 552
|
||||||
Width = 75
|
Width = 75
|
||||||
Align = alNone
|
Align = alNone
|
||||||
AutoSize = False
|
AutoSize = False
|
||||||
@ -206,6 +178,30 @@ object Form1: TForm1
|
|||||||
OnClick = Button5Click
|
OnClick = Button5Click
|
||||||
ParentFont = True
|
ParentFont = True
|
||||||
ParentShowHint = True
|
ParentShowHint = True
|
||||||
|
TabOrder = 5
|
||||||
|
TabStop = True
|
||||||
|
Visible = True
|
||||||
|
end
|
||||||
|
object Button6: TButton
|
||||||
|
Left = 24
|
||||||
|
Height = 25
|
||||||
|
Top = 504
|
||||||
|
Width = 160
|
||||||
|
Align = alNone
|
||||||
|
AutoSize = False
|
||||||
|
Cancel = False
|
||||||
|
Caption = 'Next Style Range'
|
||||||
|
Color = clBtnFace
|
||||||
|
Default = False
|
||||||
|
DragCursor = crDrag
|
||||||
|
DragKind = dkDrag
|
||||||
|
DragMode = dmManual
|
||||||
|
Enabled = True
|
||||||
|
ParentBidiMode = True
|
||||||
|
ModalResult = 0
|
||||||
|
OnClick = Button6Click
|
||||||
|
ParentFont = True
|
||||||
|
ParentShowHint = True
|
||||||
TabOrder = 6
|
TabOrder = 6
|
||||||
TabStop = True
|
TabStop = True
|
||||||
Visible = True
|
Visible = True
|
||||||
@ -213,7 +209,20 @@ object Form1: TForm1
|
|||||||
object FontDialog1: TFontDialog
|
object FontDialog1: TFontDialog
|
||||||
MinFontSize = 0
|
MinFontSize = 0
|
||||||
MaxFontSize = 0
|
MaxFontSize = 0
|
||||||
left = 328
|
left = 696
|
||||||
top = 368
|
top = 472
|
||||||
|
end
|
||||||
|
object SaveDialog1: TSaveDialog
|
||||||
|
DefaultExt = '.rtf'
|
||||||
|
Filter = 'RichText file (*.rtf)|*.rtf'
|
||||||
|
Options = [ofOverwritePrompt, ofEnableSizing, ofViewDetail]
|
||||||
|
left = 616
|
||||||
|
top = 472
|
||||||
|
end
|
||||||
|
object OpenDialog1: TOpenDialog
|
||||||
|
DefaultExt = '.rtf'
|
||||||
|
Filter = 'RichText file (*.rtf)|*.rtf'
|
||||||
|
left = 536
|
||||||
|
top = 472
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,60 +1,64 @@
|
|||||||
{ 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#234#0#6'Height'#3'P'#2#3'Top'#3#220#0#5'W'
|
'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'M'#1#6'Height'#3'T'#2#3'Top'#2#22#5'Width'
|
||||||
+'idth'#3#240#2#5'Align'#7#6'alNone'#14'AllowDropFiles'#8#10'AutoScroll'#9#8
|
+#3#239#2#5'Align'#7#6'alNone'#14'AllowDropFiles'#8#10'AutoScroll'#9#8'AutoSi'
|
||||||
+'AutoSize'#8#11'BorderIcons'#11#12'biSystemMenu'#10'biMinimize'#10'biMaximiz'
|
+'ze'#8#11'BorderIcons'#11#12'biSystemMenu'#10'biMinimize'#10'biMaximize'#0#11
|
||||||
+'e'#0#11'BorderStyle'#7#10'bsSizeable'#11'BorderWidth'#2#0#7'Caption'#6#5'Fo'
|
+'BorderStyle'#7#10'bsSizeable'#11'BorderWidth'#2#0#7'Caption'#6#5'Form1'#12
|
||||||
+'rm1'#12'ClientHeight'#3'P'#2#11'ClientWidth'#3#240#2#14'DefaultMonitor'#7#12
|
+'ClientHeight'#3'T'#2#11'ClientWidth'#3#239#2#14'DefaultMonitor'#7#12'dmActi'
|
||||||
+'dmActiveForm'#8'DockSite'#8#8'DragKind'#7#6'dkDrag'#8'DragMode'#7#8'dmManua'
|
+'veForm'#8'DockSite'#8#8'DragKind'#7#6'dkDrag'#8'DragMode'#7#8'dmManual'#7'E'
|
||||||
+'l'#7'Enabled'#9#9'FormStyle'#7#8'fsNormal'#14'ParentBiDiMode'#9#10'ParentFo'
|
+'nabled'#9#9'FormStyle'#7#8'fsNormal'#8'OnCreate'#7#10'FormCreate'#14'Parent'
|
||||||
+'nt'#8#8'Position'#7#10'poDesigned'#13'ShowInTaskBar'#7#9'stDefault'#14'UseD'
|
+'BiDiMode'#9#10'ParentFont'#8#8'Position'#7#10'poDesigned'#13'ShowInTaskBar'
|
||||||
+'ockManager'#8#10'LCLVersion'#6#6'0.9.27'#11'WindowState'#7#8'wsNormal'#0#9
|
+#7#9'stDefault'#14'UseDockManager'#8#10'LCLVersion'#6#6'0.9.27'#11'WindowSta'
|
||||||
+'TRichMemo'#9'RichMemo1'#4'Left'#2' '#6'Height'#3#6#2#3'Top'#2#24#5'Width'#3
|
+'te'#7#8'wsNormal'#0#9'TRichMemo'#9'RichMemo1'#4'Left'#2'('#6'Height'#3#176#1
|
||||||
+' '#1#5'Align'#7#6'alNone'#9'Alignment'#7#13'taLeftJustify'#7'Anchors'#11#5
|
+#3'Top'#2' '#5'Width'#3#192#2#5'Align'#7#6'alNone'#9'Alignment'#7#13'taLeftJ'
|
||||||
+'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#11'BorderStyle'#7#8'bsSingle'#5'C'
|
+'ustify'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#11'Border'
|
||||||
+'olor'#7#8'clWindow'#10'DragCursor'#7#6'crDrag'#8'DragKind'#7#6'dkDrag'#8'Dr'
|
+'Style'#7#8'bsSingle'#5'Color'#7#8'clWindow'#10'DragCursor'#7#6'crDrag'#8'Dr'
|
||||||
+'agMode'#7#8'dmManual'#7'Enabled'#9#13'HideSelection'#8#13'Lines.Strings'#1#6
|
+'agKind'#7#6'dkDrag'#8'DragMode'#7#8'dmManual'#7'Enabled'#9#13'HideSelection'
|
||||||
+#9'RichMemo1'#0#9'MaxLength'#2#0#14'ParentBidiMode'#9#11'ParentColor'#8#10'P'
|
+#8#13'Lines.Strings'#1#6#9'RichMemo1'#0#9'MaxLength'#2#0#14'ParentBidiMode'#9
|
||||||
+'arentFont'#9#14'ParentShowHint'#9#8'ReadOnly'#8#10'ScrollBars'#7#6'ssBoth'#8
|
+#11'ParentColor'#8#10'ParentFont'#9#14'ParentShowHint'#9#8'ReadOnly'#8#10'Sc'
|
||||||
+'TabOrder'#2#0#7'TabStop'#9#7'Visible'#9#11'WantReturns'#9#8'WantTabs'#8#8'W'
|
+'rollBars'#7#6'ssBoth'#8'TabOrder'#2#0#7'TabStop'#9#7'Visible'#9#11'WantRetu'
|
||||||
+'ordWrap'#8#0#0#7'TButton'#7'Button1'#4'Left'#2#24#6'Height'#2#25#3'Top'#3'$'
|
+'rns'#9#8'WantTabs'#8#8'WordWrap'#8#0#0#7'TButton'#7'Button1'#4'Left'#2#24#6
|
||||||
+#2#5'Width'#3#152#0#5'Align'#7#6'alNone'#7'Anchors'#11#6'akLeft'#8'akBottom'
|
+'Height'#2#25#3'Top'#3#216#1#5'Width'#3#160#0#5'Align'#7#6'alNone'#7'Anchors'
|
||||||
+#0#8'AutoSize'#8#6'Cancel'#8#7'Caption'#6#17'Make Bold and Red'#5'Color'#7#9
|
+#11#6'akLeft'#8'akBottom'#0#8'AutoSize'#8#6'Cancel'#8#7'Caption'#6#17'Make B'
|
||||||
+'clBtnFace'#7'Default'#8#10'DragCursor'#7#6'crDrag'#8'DragKind'#7#6'dkDrag'#8
|
+'old and Red'#5'Color'#7#9'clBtnFace'#7'Default'#8#10'DragCursor'#7#6'crDrag'
|
||||||
+'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'
|
+#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
|
+'iMode'#9#11'ModalResult'#2#0#7'OnClick'#7#12'Button1Click'#10'ParentFont'#9
|
||||||
+#14'ParentShowHint'#9#8'TabOrder'#2#2#7'TabStop'#9#7'Visible'#9#0#0#7'TButto'
|
+#14'ParentShowHint'#9#8'TabOrder'#2#1#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
|
+'n'#7'Button2'#4'Left'#3#192#0#6'Height'#2#25#3'Top'#3#216#1#5'Width'#2'a'#5
|
||||||
+'Align'#7#6'alNone'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#8'AutoSize'#8#6'Ca'
|
+'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
|
+'ncel'#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
|
+'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'
|
+'Enabled'#9#14'ParentBidiMode'#9#11'ModalResult'#2#0#7'OnClick'#7#12'Button2'
|
||||||
+'Click'#10'ParentFont'#9#14'ParentShowHint'#9#8'TabOrder'#2#3#7'TabStop'#9#7
|
+'Click'#10'ParentFont'#9#14'ParentShowHint'#9#8'TabOrder'#2#2#7'TabStop'#9#7
|
||||||
+'Visible'#9#0#0#7'TButton'#7'Button4'#4'Left'#3#0#2#6'Height'#2#25#3'Top'#3
|
+'Visible'#9#0#0#7'TButton'#7'Button3'#4'Left'#3'0'#1#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'
|
+#216#1#5'Width'#2'`'#5'Align'#7#6'alNone'#7'Anchors'#11#6'akLeft'#8'akBottom'
|
||||||
+#6#6'Export'#5'Color'#7#9'clBtnFace'#7'Default'#8#10'DragCursor'#7#6'crDrag'
|
+#0#8'AutoSize'#8#6'Cancel'#8#7'Caption'#6#11'Select Font'#5'Color'#7#9'clBtn'
|
||||||
+#8'DragKind'#7#6'dkDrag'#8'DragMode'#7#8'dmManual'#7'Enabled'#9#14'ParentBid'
|
+'Face'#7'Default'#8#10'DragCursor'#7#6'crDrag'#8'DragKind'#7#6'dkDrag'#8'Dra'
|
||||||
+'iMode'#9#11'ModalResult'#2#0#7'OnClick'#7#12'Button4Click'#10'ParentFont'#9
|
+'gMode'#7#8'dmManual'#7'Enabled'#9#14'ParentBidiMode'#9#11'ModalResult'#2#0#7
|
||||||
+#14'ParentShowHint'#9#8'TabOrder'#2#4#7'TabStop'#9#7'Visible'#9#0#0#5'TMemo'
|
+'OnClick'#7#12'Button3Click'#10'ParentFont'#9#14'ParentShowHint'#9#8'TabOrde'
|
||||||
+#5'Memo1'#4'Left'#3'H'#1#6'Height'#3#250#1#3'Top'#2#24#5'Width'#3#152#1#5'Al'
|
+'r'#2#3#7'TabStop'#9#7'Visible'#9#0#0#7'TButton'#7'Button4'#4'Left'#2'p'#6'H'
|
||||||
+'ign'#7#6'alNone'#9'Alignment'#7#13'taLeftJustify'#11'BorderStyle'#7#8'bsSin'
|
+'eight'#2#25#3'Top'#3'('#2#5'Width'#2'K'#5'Align'#7#6'alNone'#8'AutoSize'#8#6
|
||||||
+'gle'#5'Color'#7#8'clWindow'#10'DragCursor'#7#6'crDrag'#8'DragKind'#7#6'dkDr'
|
+'Cancel'#8#7'Caption'#6#6'Export'#5'Color'#7#9'clBtnFace'#7'Default'#8#10'Dr'
|
||||||
+'ag'#8'DragMode'#7#8'dmManual'#7'Enabled'#9#13'Lines.Strings'#1#6#5'Memo1'#0
|
+'agCursor'#7#6'crDrag'#8'DragKind'#7#6'dkDrag'#8'DragMode'#7#8'dmManual'#7'E'
|
||||||
+#9'MaxLength'#2#0#14'ParentBidiMode'#9#11'ParentColor'#8#10'ParentFont'#9#14
|
+'nabled'#9#14'ParentBidiMode'#9#11'ModalResult'#2#0#7'OnClick'#7#12'Button4C'
|
||||||
+'ParentShowHint'#9#8'ReadOnly'#8#10'ScrollBars'#7#6'ssBoth'#8'TabOrder'#2#5#7
|
+'lick'#10'ParentFont'#9#14'ParentShowHint'#9#8'TabOrder'#2#4#7'TabStop'#9#7
|
||||||
+'TabStop'#9#7'Visible'#9#11'WantReturns'#9#8'WantTabs'#8#0#0#7'TButton'#7'Bu'
|
+'Visible'#9#0#0#7'TButton'#7'Button5'#4'Left'#2#24#6'Height'#2#25#3'Top'#3'('
|
||||||
+'tton5'#4'Left'#3'X'#2#6'Height'#2#25#3'Top'#3'#'#2#5'Width'#2'K'#5'Align'#7
|
+#2#5'Width'#2'K'#5'Align'#7#6'alNone'#8'AutoSize'#8#6'Cancel'#8#7'Caption'#6
|
||||||
+#6'alNone'#8'AutoSize'#8#6'Cancel'#8#7'Caption'#6#6'Import'#5'Color'#7#9'clB'
|
+#6'Import'#5'Color'#7#9'clBtnFace'#7'Default'#8#10'DragCursor'#7#6'crDrag'#8
|
||||||
+'tnFace'#7'Default'#8#10'DragCursor'#7#6'crDrag'#8'DragKind'#7#6'dkDrag'#8'D'
|
+'DragKind'#7#6'dkDrag'#8'DragMode'#7#8'dmManual'#7'Enabled'#9#14'ParentBidiM'
|
||||||
+'ragMode'#7#8'dmManual'#7'Enabled'#9#14'ParentBidiMode'#9#11'ModalResult'#2#0
|
+'ode'#9#11'ModalResult'#2#0#7'OnClick'#7#12'Button5Click'#10'ParentFont'#9#14
|
||||||
+#7'OnClick'#7#12'Button5Click'#10'ParentFont'#9#14'ParentShowHint'#9#8'TabOr'
|
+'ParentShowHint'#9#8'TabOrder'#2#5#7'TabStop'#9#7'Visible'#9#0#0#7'TButton'#7
|
||||||
+'der'#2#6#7'TabStop'#9#7'Visible'#9#0#0#11'TFontDialog'#11'FontDialog1'#11'M'
|
+'Button6'#4'Left'#2#24#6'Height'#2#25#3'Top'#3#248#1#5'Width'#3#160#0#5'Alig'
|
||||||
+'inFontSize'#2#0#11'MaxFontSize'#2#0#4'left'#3'H'#1#3'top'#3'p'#1#0#0#0
|
+'n'#7#6'alNone'#8'AutoSize'#8#6'Cancel'#8#7'Caption'#6#16'Next Style Range'#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'Mo'
|
||||||
|
+'dalResult'#2#0#7'OnClick'#7#12'Button6Click'#10'ParentFont'#9#14'ParentShow'
|
||||||
|
+'Hint'#9#8'TabOrder'#2#6#7'TabStop'#9#7'Visible'#9#0#0#11'TFontDialog'#11'Fo'
|
||||||
|
+'ntDialog1'#11'MinFontSize'#2#0#11'MaxFontSize'#2#0#4'left'#3#184#2#3'top'#3
|
||||||
|
+#216#1#0#0#11'TSaveDialog'#11'SaveDialog1'#10'DefaultExt'#6#4'.rtf'#6'Filter'
|
||||||
|
+#6#27'RichText file (*.rtf)|*.rtf'#7'Options'#11#17'ofOverwritePrompt'#14'of'
|
||||||
|
+'EnableSizing'#12'ofViewDetail'#0#4'left'#3'h'#2#3'top'#3#216#1#0#0#11'TOpen'
|
||||||
|
+'Dialog'#11'OpenDialog1'#10'DefaultExt'#6#4'.rtf'#6'Filter'#6#27'RichText fi'
|
||||||
|
+'le (*.rtf)|*.rtf'#4'left'#3#24#2#3'top'#3#216#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,
|
StdCtrls, ExtCtrls, ComCtrls,
|
||||||
RichMemoTypes, RichMemo;
|
RichMemoTypes, RichMemo;
|
||||||
|
|
||||||
type
|
type
|
||||||
@ -19,14 +19,18 @@ type
|
|||||||
Button3: TButton;
|
Button3: TButton;
|
||||||
Button4: TButton;
|
Button4: TButton;
|
||||||
Button5: TButton;
|
Button5: TButton;
|
||||||
|
Button6: TButton;
|
||||||
FontDialog1: TFontDialog;
|
FontDialog1: TFontDialog;
|
||||||
Memo1: TMemo;
|
OpenDialog1: TOpenDialog;
|
||||||
RichMemo1: TRichMemo;
|
RichMemo1: TRichMemo;
|
||||||
|
SaveDialog1: TSaveDialog;
|
||||||
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 FormCreate(Sender: TObject);
|
||||||
private
|
private
|
||||||
{ private declarations }
|
{ private declarations }
|
||||||
public
|
public
|
||||||
@ -71,30 +75,50 @@ end;
|
|||||||
|
|
||||||
procedure TForm1.Button4Click(Sender: TObject);
|
procedure TForm1.Button4Click(Sender: TObject);
|
||||||
var
|
var
|
||||||
m : TMemoryStream;
|
fs : TFileStream;
|
||||||
begin
|
begin
|
||||||
m := TMemoryStream.Create;
|
if OpenDialog1.Execute then begin
|
||||||
|
fs := nil;
|
||||||
try
|
try
|
||||||
RichMemo1.SaveRichText(m);
|
fs := TFileStream.Create(OpenDialog1.FileName, fmCreate);
|
||||||
m.Position:=0;
|
RichMemo1.SaveRichText(fs);
|
||||||
Memo1.Lines.LoadFromStream(m);
|
|
||||||
except
|
except
|
||||||
m.Free;
|
end;
|
||||||
|
fs.Free;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TForm1.Button5Click(Sender: TObject);
|
procedure TForm1.Button5Click(Sender: TObject);
|
||||||
var
|
var
|
||||||
m : TMemoryStream;
|
fs : TFileStream;
|
||||||
begin
|
begin
|
||||||
m := TMemoryStream.Create;
|
if OpenDialog1.Execute then begin
|
||||||
|
fs := nil;
|
||||||
try
|
try
|
||||||
Memo1.Lines.SaveToStream(m);
|
fs := TFileStream.Create(OpenDialog1.FileName, fmOpenRead or fmShareDenyNone);
|
||||||
m.Position := 0;
|
RichMemo1.LoadRichText(fs);
|
||||||
RichMemo1.LoadRichText(m);
|
except
|
||||||
finally
|
|
||||||
m.free;
|
|
||||||
end;
|
end;
|
||||||
|
fs.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.Button6Click(Sender: TObject);
|
||||||
|
var
|
||||||
|
ofs, len : Integer;
|
||||||
|
begin
|
||||||
|
RichMemo1.GetStyleRange( RichMemo1.SelStart, ofs, len );
|
||||||
|
if (ofs = RichMEmo1.SelStart) and (len = RichMemo1.SelLength) then begin
|
||||||
|
ofs := ofs + len + 1;
|
||||||
|
RichMemo1.GetStyleRange( ofs, ofs, len );
|
||||||
|
end;
|
||||||
|
RichMemo1.SelStart := ofs;
|
||||||
|
RichMemo1.SelLength := len;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
|
@ -18,6 +18,7 @@ type
|
|||||||
|
|
||||||
TWSCustomRichMemo = class(TWSCustomMemo)
|
TWSCustomRichMemo = class(TWSCustomMemo)
|
||||||
published
|
published
|
||||||
|
class function GetStyleRange(const AWinControl: TWinControl; TextStart: Integer; var RangeStart, RangeLen: Integer): Boolean; virtual;
|
||||||
class function GetTextAttributes(const AWinControl: TWinControl; TextStart: Integer;
|
class function GetTextAttributes(const AWinControl: TWinControl; TextStart: Integer;
|
||||||
var Params: TFontParams): Boolean; virtual;
|
var Params: TFontParams): Boolean; virtual;
|
||||||
class procedure SetTextAttributes(const AWinControl: TWinControl; TextStart, TextLen: Integer;
|
class procedure SetTextAttributes(const AWinControl: TWinControl; TextStart, TextLen: Integer;
|
||||||
@ -37,6 +38,14 @@ implementation
|
|||||||
|
|
||||||
{ TWSCustomRichMemo }
|
{ TWSCustomRichMemo }
|
||||||
|
|
||||||
|
class function TWSCustomRichMemo.GetStyleRange(const AWinControl: TWinControl;
|
||||||
|
TextStart: Integer; var RangeStart, RangeLen: Integer): Boolean;
|
||||||
|
begin
|
||||||
|
RangeStart :=-1;
|
||||||
|
RangeLen := -1;
|
||||||
|
Result := false;
|
||||||
|
end;
|
||||||
|
|
||||||
class function TWSCustomRichMemo.GetTextAttributes(const AWinControl: TWinControl;
|
class function TWSCustomRichMemo.GetTextAttributes(const AWinControl: TWinControl;
|
||||||
TextStart: Integer; var Params: TFontParams): Boolean;
|
TextStart: Integer; var Params: TFontParams): Boolean;
|
||||||
begin
|
begin
|
||||||
|
Reference in New Issue
Block a user