Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 12th January 2003, 15:41   #1
Prinz
Junior Member
 
Join Date: Jan 2003
Location: The Netherlands
Posts: 24
Question 2 textfields

Hi,

I have 2 textfields on a custom page. One of them needs to be filled in, but not both. How to prevent going to the next page when

a) nothing is filled in
b) both are filled in

c) finally detect which one is filled in?

I've tried a lot things..but can't figure it out.

Greetz!
Prinz is offline   Reply With Quote
Old 12th January 2003, 17:15   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,337
There is currently no other option than checking the INI file after IO exits and call it again if needed.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 14th March 2003, 06:14   #3
cybereka
Junior Member
 
Join Date: Mar 2003
Location: India
Posts: 22
I need to insert a custom page which should have a text box to get a key value this i am trying out to have a license module like. So can some body say what is the procedure to insert a custom page. I checked a lot but confussed. So if any one can provide me step by step action i will be very thankful to u.
cybereka is offline   Reply With Quote
Old 14th March 2003, 06:33   #4
deguix
Major Dude
 
deguix's Avatar
 
Join Date: Dec 2002
Location: Everett - MA, USA
Posts: 1,351
Send a message via ICQ to deguix
Please attach the script file.

My Wiki Pages

Working now on:
New projects. (language: any)
deguix is offline   Reply With Quote
Old 14th March 2003, 07:03   #5
cybereka
Junior Member
 
Join Date: Mar 2003
Location: India
Posts: 22
With the help of the examples now i got inserted a page and placed 3 text boxes in it also but where will the values entered will be stored, how can i access the value and one more i want to control the textbox to take not more that five chars. Many thank for u deguix
cybereka is offline   Reply With Quote
Old 14th March 2003, 07:10   #6
deguix
Major Dude
 
deguix's Avatar
 
Join Date: Dec 2002
Location: Everett - MA, USA
Posts: 1,351
Send a message via ICQ to deguix
Quote:
where will the values entered will be stored
In the State of the control:

Ex.:

[Field 7]
Type=text
Left=10
Right=70
Top=1
Bottom=13
State=C:\Path

Quote:
how can i access the value
Read the State of the control.

Ex.:

ReadINIStr $0 "inifile.ini" "Field 7" "State"

Quote:
I want to control the textbox to take not more that five chars.
In the INI, use "MaxLen" for value name and "5" to the value of this value name.

Ex.:

[Field 1]
Type=text
MaxLen=5
Left=65
Right=108
Top=1
Bottom=13

My Wiki Pages

Working now on:
New projects. (language: any)
deguix is offline   Reply With Quote
Old 14th March 2003, 07:35   #7
cybereka
Junior Member
 
Join Date: Mar 2003
Location: India
Posts: 22
Is the State path is for the inifile.ini whether its a different file or the same file in which i specified the textboxes
cybereka is offline   Reply With Quote
Old 14th March 2003, 07:46   #8
deguix
Major Dude
 
deguix's Avatar
 
Join Date: Dec 2002
Location: Everett - MA, USA
Posts: 1,351
Send a message via ICQ to deguix
State=C:\Path

This is only an example, can be anything:

State=fsdfghsrot348509ue0sjp042q wr a[lfnsçoiuterbtnç odut58ps0948560

This will be show at the text box (or any control, if is a checkbox or radiobutton, will return 1 if enabled and 0 if disabled).

My Wiki Pages

Working now on:
New projects. (language: any)
deguix is offline   Reply With Quote
Old 14th March 2003, 08:26   #9
cybereka
Junior Member
 
Join Date: Mar 2003
Location: India
Posts: 22
Well my ini file is named License i made a entry State for my text as State=00000 their and then in my script i ReserveFile License.ini and in .onInit function i use this !insertmacro MUI_INATALLOPTIONS_EXTRACT "License.ini" then in the start of my section i say ReadINIStr $0 "License.ini" "Field 2" "State" and try to display this in a message box but i am getting it empty what could be the problem? I follewed all those previou steps from the example provided with the kit. Sorry for this long definition even i can post my script but its too long.
cybereka is offline   Reply With Quote
Old 14th March 2003, 08:27   #10
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
The Modern UI uses the plugins directory.

You should use:

!insertmacro MUI_INSTALLOPTIONS_READ $0 "License.ini" "Field 2" "State"

instead of ReadINIStr
Joost Verburg is offline   Reply With Quote
Old 14th March 2003, 08:48   #11
cybereka
Junior Member
 
Join Date: Mar 2003
Location: India
Posts: 22
Yes i am getting it now but is there any way to set the focus to next text box when the user types more than the maxlen of the textbox. With lots of thanks.
cybereka is offline   Reply With Quote
Old 14th March 2003, 08:54   #12
cybereka
Junior Member
 
Join Date: Mar 2003
Location: India
Posts: 22
One more question i am calling a C exe from the script how can i set the error flag of the script from C code. Like if i return -1 from the code will it set the error flag of the script
cybereka is offline   Reply With Quote
Old 14th March 2003, 08:55   #13
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
Nope. You will have to modify the InstallOptions sorce, or use one textbox.
Joost Verburg is offline   Reply With Quote
Old 15th March 2003, 10:34   #14
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,337
Quote:
One more question i am calling a C exe from the script how can i set the error flag of the script from C code. Like if i return -1 from the code will it set the error flag of the script
Use ExecWait and specify an output variable for the error code. The error code is the integer returned from the main function of your C code, or the integer passed on to ExitProcess if not using CRT (like NSIS does, ignore default libraries). For Example:

PHP Code:
ExecWait $TEMPMyProg.exe $0
StrCmp 
$-1 error
  
Return
error:
  
DetailPrint error 

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump