Blinking text on fast background change
I am using "mIRC v7.63" + "DCX dll v3.1-git222" in system "Windows 8.1 x64".
There is one problem I am facing while writing my script. If you create a large list from a set of controls for text in a dialog,, then make it so that when you hover the mouse, the background of the text and control changes to another, and when you remove the mouse, the background color changes again, then when you quickly fast move the mouse down and up, the text in these controls starts to wink, also when stretching and resizing the dialog, which is very conspicuous and doesn't look good. The same problem is observed with other controls where there is text and the ability to change the background under the text, or when it becomes transparent, for example, when using a control for an image with a transparent style and the key (+b), as well as an picture in it with the "png" extension, then when the background color on the parent element changes, the image also starts flickering.
Is there a solution to this problem to remove flickering when changing item parameters quickly or is it a common bug in dll?
Here is a test piece of script to reproduce this the problem. To run the script click on "F5" or enter the command "/newdialog":
alias F5 { newdialog }
alias newdialog {
if ($dialog(newdialog)) .dialog -x newdialog
else { .dialog -m newdialog newdialog }
}
dialog newdialog {
title "New Dialog"
icon $mircexe,0
option pixels
size 350 400 300 430
}
on *:dialog:newdialog:init:*: {
.dcx Mark $dname newdialog_work
.xdialog -b $dname +tyz
.xdialog -g $dname +b $rgb(20,20,27)
newdialog_panel $dname 20
}
alias newdialog_panel {
var %nd_np 0 | var %nd_y 10 | var %nd_q 1 | while (%nd_q <= $2) {
inc %nd_np
.xdialog -c $1 %nd_np text 10 %nd_y $calc($dialog($1).cw -20) 20 center
.xdid -f $1 %nd_np +ab ansi 11 Tahoma
.xdid -C $1 %nd_np +bk $rgb(35,35,35)
.xdid -C $1 %nd_np +t $rgb(255,199,0)
.xdid -t $1 %nd_np DialogTextTest %nd_q
inc %nd_q | inc %nd_y 20
}
}
alias newdialog_work {
if ($2 == mouseenter && $3 > 0) { .xdid -C $1 $3 +bk $rgb(50,50,50) }
if ($2 == mouseleave && $3 > 0) { .xdid -C $1 $3 +bk $rgb(35,35,35) }
}
This does happen some times, seems to be a drawing issue/delay, try using the noformat style to speed up drawing if you arn't using mirc ctrl codes.
maybe fixed in dev57 rel, try with doublebuffer style & see.
OokEek, thanks for your reply. For testing, I specifically created 2 identical dialog boxes, only in one I left everything as it was, and in the other I added new styles. Setting the style noformat helped to significantly reduce the visibility of flicker, but a small fraction still remains. If, in addition to this, add the doublebuffer style, then visible braking and even flickering of the already with black stripe begins, which, as it were, lags behind the movement of the computer mouse. In principle, this is tolerable and little noticeable, but it will be better to if possible if you can completely eliminate this flaw so that there is no flicker.
P.S. In fact, over the years of experimenting with (mIRC scripts + DCX dll) I have a lot of questions, some flaws were found and have accumulated new suggestions for improving your DLL, so when I have free time, I will leave new publications (comments) here, to help make this project even better.