twig / dcxdll

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

Text - incorrect addition of text to an existing line with text #72

Closed EpicNet closed 2 years ago

EpicNet commented 2 years ago

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

When using the command "/xdid -a" additional text is added, but starting only with the second word. Additionally, no auto "SPACE" is added before the text, as indicated in the help documentation. I found a workaround, if by add the number "1" in front of the text, then this works as it should: "/xdid -a dcx 4 1 Appended text". Probably in the source code of the control "Text" something is messed up with the number of parameters or I'm wrong. With regard to the automatic added "SPACE" there should be a choice in the command as a parameter [1|0]. Perhaps it was originally intended, but not described in the help documentation.

An example of the correct syntax: "/xdid -a [DNAME] [ID] [1|0] (Appended text)".

Would like to see a fix for this problem. 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 "/text_test":

alias F5 { text_test }
alias text_test {
  if ($dialog(text_test)) .dialog -x text_test | else { .dialog -m text_test text_test }
}
dialog text_test {
  title "Text test"
  icon $mircexe,0
  option pixels
  size -1 -1 300 260
}
on *:DIALOG:text_test:init:0:{
  .dcx Mark $dname text_test_work
  .xdialog -b $dname +ty
  .xdialog -g $dname +b $rgb(20,20,27)
  text_making $dname 1 10
}
alias text_making {
  var %x 30 | var %y 30
  var %i $2 | while (%i <= $3) {
    .xdialog -c $1 %i text %x %y 250 20 notheme transparent doublebuffer shadow
    if (%i < 3) .xdid -C $1 %i +t $rgb(65,151,225)
    if (%i > 2) .xdid -C $1 %i +t $rgb(255,235,130)
    .xdid -f $1 %i + ansi 10 Comic Sans MS
    .xdid -t $1 %i $+(04,%i,.,) Line of text to test
    inc %i | inc %y 20
  }
  .timerTEXT1 -m 1 800 .xdid -a $1 1 Additional text
  .timerTEXT2 -m 1 1500 .xdid -a $1 2 1 04➔ Additional text
}
alias text_test_work { if ($2 == keydown && $4 == 116) { text_test } }
OokEek commented 2 years ago

This is the correct behaviour, the docs were in error, fixed.