mIRC Home    About    Download    Register    News    Help

Print Thread
#194458 04/02/08 11:40 PM
Joined: Feb 2004
Posts: 20
S
Salz Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Feb 2004
Posts: 20
i search for it, i think there wars an way but.. anyway.

it would be nice if we could change the name of an existing instance of a Dialog.
example:
Code:
dialog test {
  title "test"
  size -1 -1 100 100 
  option dbu
  button "test", 1, 2 2 30 30, cancel
}
alias test {
  if ($1) {
    dialog $+(test.,$1) test
  }
}
on *:something_happend:{
  // here is an reason to rename the dialog
}

i think, a well known way to create multiple instances of an dialog, is just to add an $nick or $chan to the dialog name. But for instance, you named it with an $nick. What if $nick changes his nick and you try to find the dialog with $dialog($+(test.,$nick)). You didn't find anythink.

My Suggestion: someting like /renwin for dialogs.

Joined: Aug 2007
Posts: 334
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Aug 2007
Posts: 334
u mean like /dialog -t <name> <new name> ?


This is not the signature you are looking for
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Originally Posted By: foshizzle
u mean like /dialog -t <name> <new name> ?

He means changing the name, /dialog -t changes the title

Joined: Feb 2004
Posts: 20
S
Salz Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Feb 2004
Posts: 20
Originally Posted By: foshizzle
u mean like /dialog -t <name> <new name> ?

would love to see who you get multiple instances of the same dialog with just changing the title :-p

nope, i didn't mean "-t", like Collective meantioned.

Last edited by Salz; 05/02/08 05:43 PM.
Joined: Aug 2007
Posts: 334
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Aug 2007
Posts: 334
why do u want to change the name of a dialog though? confused


This is not the signature you are looking for
Joined: Feb 2004
Posts: 20
S
Salz Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Feb 2004
Posts: 20
maybe i open an $nick related Dialog and it would be nice if i could open more then one of those dialogs (for different nicks). So i easily add the $nick into the $dname. This way i'm able to open near by N dialogs of the same table. But when $nick changes his nick to $newnick the $dname loss his "connection" to $nick. Of cause, i could set global variables with /set %$dname and fill it with $nick, but i'm not a real fan of global variables. Btw, why would you rename an /window if you're able to retitle it?

Last edited by Salz; 05/02/08 09:15 PM.
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
I think that people who don't see the purpose of this feature should probably skip over this discussion rather than add extra noise for those who *do* see the purpose.

I personally think this would be a decent idea, if there's a renwin, I don't see why there can't be a rendialog


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Mar 2008
Posts: 27
7
Ameglian cow
Offline
Ameglian cow
7
Joined: Mar 2008
Posts: 27
ALIAS OpenNickDialog {
var %d $+(nickdialog_,$1)
dialog -m %d
}

on *:dialog:nickdialog_*:init:*: {
var %n $gettok($dname,2-,95)
...
}

wouldnt that do it ?

Joined: Jul 2006
Posts: 4,153
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,153
He would like to be able to rename the dialog after the opening


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Dec 2007
Posts: 48
K
Kol Offline
Ameglian cow
Offline
Ameglian cow
K
Joined: Dec 2007
Posts: 48
Dunno if you can have dynamic dialogs when doing

dialog name {
}

You could try something like
Code:
noop $read($script,w,dialog $dname *)
write -l $+ $readn $script dialog [u]newname[/u]
dialog -m newname newname
write -l $+ $readn $script dialog $dname


Though I highly doubt it would work =P

Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031

He's not talking about changing the name of the dialog table in the script. He's talking about a command to rename the dialog after it has been created. Maybe a switch could be added to the /dialog command to rename the dialog...

/dialog -T <oldname> <newname>

Like foshizzle suggested, but with a cap T.

Joined: Jan 2006
Posts: 468
Fjord artisan
Offline
Fjord artisan
Joined: Jan 2006
Posts: 468
Originally Posted By: Salz
maybe i open an $nick related Dialog and it would be nice if i could open more then one of those dialogs (for different nicks). So i easily add the $nick into the $dname. This way i'm able to open near by N dialogs of the same table. But when $nick changes his nick to $newnick the $dname loss his "connection" to $nick. Of cause, i could set global variables with /set %$dname and fill it with $nick, but i'm not a real fan of global variables. Btw, why would you rename an /window if you're able to retitle it?


/dialog -m Name Dialog

Means
Code:
dialog new_table {
  title "ZOMG"
  size -1 -1 101 83
  option dbu
  button ":-)", 1, 2 2 98 80
}


//dialog -m Blah ZOMG | echo -a $dialog(1)

Assuming that you only have this dialog open, it will return Blah.

basically, this means the dialog is RENAMED.

Tips, if you have internal dialog events, better use an alias like the one you mentions
Code:
alias zomg {
  dialog -m $iif($1,$+(zomg,.,$v),zomg) zomg
}


Then you need to use
On *:doialog:zomg.*:... as your event trigger.

In addition, renaming the dialog via command line is kinda useless, as mIRC provides this feature already, permanently renaming a dialog will require accessing the script file after searching for the dialog, changing, saving and such.

If you need to rename the dialog temporarily, use mIRC's normal way. Other than that? do it manually.

Last edited by symphony; 07/03/08 12:31 AM.
Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031

Simply amazing.

Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Creating a dialog with /dialog -m A B isn't renaming it. The first parameter of the /dialog command is the dialog instance name. The second parameter of the /dialog command is the dialog table name (ie. the name of the dialog layout definition). You can of course have multiple dialogs open that all use the same table. But none of this means anything is renamed.

The OP wants to actually rename existing dialogs without closing and reopening anything in order to account for dialogs that are named after dynamic things (for instance a nickname which might change while a dialog is open). That simply isn't possible using existing commands. You can 'fake' it by storing the dialog's state, closing it, and restoring it with the new name, but that would be a great deal of effort and would probably cause noticeable flicker.


Spelling mistakes, grammatical errors, and stupid comments are intentional.

Link Copied to Clipboard