JeffBurroughs
Members-
Content Count
9 -
Joined
-
Last visited
Everything posted by JeffBurroughs
-
When a form has a lot of components there is noticeable flickering when it is being painted when themes are applied. When you spend considerable effort making your program flicker free this is annoying. Any tricks or tips to stop or hide the flicker when a form is being shown? Latest Delphi 10.4.
-
When a style is changed I only set a global stylemanager style, ie stylemanager.TrySetStyle(stylename,true); Other forms then get that style automatically applied when they are created and shown. No need to set the style specifically as each form is created.
-
That would force you to have only 1 style always on though right? There is no way to have a DPR defined style but then allow the user to select another style or disable styling.
-
Thanks for the tip, but that doesn't seem to make any noticeable difference here. For example, I have a groupbox with lots of checkboxes inside. Setting the groupbox parentbackground to false does not help the visible drawing and flicker of the checkboxes when the form is shown. The flickering probably only lasts 200ms or less but it is obvious and happens every time a styled form is shown. The forms are already doublebuffered:=true which does help non-styled flicker but has no effect on reducing styled UI flicker.
-
I do leave styles disabled by default and give the user options to enable/disable them. That way at least I have a "fix" for when someone complains the UI flickers badly. Here's hoping they do spend more time on theming and styles in the future. Adding an event that triggered once styling is applied would be enough for me to have a work around flicker fix.
-
At the moment when I have some form updating code I want to hide I will use alphablend to hide form painting. Basically set alpha to 0, do your painting/resizing/etc, then set alpha to 255. This stops all the problems with "Cannot do xyz on form.show" type errors if you just set visible to false then true. The form then takes slightly longer to show (milliseconds), but it appears flicker free after all the control drawing is done with alpha 0. The problem with the styles is that the restyling seems to fire after onshow finishes so there is no way I can "hide" it repainting all the controls and having the flicker. If there was a "OnAfterStyling" event or even a "OnFormDoneGettingReady" event that fired after all the oncreate, onshow, styling, etc was all finished. Personally I think the styles are a gimmick, but since adding support for them my users love them.
-
Installed latest Delphi 10.4. When I try and compile a project that uses otlparralel I get these errors [dcc64 Error] OtlParallel.pas(3884): E2010 Incompatible types: 'TObject' and 'IOmniTaskControl' [dcc64 Error] OtlParallel.pas(4215): E2250 There is no overloaded version of 'OnStop' that can be called with these arguments [dcc64 Error] OtlParallel.pas(4234): E2250 There is no overloaded version of 'OnStop' that can be called with these arguments [dcc64 Error] OtlParallel.pas(4306): E2250 There is no overloaded version of 'CreateTask' that can be called with these arguments [dcc64 Error] OtlParallel.pas(4600): E2250 There is no overloaded version of 'Execute' that can be called with these arguments [dcc64 Error] OtlParallel.pas(4622): E2250 There is no overloaded version of 'Task' that can be called with these arguments [dcc64 Error] OtlParallel.pas(4683): E2250 There is no overloaded version of 'OnStop' that can be called with these arguments [dcc64 Error] OtlParallel.pas(4945): E2250 There is no overloaded version of 'OnStop' that can be called with these arguments [dcc64 Error] OtlParallel.pas(5016): E2250 There is no overloaded version of 'OnStop' that can be called with these arguments [dcc64 Error] OtlParallel.pas(5035): E2250 There is no overloaded version of 'OnStop' that can be called with these arguments [dcc64 Error] OtlParallel.pas(5282): E2250 There is no overloaded version of 'OnTerminated' that can be called with these arguments [dcc64 Error] OtlParallel.pas(5342): E2250 There is no overloaded version of 'Initialize' that can be called with these arguments [dcc64 Error] OtlParallel.pas(5349): E2250 There is no overloaded version of 'OnStop' that can be called with these arguments [dcc64 Error] OtlParallel.pas(5367): E2250 There is no overloaded version of 'Execute' that can be called with these arguments [dcc64 Error] OtlParallel.pas(5394): E2250 There is no overloaded version of 'OnStop' that can be called with these arguments [dcc64 Error] OtlParallel.pas(5416): E2250 There is no overloaded version of 'OnStop' that can be called with these arguments [dcc64 Error] OtlParallel.pas(5519): E2250 There is no overloaded version of 'Execute' that can be called with these arguments Using latest 3.07.7 omnithreadlibrary download. Is this my issue or a problem that needs patching in otlparallel?
-
OK, great. Makes an easy fix for otlparallel to support 10.4 then. Since remarking that line all of the parallel loop tests I have tried run perfectly.
-
If you remark out line 3884 it gets it all compiling and running, but I assume with memory leaks. Although doing some tests with lots of parallel loops does not seem to have any serious leaks? procedure TOmniFuture<T>.Execute(action: TOmniTaskDelegate; taskConfig: IOmniTaskConfig); begin FTask := CreateTask(action, 'TOmniFuture action'); Parallel.ApplyConfig(taskConfig, FTask); FTask.Unobserved; if assigned(FTask.CancellationToken) and FTask.CancellationToken.IsSignalled then begin FCancelled := true; //FreeAndNil(FTask); //REMARK THIS LINE end else Parallel.Start(FTask, taskConfig); end; { TOmniFuture<T>.Execute }