1
0
mirror of synced 2024-12-22 01:13:08 +01:00

Fixes for MonitorForm

- Fixed text details not showing up when first activated
- Fixed #4: MaxEntries being enforced while paused, causing the view to empty
- Added translations for details panel
This commit is contained in:
Mark van Renswoude 2018-02-15 16:46:28 +01:00
parent 7fe3eb6518
commit d37d729bb1
4 changed files with 77 additions and 14 deletions

View File

@ -95,6 +95,12 @@ resourcestring
LogMonitorFormMenuWindow = 'Window';
LogMonitorFormMenuWindowAlwaysOnTop = 'Always on top';
{ Caption of the details view headers }
LogMonitorFormMessageHeader = 'Message';
LogMonitorFormDetailHeader = 'Details';
LogMonitorFormKeyHeader = 'Key';
LogMonitorFormValueHeader = 'Value';
{ Status messages }
LogMonitorFormStatusPaused = 'Paused: %d log message(s) skipped';

View File

@ -35,7 +35,7 @@ object X2LogObserverMonitorForm: TX2LogObserverMonitorForm
Height = 496
Align = alRight
BevelOuter = bvNone
TabOrder = 0
TabOrder = 1
object tbDetails: TToolBar
Left = 0
Top = 0
@ -100,7 +100,7 @@ object X2LogObserverMonitorForm: TX2LogObserverMonitorForm
Left = 0
Top = 19
Width = 298
Height = 451
Height = 343
Align = alClient
BorderStyle = bsNone
Font.Charset = ANSI_CHARSET
@ -112,22 +112,24 @@ object X2LogObserverMonitorForm: TX2LogObserverMonitorForm
PlainText = True
ReadOnly = True
ScrollBars = ssBoth
TabOrder = 1
TabOrder = 0
Visible = False
ExplicitHeight = 451
end
object sbDetailsImage: TScrollBox
Left = 0
Top = 19
Width = 298
Height = 451
Height = 343
HorzScrollBar.Tracking = True
VertScrollBar.Tracking = True
Align = alClient
BorderStyle = bsNone
DoubleBuffered = True
ParentDoubleBuffered = False
TabOrder = 2
TabOrder = 1
Visible = False
ExplicitHeight = 451
object imgDetailsImage: TImage
Left = 0
Top = 0
@ -140,15 +142,47 @@ object X2LogObserverMonitorForm: TX2LogObserverMonitorForm
Left = 0
Top = 19
Width = 298
Height = 451
Height = 343
Align = alClient
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goColSizing, goAlwaysShowEditor, goThumbTracking]
TabOrder = 3
TabOrder = 2
OnKeyDown = vleDetailsDictionaryKeyDown
ExplicitHeight = 451
ColWidths = (
150
142)
end
object mmoMessage: TMemo
Left = 0
Top = 381
Width = 298
Height = 89
Align = alBottom
ReadOnly = True
ScrollBars = ssVertical
TabOrder = 3
ExplicitLeft = -2
ExplicitTop = 440
end
object hcMessage: THeaderControl
Left = 0
Top = 362
Width = 298
Height = 19
Align = alBottom
BiDiMode = bdLeftToRight
Sections = <
item
AutoSize = True
ImageIndex = -1
Text = 'Message'
Width = 298
end>
NoSizing = True
ParentBiDiMode = False
ExplicitLeft = -2
ExplicitTop = 440
end
end
end
object pnlLog: TPanel
@ -158,7 +192,7 @@ object X2LogObserverMonitorForm: TX2LogObserverMonitorForm
Height = 496
Align = alClient
BevelOuter = bvNone
TabOrder = 1
TabOrder = 0
object vstLog: TVirtualStringTree
Left = 0
Top = 22
@ -174,7 +208,7 @@ object X2LogObserverMonitorForm: TX2LogObserverMonitorForm
Header.Options = [hoAutoResize, hoColumnResize, hoDrag, hoVisible]
HintMode = hmTooltip
Images = ilsLog
TabOrder = 0
TabOrder = 1
TreeOptions.PaintOptions = [toHideFocusRect, toShowButtons, toShowDropmark, toThemeAware]
TreeOptions.SelectionOptions = [toFullRowSelect]
OnFocusChanged = vstLogFocusChanged
@ -214,7 +248,7 @@ object X2LogObserverMonitorForm: TX2LogObserverMonitorForm
Images = ilsLog
List = True
ShowCaptions = True
TabOrder = 1
TabOrder = 0
OnCustomDraw = ToolbarCustomDraw
object tbPause: TToolButton
Left = 0
@ -284,7 +318,7 @@ object X2LogObserverMonitorForm: TX2LogObserverMonitorForm
Left = 448
Top = 48
Bitmap = {
494C01010A004000040110001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
494C01010A004000080110001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
0000000000003600000028000000400000003000000001002000000000000030
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000

View File

@ -100,6 +100,8 @@ type
mmMainFileSaveAs: TMenuItem;
sdSaveAs: TSaveDialog;
vleDetailsDictionary: TValueListEditor;
mmoMessage: TMemo;
hcMessage: THeaderControl;
procedure FormShow(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
@ -360,6 +362,11 @@ begin
vstLog.Header.Columns[ColumnCategory].Text := GetLogResourceString(@LogMonitorFormColumnCategory);
vstLog.Header.Columns[ColumnMessage].Text := GetLogResourceString(@LogMonitorFormColumnMessage);
hcMessage.Sections[0].Text := GetLogResourceString(@LogMonitorFormMessageHeader);
hcDetails.Sections[0].Text := GetLogResourceString(@LogMonitorFormDetailHeader);
vleDetailsDictionary.TitleCaptions[0] := GetLogResourceString(@LogMonitorFormKeyHeader);
vleDetailsDictionary.TitleCaptions[1] := GetLogResourceString(@LogMonitorFormValueHeader);
mmMainFile.Caption := GetLogResourceString(@LogMonitorFormMenuFile);
mmMainLog.Caption := GetLogResourceString(@LogMonitorFormMenuLog);
mmMainDetails.Caption := GetLogResourceString(@LogMonitorFormMenuDetails);
@ -505,8 +512,11 @@ begin
vstLog.IsVisible[node] := (not Paused) and (ALevel in VisibleLevels);
while vstLog.RootNodeCount > MaxEntries do
vstLog.DeleteNode(vstLog.GetFirst);
if not paused then
begin
while vstLog.RootNodeCount > MaxEntries do
vstLog.DeleteNode(vstLog.GetFirst);
end;
finally
vstLog.EndUpdate;
end;
@ -620,9 +630,12 @@ begin
else if Supports(ADetails, IX2LogDetailsText, logDetailsText) then
begin
reDetails.Text := logDetailsText.AsString;
canWrap := True;
SetVisibleDetails(reDetails);
// Must be set after Visible = True, because the Text will get lost
// as soon as the handle is allocated.
reDetails.Text := logDetailsText.AsString;
end;
end else
SetVisibleDetails(nil);
@ -900,9 +913,14 @@ begin
if Assigned(Node) then
begin
nodeData := Sender.GetNodeData(Node);
mmoMessage.Text := nodeData^.Message;
SetDetails(nodeData^.Details);
end else
begin
mmoMessage.Clear;
SetDetails(nil);
end;
UpdateUI;
end;

View File

@ -38,6 +38,11 @@ begin
SetLogResourceString(@LogMonitorFormMenuWindow, 'Venster');
SetLogResourceString(@LogMonitorFormMenuWindowAlwaysOnTop, 'Altijd op voorgrond');
SetLogResourceString(@LogMonitorFormMessageHeader, 'Melding');
SetLogResourceString(@LogMonitorFormDetailHeader, 'Details');
SetLogResourceString(@LogMonitorFormKeyHeader, 'Naam');
SetLogResourceString(@LogMonitorFormValueHeader, 'Waarde');
SetLogResourceString(@LogMonitorFormStatusPaused, 'Gepauzeerd: %d melding(en) overgeslagen');
SetLogResourceString(@LogMonitorFormSaveDetailsFilter, 'Alle bestanden (*.*)|*.*');