twig / dcxdll

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

Button - incorrect visual display of the control and the work of its settings #40

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 creating buttons with a combination of different styles and coloring, I encountered a number of shortcomings:

  1. When adding borders with the "/xdid -x $dname 2 +b" command while painting the background, only the border around the button becomes colored. This can be seen in the example of "Button 2".
  2. To color the button in the desired color, you need to apply the style bitmap, although this is not said anywhere in the documentation. But in this case, the set border for the button loses its color and becomes dark gray and the button loses its clicked effect. This can be seen in the example of "Button 3".
  3. When adding an icon for a button, it is set only before the button name, and besides, the name with the icon can be located only in the center of the button. I tried changing the center position by adding "$str($chr(8199),10)" (numeric space) to the end of the text, but this is more of a crutch, than that how it should actually work. In addition, if the number of characters exceeds the size of the button, an ellipsis appears at the end of the button. This can be seen in the example of "Button 6".

Would like to see a fix for these problems. 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 "/button_test":

alias F5 { button_test }
alias button_test {
  if ($dialog(button_test)) .dialog -x button_test | else { .dialog -m button_test button_test }
}
dialog button_test {
  title "Button test"
  icon $mircexe,0
  option pixels
  size -1 -1 200 260
}
on *:DIALOG:button_test:init:0:{
  .dcx Mark $dname button_test_work
  .xdialog -b $dname +ty
  .xdialog -g $dname +b $rgb(20,20,27)
  button_making $dname
}
alias button_making {
  var %y 30 | var %i 1 | while (%i <= 6) {
    if (%i == 1) {
      .xdialog -c $1 %i button 50 %y 100 25 notheme
      .xdid -x $1 %i +b
      .xdid -t $1 %i Button %i
    }
    if (%i == 2) {
      .xdialog -c $1 %i button 50 %y 100 25 noformat
      .xdid -x $1 %i +b
      .xdid -t $1 %i Button %i
      .xdid -C $1 %i +b $rgb(255,0,0)
    }
    if (%i == 3) {
      .xdialog -c $1 %i button 50 %y 100 25 noformat bitmap
      .xdid -x $1 %i +b
      .xdid -C $1 %i +b $rgb(95,148,34)
      .xdid -c $1 %i +hs $rgb(155,248,255)
      .xdid -m $1 %i 1
      .xdid -t $1 %i Button %i
    }
    if (%i isnum 4-6) {
      .xdialog -c $1 %i button 50 %y 100 25 notheme noformat bitmap vgradient
      .xdid -C $1 %i +b $rgb(95,148,34)
      .xdid -C $1 %i +g $rgb(95,148,34)
      .xdid -C $1 %i +G $rgb(51,80,19)
      .xdid -c $1 %i +dn $rgb(216,216,230)
      .xdid -c $1 %i +h $rgb(155,248,255)
      .xdid -c $1 %i +s $rgb(255,248,225)
      .xdid -m $1 %i 1
      .xdid -t $1 %i Button %i
    }
    if (%i isnum 5-6) {
      .xdid -l $1 %i 16
      .xdid -w $1 %i +n 18 $mircexe
    }
    if (%i == 6) {
      .xdid -w $1 %i +s 44 $mircexe
      .xdid -t $1 %i Button %i $str($chr(8199),10)
    }
    .xdid -J $1 %i +r hand | .xdid -R $1 %i +r 3
    inc %i | inc %y 35
  }
}
alias button_test_work {}