View Issue Details

IDProjectCategoryView StatusLast Update
0037215FPCFVpublic2021-04-30 14:33
Reporterrolandvh Assigned ToMarco van de Voort  
PrioritynormalSeverityminorReproducibilityalways
Status assignedResolutionopen 
Product Version3.0.4 
Summary0037215: TMemo in free vision gives black area when using scrollbars
DescriptionWhen I type in the memo field and I get past the width of the field you see a black box and letters are repeated. See attachment.
Steps To Reproduceprogram errormemo;
uses App, Menus, dialogs, drivers, views, objects, editors;
type
   TMyApp = OBJECT(TApplication)
        constructor init;
        procedure HandleEvent(var aEvent : TEvent); virtual;
        procedure MakeMemoDialog;
        procedure InitMenuBar; virtual;
   end;


var
        MyApp: TMyApp;
const cmMemoDialog = 1000;

constructor TMyApp.init;
begin
        inherited init;
end;

procedure TMyApp.InitMenuBar;
var R : TRect;
begin
       GetExtent(R);
        R.B.Y := R.A.Y + 1;
        MenuBar := New(PMenubar, Init(R, NewMenu(NewSubMenu('~M~emo test', hcNoContext,
                                                 NewMenu(
                                                 NewItem('Test', 'F2', kbF2, cmMemoDialog, hcNoContext, nil)),nil))));
end;

procedure TMyApp.HandleEvent(var aEvent : TEvent);
begin
        inherited HandleEvent(aEvent);
        if aEvent.What = evCommand then begin
          case aEvent.Command of
            cmMemoDialog:
            begin
                MakeMemoDialog;
            end
            else
            begin
                Exit;
            end;
          end;
    end;
    ClearEvent(aEvent);

end;

procedure TMyApp.MakeMemoDialog;
var
    D: PDialog;
    R: TRect;
    rs: word;
    aVScrollBar : PScrollBar;
    aHScrollBar : PScrollBar;
    aIndicator : PIndicator;
    aMemo : PMemo;
begin
    GetExtent(R);
    R.A.X := R.A.X + 4;
    R.A.Y := R.A.Y + 1;
    R.B.X := R.B.X - 4;
    R.B.Y := R.B.Y - 4;
    D := New(PDialog, Init(R, 'Test memo'));

    R.A.X := 3;
    R.A.Y := 10;
    R.B.X := 60;
    R.B.Y := 11;
    aHScrollBar := New(PScrollbar, Init(R));
    D^.Insert(aHScrollBar);

    R.A.X := 60;
    R.A.Y := 3;
    R.B.X := 61;
    R.B.Y := 10;
    aVScrollBar := New(PScrollBar, Init(R));
    D^.Insert(aVScrollBar);

    R.A.X := 61;
    R.A.Y := 7;
    R.B.X := 64;
    R.B.Y := 8;
    aIndicator := New(PIndicator, Init(R));
    D^.Insert(aIndicator);

    R.A.X := 3;
    R.A.Y := 3;
    R.B.X := 60;
    R.B.Y := 10;
    aMemo := New(PMemo, Init(R, aHScrollBar, aVScrollBar, aIndicator, 10000));
    aMemo^.Limit.X := 70;
    aMemo^.Limit.Y := 40;
    D^.Insert(aMemo);


    rs := Desktop^.ExecView(D);
    Dispose(D, Done);

end;

begin
  MyApp.Init;
  MyApp.Run;
  MyApp.Done;
end.
TagsNo tags attached.
Fixed in Revision
FPCOldBugId
FPCTarget-
Attached Files

Activities

rolandvh

2020-06-15 08:39

reporter  

memoerror.png (10,064 bytes)   
memoerror.png (10,064 bytes)   

Marco van de Voort

2021-04-10 23:34

manager   ~0130256

Can't reproduce this on Windows. What did you try this on?

rolandvh

2021-04-17 08:30

reporter   ~0130420

I tried it on windows 10. Both with a 32 bit and a 64 bit compiler.

compiller command32 bit:
fpc -FED:\FPC\projects\ -FoD:\FPC\projects\ -FuD:\FPC\projects D:\FPC\projects\errormemo.pas

compiler command 64 bit:
ppcrossx64 -B -Xs -O3 -Si -Twin64 -Px86_64 -S2 -Va -FED:\FPC\projects\ -FoD:\FPC\projects\ -FuD:\FPC\projects D:\FPC\projects\errormemo.pas

It happens with the 3.0.4 version and 3.2.0 version

Marco van de Voort

2021-04-17 15:07

manager   ~0130427

My bad, yes I can reproduce. (though fixing is something else) You have to first write enough characters to make the memo scroll horizontally

Issue History

Date Modified Username Field Change
2020-06-15 08:39 rolandvh New Issue
2020-06-15 08:39 rolandvh File Added: memoerror.png
2021-04-10 23:34 Marco van de Voort Assigned To => Marco van de Voort
2021-04-10 23:34 Marco van de Voort Status new => feedback
2021-04-10 23:34 Marco van de Voort FPCTarget => -
2021-04-10 23:34 Marco van de Voort Note Added: 0130256
2021-04-17 08:30 rolandvh Note Added: 0130420
2021-04-17 08:30 rolandvh Status feedback => assigned
2021-04-17 15:07 Marco van de Voort Note Added: 0130427