Code Monkey home page Code Monkey logo

Comments (19)

Alexey-T avatar Alexey-T commented on August 24, 2024

Pls move question-2 to new topic.
Flickering: we have overriden Invalidate

procedure TATListbox.Invalidate;
begin
  if Assigned(FScrollbar) then
    FScrollbar.Update;

  inherited Invalidate;
end;

what if you add "if assigned(FScrollbar) and FScrollbar.Visible"?

from atflatcontrols.

Alexey-T avatar Alexey-T commented on August 24, 2024

Idea-2. Toggle the DoubleBuffered prop.

from atflatcontrols.

Alexey-T avatar Alexey-T commented on August 24, 2024

Q-2. The reason is

procedure TATScrollbar.Update;
begin
  if IsHorz then
    Height:= DoScale(FTheme^.InitialSize)
  else
    Width:= DoScale(FTheme^.InitialSize);

  Invalidate;
end;

so you need to change Theme's prop.

from atflatcontrols.

srd-software avatar srd-software commented on August 24, 2024

Tried both of those and no luck.

All I've gotten to work so far is to set the atlistbox.scrollbar.width := 0 and then use an external atscrollbar instead.

from atflatcontrols.

srd-software avatar srd-software commented on August 24, 2024

Q-2. The reason is

procedure TATScrollbar.Update;
begin
  if IsHorz then
    Height:= DoScale(FTheme^.InitialSize)
  else
    Width:= DoScale(FTheme^.InitialSize);

  Invalidate;
end;

so you need to change Theme's prop.

If I do that, won't all the atscrollbars in the app use the new setting? I was wanting to have a narrow bar in my list and all the others are OK at default.

Looks like maybe the external SB is the way for me to go with this particular problem.

from atflatcontrols.

Alexey-T avatar Alexey-T commented on August 24, 2024

So you must change Theme of those bar which is deferent from other bars. Set theme colors the same and InitialSize not the same

from atflatcontrols.

srd-software avatar srd-software commented on August 24, 2024

So you must change Theme of those bar which is deferent from other bars. Set theme colors the same and InitialSize not the same

Ah, that worked, thanks. I was wondering what InitialSize was for.

from atflatcontrols.

srd-software avatar srd-software commented on August 24, 2024

As far as the flicker problem, for now I'll use the external SB but I'll keep looking at the listbox code and see if I can figure anything out.

from atflatcontrols.

Alexey-T avatar Alexey-T commented on August 24, 2024

All right

from atflatcontrols.

Alexey-T avatar Alexey-T commented on August 24, 2024

Stan, problem is not visible on Win10 (and Lin) in Lazarus. so maybe Delphi dependant.

from atflatcontrols.

srd-software avatar srd-software commented on August 24, 2024

OK. I'll look at the erase bgnd message too. Seems to be an issue sometimes.

from atflatcontrols.

srd-software avatar srd-software commented on August 24, 2024

Alexey,

I think I've found the fix for the fscrollbar flicker problem in MouseMove:

      FHotTrackIndex:= NewIndex;
      if Assigned(FScrollbar) and FScrollbar.Visible then
      begin
        r := ClientRect;
        r.Right := ClientWidth;
        {$ifdef FPC}
        InvalidateRect(Handle,@r,false);
        {$endif}
        {$ifndef FPC}
        InvalidateRect(Handle,r,false);
        {$endif}
      end
      else
        Invalidate;

From what I could find online, Invalidate repaints the entire control. So by eliminating the rect the fscrollbar is on and refreshing only the area needed, it fixes the fscrollbar flicker. Since this only happens in mousemove with hottrack enabled, I don't think there's any bad effects from not using the overridden Invalidate. I don't think we need to update the fscrollbar here since mousemove is not changing its position or parameters.

I tried this in lazarus and had to add the slight diff on InvalidateRect. It seems to work just fine in the demo but I'm not a lazarus expert like you so maybe you can review and verify that it looks OK.

from atflatcontrols.

Alexey-T avatar Alexey-T commented on August 24, 2024

applied that fix, thanks - pls check it.

from atflatcontrols.

srd-software avatar srd-software commented on August 24, 2024

Yes, looks good. Thanks for the better code too! That one was a real difficult one to find.

I still get a little of the funny business in the SB when resizing the control at run time with a splitter, but that's not as noticeable. I'll look into that as well but it was the mouseover that was really noticeable.

from atflatcontrols.

Alexey-T avatar Alexey-T commented on August 24, 2024

Allright.

from atflatcontrols.

srd-software avatar srd-software commented on August 24, 2024

Still looking at resizing but while doing that I found I needed the new invalidate code for mouseenter/leave. So I added those and moved the invalidaterect code to its own proc. #33

from atflatcontrols.

Alexey-T avatar Alexey-T commented on August 24, 2024

Ok, thanks.

from atflatcontrols.

srd-software avatar srd-software commented on August 24, 2024

I have a fix for the resize problem. Took awhile to get github to work, it's apparently having issues today!

#34

from atflatcontrols.

srd-software avatar srd-software commented on August 24, 2024

A little more fine tuning. This update keeps the fscrollbar from disappearing in some cases. #36

from atflatcontrols.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.