|
|
#1 |
|
Junior Member
Join Date: Jul 2009
Posts: 5
|
How to show preview pics for each section?
Hi
I made an installer that can install a fex iconpacks. Now it would be nice if I could show a preview of each section maybe between the set section and size line to the left of sections list? How could I do that? ideas? Thanks alot |
|
|
|
|
|
#2 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
|
You need to add a bitmap control (either at run time using CreateWindowEx or using Resource Hacker) then you can set the bitmap using the LoadImage and SendMessage with ${STM_SETIMAGE} in the MUI_CUSTOMFUNCTION_ONMOUSEOVERSECTION event.
Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Jul 2009
Posts: 5
|
thanks I'll try that..
|
|
|
|
|
|
#4 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
|
Some code here that should help you:
http://nsis.sourceforge.net/Image_in...dow_background You basically want X custom variables to store the handles to your X images you should load in !define MUI_CUSTOMFUNCTION_GUIINIT myOnGUIInit using LoadImage and then destroy in .onGUIEnd using DeleteObject. If you add the bitmap control using Resource Hacker you then just need to use STM_SETIMAGE with IMAGE_BITMAP in the MUI_CUSTOMFUNCTION_ONMOUSEOVERSECTION event with the image handle (stored in your custom variable). Note as the manual says, the section id/index is stored in $0. The first section will be index 0, second index 1 and so on. You can therefore use an ${If} $0 == 0 ... ${ElseIf} $0 == 1 ... to load the correct image (or use a ${Switch}). Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Nov 2006
Location: Argentina
Posts: 142
|
HI Afrow in the sample code ive an error when compile
LicenseData: open failed "bgbitmap.nsi" Usage: LicenseData local_file_that_has_license_text | license_lang_string Error in macro MUI_PAGE_LICENSE on macroline 21 Error in script "C:\NSIS\Image in installer window background.nsi" on line 58 -- aborting creation process Where i could find "bgbitmap.nsi"? |
|
|
|
|
|
#6 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
|
bgbitmap.nsi is the script you are compiling. The license is a dummy - just use any text file.
Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#7 |
|
Senior Member
Join Date: Nov 2006
Location: Argentina
Posts: 142
|
Ups, sorry, thanks
|
|
|
|
|
|
#8 |
|
Junior Member
Join Date: Jul 2009
Posts: 5
|
hmm okay..
your code looks usefull for me, but I can't understand it well... so the recource hacker variant looks easier... but how do I use Recource Hacker for this? I open modern_smalldesc and insert control, chouse Bitmap and set position.. but how can I use this in NSIS code? Sorry I'm really new to this... |
|
|
|
|
|
#9 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
|
Give your bitmap control a unique id, then in the MUI_CUSTOMFUNCTION_ONMOUSEOVERSECTION you need to get a handle to the control using:
FindWindow $R0 `#32770` `` $HWNDPARENT GetDlgItem $R0 $R0 bitmap_control_id ...Where bitmap_control_id is the id number you assigned using Resource Hacker. Also to use the UI (if you haven't already) you need to use it by using !define MUI_UI ui_file.exe. Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#10 |
|
Junior Member
Join Date: Jul 2009
Posts: 5
|
Thanks Afrow UK
I got it working now.. I haven't used resource hacker cause I couldn't get it to work, maybe wrong ID? don't know... but the method from the link worked fine... changed it from onmouseover to on select ![]() Scream81 |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|