WINAMP.COM | Forums : Powered by vBulletin version 2.3.9 WINAMP.COM | Forums > Developer Center > NSIS Discussion > Install Options: Save Question
  Last Thread   Next Thread
Author
Thread Post New Thread    Post A Reply
Chieftec
Junior Member

Registered: Oct 2006
From:

Install Options: Save Question

Hi,

i am searching for the easiest way to save the data in the Labels and restore them while switching between the boxes.
My Custom Page:



Every Checkbox on the left side have their own labels.
I hope I have expressed myself clearly enough and you understand what I mean.

Thanks in advance

Quick Link | Report this post to a moderator | IP: Logged

Chieftec is offline Old Post 12-17-2006 03:12 AM
Click Here to See the Profile for Chieftec Click here to Send Chieftec a Private Message Find more posts by Chieftec Add Chieftec to your buddy list Edit/Delete Message Reply w/Quote
Red Wine
Forum King

Registered: Mar 2006
From: Ath. GR

I'm not really sure if I got your point.
Compile and examine the code below to see if it could help you do what you're looking for.

code:
outfile 'CheckboxNotify.exe' showinstdetails show licenseData '${NSISDIR}\License.txt' !define NOCHECKED_TEXT 'Please select a checkbox' !include WinMessages.nsh !include LogicLib.nsh page license page custom CustomCreate CustomLeave page instfiles section - sectionend function .onInit initpluginsdir gettempfilename $0 rename $0 '$PLUGINSDIR\custom.ini' call WriteIni functionend function CustomCreate push $R1 InstallOptions::InitDialog /NOUNLOAD '$PLUGINSDIR\custom.ini' pop $R1 GetDlgItem $R0 $HWNDPARENT 1 EnableWindow $R0 0 InstallOptions::Show '$PLUGINSDIR\custom.ini' pop $R1 functionend function CustomLeave readinistr $0 '$PLUGINSDIR\custom.ini' 'Settings' 'State' ${if} $0 == 1 readinistr $1 '$PLUGINSDIR\custom.ini' 'Field 1' 'Text' readinistr $2 '$PLUGINSDIR\custom.ini' 'Field 5' 'HWND' readinistr $3 '$PLUGINSDIR\custom.ini' 'Field 1' 'State' ${if} $3 == 1 SendMessage $2 ${WM_SETTEXT} 1 'STR:$1' GetDlgItem $R0 $HWNDPARENT 1 EnableWindow $R0 1 ${else} SendMessage $2 ${WM_SETTEXT} 1 'STR:${NOCHECKED_TEXT}' GetDlgItem $R0 $HWNDPARENT 1 EnableWindow $R0 0 ${endif} readinistr $2 '$PLUGINSDIR\custom.ini' 'Field 2' 'HWND' SendMessage $2 ${BM_SETCHECK} 0 0 readinistr $2 '$PLUGINSDIR\custom.ini' 'Field 3' 'HWND' SendMessage $2 ${BM_SETCHECK} 0 0 abort ${elseif} $0 == 2 readinistr $1 '$PLUGINSDIR\custom.ini' 'Field 2' 'Text' readinistr $2 '$PLUGINSDIR\custom.ini' 'Field 5' 'HWND' readinistr $3 '$PLUGINSDIR\custom.ini' 'Field 2' 'State' ${if} $3 == 1 SendMessage $2 ${WM_SETTEXT} 1 'STR:$1' GetDlgItem $R0 $HWNDPARENT 1 EnableWindow $R0 1 ${else} SendMessage $2 ${WM_SETTEXT} 1 'STR:${NOCHECKED_TEXT}' GetDlgItem $R0 $HWNDPARENT 1 EnableWindow $R0 0 ${endif} readinistr $2 '$PLUGINSDIR\custom.ini' 'Field 1' 'HWND' SendMessage $2 ${BM_SETCHECK} 0 0 readinistr $2 '$PLUGINSDIR\custom.ini' 'Field 3' 'HWND' SendMessage $2 ${BM_SETCHECK} 0 0 abort ${elseif} $0 == 3 readinistr $1 '$PLUGINSDIR\custom.ini' 'Field 3' 'Text' readinistr $2 '$PLUGINSDIR\custom.ini' 'Field 5' 'HWND' readinistr $3 '$PLUGINSDIR\custom.ini' 'Field 3' 'State' ${if} $3 == 1 SendMessage $2 ${WM_SETTEXT} 1 'STR:$1' GetDlgItem $R0 $HWNDPARENT 1 EnableWindow $R0 1 ${else} SendMessage $2 ${WM_SETTEXT} 1 'STR:${NOCHECKED_TEXT}' GetDlgItem $R0 $HWNDPARENT 1 EnableWindow $R0 0 ${endif} readinistr $2 '$PLUGINSDIR\custom.ini' 'Field 1' 'HWND' SendMessage $2 ${BM_SETCHECK} 0 0 readinistr $2 '$PLUGINSDIR\custom.ini' 'Field 2' 'HWND' SendMessage $2 ${BM_SETCHECK} 0 0 abort ${endif} functionend function WriteIni WriteIniStr '$PLUGINSDIR\custom.ini' 'Settings' 'NumFields' '5' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 1' 'Type' 'Checkbox' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 1' 'Left' '2' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 1' 'Top' '2' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 1' 'Right' '100' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 1' 'Bottom' '14' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 1' 'Text' 'Checkbox one' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 1' 'State' '0' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 1' 'Flags' 'NOTIFY' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 2' 'Type' 'Checkbox' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 2' 'Left' '2' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 2' 'Top' '18' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 2' 'Right' '100' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 2' 'Bottom' '32' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 2' 'Text' 'Checkbox two' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 2' 'State' '0' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 2' 'Flags' 'NOTIFY' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 3' 'Type' 'Checkbox' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 3' 'Left' '2' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 3' 'Top' '36' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 3' 'Right' '100' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 3' 'Bottom' '50' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 3' 'Text' 'Checkbox three' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 3' 'State' '0' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 3' 'Flags' 'NOTIFY' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 4' 'Type' 'GroupBox' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 4' 'Left' '30' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 4' 'Top' '70' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 4' 'Right' '-31' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 4' 'Bottom' '120' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 4' 'Text' 'Select Checkbox' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 5' 'Type' 'Text' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 5' 'Left' '40' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 5' 'Top' '90' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 5' 'Right' '-41' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 5' 'Bottom' '105' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 5' 'State' '${NOCHECKED_TEXT}' Functionend

