Comments (19)
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.
Idea-2. Toggle the DoubleBuffered prop.
from atflatcontrols.
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.
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.
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.
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.
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.
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.
All right
from atflatcontrols.
Stan, problem is not visible on Win10 (and Lin) in Lazarus. so maybe Delphi dependant.
from atflatcontrols.
OK. I'll look at the erase bgnd message too. Seems to be an issue sometimes.
from atflatcontrols.
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.
applied that fix, thanks - pls check it.
from atflatcontrols.
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.
Allright.
from atflatcontrols.
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.
Ok, thanks.
from atflatcontrols.
I have a fix for the resize problem. Took awhile to get github to work, it's apparently having issues today!
from atflatcontrols.
A little more fine tuning. This update keeps the fscrollbar from disappearing in some cases. #36
from atflatcontrols.
Related Issues (20)
- ATTabs - Slight Rounding HOT 2
- Inline title edit HOT 6
- ColorTabActive paint regression HOT 1
- IsTabVisible/MakeTabVisible issue HOT 12
- Can't compile in Delphi 10.2 HOT 2
- Memory leak in TATTabs? HOT 4
- Drag/drop from other controls not working HOT 7
- Font scaling correction HOT 8
- Question about buttons placed on the left side and tabwidth of the leftmost tab after scrolling HOT 4
- Can't compile ATCanvasPrimitives in 10.4 HOT 4
- How put a form insde tTab or controls like tpage HOT 3
- Prob with DragDrop (unexpected exchange of tabs)? HOT 14
- TATTabs: Missing Event while reordering Tabs HOT 7
- Little problem again HOT 4
- Small problem
- Little problem in Delphi
- How to change the position of dropdown list of a ATComboEdit? HOT 6
- Bug report in TabChangeQuery HOT 3
- Case where changed Data.TabHint is not reliably propagated to tab's hint HOT 9
- Problem HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from atflatcontrols.