Old 11th May 2011, 17:36   #1
hanenjom
Member
 
Join Date: Apr 2011
Posts: 56
Help Button

Please can you help me,

i need to add a Help Button, and in my Result i need to have a window (.ini), i have a solution
HelpButton::show /NOUNLOAD "232,231" "Help" "Dialog" "/file=C:\NSIS\.....\file.ini" wrap 20
but i hve in result the .ini in lines no a window.
how can i change the HelpButton.dll to display my file.ini.


think you
hanenjom is offline   Reply With Quote
Old 11th May 2011, 20:33   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
The window only displays text. You can't have it showing a custom page. If you want to have a custom page with help information on it, either put it in another executable and extract and run it or add a custom page and only show it when your help button is pressed (don't need HelpButton for this).

Stu
Afrow UK is offline   Reply With Quote
Old 12th May 2011, 04:39   #3
T.Slappy
Major Dude
 
T.Slappy's Avatar
 
Join Date: Jan 2006
Location: Slovakia
Posts: 562
Send a message via ICQ to T.Slappy
I dont entirely understand but isn't there possibility to create dialog with nsDialogs?

Cool looking installers with custom design: www.graphical-installer.com
Create Setup Pages easily: www.install-designer.com
Build installers in Visual Studio 2005-2022: www.visual-installer.com
or RAD Studio 2009 - 11 Alexandria: www.rad-installer.com
T.Slappy is offline   Reply With Quote
Old 12th May 2011, 07:24   #4
jiake
Senior Member
 
jiake's Avatar
 
Join Date: Oct 2007
Location: Shanghai, China
Posts: 207
You can use nsWindows, it could create dialog box.

Contact me: 137729898@qq.com
jiake is offline   Reply With Quote
Old 12th May 2011, 13:47   #5
hanenjom
Member
 
Join Date: Apr 2011
Posts: 56
think for your answers,

but my problem is "how could I call a page from a help button that will contain components such as GroupBox and Label".


