mirror of https://gitlab.com/basile.b/dexed.git
Merge branch 'a12_2_a13'
This commit is contained in:
commit
f65f666ae9
|
@ -143,6 +143,7 @@
|
||||||
<ComponentName Value="CECdbWidget"/>
|
<ComponentName Value="CECdbWidget"/>
|
||||||
<HasResources Value="True"/>
|
<HasResources Value="True"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
|
<UnitName Value="ce_cdbcmd"/>
|
||||||
</Unit1>
|
</Unit1>
|
||||||
<Unit2>
|
<Unit2>
|
||||||
<Filename Value="..\src\ce_common.pas"/>
|
<Filename Value="..\src\ce_common.pas"/>
|
||||||
|
@ -156,10 +157,12 @@
|
||||||
<Unit4>
|
<Unit4>
|
||||||
<Filename Value="..\src\ce_dcd.pas"/>
|
<Filename Value="..\src\ce_dcd.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
|
<UnitName Value="ce_dcd"/>
|
||||||
</Unit4>
|
</Unit4>
|
||||||
<Unit5>
|
<Unit5>
|
||||||
<Filename Value="..\src\ce_dlang.pas"/>
|
<Filename Value="..\src\ce_dlang.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
|
<UnitName Value="ce_dlang"/>
|
||||||
</Unit5>
|
</Unit5>
|
||||||
<Unit6>
|
<Unit6>
|
||||||
<Filename Value="..\src\ce_dlangutils.pas"/>
|
<Filename Value="..\src\ce_dlangutils.pas"/>
|
||||||
|
@ -168,6 +171,7 @@
|
||||||
<Unit7>
|
<Unit7>
|
||||||
<Filename Value="..\src\ce_dmdwrap.pas"/>
|
<Filename Value="..\src\ce_dmdwrap.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
|
<UnitName Value="ce_dmdwrap"/>
|
||||||
</Unit7>
|
</Unit7>
|
||||||
<Unit8>
|
<Unit8>
|
||||||
<Filename Value="..\src\ce_editor.pas"/>
|
<Filename Value="..\src\ce_editor.pas"/>
|
||||||
|
@ -185,6 +189,7 @@
|
||||||
<Unit10>
|
<Unit10>
|
||||||
<Filename Value="..\src\ce_libman.pas"/>
|
<Filename Value="..\src\ce_libman.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
|
<UnitName Value="ce_libman"/>
|
||||||
</Unit10>
|
</Unit10>
|
||||||
<Unit11>
|
<Unit11>
|
||||||
<Filename Value="..\src\ce_libmaneditor.pas"/>
|
<Filename Value="..\src\ce_libmaneditor.pas"/>
|
||||||
|
@ -207,6 +212,7 @@
|
||||||
<ComponentName Value="CEMessagesWidget"/>
|
<ComponentName Value="CEMessagesWidget"/>
|
||||||
<HasResources Value="True"/>
|
<HasResources Value="True"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
|
<UnitName Value="ce_messages"/>
|
||||||
</Unit13>
|
</Unit13>
|
||||||
<Unit14>
|
<Unit14>
|
||||||
<Filename Value="..\src\ce_miniexplorer.pas"/>
|
<Filename Value="..\src\ce_miniexplorer.pas"/>
|
||||||
|
@ -214,6 +220,7 @@
|
||||||
<ComponentName Value="CEMiniExplorerWidget"/>
|
<ComponentName Value="CEMiniExplorerWidget"/>
|
||||||
<HasResources Value="True"/>
|
<HasResources Value="True"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
|
<UnitName Value="ce_miniexplorer"/>
|
||||||
</Unit14>
|
</Unit14>
|
||||||
<Unit15>
|
<Unit15>
|
||||||
<Filename Value="..\src\ce_observer.pas"/>
|
<Filename Value="..\src\ce_observer.pas"/>
|
||||||
|
@ -223,6 +230,7 @@
|
||||||
<Unit16>
|
<Unit16>
|
||||||
<Filename Value="..\src\ce_options.pas"/>
|
<Filename Value="..\src\ce_options.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
|
<UnitName Value="ce_options"/>
|
||||||
</Unit16>
|
</Unit16>
|
||||||
<Unit17>
|
<Unit17>
|
||||||
<Filename Value="..\src\ce_procinput.pas"/>
|
<Filename Value="..\src\ce_procinput.pas"/>
|
||||||
|
@ -230,6 +238,7 @@
|
||||||
<ComponentName Value="CEProcInputWidget"/>
|
<ComponentName Value="CEProcInputWidget"/>
|
||||||
<HasResources Value="True"/>
|
<HasResources Value="True"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
|
<UnitName Value="ce_procinput"/>
|
||||||
</Unit17>
|
</Unit17>
|
||||||
<Unit18>
|
<Unit18>
|
||||||
<Filename Value="..\src\ce_projconf.pas"/>
|
<Filename Value="..\src\ce_projconf.pas"/>
|
||||||
|
@ -237,10 +246,12 @@
|
||||||
<ComponentName Value="CEProjectConfigurationWidget"/>
|
<ComponentName Value="CEProjectConfigurationWidget"/>
|
||||||
<HasResources Value="True"/>
|
<HasResources Value="True"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
|
<UnitName Value="ce_projconf"/>
|
||||||
</Unit18>
|
</Unit18>
|
||||||
<Unit19>
|
<Unit19>
|
||||||
<Filename Value="..\src\ce_project.pas"/>
|
<Filename Value="..\src\ce_project.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
|
<UnitName Value="ce_project"/>
|
||||||
</Unit19>
|
</Unit19>
|
||||||
<Unit20>
|
<Unit20>
|
||||||
<Filename Value="..\src\ce_projinspect.pas"/>
|
<Filename Value="..\src\ce_projinspect.pas"/>
|
||||||
|
@ -256,6 +267,7 @@
|
||||||
<ComponentName Value="CESearchWidget"/>
|
<ComponentName Value="CESearchWidget"/>
|
||||||
<HasResources Value="True"/>
|
<HasResources Value="True"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
|
<UnitName Value="ce_search"/>
|
||||||
</Unit21>
|
</Unit21>
|
||||||
<Unit22>
|
<Unit22>
|
||||||
<Filename Value="..\src\ce_staticexplorer.pas"/>
|
<Filename Value="..\src\ce_staticexplorer.pas"/>
|
||||||
|
@ -263,10 +275,12 @@
|
||||||
<ComponentName Value="CEStaticExplorerWidget"/>
|
<ComponentName Value="CEStaticExplorerWidget"/>
|
||||||
<HasResources Value="True"/>
|
<HasResources Value="True"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
|
<UnitName Value="ce_staticexplorer"/>
|
||||||
</Unit22>
|
</Unit22>
|
||||||
<Unit23>
|
<Unit23>
|
||||||
<Filename Value="..\src\ce_staticmacro.pas"/>
|
<Filename Value="..\src\ce_staticmacro.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
|
<UnitName Value="ce_staticmacro"/>
|
||||||
</Unit23>
|
</Unit23>
|
||||||
<Unit24>
|
<Unit24>
|
||||||
<Filename Value="..\src\ce_symstring.pas"/>
|
<Filename Value="..\src\ce_symstring.pas"/>
|
||||||
|
@ -281,6 +295,7 @@
|
||||||
<Unit26>
|
<Unit26>
|
||||||
<Filename Value="..\src\ce_tools.pas"/>
|
<Filename Value="..\src\ce_tools.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
|
<UnitName Value="ce_tools"/>
|
||||||
</Unit26>
|
</Unit26>
|
||||||
<Unit27>
|
<Unit27>
|
||||||
<Filename Value="..\src\ce_toolseditor.pas"/>
|
<Filename Value="..\src\ce_toolseditor.pas"/>
|
||||||
|
@ -288,7 +303,6 @@
|
||||||
<ComponentName Value="CEToolsEditorWidget"/>
|
<ComponentName Value="CEToolsEditorWidget"/>
|
||||||
<HasResources Value="True"/>
|
<HasResources Value="True"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<UnitName Value="ce_toolseditor"/>
|
|
||||||
</Unit27>
|
</Unit27>
|
||||||
<Unit28>
|
<Unit28>
|
||||||
<Filename Value="..\src\ce_txtsyn.pas"/>
|
<Filename Value="..\src\ce_txtsyn.pas"/>
|
||||||
|
@ -300,11 +314,11 @@
|
||||||
<ComponentName Value="CEWidget"/>
|
<ComponentName Value="CEWidget"/>
|
||||||
<HasResources Value="True"/>
|
<HasResources Value="True"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
|
<UnitName Value="ce_widget"/>
|
||||||
</Unit29>
|
</Unit29>
|
||||||
<Unit30>
|
<Unit30>
|
||||||
<Filename Value="..\src\ce_writablecomponent.pas"/>
|
<Filename Value="..\src\ce_writablecomponent.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<UnitName Value="ce_writableComponent"/>
|
|
||||||
</Unit30>
|
</Unit30>
|
||||||
<Unit31>
|
<Unit31>
|
||||||
<Filename Value="..\src\ce_todolist.pas"/>
|
<Filename Value="..\src\ce_todolist.pas"/>
|
||||||
|
@ -324,6 +338,7 @@
|
||||||
<ComponentName Value="CEOptionEditorWidget"/>
|
<ComponentName Value="CEOptionEditorWidget"/>
|
||||||
<HasResources Value="True"/>
|
<HasResources Value="True"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
|
<UnitName Value="ce_optionseditor"/>
|
||||||
</Unit33>
|
</Unit33>
|
||||||
<Unit34>
|
<Unit34>
|
||||||
<Filename Value="..\src\ce_editoroptions.pas"/>
|
<Filename Value="..\src\ce_editoroptions.pas"/>
|
||||||
|
@ -333,6 +348,7 @@
|
||||||
<Unit35>
|
<Unit35>
|
||||||
<Filename Value="..\src\ce_dockoptions.pas"/>
|
<Filename Value="..\src\ce_dockoptions.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
|
<UnitName Value="ce_dockoptions"/>
|
||||||
</Unit35>
|
</Unit35>
|
||||||
<Unit36>
|
<Unit36>
|
||||||
<Filename Value="..\src\ce_shortcutseditor.pas"/>
|
<Filename Value="..\src\ce_shortcutseditor.pas"/>
|
||||||
|
@ -340,6 +356,7 @@
|
||||||
<ComponentName Value="CEShortcutEditor"/>
|
<ComponentName Value="CEShortcutEditor"/>
|
||||||
<HasResources Value="True"/>
|
<HasResources Value="True"/>
|
||||||
<ResourceBaseClass Value="Frame"/>
|
<ResourceBaseClass Value="Frame"/>
|
||||||
|
<UnitName Value="ce_shortcutseditor"/>
|
||||||
</Unit36>
|
</Unit36>
|
||||||
</Units>
|
</Units>
|
||||||
</ProjectOptions>
|
</ProjectOptions>
|
||||||
|
|
|
@ -256,7 +256,7 @@ begin
|
||||||
end;
|
end;
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
|
|
||||||
{$REGION ICEEDitableSHortcut ---------------------------------------------------}
|
{$REGION ICEEDitableShortcut ---------------------------------------------------}
|
||||||
function TCEEditorWidget.scedWantFirst: boolean;
|
function TCEEditorWidget.scedWantFirst: boolean;
|
||||||
begin
|
begin
|
||||||
result := fDoc <> nil;
|
result := fDoc <> nil;
|
||||||
|
@ -267,16 +267,13 @@ function TCEEditorWidget.scedWantNext(out category, identifier: string; out aSho
|
||||||
var
|
var
|
||||||
shrct: TSynEditKeyStroke;
|
shrct: TSynEditKeyStroke;
|
||||||
begin
|
begin
|
||||||
result := false;
|
|
||||||
if fShortcutCount > fDoc.Keystrokes.Count-1 then exit;
|
|
||||||
//
|
|
||||||
shrct := fDoc.Keystrokes.Items[fShortcutCount];
|
shrct := fDoc.Keystrokes.Items[fShortcutCount];
|
||||||
category := 'Editor';
|
category := 'Editor';
|
||||||
identifier:= shrct.DisplayName;
|
identifier:= shrct.DisplayName;
|
||||||
aShortcut := Shortcut(shrct.Key, shrct.Shift);
|
aShortcut := Shortcut(shrct.Key, shrct.Shift);
|
||||||
//
|
//
|
||||||
fShortcutCount += 1;
|
fShortcutCount += 1;
|
||||||
result := true;
|
result := fShortcutCount < fDoc.Keystrokes.Count;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCEEditorWidget.scedSendItem(const category, identifier: string; aShortcut: TShortcut);
|
procedure TCEEditorWidget.scedSendItem(const category, identifier: string; aShortcut: TShortcut);
|
||||||
|
|
|
@ -916,16 +916,13 @@ function TCEMainForm.scedWantNext(out category, identifier: string; out aShortcu
|
||||||
var
|
var
|
||||||
act: TCustomAction;
|
act: TCustomAction;
|
||||||
begin
|
begin
|
||||||
result := false;
|
|
||||||
if fScCollectCount > actions.ActionCount -1 then exit;
|
|
||||||
//
|
|
||||||
act := TCustomAction(Actions.Actions[fScCollectCount]);
|
act := TCustomAction(Actions.Actions[fScCollectCount]);
|
||||||
category := act.Category;
|
category := act.Category;
|
||||||
identifier := act.Caption;
|
identifier := act.Caption;
|
||||||
aShortcut := act.ShortCut;
|
aShortcut := act.ShortCut;
|
||||||
//
|
//
|
||||||
fScCollectCount += 1;
|
fScCollectCount += 1;
|
||||||
result := true;
|
result := fScCollectCount < actions.ActionCount;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCEMainForm.scedSendItem(const category, identifier: string; aShortcut: TShortcut);
|
procedure TCEMainForm.scedSendItem(const category, identifier: string; aShortcut: TShortcut);
|
||||||
|
|
|
@ -40,6 +40,7 @@ inherited CEOptionEditorWidget: TCEOptionEditorWidget
|
||||||
HideSelection = False
|
HideSelection = False
|
||||||
ReadOnly = True
|
ReadOnly = True
|
||||||
ScrollBars = ssAutoBoth
|
ScrollBars = ssAutoBoth
|
||||||
|
SortType = stText
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
OnDeletion = selCatDeletion
|
OnDeletion = selCatDeletion
|
||||||
OnSelectionChanged = selCatSelectionChanged
|
OnSelectionChanged = selCatSelectionChanged
|
||||||
|
|
|
@ -41,6 +41,7 @@ type
|
||||||
private
|
private
|
||||||
fEdOptsSubj: TCEEditableOptionsSubject;
|
fEdOptsSubj: TCEEditableOptionsSubject;
|
||||||
procedure updateCategories;
|
procedure updateCategories;
|
||||||
|
function sortCategories(Cat1, Cat2: TTreeNode): integer;
|
||||||
public
|
public
|
||||||
constructor create(aOwner: TComponent); override;
|
constructor create(aOwner: TComponent); override;
|
||||||
destructor destroy; override;
|
destructor destroy; override;
|
||||||
|
@ -100,6 +101,12 @@ begin
|
||||||
dt^.kind := ed.optionedWantEditorKind;
|
dt^.kind := ed.optionedWantEditorKind;
|
||||||
dt^.observer := ed;
|
dt^.observer := ed;
|
||||||
end;
|
end;
|
||||||
|
selCat.Items.SortTopLevelNodes(@sortCategories);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TCEOptionEditorWidget.sortCategories(Cat1, Cat2: TTreeNode): integer;
|
||||||
|
begin
|
||||||
|
result := CompareText(Cat1.Text, Cat2.Text);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCEOptionEditorWidget.selCatDeletion(Sender: TObject; Node: TTreeNode);
|
procedure TCEOptionEditorWidget.selCatDeletion(Sender: TObject; Node: TTreeNode);
|
||||||
|
|
|
@ -44,6 +44,7 @@ object CEShortcutEditor: TCEShortcutEditor
|
||||||
HideSelection = False
|
HideSelection = False
|
||||||
ReadOnly = True
|
ReadOnly = True
|
||||||
ScrollBars = ssAutoBoth
|
ScrollBars = ssAutoBoth
|
||||||
|
SortType = stText
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
OnSelectionChanged = treeSelectionChanged
|
OnSelectionChanged = treeSelectionChanged
|
||||||
Options = [tvoAutoExpand, tvoAutoItemHeight, tvoKeepCollapsedNodes, tvoReadOnly, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoToolTips, tvoThemedDraw]
|
Options = [tvoAutoExpand, tvoAutoItemHeight, tvoKeepCollapsedNodes, tvoReadOnly, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoToolTips, tvoThemedDraw]
|
||||||
|
|
|
@ -65,6 +65,7 @@ type
|
||||||
procedure optionedEvent(anEvent: TOptionEditorEvent);
|
procedure optionedEvent(anEvent: TOptionEditorEvent);
|
||||||
//
|
//
|
||||||
function findCategory(const aName: string; aData: Pointer): TTreeNode;
|
function findCategory(const aName: string; aData: Pointer): TTreeNode;
|
||||||
|
function sortCategories(Cat1, Cat2: TTreeNode): integer;
|
||||||
procedure updateFromObservers;
|
procedure updateFromObservers;
|
||||||
procedure updateEditCtrls;
|
procedure updateEditCtrls;
|
||||||
protected
|
protected
|
||||||
|
@ -253,15 +254,37 @@ begin
|
||||||
exit(tree.Items[i]);
|
exit(tree.Items[i]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TCEShortcutEditor.sortCategories(Cat1, Cat2: TTreeNode): integer;
|
||||||
|
begin
|
||||||
|
result := CompareText(Cat1.Text, Cat2.Text);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCEShortcutEditor.updateFromObservers;
|
procedure TCEShortcutEditor.updateFromObservers;
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
obs: ICEEditableShortCut;
|
obs: ICEEditableShortCut;
|
||||||
cat: string;
|
cat: string;
|
||||||
prt: TTreeNode;
|
|
||||||
sht: word;
|
sht: word;
|
||||||
idt: string;
|
idt: string;
|
||||||
itm: TShortcutItem;
|
itm: TShortcutItem;
|
||||||
|
procedure addItem();
|
||||||
|
var
|
||||||
|
prt: TTreeNode;
|
||||||
|
begin
|
||||||
|
// root category
|
||||||
|
if cat = '' then exit;
|
||||||
|
if idt = '' then exit;
|
||||||
|
prt := findCategory(cat, obs);
|
||||||
|
if prt = nil then
|
||||||
|
prt := tree.Items.AddObject(nil, cat, obs);
|
||||||
|
// item as child
|
||||||
|
itm := TShortcutItem(fShortcuts.items.Add);
|
||||||
|
itm.identifier := idt;
|
||||||
|
itm.data:= sht;
|
||||||
|
tree.Items.AddChildObject(prt, idt, itm);
|
||||||
|
cat := '';
|
||||||
|
idt := '';
|
||||||
|
end;
|
||||||
begin
|
begin
|
||||||
tree.Items.Clear;
|
tree.Items.Clear;
|
||||||
fShortcuts.items.Clear;
|
fShortcuts.items.Clear;
|
||||||
|
@ -271,25 +294,14 @@ begin
|
||||||
for i:= 0 to fObservers.observersCount-1 do
|
for i:= 0 to fObservers.observersCount-1 do
|
||||||
begin
|
begin
|
||||||
obs := fObservers.observers[i] as ICEEditableShortCut;
|
obs := fObservers.observers[i] as ICEEditableShortCut;
|
||||||
if obs.scedWantFirst then while obs.scedWantNext(cat, idt, sht) do
|
if obs.scedWantFirst then
|
||||||
begin
|
begin
|
||||||
// root category
|
while obs.scedWantNext(cat, idt, sht) do
|
||||||
if cat = '' then
|
addItem();
|
||||||
continue;
|
addItem();
|
||||||
if idt = '' then
|
|
||||||
continue;
|
|
||||||
prt := findCategory(cat, obs);
|
|
||||||
if prt = nil then
|
|
||||||
prt := tree.Items.AddObject(nil, cat, obs);
|
|
||||||
// item as child
|
|
||||||
itm := TShortcutItem(fShortcuts.items.Add);
|
|
||||||
itm.identifier := idt;
|
|
||||||
itm.data:= sht;
|
|
||||||
tree.Items.AddChildObject(prt, idt, itm);
|
|
||||||
cat := '';
|
|
||||||
idt := '';
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
tree.Items.SortTopLevelNodes(@sortCategories);
|
||||||
end;
|
end;
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
|
|
||||||
|
|
|
@ -10,8 +10,6 @@ uses
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
//TODO-cfeature: declare tools shortcuts, set TCETools ICEEditableShortcut
|
|
||||||
|
|
||||||
TCEToolItem = class(TCollectionItem)
|
TCEToolItem = class(TCollectionItem)
|
||||||
private
|
private
|
||||||
fProcess: TCheckedAsyncProcess;
|
fProcess: TCheckedAsyncProcess;
|
||||||
|
@ -24,7 +22,7 @@ type
|
||||||
fQueryParams: boolean;
|
fQueryParams: boolean;
|
||||||
fChainBefore: TStringList;
|
fChainBefore: TStringList;
|
||||||
fChainAfter: TStringList;
|
fChainAfter: TStringList;
|
||||||
//fShortcut: TShortcut;
|
fShortcut: TShortcut;
|
||||||
fMsgs: ICEMessagesDisplay;
|
fMsgs: ICEMessagesDisplay;
|
||||||
procedure setParameters(aValue: TStringList);
|
procedure setParameters(aValue: TStringList);
|
||||||
procedure setChainBefore(aValue: TStringList);
|
procedure setChainBefore(aValue: TStringList);
|
||||||
|
@ -41,21 +39,26 @@ type
|
||||||
property queryParameters: boolean read fQueryParams write fQueryParams;
|
property queryParameters: boolean read fQueryParams write fQueryParams;
|
||||||
property chainBefore: TStringList read fChainBefore write setchainBefore;
|
property chainBefore: TStringList read fChainBefore write setchainBefore;
|
||||||
property chainAfter: TStringList read fChainAfter write setChainAfter;
|
property chainAfter: TStringList read fChainAfter write setChainAfter;
|
||||||
//property shortcut: TShortcut read fShortcut write fShortcut;
|
property shortcut: TShortcut read fShortcut write fShortcut;
|
||||||
public
|
public
|
||||||
constructor create(ACollection: TCollection); override;
|
constructor create(ACollection: TCollection); override;
|
||||||
destructor destroy; override;
|
destructor destroy; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TCETools = class(TWritableLfmTextComponent, ICEMainMenuProvider)
|
TCETools = class(TWritableLfmTextComponent, ICEMainMenuProvider, ICEEditableShortcut)
|
||||||
private
|
private
|
||||||
fTools: TCollection;
|
fTools: TCollection;
|
||||||
|
fShctCount: Integer;
|
||||||
function getTool(index: Integer): TCEToolItem;
|
function getTool(index: Integer): TCEToolItem;
|
||||||
procedure setTools(const aValue: TCollection);
|
procedure setTools(const aValue: TCollection);
|
||||||
//
|
//
|
||||||
procedure menuDeclare(item: TMenuItem);
|
procedure menuDeclare(item: TMenuItem);
|
||||||
procedure menuUpdate(item: TMenuItem);
|
procedure menuUpdate(item: TMenuItem);
|
||||||
procedure executeToolFromMenu(sender: TObject);
|
procedure executeToolFromMenu(sender: TObject);
|
||||||
|
//
|
||||||
|
function scedWantFirst: boolean;
|
||||||
|
function scedWantNext(out category, identifier: string; out aShortcut: TShortcut): boolean;
|
||||||
|
procedure scedSendItem(const category, identifier: string; aShortcut: TShortcut);
|
||||||
published
|
published
|
||||||
property tools: TCollection read fTools write setTools;
|
property tools: TCollection read fTools write setTools;
|
||||||
public
|
public
|
||||||
|
@ -81,6 +84,7 @@ uses
|
||||||
const
|
const
|
||||||
toolsFname = 'tools.txt';
|
toolsFname = 'tools.txt';
|
||||||
|
|
||||||
|
{$REGION TCEToolItem -----------------------------------------------------------}
|
||||||
constructor TCEToolItem.create(ACollection: TCollection);
|
constructor TCEToolItem.create(ACollection: TCollection);
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
|
@ -164,7 +168,9 @@ begin
|
||||||
lst.Free;
|
lst.Free;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
{$ENDREGION --------------------------------------------------------------------}
|
||||||
|
|
||||||
|
{$REGION Standard Comp/Obj -----------------------------------------------------}
|
||||||
constructor TCETools.create(aOwner: TComponent);
|
constructor TCETools.create(aOwner: TComponent);
|
||||||
var
|
var
|
||||||
fname: string;
|
fname: string;
|
||||||
|
@ -186,7 +192,9 @@ begin
|
||||||
fTools.Free;
|
fTools.Free;
|
||||||
inherited;
|
inherited;
|
||||||
end;
|
end;
|
||||||
|
{$ENDREGION}
|
||||||
|
|
||||||
|
{$REGION ICEMainMenuProvider ---------------------------------------------------}
|
||||||
procedure TCETools.executeToolFromMenu(sender: TObject);
|
procedure TCETools.executeToolFromMenu(sender: TObject);
|
||||||
begin
|
begin
|
||||||
executeTool(TCEToolItem(TMenuItem(sender).tag));
|
executeTool(TCEToolItem(TMenuItem(sender).tag));
|
||||||
|
@ -225,7 +233,32 @@ begin
|
||||||
item.Items[i].Caption := tool[i].toolAlias;
|
item.Items[i].Caption := tool[i].toolAlias;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
{$ENDREGION}
|
||||||
|
|
||||||
|
{$REGION ICEEditableShortcut ---------------------------------------------------}
|
||||||
|
function TCETools.scedWantFirst: boolean;
|
||||||
|
begin
|
||||||
|
result := fTools.Count > 0;
|
||||||
|
fShctCount := 0;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TCETools.scedWantNext(out category, identifier: string; out aShortcut: TShortcut): boolean;
|
||||||
|
begin
|
||||||
|
category := 'Tools';
|
||||||
|
identifier:= tool[fShctCount].toolAlias;
|
||||||
|
aShortcut := tool[fShctCount].shortcut;
|
||||||
|
//
|
||||||
|
fShctCount += 1;
|
||||||
|
result := fShctCount < fTools.Count;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCETools.scedSendItem(const category, identifier: string; aShortcut: TShortcut);
|
||||||
|
begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
{$ENDREGION}
|
||||||
|
|
||||||
|
{$REGION Tools things ----------------------------------------------------------}
|
||||||
procedure TCETools.setTools(const aValue: TCollection);
|
procedure TCETools.setTools(const aValue: TCollection);
|
||||||
begin
|
begin
|
||||||
fTools.Assign(aValue);
|
fTools.Assign(aValue);
|
||||||
|
@ -271,6 +304,7 @@ begin
|
||||||
//
|
//
|
||||||
executeTool(tool[aToolIndex]);
|
executeTool(tool[aToolIndex]);
|
||||||
end;
|
end;
|
||||||
|
{$ENDREGION}
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
RegisterClasses([TCEToolItem, TCETools]);
|
RegisterClasses([TCEToolItem, TCETools]);
|
||||||
|
|
Loading…
Reference in New Issue