twig / dcxdll

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

Box - add support setting color and thickness for the Border #44

Open EpicNet opened 2 years ago

EpicNet commented 2 years ago

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

It would be nice to be able to set the color and size of the thickness for the borders of the "Box" control. For some reason, set color can only be done when setting the control style rounded for rounding corners, but it cannot be done for a square shape.

My proposals for what needs to be corrected and added in "Box", to make it maximally functional and beautiful:

  1. Add a new type of border with to customizable the thickness in pixels. For example +a new flag: "/xdid -x dcx 4 +a 1".
  2. Add to new type of border possibility to color customization. For example +a new flag: "/xdid -C dcx 4 +a $rgb(255,0,0)".

image

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

alias F5 { box_test }
alias box_test {
  if ($dialog(box_test)) .dialog -x box_test | else { .dialog -m box_test box_test }
}
dialog box_test {
  title "Box test"
  icon $mircexe,0
  option pixels
  size -1 -1 400 300
}
on *:DIALOG:box_test:init:0:{
  .dcx Mark $dname box_test_work
  .xdialog -b $dname +ty
  .xdialog -g $dname +b $rgb(20,20,27)
  box_making $dname 1
}
alias box_making {
  .xdialog -c $1 $2 box 50 45 300 205 notheme noformat center
  .xdid -C $1 $2 +bk $rgb(40,40,47)
  .xdid -C $1 $2 +t $rgb(255,136,0)
  .xdid -t $1 $2 Box
  var %x 25 | var %y 25 | var %n $calc($2 +1) | var %i 1 | while (%i <= 6) {
    .xdid -c $1 $2 %n box %x %y 70 70 notheme noformat center
    .xdid -C $1 %n +bk $rgb(20,20,27)
    .xdid -C $1 %n +t $rgb(95,148,34)
    .xdid -t $1 %n Box %i
    inc %i | inc %n | if (%i < 4) || (%i > 4) { inc %x 90 } | else { var %x 25 | var %y 110 }
  }
}
alias box_test_work {}