mIRC Home    About    Download    Register    News    Help

Print Thread
A Check Question #4131 31/12/02 01:18 AM
Joined: Dec 2002
Posts: 174
P
PHMinistries Offline OP
Vogon poet
OP Offline
Vogon poet
P
Joined: Dec 2002
Posts: 174
check "Enable Auto Idel Away",7, 150 50 125 20
button "Apply", 23, 430 250 50 20
question for you


on *:DIALOG:phmawaypref:sclick:7:{ set %enableautoid on }
work when someone clicks on the check mark
that works, but how do i get the check mark to stay checked?

and how do iget it to to set it off if unclicked?

if so how would you get it to set %enableautoid off if unclicked

or how would i do this?

Last edited by PHMinistries; 31/12/02 01:22 AM.
Re: A Check Question #4132 31/12/02 01:29 AM
Joined: Dec 2002
Posts: 144
D
Dana Offline
Vogon poet
Offline
Vogon poet
D
Joined: Dec 2002
Posts: 144
$did().state allows you to verify the state of a checkbox (whether it's checked or not). Use On *:DIALOG:dialogname:init:0:{ to verify the state of certain variables when the dialog is first opened and then use the /did command to check the appropriate boxes.

See this tutorial for a detailed explanation on how to save settings.


"Any sufficiently advanced technology is indistinguishable from magic." - Arthur C. Clarke
Re: A Check Question #4133 31/12/02 01:50 AM
Joined: Dec 2002
Posts: 174
P
PHMinistries Offline OP
Vogon poet
OP Offline
Vogon poet
P
Joined: Dec 2002
Posts: 174
wow that totally reaks of aweosmoeness
just need to get that other question answered on the other post and i think i ve got it the way i need it, (dont think its on that tutoiral
thats awesome thanks so much!

Re: A Check Question #4134 31/12/02 02:27 AM
Joined: Dec 2002
Posts: 271
N
NightChillz Offline
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 271
If you read the help file, all of these questions you are asking about dialogs are well documented there, all the /did and $did() commands are well explained:


Code:
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

  -e	enable id
  -b	disable id
  -v	make id visible
  -h	hide id

  -n	enables editbox
  -m	disables editbox

  -c	check checkbox/radiobutton list/combo line
  -u	uncheck checkbox/radiobutton list/combo line
  -k	works with -cu, keeps other selections in a listbox

  -r	clear all text in id
  -a	add line of text to end
  -d	delete Nth line
  -i	insert text at Nth line
  -o	overwrite Nth line with text

  -g	set a new icon/bmp to an icon control
	/did -g name id [n] filename

  -z	resets the width of horizontal scrollbar in listbox

  -j	resets the edited setting in an editbox

Where name identifies the dialog and id is the id number of the control you want to modify.

If you want to modify several controls at the same time, you can specify multiple id numbers separated by commas, eg. /did -b name 2,12,14,16 etc.

You can select a range of text in an editbox using /did -c name id [n] [start [end]]. This selects line N in editbox, and sets selection to specified range of characters.

You can mark a 3state checkbox as indeterminate by specifying both -cu switches.

You can access the edit control in a combobox by using 0 as the N value.

To change the range of a scrollbar control, you can use /did -z name id [min max].

$did(name,id)
You can get the settings and values of controls in a dialog by using the $did() dialog id identifier with the following formats and properties as appropriate to the control to which you are referring.

 $did(name,id)
 $did(name,id,N)

 If used in the on dialog event, name is optional.

The following $did() properties are supported:


 text	returns line or Nth line
	$did(id) is same as $did(id).text
 len	returns length of line or length of Nth line
 lines	returns number of lines
 sel	returns Line Number of Nth selected line
	if N is 0, returns number of selected lines
 seltext	returns selected text in an editbox or first selected item in a listbox
 selstart	returns select start character in editbox line
 selend	returns select end character in editbox line
 edited	returns $true if text in editbox was changed
 state	returns 0 = off, 1 = on, and 2 = indeterminate
 next	returns id of next control in tab key order
 prev	returns id of previous control in tab key order
 visible	returns $true if the control is visible, otherwise $false
 enabled	returns $true if the control is enabled, otherwise $false

You can access the edit control in a combobox by using 0 as the N value.

$didwm(name,id,wildtext,N)
Returns the number of the line that matches wildtext, with the search starting at line N. N is optional.

$didtok(name,id,C)
Returns a tokenized list of the items in a list/combo/edit box.

You can use /didtok name id C text to add a tokenized list of items to a list/combo/edit box.



Re: A Check Question #4135 31/12/02 02:35 AM
Joined: Dec 2002
Posts: 174
P
PHMinistries Offline OP
Vogon poet
OP Offline
Vogon poet
P
Joined: Dec 2002
Posts: 174
i was lost when i read them and didnt quite understand it all,

i will ask if this would work though

$didwm(name,id,wildtext,N)

for the combobox

$didwm(nameofdialog,id,numberselectedinthecombobox,0)

thats the part i dont understand i get everything else i think

thanks for any help

Re: A Check Question #4136 31/12/02 03:52 AM
Joined: Dec 2002
Posts: 144
D
Dana Offline
Vogon poet
Offline
Vogon poet
D
Joined: Dec 2002
Posts: 144
Alright .. suppose that you had a combo with the following four items in it (in this order):


hello
good
testing
helmet


You can use the $didwm identifier to find out what line a certain string starts at. For instance, you want to know the number of the line that first has a string that starts with hel. You'd use $didwm(dialog,id,hel*). The answer would be 1 since the first item (hello) matches your search criteria.

If you want to know what the number of the line that has a string that starts with hel, but that is AFTER "hello", then you'd use $didwm(dialog,id,hel*,2). The answer would be line 4 (helmet).

Why did we use the number 2 with $didwm? Because we wanted to have the wildcard search start on the second line. We already know that the first line is "hello" and we want to look for other lines that also match the criteria. So we had to skip through the first line.

Hope this explanation helps wink

Dana


"Any sufficiently advanced technology is indistinguishable from magic." - Arthur C. Clarke
Re: A Check Question #4137 31/12/02 04:03 AM
Joined: Dec 2002
Posts: 174
P
PHMinistries Offline OP
Vogon poet
OP Offline
Vogon poet
P
Joined: Dec 2002
Posts: 174
actually that showed me its not what i want doh lol

your a great help though,
im glad you told me cause now i need to look at another thing,

i have a pull down menu
with numbers on them representing minutes

so that if you pulled down 60 it would save it in a variable as 60 min

ill show you what i have

and maybe you can help me tha tway

alias phmawaypref { dialog -m phmawaypref phmawaypref }
dialog phmawaypref {
title "PHM Multi Server Away Preferences"
size -1 -1 500 290
icon graphics/icon.ico, index
text "PHM Multi Server Away Preferences", 1, 120 13 200 20,center
button "OK", 2, 15 250 30 20,ok
text "Select Auto Repeat Message Time", 3, 275 30 200 20, center
combo 4, 340 50 63 100, drop
text "Activate Auto Idle Away", 5, 15 30 200 20,center
combo 6, 80 50 63 100, drop
check "Enable Auto Idel Away",7, 150 50 125 20
check "Enable Away Pager",8, 50 80 115 20
check "Enable Away Nick", 9, 190 80 115 20
text "Away Nick", 10, 350 80 80 20
edit %phmawaynicksc , 11, 320 105 120 20, autohs
Check "DeOP In Channels When Away",12, 50 105 200 20
text "Away Nick Nickserv Password", 13, 310 135 200 20
edit %phmawaynssc ,14,320 160 120 20, autohs
check "Set Back Mode On Click On Channel Input",15, 50 135 220 20
icon 16, 10 200 50 50, graphics/icon.ico, index, center
icon 17, 100 200 50 50, graphics/icon.ico, index, center
icon 18, 200 200 50 50, graphics/icon.ico, index, center
icon 19, 300 200 50 50, graphics/icon.ico, inxed, center
icon 20, 400 200 50 50, graphics/icon.ico, index, center
icon 21, 450 200 50 50, graphics/icon.ico, index, center
button "Cancel", 22, 230 250 50 20,cancel
button "Apply", 23, 430 250 50 20
}
on *:DIALOG:phmawaypref:sclick:23:{ /set %phmawaynicksc $did($dname,11) | /set %phmawaynssc $did($dname,14) }
on *:dialog:PHMawaypref:init:0: {
.did -a PHMawaypref 4 15
.did -a PHMawaypref 4 30
.did -a PHMawaypref 4 45
.did -a PHMawaypref 4 60
.did -a PHMawaypref 4 90
}

how do i get id 4 60 min or any minute to go into a variable to set when someone selects it.

thanks for any help
so far youve been amng the best ive talked to,


Re: A Check Question #4138 31/12/02 04:08 AM
Joined: Dec 2002
Posts: 144
D
Dana Offline
Vogon poet
Offline
Vogon poet
D
Joined: Dec 2002
Posts: 144
I believe that you'd have to take a look at $did().sel or $did().seltext for that. smile

Oh and you can detect when somebody starts selecting something in your combo by using On *:DIALOG:name:sclick:id: { }.

Last edited by Dana; 31/12/02 04:11 AM.

"Any sufficiently advanced technology is indistinguishable from magic." - Arthur C. Clarke
Re: A Check Question #4139 31/12/02 04:09 AM
Joined: Dec 2002
Posts: 3,138
C
Collective Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
on *:DIALOG:phmawaypref:sclick:4:{
set %var $did(4)
}

This is all in the helpfile..