mIRC Home    About    Download    Register    News    Help

Print Thread
Multiple default buttons in custom dialogs #78034 05/04/04 12:52 PM
Joined: Mar 2003
Posts: 21
N
Nanaki Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Mar 2003
Posts: 21
I have a tabbed dialog, and each tab has a button that I would like to make the default button within that tab (so when enter is pressed the event relating to that button would occur). However, it seems it is only possible to have one default button for the whole dialog, and not a default button on each tab. Could you please either tell me that it is definitely not possible, so I stop trying, or perhaps detail a way that it is possible?

Thanks in advance-

~Nanaki.

Re: Multiple default buttons in custom dialogs #78035 05/04/04 01:14 PM
Joined: Mar 2003
Posts: 1,271
L
LocutusofBorg Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
Not sure if this will work, but what I'd try is

on *:dialog:sclick:*:*: {
if ($did == id-of-tab) did -f $dname id-of-button
}


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
Re: Multiple default buttons in custom dialogs #78036 05/04/04 01:30 PM
Joined: Dec 2002
Posts: 1,922
O
Online Offline
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
Following Loc's idea...

dialog x {
size -1 -1 52 35
option dbu
tab "A", 1, 1 0 48 32
button "one", 3, 5 16 40 12, default tab 1
tab "B", 2
button "two", 4, 5 16 40 12, tab 2
}

On *:dialog:x:sclick:*:{
if $did == 1 { did -t x 3 }
elseif $did == 2 { did -t x 4 }
elseif $did == 3 || $did == 4 {
echo -a * Clicked button: $did
}
}

Re: Multiple default buttons in custom dialogs #78037 05/04/04 01:42 PM
Joined: Mar 2003
Posts: 21
N
Nanaki Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Mar 2003
Posts: 21
Re: Loc's idea:
Well, it focuses on the button, but then if I type something into the edit box, I lose focus from the button - I want to be able to hit enter and for it to react, which it doesn't.
And also, it is on *:dialog:*:sclick:*:, rather than what you had given which was on *:dialog:sclick:*:*:
Thanks anyway.

Last edited by Nanaki; 05/04/04 01:43 PM.
Re: Multiple default buttons in custom dialogs #78038 05/04/04 01:51 PM
Joined: Dec 2002
Posts: 102
M
MIMP Offline
Vogon poet
Offline
Vogon poet
M
Joined: Dec 2002
Posts: 102
The /did -t switch is suppose to set default. I think that's what Loc was after. Give that a try. From the help file:


The /did command
The /did command allows you to modify the values of controls in a dialog, eg. changing the text in an edit control, or setting focus to a button, or deleting lines in a listbox.

/did -ftebvhnmcukradiogj name id [n] [text | filename]

-f set focus on id
-t set id as default button



-
MIMP
Re: Multiple default buttons in custom dialogs #78039 06/04/04 12:35 PM
Joined: Mar 2003
Posts: 21
N
Nanaki Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Mar 2003
Posts: 21
Ah yes, thankyou Online and MIMP, it works great. I did see that in the help file, but couldn't quite get it to work, perhaps I was using the wrong syntax. Anyway, works now, thanks again!