twig / dcxdll

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

Edit - unpredictable chaotic behavior when setting the control style Transparent #49

Open EpicNet opened 3 years ago

EpicNet commented 3 years ago

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

When testing a control "Edit" with a control style set transparent a significant flaw in the form of unpredictable behavior was revealed of the element. This is one of the large and notable BUG that needs fixing. Thanks.

Brief description of what is happening:

  1. When moving the mouse up and down, the text that is inside the field begins to superimpose many times, increasing gradually the font thickness and all this is accompanied by periodic flickering.
  2. When typing, it is superimposed on top of the ghost message and with each subsequent letter, the font thickness also increases.
  3. If, after the typed text, you go to the second field, the typed text is transferred there with the same text overlap.
  4. When you try to erase the typed message, nothing happens, except for moving the cursor to the left, but if you move to the second field, the text is partially deleted.
  5. If set focus to the first field, and then go to the adjacent open script editor window, then a ghostly "OK" button will appear in this field.
  6. If set style transparent together with multi, then the effect will be slightly different, but similar to the described above.

image

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

alias F5 { edit_test }
alias edit_test {
  if ($dialog(edit_test)) .dialog -x edit_test
  else { .dialog -m edit_test edit_test }
}
dialog edit_test {
  title "Edit test"
  icon $mircexe,0
  option pixels
  size -1 -1 400 300
}
on *:DIALOG:edit_test:init:*:{
  .dcx Mark $dname edit_test_work
  .xdialog -b $dname +tyz
  .xdialog -g $dname +b $rgb(20,20,27)
  if ($exists($mircdirimage\edit-test.jpg)) .xdialog -g $dname +is $mircdirimage\edit-test.jpg
  .xdialog -c $dname 1 edit 90 75 210 23 showsel transparent | edit_decor $dname 1
  .xdialog -c $dname 2 edit 90 105 210 23 showsel transparent | edit_decor $dname 2
  .xdialog -c $dname 3 edit 90 135 210 78 multi showlinenumbers return showsel autovs | edit_decor $dname 3
}
alias edit_decor {
  .xdid -x $1 $2 +b
  .xdid -C $1 $2 +bk $rgb(25,25,32)
  .xdid -C $1 $2 +t $rgb(235,227,203)
  .xdid -f $1 $2 + ansi 10 Comic Sans MS
  if ($2 isnum 1-2) {
    .xdid -R $1 $2 +b 1 160
    .xdid -E $1 $2 Enter your text here ...
  }
  if ($2 == 3) {
    .xdid -o $1 $2 1 test line 1
    .xdid -o $1 $2 2 test line 2
    .xdid -o $1 $2 3 test line 3
    .xdid -o $1 $2 4 test line 4
    .xdid -S $1 $2 24 | .xdid -F $1 $2
  }
}
alias edit_test_work {}
OokEek commented 2 years ago

Provisionally fixed. The text displayed when transparent can have some odd artefacts depending on the background. Working on something better.