mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2004
Posts: 423
C
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Aug 2004
Posts: 423
hello again,

my question is this.. is it possible to be able to replace a specific character in a line of text that resides in a edit box through another dialog? meaning if i want to make a change to existing text in one dialog with one selected from another dialog.. the reason i'm asking is because i have two dialogs and one is for editing and the other is mainly to add/change that contains different chacters.. but when i load the second dialog the first losses focus and when i add a character that i want replaced it appends it to the end of the text.. is it possible to append like in the middle of a line of text??

i hope i'm explaining this correctly..

Joined: Aug 2004
Posts: 423
C
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Aug 2004
Posts: 423
to better explain a bit :
Code:
dialog ascii_table {
  title -= (A)(M) =- Ascii  Table ( Extra Characters ) 
  size -1 -1 218 177
  option dbu
  list 1, 11 20 26 112
  list 2, 54 49 26 104
  list 3, 130 49 26 104
  list 4, 177 21 26 112
  button "Add", 5, 90 73 29 9
  button "Done", 6, 87 166 37 9, ok
  box "Upper Case", 7, 4 4 41 157
  box "Lower Case", 8, 49 35 38 126
  box "Numeric", 9, 122 35 40 126
  box "Misc", 10, 166 4 50 157
  text "A", 11, 68 11 4 8
  text "S", 12, 76 13 4 8
  text "C", 13, 83 12 4 8
  text "I", 14, 90 11 2 8
  text "I", 15, 96 13 2 8
  text "T", 16, 104 12 4 8
  text "A", 17, 111 11 4 8
  text "B", 18, 118 13 4 8
  text "L", 19, 125 12 3 8
  text "E", 20, 132 11 4 8
  edit "", 21, 97 86 15 13
  text Double Click On Characters, 22, 68 22 68 8
}
on *:dialog:ascii_table:*:*:{
  if ($devent == init) {
    didtok $dname 1 44 À,Á,Â,Ã,Ä,Å,ß,Ç,Ð,È,É,Ê,Ê,Ë,Ì,Í,Î,Ï,Ñ,Ò,Ó,Ô,Õ,Ö,Ù,Ú,Û,Ü,Ý,¥
    didtok $dname 2 44 à,á,â,ã,ä,å,ç,è,é,ê,ë,ì,í,î,ï,ñ,ò,ó,ô,õ,ö,ù,ú,û,ü,ý,ÿ
    didtok $dname 3 44 ø,¹,²,³,×,÷,¢,£,¼,½,¾
    didtok $dname 4 44 ª,º,°,©,®,¡,¿,¤,§,«,»,¬,±,µ,¶,þ,Þ,Æ,æ,ð,¸,‘,’
  }
  if ($devent == sclick) {
    if ($did == 5) { 
      if ($did($dname,21) == $null) { $asciiwarno }
      elseif $dialog(acro_edit) { did -a acro_edit 2 $did(21) | did -v acro_edit 6 $did(21) | did -r $dname 21 }
      else { did -a acro_main 4 %acro_temp $did(21) | did -r $dname 21 } 
    }
  } 
  if ($devent == dclick) {
    if $did(1).seltext || $did(2).seltext || $did(3).seltext || $did(4).seltext {  
      did -ra $dname 21 $v1 | did -u $dname 1,2,3,4
    }
  }
}
  


and
Code:
dialog acro_edit {
  title (A)(M) Acro Editor
  size -1 -1 211 79
  option dbu
  edit , 1, 4 23 46 10
  edit "", 2, 55 23 150 10
  button "&Cancel", 5, 38 62 37 12, cancel
  button "&Edit Acronym", 6, 82 39 39 12
  text "-= Input Text =-", 7, 6 11 41 7
  text "-= Output Text =-", 8, 104 11 45 7
  button "Ascii &Table", 3, 131 62 37 12
}
on *:dialog:acro_edit:*:*: {
  if ($devent == init) {
    did -a $dname 1 $did(acro_main,3) | did -a $dname 2 $did(acro_main,4)
    did -r acro_main 3 | did -r acro_main 4 | did -h $dname 6
  }
  if ($devent == edit) {
    if $did(1).edited || $did(2).edited == $true {
      did -v $dname 6 
    }
  }
  if ($devent == sclick) {
    if ($did == 3) { od ascii_table }
    if ($did == 6) {
      if %acro_temp { 
        if $hget(amacros) { 
          hdel amacros $did(acro_main,1,%acro_temp) | hadd amacros $did(1) $did(2) 
        } 
        did -o acro_main 1 %acro_temp $did(1) | did -o acro_main 2 %acro_temp $did(2) 
        did -r $dname 1,2 | did -b acro_main 5,6,25 | dialog -x acro_edit
        unset %acro_temp 
      } 
    } 
  }
}
  


these are the dialogs i mentioned..now lets say i want to change an item and i select a character from the acsii dialog.. is it possible to change/replace a character from a line of text in the edit dialog with a new/diff one from the ascii dialog in a one click operation? like it adds to the end. but if i have this: (item) (vaule)
hello hiya
and i want to change hiya into hiÿa ( for example), right now it just adds it to the end of the text but i want to be able to have it insert anywhere i want to place it..
does mirc have that ability??

(sorry for the long winded post, just trying to explain best i can)..



if

Joined: Aug 2004
Posts: 423
C
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Aug 2004
Posts: 423
welp, i guess either the answer is no it'sot possible or no understands what i'm talking about... either way is ok....

heh, i guess this thread can be closed..

Joined: Aug 2003
Posts: 314
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2003
Posts: 314
You just need to use the 'selstart' and 'selend' properties of $did

Code:
  var %a = $did(acro_edit,2)
  did -ra acro_edit 2 $+($left(%a,$did(acro_edit,2).selstart),[color:brown]$did(21)[/color],$mid(%a,$calc(1+$did(acro_edit,2).selend)))

Joined: Aug 2004
Posts: 423
C
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Aug 2004
Posts: 423
OH WOW!

i didn't know what those properties did, let alone how to use them... hehehe still got a ways to go yet.

thanks so much sigh!

don't think i would've gotten that on my own..


Link Copied to Clipboard