__________________
Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS

Quick Link | Report this post to a moderator | IP: Logged

Red Wine is offline Old Post 12-17-2006 04:57 PM
Click Here to See the Profile for Red Wine Click here to Send Red Wine a Private Message Find more posts by Red Wine Add Red Wine to your buddy list Edit/Delete Message Reply w/Quote
Chieftec
Junior Member

Registered: Oct 2006
From:

First I want to thank you for writing the code for me.
But unfortunately this isn't what I want to do. But I think I didn't express myself good enough.
You're reading the text of the checkbox and send it to the label using SendMessage.
I want to save the text in the labels separate for every checkboxes. I will try to make an example:
If I type "This is a test 1" into CB_1_1 and "This is a test 2" into CB_1_2 and I select another CheckBox the labels should disappear empty. Now you type some other text into the labels. If I select CB_1 again the text I type in before ("This is a test 1" & "This is a test 2") should be restored.

I hope you understand me now.

Quick Link | Report this post to a moderator | IP: Logged

Chieftec is offline Old Post 12-18-2006 12:31 AM
Click Here to See the Profile for Chieftec Click here to Send Chieftec a Private Message Find more posts by Chieftec Add Chieftec to your buddy list Edit/Delete Message Reply w/Quote
Red Wine
Forum King

Registered: Mar 2006
From: Ath. GR

I understand you :-)
I believe the provided above code example would help you understand the NOTIFY flag and therefore manage those things that you're looking for. It's just a few steps forward.

__________________
Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS

Quick Link | Report this post to a moderator | IP: Logged

Red Wine is offline Old Post 12-18-2006 08:37 AM
Click Here to See the Profile for Red Wine Click here to Send Red Wine a Private Message Find more posts by Red Wine Add Red Wine to your buddy list Edit/Delete Message Reply w/Quote
All times are GMT. The time now is 09:19 AM. Post New Thread    Post A Reply
  Last Thread   Next Thread
WINAMP.COM | Forums : Powered by vBulletin version 2.3.9 WINAMP.COM | Forums > Developer Center > NSIS Discussion > Install Options: Save Question
Show Printable Version
 | 
Email this Page
 | 
Subscribe to this Thread

Forum Jump:
 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is off
vB code is ON
Smilies are ON
[IMG] code is ON