mirror of https://gitlab.com/basile.b/dexed.git
Merge branch 'a12_2_a13'
This commit is contained in:
commit
1610f07dbc
|
@ -140,7 +140,7 @@
|
||||||
<PackageName Value="LCL"/>
|
<PackageName Value="LCL"/>
|
||||||
</Item6>
|
</Item6>
|
||||||
</RequiredPackages>
|
</RequiredPackages>
|
||||||
<Units Count="34">
|
<Units Count="35">
|
||||||
<Unit0>
|
<Unit0>
|
||||||
<Filename Value="coedit.lpr"/>
|
<Filename Value="coedit.lpr"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
|
@ -356,6 +356,11 @@
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<UnitName Value="ce_optionseditor"/>
|
<UnitName Value="ce_optionseditor"/>
|
||||||
</Unit33>
|
</Unit33>
|
||||||
|
<Unit34>
|
||||||
|
<Filename Value="..\src\ce_editoroptions.pas"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
<UnitName Value="ce_editoroptions"/>
|
||||||
|
</Unit34>
|
||||||
</Units>
|
</Units>
|
||||||
</ProjectOptions>
|
</ProjectOptions>
|
||||||
<CompilerOptions>
|
<CompilerOptions>
|
||||||
|
|
|
@ -8,7 +8,7 @@ uses
|
||||||
{$ENDIF}{$ENDIF}
|
{$ENDIF}{$ENDIF}
|
||||||
Interfaces, Forms, lazcontrols, runtimetypeinfocontrols, ce_observer, ce_libman,
|
Interfaces, Forms, lazcontrols, runtimetypeinfocontrols, ce_observer, ce_libman,
|
||||||
ce_tools, ce_dcd, ce_main, ce_writableComponent, ce_options, ce_symstring,
|
ce_tools, ce_dcd, ce_main, ce_writableComponent, ce_options, ce_symstring,
|
||||||
ce_staticmacro, ce_inspectors, LResources;
|
ce_staticmacro, ce_inspectors, LResources, ce_editoroptions;
|
||||||
|
|
||||||
{$R *.res}
|
{$R *.res}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,238 @@
|
||||||
|
unit ce_editoroptions;
|
||||||
|
|
||||||
|
{$I ce_defines.inc}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Classes, SysUtils, Graphics, SynEdit, SynEditMouseCmds,
|
||||||
|
ce_interfaces, ce_observer, ce_common, ce_writableComponent, ce_synmemo,
|
||||||
|
ce_d2syn, ce_txtsyn;
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
TDHighligthOptions = class(TPersistent)
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
TTxtHighligthOptions = class(TPersistent)
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
(**
|
||||||
|
* Container for the editor and highlither options.
|
||||||
|
* The base class is also used to backup settings
|
||||||
|
* to allow settings to be previewed in live and restored
|
||||||
|
* when not accepted.
|
||||||
|
*)
|
||||||
|
TCEEditorOptionsBase = class(TWritableLfmTextComponent)
|
||||||
|
private
|
||||||
|
fDHlOptions: TPersistent;
|
||||||
|
fTxtHlOptions: TPersistent;
|
||||||
|
fFont: TFont;
|
||||||
|
//
|
||||||
|
fTabWidth: Integer;
|
||||||
|
fBlockIdent: Integer;
|
||||||
|
fLineSpacing: Integer;
|
||||||
|
fCharSpacing: Integer;
|
||||||
|
fOptions1: TSynEditorOptions;
|
||||||
|
fOptions2: TSynEditorOptions2;
|
||||||
|
fMouseOptions: TSynEditorMouseOptions;
|
||||||
|
//
|
||||||
|
procedure setFont(aFont: TFont);
|
||||||
|
published
|
||||||
|
property tabulationWidth: Integer read fTabWidth write fTabWidth;
|
||||||
|
property blockIdentation: Integer read fBlockIdent write fBlockIdent;
|
||||||
|
property lineSpacing: Integer read fLineSpacing write fLineSpacing;
|
||||||
|
property characterSpacing: Integer read fCharSpacing write fCharSpacing;
|
||||||
|
property font: TFont read fFont write setFont;
|
||||||
|
property options1: TSynEditorOptions read fOptions1 write fOptions1;
|
||||||
|
property options2: TSynEditorOptions2 read fOptions2 write fOptions2;
|
||||||
|
property mouseOptions: TSynEditorMouseOptions read fMouseOptions write fMouseOptions;
|
||||||
|
|
||||||
|
property D_colorizer: TPersistent read fDHlOptions;
|
||||||
|
property TXT_colorizer: TPersistent read fTxtHlOptions;
|
||||||
|
public
|
||||||
|
constructor Create(AOwner: TComponent); override;
|
||||||
|
//
|
||||||
|
procedure assign(src: TPersistent); override;
|
||||||
|
end;
|
||||||
|
|
||||||
|
(**
|
||||||
|
* Manages and exposes all the editor and highligther options to an TCEOptionsEditor.
|
||||||
|
*)
|
||||||
|
TCEEditorOptions = class(TCEEditorOptionsBase, ICEEditableOptions, ICEMultiDocObserver)
|
||||||
|
private
|
||||||
|
fBackup: TCEEditorOptionsBase;
|
||||||
|
//
|
||||||
|
function optionedWantCategory(): string;
|
||||||
|
function optionedWantEditorKind: TOptionEditorKind;
|
||||||
|
function optionedWantContainer: TPersistent;
|
||||||
|
procedure optionedEvent(anEvent: TOptionEditorEvent);
|
||||||
|
//
|
||||||
|
procedure docNew(aDoc: TCESynMemo);
|
||||||
|
procedure docFocused(aDoc: TCESynMemo);
|
||||||
|
procedure docChanged(aDoc: TCESynMemo);
|
||||||
|
procedure docClosing(aDoc: TCESynMemo);
|
||||||
|
//
|
||||||
|
procedure applyChangesFromSelf;
|
||||||
|
procedure applyChangeToEditor(anEditor: TCESynMemo);
|
||||||
|
public
|
||||||
|
constructor Create(AOwner: TComponent); override;
|
||||||
|
destructor Destroy; override;
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
EditorOptions: TCEEditorOptions;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{$REGION Standard Comp/Obj -----------------------------------------------------}
|
||||||
|
constructor TCEEditorOptionsBase.Create(AOwner: TComponent);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
fDHlOptions := D2Syn;
|
||||||
|
fTxtHlOptions := TxtSyn;
|
||||||
|
//
|
||||||
|
fFont := TFont.Create;
|
||||||
|
fFont.Size := 10;
|
||||||
|
fFont.Name := 'Courier New';
|
||||||
|
fFont.Quality := fqProof;
|
||||||
|
fFont.Pitch := fpFixed;
|
||||||
|
fFont.Size:= 10;
|
||||||
|
//
|
||||||
|
tabulationWidth := 4;
|
||||||
|
blockIdentation := 4;
|
||||||
|
//
|
||||||
|
options1 :=
|
||||||
|
[eoAutoIndent, eoBracketHighlight, eoGroupUndo, eoTabsToSpaces,
|
||||||
|
eoDragDropEditing, eoShowCtrlMouseLinks, eoEnhanceHomeKey, eoTabIndent];
|
||||||
|
options2 :=
|
||||||
|
[eoEnhanceEndKey, eoFoldedCopyPaste, eoOverwriteBlock];
|
||||||
|
//
|
||||||
|
mouseOptions := MouseOptions +
|
||||||
|
[emAltSetsColumnMode, emDragDropEditing, emCtrlWheelZoom, emShowCtrlMouseLinks];
|
||||||
|
end;
|
||||||
|
|
||||||
|
constructor TCEEditorOptions.Create(AOwner: TComponent);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
fBackup := TCEEditorOptionsBase.Create(self);
|
||||||
|
EntitiesConnector.addObserver(self);
|
||||||
|
end;
|
||||||
|
|
||||||
|
destructor TCEEditorOptions.Destroy;
|
||||||
|
begin
|
||||||
|
EntitiesConnector.removeObserver(self);
|
||||||
|
inherited;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCEEditorOptionsBase.assign(src: TPersistent);
|
||||||
|
var
|
||||||
|
srcopt: TCEEditorOptionsBase;
|
||||||
|
begin
|
||||||
|
if (src is TCEEditorOptionsBase) then
|
||||||
|
begin
|
||||||
|
srcopt := TCEEditorOptionsBase(src);
|
||||||
|
//
|
||||||
|
font.Assign(srcopt.font);
|
||||||
|
tabulationWidth := srcopt.tabulationWidth;
|
||||||
|
blockIdentation := srcopt.blockIdentation;
|
||||||
|
lineSpacing := srcopt.lineSpacing;
|
||||||
|
characterSpacing:= srcopt.characterSpacing;
|
||||||
|
options1 := srcopt.options1;
|
||||||
|
options2 := srcopt.options2;
|
||||||
|
mouseOptions := srcopt.mouseOptions;
|
||||||
|
end
|
||||||
|
else inherited;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCEEditorOptionsBase.setFont(aFont: TFont);
|
||||||
|
begin
|
||||||
|
fFont.Assign(aFont);
|
||||||
|
end;
|
||||||
|
{$ENDREGION}
|
||||||
|
|
||||||
|
{$REGION ICEMultiDocObserver ----------------------------------------------------}
|
||||||
|
procedure TCEEditorOptions.docNew(aDoc: TCESynMemo);
|
||||||
|
begin
|
||||||
|
applyChangeToEditor(aDoc);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCEEditorOptions.docFocused(aDoc: TCESynMemo);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCEEditorOptions.docChanged(aDoc: TCESynMemo);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCEEditorOptions.docClosing(aDoc: TCESynMemo);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
{$ENDREGION}
|
||||||
|
|
||||||
|
{$REGION ICEEditableOptions ----------------------------------------------------}
|
||||||
|
function TCEEditorOptions.optionedWantCategory(): string;
|
||||||
|
begin
|
||||||
|
exit('Editor');
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TCEEditorOptions.optionedWantEditorKind: TOptionEditorKind;
|
||||||
|
begin
|
||||||
|
exit(oekAbstract);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TCEEditorOptions.optionedWantContainer: TPersistent;
|
||||||
|
begin
|
||||||
|
fBackup.Assign(self);
|
||||||
|
exit(self);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCEEditorOptions.optionedEvent(anEvent: TOptionEditorEvent);
|
||||||
|
begin
|
||||||
|
// restores
|
||||||
|
if anEvent = oeeCancel then
|
||||||
|
self.assign(fBackup);
|
||||||
|
// apply
|
||||||
|
applyChangesFromSelf;
|
||||||
|
// new backup values based on accepted values.
|
||||||
|
if anEvent = oeeAccept then
|
||||||
|
fBackup.assign(self);
|
||||||
|
end;
|
||||||
|
{$ENDREGION}
|
||||||
|
|
||||||
|
{$REGION ICEEditableOptions ----------------------------------------------------}
|
||||||
|
procedure TCEEditorOptions.applyChangesFromSelf;
|
||||||
|
var
|
||||||
|
multied: ICEMultiDocHandler;
|
||||||
|
i: Integer;
|
||||||
|
begin
|
||||||
|
// editors
|
||||||
|
multied := getMultiDocHandler;
|
||||||
|
for i := 0 to multied.documentCount-1 do
|
||||||
|
applyChangeToEditor(multied.document[i]);
|
||||||
|
// highlighter(s)
|
||||||
|
// ...
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCEEditorOptions.applyChangeToEditor(anEditor: TCESynMemo);
|
||||||
|
begin
|
||||||
|
anEditor.Font.Assign(font);
|
||||||
|
anEditor.TabWidth := tabulationWidth;
|
||||||
|
anEditor.BlockIndent := blockIdentation;
|
||||||
|
anEditor.ExtraLineSpacing := lineSpacing;
|
||||||
|
anEditor.ExtraCharSpacing := characterSpacing;
|
||||||
|
anEditor.Options := options1;
|
||||||
|
anEditor.Options2 := options2;
|
||||||
|
anEditor.MouseOptions := mouseOptions;
|
||||||
|
end;
|
||||||
|
{$ENDREGION}
|
||||||
|
|
||||||
|
|
||||||
|
initialization
|
||||||
|
EditorOptions := TCEEditorOptions.Create(nil);
|
||||||
|
finalization
|
||||||
|
EditorOptions.Free;
|
||||||
|
end.
|
||||||
|
|
|
@ -469,6 +469,7 @@ begin
|
||||||
|
|
||||||
for i := 0 to fWidgList.Count-1 do
|
for i := 0 to fWidgList.Count-1 do
|
||||||
begin
|
begin
|
||||||
|
if not fWidgList.widget[i].isDockable then continue;
|
||||||
DockMaster.MakeDockable(fWidgList.widget[i], not fileExists(getCoeditDocPath + 'docking.xml'));
|
DockMaster.MakeDockable(fWidgList.widget[i], not fileExists(getCoeditDocPath + 'docking.xml'));
|
||||||
DockMaster.GetAnchorSite(fWidgList.widget[i]).Header.HeaderPosition := adlhpTop;
|
DockMaster.GetAnchorSite(fWidgList.widget[i]).Header.HeaderPosition := adlhpTop;
|
||||||
end;
|
end;
|
||||||
|
@ -544,6 +545,7 @@ begin
|
||||||
// does not save minimized/undocked windows to prevent bugs
|
// does not save minimized/undocked windows to prevent bugs
|
||||||
for i:= 0 to fWidgList.Count-1 do
|
for i:= 0 to fWidgList.Count-1 do
|
||||||
begin
|
begin
|
||||||
|
if not fWidgList.widget[i].isDockable then continue;
|
||||||
if DockMaster.GetAnchorSite(fWidgList.widget[i]).WindowState = wsMinimized then
|
if DockMaster.GetAnchorSite(fWidgList.widget[i]).WindowState = wsMinimized then
|
||||||
DockMaster.GetAnchorSite(fWidgList.widget[i]).Close
|
DockMaster.GetAnchorSite(fWidgList.widget[i]).Close
|
||||||
else if DockMaster.GetAnchorSite(fWidgList.widget[i]).SiteType = adhstNone then
|
else if DockMaster.GetAnchorSite(fWidgList.widget[i]).SiteType = adhstNone then
|
||||||
|
@ -1366,7 +1368,12 @@ var
|
||||||
begin
|
begin
|
||||||
widg := TCEWidget( TComponent(sender).tag );
|
widg := TCEWidget( TComponent(sender).tag );
|
||||||
if widg = nil then exit;
|
if widg = nil then exit;
|
||||||
win := DockMaster.GetAnchorSite(widg);
|
//
|
||||||
|
if widg.isDockable then
|
||||||
|
win := DockMaster.GetAnchorSite(widg)
|
||||||
|
else
|
||||||
|
win := widg;
|
||||||
|
//
|
||||||
if win = nil then exit;
|
if win = nil then exit;
|
||||||
win.Show;
|
win.Show;
|
||||||
win.BringToFront;
|
win.BringToFront;
|
||||||
|
@ -1395,6 +1402,7 @@ begin
|
||||||
// TODO-cLCL&LAZ-specific: possible loading AV, xml saved after undocking some widgets, xml file abnormal size.
|
// TODO-cLCL&LAZ-specific: possible loading AV, xml saved after undocking some widgets, xml file abnormal size.
|
||||||
for i:= 0 to fWidgList.Count-1 do
|
for i:= 0 to fWidgList.Count-1 do
|
||||||
begin
|
begin
|
||||||
|
if not fWidgList.widget[i].isDockable then continue;
|
||||||
if DockMaster.GetAnchorSite(fWidgList.widget[i]).WindowState = wsMinimized then
|
if DockMaster.GetAnchorSite(fWidgList.widget[i]).WindowState = wsMinimized then
|
||||||
DockMaster.GetAnchorSite(fWidgList.widget[i]).Close
|
DockMaster.GetAnchorSite(fWidgList.widget[i]).Close
|
||||||
else if DockMaster.GetAnchorSite(fWidgList.widget[i]).SiteType = adhstNone then
|
else if DockMaster.GetAnchorSite(fWidgList.widget[i]).SiteType = adhstNone then
|
||||||
|
|
|
@ -6,7 +6,7 @@ interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, ComCtrls,
|
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, ComCtrls,
|
||||||
lcltype, ce_widget, ActnList, Menus, clipbrd, AnchorDocking, Buttons,
|
lcltype, ce_widget, ActnList, Menus, clipbrd, AnchorDocking, Buttons, ce_writableComponent,
|
||||||
ce_common, ce_project, ce_synmemo, ce_dlangutils, ce_interfaces, ce_observer;
|
ce_common, ce_project, ce_synmemo, ce_dlangutils, ce_interfaces, ce_observer;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
@ -20,7 +20,7 @@ type
|
||||||
data: Pointer;
|
data: Pointer;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TCEMessagesOptions = class(TPersistent)
|
TCEMessagesOptions = class(TWritableLfmTextComponent)
|
||||||
private
|
private
|
||||||
fMaxCount: Integer;
|
fMaxCount: Integer;
|
||||||
fAutoSelect: boolean;
|
fAutoSelect: boolean;
|
||||||
|
@ -74,9 +74,9 @@ type
|
||||||
function iconIndex(aKind: TCEAppMessageKind): Integer;
|
function iconIndex(aKind: TCEAppMessageKind): Integer;
|
||||||
//
|
//
|
||||||
procedure optset_MaxMessageCount(aReader: TReader);
|
procedure optset_MaxMessageCount(aReader: TReader);
|
||||||
procedure optget_MaxMessageCount(awriter: TWriter);
|
procedure optget_MaxMessageCount(aWriter: TWriter);
|
||||||
procedure optset_AutoSelect(aReader: TReader);
|
procedure optset_AutoSelect(aReader: TReader);
|
||||||
procedure optget_AutoSelect(awriter: TWriter);
|
procedure optget_AutoSelect(aWriter: TWriter);
|
||||||
//
|
//
|
||||||
procedure projNew(aProject: TCEProject);
|
procedure projNew(aProject: TCEProject);
|
||||||
procedure projClosing(aProject: TCEProject);
|
procedure projClosing(aProject: TCEProject);
|
||||||
|
@ -124,7 +124,7 @@ implementation
|
||||||
{$REGION Standard Comp/Obj------------------------------------------------------}
|
{$REGION Standard Comp/Obj------------------------------------------------------}
|
||||||
constructor TCEMessagesWidget.create(aOwner: TComponent);
|
constructor TCEMessagesWidget.create(aOwner: TComponent);
|
||||||
begin
|
begin
|
||||||
fMaxMessCnt := 125;
|
fMaxMessCnt := 500;
|
||||||
fCtxt := amcAll;
|
fCtxt := amcAll;
|
||||||
//
|
//
|
||||||
fActAutoSel := TAction.Create(self);
|
fActAutoSel := TAction.Create(self);
|
||||||
|
@ -149,7 +149,9 @@ begin
|
||||||
//
|
//
|
||||||
inherited;
|
inherited;
|
||||||
//
|
//
|
||||||
fEditableOptions := TCEMessagesOptions.Create;
|
fEditableOptions := TCEMessagesOptions.Create(Self);
|
||||||
|
fEditableOptions.Name:= 'messageOptions';
|
||||||
|
//
|
||||||
List.PopupMenu := contextMenu;
|
List.PopupMenu := contextMenu;
|
||||||
List.OnDeletion := @ListDeletion;
|
List.OnDeletion := @ListDeletion;
|
||||||
//
|
//
|
||||||
|
@ -173,7 +175,6 @@ end;
|
||||||
destructor TCEMessagesWidget.destroy;
|
destructor TCEMessagesWidget.destroy;
|
||||||
begin
|
begin
|
||||||
EntitiesConnector.removeObserver(self);
|
EntitiesConnector.removeObserver(self);
|
||||||
fEditableOptions.Free;
|
|
||||||
Inherited;
|
Inherited;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -250,6 +251,7 @@ begin
|
||||||
begin
|
begin
|
||||||
fMaxMessCnt := fEditableOptions.maxMessageCount;
|
fMaxMessCnt := fEditableOptions.maxMessageCount;
|
||||||
fActAutoSel.Checked := fEditableOptions.autoSelect;
|
fActAutoSel.Checked := fEditableOptions.autoSelect;
|
||||||
|
clearOutOfRangeMessg;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
|
@ -257,10 +259,8 @@ end;
|
||||||
{$REGION ICESessionOptionsObserver ---------------------------------------------}
|
{$REGION ICESessionOptionsObserver ---------------------------------------------}
|
||||||
procedure TCEMessagesWidget.setMaxMessageCount(aValue: Integer);
|
procedure TCEMessagesWidget.setMaxMessageCount(aValue: Integer);
|
||||||
begin
|
begin
|
||||||
if aValue < 10 then
|
if aValue < 5 then
|
||||||
aValue := 10;
|
aValue := 5;
|
||||||
if aValue > 1023 then
|
|
||||||
aValue := 1023;
|
|
||||||
if fMaxMessCnt = aValue then
|
if fMaxMessCnt = aValue then
|
||||||
exit;
|
exit;
|
||||||
fMaxMessCnt := aValue;
|
fMaxMessCnt := aValue;
|
||||||
|
@ -283,9 +283,9 @@ begin
|
||||||
fActAutoSel.Checked := fAutoSelect;
|
fActAutoSel.Checked := fAutoSelect;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCEMessagesWidget.optget_AutoSelect(awriter: TWriter);
|
procedure TCEMessagesWidget.optget_AutoSelect(aWriter: TWriter);
|
||||||
begin
|
begin
|
||||||
awriter.WriteBoolean(fAutoSelect);
|
aWriter.WriteBoolean(fAutoSelect);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCEMessagesWidget.sesoptDeclareProperties(aFiler: TFiler);
|
procedure TCEMessagesWidget.sesoptDeclareProperties(aFiler: TFiler);
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
inherited CEOptionEditorWidget: TCEOptionEditorWidget
|
inherited CEOptionEditorWidget: TCEOptionEditorWidget
|
||||||
Left = 626
|
Left = 594
|
||||||
Height = 377
|
Height = 377
|
||||||
Top = 270
|
Top = 257
|
||||||
Width = 548
|
Width = 548
|
||||||
|
BorderIcons = [biSystemMenu, biMinimize, biMaximize]
|
||||||
Caption = 'Options editor'
|
Caption = 'Options editor'
|
||||||
ClientHeight = 377
|
ClientHeight = 377
|
||||||
ClientWidth = 548
|
ClientWidth = 548
|
||||||
|
FormStyle = fsSystemStayOnTop
|
||||||
inherited Back: TPanel
|
inherited Back: TPanel
|
||||||
Height = 377
|
Height = 377
|
||||||
Width = 548
|
Width = 548
|
||||||
|
@ -31,7 +33,7 @@ inherited CEOptionEditorWidget: TCEOptionEditorWidget
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 335
|
Height = 335
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 193
|
Width = 140
|
||||||
Align = alLeft
|
Align = alLeft
|
||||||
DefaultItemHeight = 18
|
DefaultItemHeight = 18
|
||||||
ScrollBars = ssAutoBoth
|
ScrollBars = ssAutoBoth
|
||||||
|
@ -40,31 +42,32 @@ inherited CEOptionEditorWidget: TCEOptionEditorWidget
|
||||||
OnSelectionChanged = selCatSelectionChanged
|
OnSelectionChanged = selCatSelectionChanged
|
||||||
end
|
end
|
||||||
object pnlEd: TPanel
|
object pnlEd: TPanel
|
||||||
Left = 199
|
Left = 146
|
||||||
Height = 335
|
Height = 335
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 341
|
Width = 394
|
||||||
Align = alClient
|
Align = alClient
|
||||||
BevelOuter = bvNone
|
BevelOuter = bvNone
|
||||||
ClientHeight = 335
|
ClientHeight = 335
|
||||||
ClientWidth = 341
|
ClientWidth = 394
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
object inspector: TTIPropertyGrid
|
object inspector: TTIPropertyGrid
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 335
|
Height = 335
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 341
|
Width = 394
|
||||||
Align = alClient
|
Align = alClient
|
||||||
DefaultValueFont.Color = clWindowText
|
DefaultValueFont.Color = clWindowText
|
||||||
Filter = [tkInteger, tkChar, tkEnumeration, tkFloat, tkSet, tkMethod, tkSString, tkLString, tkAString, tkWString, tkVariant, tkArray, tkRecord, tkInterface, tkClass, tkObject, tkWChar, tkBool, tkInt64, tkQWord, tkDynArray, tkInterfaceRaw, tkProcVar, tkUString, tkUChar, tkHelper]
|
Filter = [tkInteger, tkChar, tkEnumeration, tkFloat, tkSet, tkMethod, tkSString, tkLString, tkAString, tkWString, tkVariant, tkArray, tkRecord, tkInterface, tkClass, tkObject, tkWChar, tkBool, tkInt64, tkQWord, tkDynArray, tkInterfaceRaw, tkProcVar, tkUString, tkUChar, tkHelper]
|
||||||
Indent = 16
|
Indent = 16
|
||||||
NameFont.Color = clWindowText
|
NameFont.Color = clWindowText
|
||||||
OnModified = inspectorModified
|
OnModified = inspectorModified
|
||||||
|
SplitterX = 200
|
||||||
ValueFont.Color = clMaroon
|
ValueFont.Color = clMaroon
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object Splitter1: TSplitter
|
object Splitter1: TSplitter
|
||||||
Left = 193
|
Left = 140
|
||||||
Height = 335
|
Height = 335
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 6
|
Width = 6
|
||||||
|
|
|
@ -51,6 +51,7 @@ var
|
||||||
png: TPortableNetworkGraphic;
|
png: TPortableNetworkGraphic;
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
|
fDockable := false;
|
||||||
fEdOptsSubj := TCEEditableOptionsSubject.create;
|
fEdOptsSubj := TCEEditableOptionsSubject.create;
|
||||||
//
|
//
|
||||||
png := TPortableNetworkGraphic.Create;
|
png := TPortableNetworkGraphic.Create;
|
||||||
|
@ -149,6 +150,9 @@ begin
|
||||||
PCategoryData(selCat.Selected.Data)^
|
PCategoryData(selCat.Selected.Data)^
|
||||||
.observer
|
.observer
|
||||||
.optionedEvent(oeeCancel);
|
.optionedEvent(oeeCancel);
|
||||||
|
//
|
||||||
|
// if generic editor then
|
||||||
|
// refresh displayed value since the provider may have updated the options container
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCEOptionEditorWidget.btnAcceptClick(Sender: TObject);
|
procedure TCEOptionEditorWidget.btnAcceptClick(Sender: TObject);
|
||||||
|
|
|
@ -7,7 +7,8 @@ interface
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, SynEdit, ce_d2syn, ce_txtsyn ,SynEditHighlighter, controls,
|
Classes, SysUtils, SynEdit, ce_d2syn, ce_txtsyn ,SynEditHighlighter, controls,
|
||||||
lcltype, LazSynEditText, SynEditKeyCmds, SynHighlighterLFM, SynEditMouseCmds,
|
lcltype, LazSynEditText, SynEditKeyCmds, SynHighlighterLFM, SynEditMouseCmds,
|
||||||
SynEditFoldedView, crc, ce_common, ce_observer, ce_writableComponent, Forms;
|
SynEditFoldedView, crc, ce_common, ce_observer, ce_writableComponent, Forms,
|
||||||
|
graphics;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
|
@ -129,9 +130,7 @@ var
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
graphics, ce_interfaces, ce_staticmacro, ce_dcd, SynEditHighlighterFoldBase;
|
ce_interfaces, ce_staticmacro, ce_dcd, SynEditHighlighterFoldBase;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
constructor TCEEditorHintWindow.Create(AOwner: TComponent);
|
constructor TCEEditorHintWindow.Create(AOwner: TComponent);
|
||||||
begin
|
begin
|
||||||
|
@ -318,20 +317,7 @@ constructor TCESynMemo.Create(aOwner: TComponent);
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
SetDefaultKeystrokes; // not called in inherited if owner = nil !
|
SetDefaultKeystrokes; // not called in inherited if owner = nil !
|
||||||
Font.Quality := fqProof;
|
fStoredFontSize := 10;
|
||||||
Font.Pitch := fpFixed;
|
|
||||||
Font.Size:= 10;
|
|
||||||
TabWidth := 4;
|
|
||||||
BlockIndent := 4;
|
|
||||||
Options :=
|
|
||||||
[eoAutoIndent, eoBracketHighlight, eoGroupUndo, eoTabsToSpaces,
|
|
||||||
eoDragDropEditing, eoShowCtrlMouseLinks, eoEnhanceHomeKey, eoTabIndent];
|
|
||||||
Options2 :=
|
|
||||||
[eoEnhanceEndKey, eoFoldedCopyPaste, eoOverwriteBlock];
|
|
||||||
fStoredFontSize := Font.Size;
|
|
||||||
|
|
||||||
MouseOptions := MouseOptions +
|
|
||||||
[emAltSetsColumnMode, emDragDropEditing, emCtrlWheelZoom, emShowCtrlMouseLinks];
|
|
||||||
Gutter.LineNumberPart.ShowOnlyLineNumbersMultiplesOf := 5;
|
Gutter.LineNumberPart.ShowOnlyLineNumbersMultiplesOf := 5;
|
||||||
Gutter.LineNumberPart.MarkupInfo.Foreground := clGray;
|
Gutter.LineNumberPart.MarkupInfo.Foreground := clGray;
|
||||||
Gutter.SeparatorPart.LineOffset := 1;
|
Gutter.SeparatorPart.LineOffset := 1;
|
||||||
|
@ -541,10 +527,11 @@ end;
|
||||||
|
|
||||||
procedure TCESynMemo.MouseMove(Shift: TShiftState; X, Y: Integer);
|
procedure TCESynMemo.MouseMove(Shift: TShiftState; X, Y: Integer);
|
||||||
begin
|
begin
|
||||||
|
fMousePos := PixelsToRowColumn(Point(X,Y));
|
||||||
|
Application.HideHint;
|
||||||
inherited;
|
inherited;
|
||||||
if ssLeft in Shift then
|
if ssLeft in Shift then
|
||||||
identifierToD2Syn;
|
identifierToD2Syn;
|
||||||
fMousePos := PixelsToRowColumn(Point(X,Y));
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCESynMemo.MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y:Integer);
|
procedure TCESynMemo.MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y:Integer);
|
||||||
|
|
|
@ -35,6 +35,7 @@ type
|
||||||
procedure optget_UpdaterDelay(aWriter: TWriter);
|
procedure optget_UpdaterDelay(aWriter: TWriter);
|
||||||
procedure optset_UpdaterDelay(aReader: TReader);
|
procedure optset_UpdaterDelay(aReader: TReader);
|
||||||
protected
|
protected
|
||||||
|
fDockable: boolean;
|
||||||
fID: string;
|
fID: string;
|
||||||
// a descendant overrides to implementi a periodic update.
|
// a descendant overrides to implementi a periodic update.
|
||||||
procedure UpdateByLoop; virtual;
|
procedure UpdateByLoop; virtual;
|
||||||
|
@ -74,6 +75,8 @@ type
|
||||||
//
|
//
|
||||||
// returns true if one of the three updater is processing.
|
// returns true if one of the three updater is processing.
|
||||||
property updating: boolean read fUpdating;
|
property updating: boolean read fUpdating;
|
||||||
|
// true by default, allow a widget to be docked.
|
||||||
|
property isDockable: boolean read fDockable;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
(**
|
(**
|
||||||
|
@ -110,6 +113,7 @@ var
|
||||||
itm: TmenuItem;
|
itm: TmenuItem;
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
|
fDockable := true;
|
||||||
fUpdaterAuto := TTimer.Create(self);
|
fUpdaterAuto := TTimer.Create(self);
|
||||||
fUpdaterAuto.Interval := 70;
|
fUpdaterAuto.Interval := 70;
|
||||||
fUpdaterAuto.OnTimer := @updaterAutoProc;
|
fUpdaterAuto.OnTimer := @updaterAutoProc;
|
||||||
|
|
Loading…
Reference in New Issue