Please help me
hanenjom is offline   Reply With Quote
Old 12th May 2011, 14:17   #6
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
http://nsis.sourceforge.net/Go_to_a_NSIS_page
  1. Add a help button (if it's via Resource Hacker then use ButtonEvent plug-in on it)
  2. On click, set a global Var (i.e. $ShowHelp) to 1
  3. Jump to your help page

In your help page's show function, call Abort if $ShowHelp != 1. Also ensure you reset $ShowHelp to 0 when you leave the help page.

The only issue really is that when you enter the help page, the back or next buttons won't take you back to where you were when you clicked the Help button. For that reason to be honest it'd be easier to have a pop-up.

Stu
Afrow UK is offline   Reply With Quote
Old 12th May 2011, 15:12   #7
hanenjom
Member
 
Join Date: Apr 2011
Posts: 56
Re

Hi, in fact am little bit confused here, the pop-up you mentioned earlier you mean a message_box or a whole custom page? cause this last one always ,as you know ,contains the three useless button, (next,back and cancel ).
thnks
hanenjom is offline   Reply With Quote
Old 12th May 2011, 17:06   #8
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
If you want a custom page pop-up, use nsWindows (as mentioned already) which is a modified version of nsDialogs. The other option as I said would be to bundle another NSIS EXE which has one custom page and extract and run that (probably messier than nsWindows).

Stu
Afrow UK is offline   Reply With Quote
Old 13th May 2011, 06:03   #9
jiake
Senior Member
 
jiake's Avatar
 
Join Date: Oct 2007
Location: Shanghai, China
Posts: 207
Create a pop-up dialog with web control, list view and tree view with checkboxes.


See this example script.
Attached Thumbnails
Click image for larger version

Name:	nsWindows1.png
Views:	711
Size:	29.7 KB
ID:	48828   Click image for larger version

Name:	nsWindows2.png
Views:	758
Size:	29.0 KB
ID:	48829  
Attached Files
File Type: zip WebCtrl.zip (21.2 KB, 157 views)

Contact me: 137729898@qq.com
jiake is offline   Reply With Quote
Old 13th May 2011, 09:16   #10
hanenjom
Member
 
Join Date: Apr 2011
Posts: 56
thx

think you for your help, its working , i can finally have my custom Dialog .

thx
hanenjom is offline   Reply With Quote
Old 13th May 2011, 16:29   #11
hanenjom
Member
 
Join Date: Apr 2011
Posts: 56
button to close

Please i need a button to close my custom popup , and return to the origin page.
i create the button, but i have a problem with the event to add on to close.
can you help me please?
thx
hanenjom is offline   Reply With Quote
Old 30th May 2011, 10:43   #12
hanenjom
Member
 
Join Date: Apr 2011
Posts: 56
hi, please i use the help button , but i have a problem,
when I click in my help button I lost my parent page and I have a other page,
how can I still in my parent Page.
my parent page is a custom page.

I use this code :
when i click in my button help i call "CreateHelpButton"

Function CreateHelpButton

nsDialogs::Create 1018
Pop $0

StrCmp $0 error 0 +2
Abort
call CreateCustomDialog

nsDialogs::Show

FunctionEnd

Function CreateCustomDialog

Pop $0
nsWindows::Create $0 0 ${WS_VISIBLE}|${WS_SYSMENU}|${WS_CAPTION} "Help dialog" 1018
Pop $1

${NSW_SetWindowSize} $1 500 350
${NSW_CenterWindow} $1 $HWNDPARENT

StrCmp $1 error 0 +2
Abort

EnableWindow $0 0

${NSW_CreateGroupBox} 3% 4% 90% 10% "blabal"
Pop $R0
${NSW_CreateLabel} 8% 8% 70% 5% "blabal"
Pop $R1

${NSW_CreateGroupBox} 3% 19% 90% 10% "blabal"
Pop $R2
${NSW_CreateLabel} 8% 23% 70% 5% "blabal"
Pop $R3

${NSW_CreateGroupBox} 3% 34% 90% 10% "blabal"
Pop $R4
${NSW_CreateLabel} 8% 38% 70% 5% "blabal"
Pop $R5

${NSW_CreateGroupBox} 3% 49% 90% 10% "blabal"
Pop $R6
${NSW_CreateLabel} 8% 53% 70% 5% "blabal"
Pop $R7

${NSW_CreateGroupBox} 3% 64% 90% 10% "blabal"
Pop $R8
${NSW_CreateLabel} 8% 68% 70% 5% " blabal"
Pop $R9

${NSW_CreateButton} 50% 84% 10% 5% "OK"
Pop $R1

${NSW_OnClick} $R1 CloseCustomDialog
nsWindows::Show
FunctionEnd

Function CloseCustomDialog

SendMessage $1 ${WM_CLOSE} 0 0

FunctionEnd
hanenjom is offline   Reply With Quote
Old 13th May 2011, 17:08   #13
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Send WM_CLOSE to the window (the handle returned from ::Create) using SendMessage.

Stu
Afrow UK is offline   Reply With Quote
Old 14th May 2011, 02:07   #14
jiake
Senior Member
 
jiake's Avatar
 
Join Date: Oct 2007
Location: Shanghai, China
Posts: 207
In this example I use $0 multiple times for dialog handle and other controls. If you want to send message to dialog handle, make sure the value of the variable for dialog's handle in dialog creation function is always the same, use the variable only once.

nsWindows::Create $HWNDPARENT 0 ${WS_VISIBLE}|${WS_SYSMENU}|${WS_CAPTION} "Pop-up dialog" 1018
Pop $0 # handle of dialog

If you use $0 for dialog handle, the variable wouldn't be used again in all event funtions of controls on this dialog. I think you should know.

Contact me: 137729898@qq.com
jiake is offline   Reply With Quote
Old 16th May 2011, 07:25   #15
hanenjom
Member
 
Join Date: Apr 2011
Posts: 56
re

hi,

please, I still can not find how to leave the window and return to the calling page via the button .

I need your help.

thx.
hanenjom is offline   Reply With Quote
Old 16th May 2011, 13:03   #16
hanenjom
Member
 
Join Date: Apr 2011
Posts: 56
hi,

please, I still can not find how to leave the window and return to the calling page via the button .

I need your help.

thx.
hanenjom is offline   Reply With Quote
Old 16th May 2011, 13:28   #17
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
In your button event use:
SendMessage $handle ${WM_CLOSE} 0 0
Where $handle has been mentioned already.

Stu
Afrow UK is offline   Reply With Quote
Old 27th May 2011, 09:14   #18
hanenjom
Member
 
Join Date: Apr 2011
Posts: 56
re

Hi

I try to do this for my close button

Function help
${NSW_CreateButton} 50% 84% 10% 5% "OK"
Pop $R1

${NSW_OnClick} $R1 CloseCustomDialog

nsWindows::Show
FunctionEnd

Function CloseCustomDialog

SendMessage $HWNDPARENT ${WS_CLOSE} 0 0

FunctionEnd

and it's still not working

Please help me.
hanenjom is offline   Reply With Quote
Old 27th May 2011, 09:23   #19
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
It's WM_CLOSE not WS_CLOSE. Where did you get WS_CLOSE from? You should be seeing a compiler warning "unknown variable/constant "{WS_CLOSE}" detected, ignoring" if you haven't defined WS_CLOSE. Don't ignore ANY compiler warnings.

Stu
Afrow UK is offline   Reply With Quote
Old 27th May 2011, 09:52   #20
hanenjom
Member
 
Join Date: Apr 2011
Posts: 56
re

if i use ${WM_Close} , i will close the window for help and the parnet window ...
hanenjom is offline   Reply With Quote
Old 27th May 2011, 13:27   #21
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
That's because you're using $HWNDPARENT which is a handle to the NSIS window. You want the handle returned from nsWindow::Create as we have already explained.

Stu
Afrow UK is offline   Reply With Quote
Old 30th May 2011, 10:08   #22
hanenjom
Member
 
Join Date: Apr 2011
Posts: 56
re

thx for your answers, now i can close my Dialog.

juste my problem is how retur to the parent window?

I have a custom page, when i click in my help button i lost my custom page , she disappears.

how could I stay on the same custom page during the call and help when I close my dialog?

can you help me please.
hanenjom is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast 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