twig / dcxdll

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

Edit - new proposals to fix and improve for updating #51

Open EpicNet opened 2 years ago

EpicNet commented 2 years ago

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

My proposals for what needs to be corrected and added in "Edit", 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)".
  3. Add customizable color for selected (highlighted) part of the text (instead of the standard blue).
  4. Add customizable color of the separator vertical line for the style showlinenumbers using the command: "/xdid -g".
  5. Add customizable line position by using indents, separately on each side. Something similar to CSS (margin/padding).
  6. Add a the ability to align the line numbering position using pixel indents. (If will be different from the font).
  7. Add a the ability to set focus to the desired existing line number when using the multi style.
  8. Add a the ability to change the color and transparency level for the "ghostly text": "/xdid -E".
  9. Add a the ability for style password to set any character from the Unicode table. For example: "/xdid -j dcx 4 1 ⦁".
  10. Add a new functionality for the style transparent, so that only the background can become transparent (without affecting the text and border) and the transparency level was regulation using the command: "/xdid -R dcx 4 +b 2 [0-255]" - through the number +b 2, so as not to break backward compatibility for those who use the effect through the number +b 1.
  11. Add command for opportunity the ability to set (assign) shades of colors in the RGB range on certain words (masks), which will be be present in the text inside the "Edit" control. It would be interesting and useful for example when creating your own script editor (code) for highlighting the syntax, events, identifiers, variables, etc. Or to check your spelling when a misspelled word is highlighted in a different color. I think that everyone can think of what this can be used for.

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.


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 300 210
}
on *:DIALOG:edit_test:init:0:{
  .dcx Mark $dname edit_test_work
  .xdialog -b $dname +tyz
  .xdialog -g $dname +b $rgb(20,20,27)
  .xdialog -c $dname 1 edit 40 40 210 23 notheme showsel | edit_decor $dname 1
  .xdialog -c $dname 2 edit 40 85 210 78 notheme multi showlinenumbers return showsel autovs | edit_decor $dname 2
}
alias edit_decor {
  .xdid -x $1 $2 +b
  .xdid -C $1 $2 +bk $rgb(40,40,47)
  .xdid -C $1 $2 +t $rgb(235,227,203)
  .xdid -f $1 $2 +a ansi 10 Comic Sans MS
  if ($2 == 1) .xdid -a $1 $2 test edit
  if ($2 == 2) {
    .xdid -g $1 $2 $rgb(160,0,0) $rgb(25,25,25) $rgb(250,250,250) $rgb(176,176,200) $rgb(61,61,70)
    var %i 1 | while (%i <= 4) { .xdid -o $1 $2 %i test line %i | inc %i }
  }
}
alias edit_test_work {}
EpicNet commented 2 years ago
  1. Add functionality of the transparent style, so that only the background can become transparent (without affecting the text and border) and the transparency level was regulation using the command: "/xdid -R $dname 1 +b 1 [0-255]".

I apologize for the belated comments and changes made, but it took a little time to think more carefully about how this should work. I thought so that probably this will be more correct to do as an additional alternative design style, so as not to break backward compatibility with scripts that were already created in the old style (who liked this appearance more). Therefore, if possible, should make the inclusion of a new mode for displaying transparency with style transparent, so that the transparency level (for the background only) is regulation through the specified parameter number "2" in the command: "/xdid -R $dname 1 +b 2 [0-255]" - without changing how it works with the specified parameter number "1", when the entire control becomes transparent, not just its background.

This also goes for my proposals for the "RichEdit" and "IP Address" controls, and maybe for something else in the future. If it can be done, it will be a super effect and I will welcome it. Thanks.