mirror of https://gitlab.com/basile.b/dexed.git
interface, add more message contexts
This commit is contained in:
parent
44b2ed66f1
commit
b86e65cba0
|
|
@ -252,7 +252,16 @@ type
|
|||
/// describes the message kind, 'amkAuto' implies that an ICELogMessageObserver guess the kind.
|
||||
TCEAppMessageKind = (amkAuto, amkBub, amkInf, amkHint, amkWarn, amkErr);
|
||||
/// describes the message context. Used by a ICELogMessageObserver to filter the messages.
|
||||
TCEAppMessageCtxt = (amcAll, amcEdit, amcProj, amcApp, amcMisc);
|
||||
TCEAppMessageCtxt = (
|
||||
amcAll, // used as filter
|
||||
amcEdit, // used as filter
|
||||
amcProj, // used as filter
|
||||
amcApp, // used as filter
|
||||
amcMisc, // used as filter
|
||||
amcAutoEdit, // same as amcEdit but the message data is set automatically from the widget side
|
||||
amcAutoProj, // same as amcProj but the message data is set automatically from the widget side
|
||||
amcAutoCompile // same as amcAutoEdit or amcAutoProj, according to what's being compiled.
|
||||
);
|
||||
|
||||
(**
|
||||
* Single service provided by the messages widget.
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ type
|
|||
fEditorMessagePos: TCEEditorMessagePos;
|
||||
fDemanglerAvailable: boolean;
|
||||
fMsgColors: array[TCEAppMessageKind] of TColor;
|
||||
fProjCompile: boolean;
|
||||
fActAutoSel: TAction;
|
||||
fActClearAll: TAction;
|
||||
fActClearCurCat: TAction;
|
||||
|
|
@ -674,10 +675,12 @@ end;
|
|||
|
||||
procedure TCEMessagesWidget.projCompiling(aProject: ICECommonProject);
|
||||
begin
|
||||
fProjCompile := true;
|
||||
end;
|
||||
|
||||
procedure TCEMessagesWidget.projCompiled(aProject: ICECommonProject; success: boolean);
|
||||
begin
|
||||
fProjCompile := false;
|
||||
end;
|
||||
{$ENDREGION}
|
||||
|
||||
|
|
@ -761,6 +764,23 @@ begin
|
|||
msg := aValue;
|
||||
if aKind = amkAuto then
|
||||
aKind := guessMessageKind(msg);
|
||||
if aCtxt = amcAutoCompile then
|
||||
begin
|
||||
case fProjCompile of
|
||||
false: aCtxt := amcAutoEdit;
|
||||
true: aCtxt := amcAutoProj;
|
||||
end;
|
||||
end;
|
||||
if aCtxt = amcAutoEdit then
|
||||
begin
|
||||
aData := fDoc;
|
||||
aCtxt := amcEdit;
|
||||
end
|
||||
else if aCtxt = amcAutoProj then
|
||||
begin
|
||||
aData := fProj;
|
||||
aCtxt := amcProj;
|
||||
end;
|
||||
dt := new(PMessageData);
|
||||
dt^.data := aData;
|
||||
dt^.ctxt := aCtxt;
|
||||
|
|
|
|||
Loading…
Reference in New Issue