twig / dcxdll

Dialog Control eXtensions for mIRC
BSD 3-Clause "New" or "Revised" License
23 stars 2 forks source link

Line - incorrect line coloring when the control style is enabled "simple" #63

Open EpicNet opened 2 years ago

EpicNet commented 2 years ago

I am using "mIRC v7.67" + "DCX dll v3.1-git469" in system "Windows 8.1 x64".

When enable the control style simple - a colored line is drawn, and for some reason a duplicate is drawn next to it in the form of a light gray line. At the same time, as you can see in the screenshot, the first crosshair of two 1-pixel lines has no color at all. In addition, it is not entirely clear why you need to specify a control style for this, if, according to the logic, coloring or drawing of a colored line should occur automatically when the "/xdid -C" command is used. But if cannot do without this action, then I would suggest renaming this control style to a more intuitive name. For example colored or colorline.

Would like to see a fix for this problem. Thanks.


image

Here is a test piece of script to reproduce this the problem. To run the script click on "F5" or enter the command "/line_test":

alias F5 { line_test }
alias -l line_test {
  if ($dialog(line_test)) .dialog -x line_test | else { .dialog -m line_test line_test }
}
dialog -l line_test {
  title "Line test"
  icon $mircexe,0
  option pixels
  size -1 -1 370 120
}
on *:DIALOG:line_test:init:0:{
  .dcx Mark $dname line_test_work
  .xdialog -b $dname +ty
  .xdialog -g $dname +b $rgb(20,20,27)
  .xdialog -c $dname 1 line 20 44 50 1 simple | .xdid -C $dname 1 +b $rgb(255,0,0)
  .xdialog -c $dname 2 line 43 20 1 50 simple vertical | .xdid -C $dname 2 +b $rgb(255,0,0)
  .xdialog -c $dname 3 line 90 44 50 2 simple | .xdid -C $dname 3 +b $rgb(255,0,0)
  .xdialog -c $dname 4 line 113 20 2 50 simple vertical | .xdid -C $dname 4 +b $rgb(255,0,0)
  .xdialog -c $dname 5 line 160 44 50 3 simple | .xdid -C $dname 5 +b $rgb(255,0,0)
  .xdialog -c $dname 6 line 183 20 3 50 simple vertical | .xdid -C $dname 6 +b $rgb(255,0,0)
  .xdialog -c $dname 7 line 230 44 50 4 simple | .xdid -C $dname 7 +b $rgb(255,0,0)
  .xdialog -c $dname 8 line 252 20 4 50 simple vertical | .xdid -C $dname 8 +b $rgb(255,0,0)
  .xdialog -c $dname 9 line 300 44 50 5 simple | .xdid -C $dname 9 +b $rgb(255,0,0)
  .xdialog -c $dname 10 line 322 20 5 50 simple vertical | .xdid -C $dname 10 +b $rgb(255,0,0)
  .xdialog -c $dname 11 line 20 90 330 10 simple | .xdid -C $dname 11 +b $rgb(255,0,0)
}
alias line_test_work {}
EpicNet commented 2 years ago

I found a temporary workaround to fix this problem. If add text through the command "/xdid -t $dname 1 $str($chr(8195),50)", where instead of letters for writing will be used (wide space), which will be cloned for a certain number of characters, this will help to draw a colored line in the desired size. But at the same time, another problem arises, which consists is that, if such drawn lines are long enough and there will be a lot of them, then would need to use a lot more characters to color the line, and in which case, when stretching (resizing) the dialog box, there will be a noticeable large deceleration (braking) for the window to refresh.

So, this method is not suitable for regular use in resizable dialog boxes, and may not be a stable solution to this problem. Therefore, it is obvious that something needs to be changed in the code so that you can draw simple colored lines without using text, as it was originally intended. Perhaps this will give some hints on how can to fix this problem. Thanks in advance.


image

Here's a modified script to help demonstrate how to draw different colored lines:

alias F5 { line_test }
alias -l line_test {
  if ($dialog(line_test)) .dialog -x line_test | else { .dialog -m line_test line_test }
}
dialog -l line_test {
  title "Line test"
  icon $mircexe,0
  option pixels
  size -1 -1 380 165
}
on *:DIALOG:line_test:init:0:{
  .dcx Mark $dname line_test_work
  .xdialog -b $dname +tyxz
  .xdialog -g $dname +b $rgb(20,20,27)
  .xdialog -c $dname 1 line 20 44 50 1 simple | .xdid -C $dname 1 +b $rgb(255,0,0) | .xdid -t $dname 1 $str($chr(8195),50)
  .xdialog -c $dname 2 line 43 20 1 50 simple vertical | .xdid -C $dname 2 +b $rgb(255,0,0) | .xdid -t $dname 2 $str($chr(8195),50)
  .xdialog -c $dname 3 line 90 44 50 2 simple | .xdid -C $dname 3 +b $rgb(255,0,0) | .xdid -t $dname 3 $str($chr(8195),50)
  .xdialog -c $dname 4 line 113 20 2 50 simple vertical | .xdid -C $dname 4 +b $rgb(255,0,0) | .xdid -t $dname 4 $str($chr(8195),50)
  .xdialog -c $dname 5 line 160 44 50 3 simple | .xdid -C $dname 5 +b $rgb(255,0,0) | .xdid -t $dname 5 $str($chr(8195),50)
  .xdialog -c $dname 6 line 183 20 3 50 simple vertical | .xdid -C $dname 6 +b $rgb(255,0,0) | .xdid -t $dname 6 $str($chr(8195),50)
  .xdialog -c $dname 7 line 230 43 50 4 simple | .xdid -C $dname 7 +b $rgb(255,0,0) | .xdid -t $dname 7 $str($chr(8195),50)
  .xdialog -c $dname 8 line 252 20 4 50 simple vertical | .xdid -C $dname 8 +b $rgb(255,0,0) | .xdid -t $dname 8 $str($chr(8195),50)
  .xdialog -c $dname 9 line 300 43 50 5 simple | .xdid -C $dname 9 +b $rgb(255,0,0) | .xdid -t $dname 9 $str($chr(8195),50)
  .xdialog -c $dname 10 line 322 20 5 50 simple vertical | .xdid -C $dname 10 +b $rgb(255,0,0) | .xdid -t $dname 10 $str($chr(8195),50)
  .xdialog -c $dname 11 line 20 90 330 10 simple | .xdid -C $dname 11 +b $rgb(0,130,200) | .xdid -t $dname 11 $str($chr(8195),50)
  .xdialog -c $dname 12 line 20 110 330 6 simple | .xdid -C $dname 12 +b $rgb(255,200,0) | .xdid -t $dname 12 $str($chr(8195),50)
  .xdialog -c $dname 13 line 20 125 330 3 simple | .xdid -C $dname 13 +b $rgb(23,200,0) | .xdid -t $dname 13 $str($chr(8195),50)
  .xdialog -c $dname 14 line 20 136 330 1 simple | .xdid -C $dname 14 +b $rgb(255,0,0) | .xdid -t $dname 14 $str($chr(8195),50)
}
alias line_test_work {}