1
0
mirror of synced 2024-11-08 14:19:16 +00:00

Added: Word wrap button for text details

This commit is contained in:
Mark van Renswoude 2014-08-19 14:06:25 +00:00
parent fb05ff8401
commit fabf621dc0
3 changed files with 101 additions and 51 deletions

BIN
Resources/Wrap.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 822 B

View File

@ -41,7 +41,7 @@ object X2LogObserverMonitorForm: TX2LogObserverMonitorForm
Width = 382
Height = 22
AutoSize = True
ButtonWidth = 52
ButtonWidth = 80
Images = ilsLog
List = True
ShowCaptions = True
@ -59,6 +59,18 @@ object X2LogObserverMonitorForm: TX2LogObserverMonitorForm
Action = actSaveDetails
AutoSize = True
end
object tbDetailsSep1: TToolButton
Left = 111
Top = 0
Width = 8
ImageIndex = 7
Style = tbsSeparator
end
object tbWordWrap: TToolButton
Left = 119
Top = 0
Action = actWordWrap
end
end
object pnlBorder: TPanel
Left = 0
@ -69,7 +81,7 @@ object X2LogObserverMonitorForm: TX2LogObserverMonitorForm
BevelKind = bkFlat
BevelOuter = bvNone
TabOrder = 1
object HeaderControl1: THeaderControl
object hcDetails: THeaderControl
Left = 0
Top = 0
Width = 378
@ -254,7 +266,7 @@ object X2LogObserverMonitorForm: TX2LogObserverMonitorForm
Left = 448
Top = 48
Bitmap = {
494C010109004000BC0010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
494C01010A004000D00010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
0000000000003600000028000000400000003000000001002000000000000030
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
@ -266,113 +278,113 @@ object X2LogObserverMonitorForm: TX2LogObserverMonitorForm
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000B5845800D074
1100CD6E0900D1720900C98546000000000000000000C6824500CF720D00CD6E
0900D1720900B886590000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0900D1720900B886590000000000000000000000000000000000C49C8800C996
7E00C5927C00C18E7A00BD8A7800B9867600B5827400B17E7200AD7A7000A976
6E00A5726C00A67D790000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000CD711100FFAD
1400FF9F0100FFA30000E27A00000000000000000000E07E0C00FFAA0F00FF9F
0100FFA30000D172090000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0100FFA30000D1720900000000000000000000000000C79E8900EEDACE00F9F9
F900F9F9F900FAFAFA00FCFCFC00FEFEFE00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00DBC7C400A67D7900000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000C9660600FF9F
0100FD960000FF9F0100DD7700000000000000000000D6710100FD960000FD96
0000FF9F0100CF6D060000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000FF9F0100CF6D0600000000000000000000000000D29F8200FFFFFF009990
870099948E00999794009999990099999900FFFFFF0099999900999999009999
990099999900FFFFFF00A5726C00000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000C35F0600F48E
0000F48E0000FD960000DD7700000000000000000000D06A0000F6900000F48E
0000FF9F0100C966060000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000FF9F0100C9660600000000000000000000000000D7A48400FFFFFF00FFF0
E100FFF6EC00FFFBF700FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00A9766E00000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000BE5C0600EE88
0000EC860000F48E0000D06A00000000000000000000C9660600EC860000EC86
0000F48E0000C966060000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000F48E0000C9660600000000000000000000000000DCA98700FFFFFF009990
870099948E009997940099999900999999009999990099999900999999009999
990099999900FFFFFF00AE7B7000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000BE5C0600E27A
0000E27A0000EE880000CF6D06000000000000000000C35F0600E27A0000EC86
0000EC860000C35F060000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000EC860000C35F0600000000000000000000000000E1AE8A00FFFFFF00FFEE
DD00FFF4E800FFF9F300FFFDFB00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00B3807300000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000B14F0600DE78
0000DE780000E27A0000C96606000000000000000000C35F0600DD770000DD77
0000E27A0000BE5C060000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000E27A0000BE5C0600000000000000000000000000E5B28C00FFFFFF00998E
83009991890099948E0099979400999999009999990099999900FFFFFF009999
990099999900FFFFFF00B7847500000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000B14F0600D06A
0000DD770000DD770000C35F06000000000000000000BA540100D06A0000DD77
0000DD770000BA54010000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000DD770000BA540100000000000000000000000000E9B68E00FFFFFF00FFEB
D600FFEEDD00FFF4E800FFF7F000FFFBF700FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FEFEFE00BA877700000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000AD4C0C00D172
0900C9660600D06A0000BA5401000000000000000000B6540A00D06F0C00C966
0600D06A0000BA54010000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0600D06A0000BA540100000000000000000000000000EDBA9000FFFFFF00998B
7C00998D800099908700FFF4E800999490009997940099989700999999009999
990099999900FCFCFC00BE8B7900000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000AD4C0C00D382
3700CD721D00D0741100BE5C06000000000000000000B3561500D07F3300CD72
1D00D0741100B14F060000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
1D00D0741100B14F0600000000000000000000000000F1BE9200FFFFFF00FFE4
C700FFE9D200FFEDDA00FFF0E100FFF4E800FFF6EC00FFF9F300FFFBF700FFFB
F700FFFBF700FAFAFA00C28F7B00000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000A5491300D795
5E00D0854400D68B4300B75A16000000000000000000B1592000D7955E00D382
3700D68B4300AD4C0C0000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
3700D68B4300AD4C0C00000000000000000000000000F5C29400FFFFFF009986
730099897A00998C7E00998D8000FFEEDD009991890099928B0099948E009994
8E0099948E00F9F9F900C6937D00000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000A4491900DDAD
8700D59A6B00D9A06D00B15920000000000000000000B15D2A00DDAD8700D59A
6B00D9A06D00A94D150000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
6B00D9A06D00A94D1500000000000000000000000000F9C69600FFFFFF00FFDC
B800FFE0C000FFE4C700FFE7CE00FFEBD600FFEDDA00FFEEDD00FFF0E100FFF0
E100FFF0E100F9F9F900C9967E00000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000A7522700EED8
C600E6C4A800ECCCAF00B96939000000000000000000B7673A00EED6C100E6C4
A800ECCCAF00AB57280000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
A800ECCCAF00AB572800000000000000000000000000E4BC9800FDE8D500FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00EEDACE00AA817A00000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000A16C5600A449
19009F441200A4491900AA6544000000000000000000AA654400A44919009F44
1200A4491900A26E580000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
1200A4491900A26E580000000000000000000000000000000000E0B89500F9C6
9600F5C29400F1BE9200EDBA9000E9B68E00E5B28C00E1AE8A00DDAA8800D9A6
8600D5A28400AA817A0000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
@ -642,11 +654,11 @@ object X2LogObserverMonitorForm: TX2LogObserverMonitorForm
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000424D3E000000000000003E000000
2800000040000000300000000100010000000000800100000000000000000000
000000000000000000000000FFFFFF00FFFF000000000000C183000000000000
C183000000000000C183000000000000C183000000000000C183000000000000
C183000000000000C183000000000000C183000000000000C183000000000000
C183000000000000C183000000000000C183000000000000C183000000000000
C183000000000000FFFF000000000000FFFFFFFFFFFFFFFFC003C001C7CF801F
000000000000000000000000FFFFFF00FFFFFFFF00000000C183C00300000000
C183800100000000C183800100000000C183800100000000C183800100000000
C183800100000000C183800100000000C183800100000000C183800100000000
C183800100000000C183800100000000C183800100000000C183800100000000
C183C00300000000FFFFFFFF00000000FFFFFFFFFFFFFFFFC003C001C7CF801F
C00380018383801FC003800181018001C0038001C0018001C003800180038001
C0038001C0078001C0038001F00F8001C0038001F80F8001C0038001F0078001
C0038001F0078001C0038001E0838001C0038001E0C18001C0078001E1E1F803
@ -708,6 +720,13 @@ object X2LogObserverMonitorForm: TX2LogObserverMonitorForm
ImageIndex = 3
OnExecute = actShowErrorExecute
end
object actWordWrap: TAction
AutoCheck = True
Caption = '&Word wrap'
Enabled = False
ImageIndex = 9
OnExecute = actWordWrapExecute
end
end
object sdDetails: TSaveDialog
Options = [ofOverwritePrompt, ofHideReadOnly, ofEnableSizing]

View File

@ -38,7 +38,7 @@ type
vstLog: TVirtualStringTree;
ilsLog: TImageList;
splDetails: TSplitter;
HeaderControl1: THeaderControl;
hcDetails: THeaderControl;
pnlDetails: TPanel;
reDetails: TRichEdit;
pnlLog: TPanel;
@ -67,6 +67,9 @@ type
lblFilter: TLabel;
sbDetailsImage: TScrollBox;
imgDetailsImage: TImage;
tbWordWrap: TToolButton;
tbDetailsSep1: TToolButton;
actWordWrap: TAction;
procedure FormShow(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
@ -84,6 +87,7 @@ type
procedure actShowInfoExecute(Sender: TObject);
procedure actShowWarningExecute(Sender: TObject);
procedure actShowErrorExecute(Sender: TObject);
procedure actWordWrapExecute(Sender: TObject);
private class var
FInstances: TMonitorFormDictionary;
private
@ -96,6 +100,7 @@ type
FDetails: IX2LogDetails;
FVisibleLevels: TX2LogLevels;
FMaxEntries: Cardinal;
FWordWrap: Boolean;
protected
class function GetInstance(ALog: IX2LogObservable; out AForm: TX2LogObserverMonitorForm): Boolean;
class procedure RemoveInstance(AForm: TX2LogObserverMonitorForm);
@ -121,6 +126,7 @@ type
procedure SetGraphicDetails(ADetails: IX2LogDetailsGraphic);
procedure SetVisibleDetails(AControl: TControl);
procedure SetWordWrap(AValue: Boolean);
property Closed: Boolean read FClosed;
property Details: IX2LogDetails read FDetails;
@ -532,9 +538,11 @@ var
logDetailsGraphic: IX2LogDetailsGraphic;
logDetailsBinary: IX2LogDetailsBinary;
logDetailsText: IX2LogDetailsText;
canWrap: Boolean;
begin
FDetails := ADetails;
canWrap := False;
if Assigned(Details) then
begin
@ -547,6 +555,7 @@ begin
else if Supports(ADetails, IX2LogDetailsText, logDetailsText) then
begin
reDetails.Text := logDetailsText.AsString;
canWrap := True;
SetVisibleDetails(reDetails);
end;
end else
@ -555,6 +564,10 @@ begin
actCopyDetails.Enabled := Supports(ADetails, IX2LogDetailsCopyable);
actSaveDetails.Enabled := Supports(ADetails, IX2LogDetailsStreamable);
actWordWrap.Enabled := canWrap;
actWordWrap.Checked := canWrap and FWordWrap;
SetWordWrap(actWordWrap.Checked);
end;
@ -682,6 +695,17 @@ begin
end;
procedure TX2LogObserverMonitorForm.SetWordWrap(AValue: Boolean);
begin
reDetails.WordWrap := AValue;
if AValue then
reDetails.ScrollBars := ssVertical
else
reDetails.ScrollBars := ssBoth;
end;
procedure TX2LogObserverMonitorForm.vstLogFreeNode(Sender: TBaseVirtualTree; Node: PVirtualNode);
var
nodeData: PLogEntryNodeData;
@ -803,6 +827,13 @@ begin
end;
procedure TX2LogObserverMonitorForm.actWordWrapExecute(Sender: TObject);
begin
FWordWrap := actWordWrap.Checked;
SetWordWrap(FWordWrap);
end;
procedure TX2LogObserverMonitorForm.actPauseExecute(Sender: TObject);
var
node: PVirtualNode;