mirror of https://gitlab.com/basile.b/dexed.git
message options as a writableLFmTextComponent
This commit is contained in:
parent
9f7b702417
commit
95c6b68490
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue