twig / dcxdll

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

Check - incorrect settings and display on a colored background of the dialog #43

Closed EpicNet closed 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".

In the process testing, I encountered a number of disadvantages of this control when using dark background colors to create my own dialog design. The light gray standard background and black text simply do not fit into the dark colors, which makes this tool useless when designing design a dialog. It upsets the impossibility of adjusting the color for most things. In addition, the gradient does not work correctly, most likely it is not needed here, and when the dialog is resized, all controls start blinking.

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

  1. Add customizable frame color around a square the "CheckBox".
  2. Add customizable background color inside inside a square the "CheckBox".
  3. Add customizable flag color (check mark) inside a square the "CheckBox".
  4. Add customizable text color.
  5. Add the ability to customizable the display or hide of the frame around the text.
  6. Add customizable frame color around the text.
  7. All color add-ons must use +dhns flags (or something similar) to change colors on hover or mouse click.
  8. Add customizable size of text indents from a square the "CheckBox".
  9. Add a new style multi for to support multi-line text.
  10. Eliminate flickering of all created controls when the dialog is resized.

P.S. Perhaps I did not take into account something, forgot to mention or lost sight of what else needs to be done, or on the contrary, made a request about something useless, or maybe after that you have new interesting ideas, therefore, in order to avoid misunderstandings expressed in multiple corrections and rewriting of the code - we can always preliminarily think about this update and discuss in detail the innovations in the chat, so that this control becomes versatile enough, functional, maximally customizable and suitable for any design, in a own peculiar style. Thanks.


On the left is how it looks now, and on the right is how it could be after the update:

image

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

alias F5 { check_test }
alias check_test {
  if ($dialog(check_test)) .dialog -x check_test | else { .dialog -mp check_test check_test }
}
dialog check_test {
  title "Check test"
  icon $mircexe,0
  option pixels
  size -1 -1 340 290
}
on *:DIALOG:check_test:init:0:{
  .dcx Mark $dname check_test_work
  .xdialog -b $dname +tyz
  .xdialog -g $dname +b $rgb(20,20,27)
  .xdialog -c $dname 1 box 45 45 130 180 noformat center rounded transparent
  .xdid -C $dname 1 +r $rgb(51,80,19)
  .xdid -C $dname 1 +t $rgb(95,148,34)
  .xdid -t $dname 1 Check test
  check_making1 $dname 1 2 6
  check_making2 $dname 8 6
}
alias check_making1 {
  var %y 35 | var %n $3 | var %i 1 | while (%i <= $4) {
    .xdid -c $1 $2 %n check 30 %y 90 15 noformat vgradient
    .xdid -C $1 %n +g $rgb(40,40,47)
    .xdid -C $1 %n +G $rgb(25,25,25)
    .xdid -C $1 %n +b $rgb(40,40,47)
    .xdid -C $1 %n +t $rgb(180,180,187)
    .xdid -t $1 %n Check text %i
    inc %i | inc %n | inc %y 20
  }
}
alias check_making2 {
  var %y 80 | var %n $2 | var %i 1 | while (%i <= $3) {
    .xdialog -c $1 %n check 210 %y 90 15
    .xdid -C $1 %n +b $rgb(40,40,47)
    .xdid -C $1 %n +t $rgb(180,180,187)
    .xdid -t $1 %n Check text %i
    inc %i | inc %n | inc %y 20
  }
}
alias check_test_work {}
OokEek commented 2 years ago

Some of these features are already present

xdid -C dname id +t $rgb(...) set text colour. xdid -C dname id +k $rgb(...) set text background colour. xdid -C dname id +b $rgb(...) set background colour. xdid -C dname id +g $rgb(...) set start of gradient colours. (for background when vgradient or hgradient styles used) xdid -C dname id +G $rgb(...) set end of gradient colours.

EpicNet commented 2 years ago

Yes, really this it works, but only when the style is set notheme, which I did not take into account in the test. Nevertheless, this does not help to paint the checkbox (square) itself in different colors and to make all the decorations that I described above.

In addition, if you apply this control style to elements that are inside the "Box" as children, then this looks very different. Obviously, there are still many errors, so this needs a revision of the entire code of the class and a deep modernization.

By the way, to solve the change in the color and appearance of the checkmark ☑ inside the square, I would suggest adding to the command the ability to set the path to your own images with a transparent background in the "PNG" extension.

So I continue to await the release of the update, to run new tests 😎

EpicNet commented 2 years ago

In addition (as a bonus), it would be nice to be able to customize size of the square "CheckBox" in pixels, in case a different, larger font will be used, or if the default size seems too small, when creating own design for the menu. And it would also be logical that all color settings could be changed on the fly using commands, using the "/dcx Mark" callback events to create custom effects in the control.

OokEek commented 2 years ago

checkbox colours added.