Index: ZPreview/src/Delphi/F_PE_Hex.dfm ================================================================== --- ZPreview/src/Delphi/F_PE_Hex.dfm +++ ZPreview/src/Delphi/F_PE_Hex.dfm @@ -18,10 +18,11 @@ Left = 0 Top = 0 Width = 401 Height = 282 Align = alClient + Color = clBtnFace ParentColor = False OnPaint = pbxPreviewPaint ExplicitLeft = 120 ExplicitTop = 56 ExplicitWidth = 105 Index: ZPreview/src/Delphi/F_PE_Hex.pas ================================================================== --- ZPreview/src/Delphi/F_PE_Hex.pas +++ ZPreview/src/Delphi/F_PE_Hex.pas @@ -76,10 +76,16 @@ var Canvas: TCanvas; begin {$MESSAGE WARN 'TODO: TfrmPEHex.pbxPreviewPaint — MCO 18-02-2015'} // TODO: check whether anything has changed since last time? + // TODO: differentiate between context changes and content changes + // (context being the width, height, font; content being the file (name), + // position, selection start and end, etc). + // Context change means we need to recalculate everything, then redraw; + // content change means we don't need to recalculate everything, just + // the position and actual contents. if not Assigned(FBitmap) or (pbxPreview.ClientWidth <> FBitmap.Width) or (pbxPreview.ClientHeight <> FBitmap.Height) or CompareMem(@FCurrLayout, @FPrevLayout, SizeOf(TLayoutInfo)) then begin