Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 9th July 2009, 13:10   #1
Scream81
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
Scream81 is offline   Reply With Quote
Old 10th July 2009, 11:05   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
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
Afrow UK is offline   Reply With Quote
Old 10th July 2009, 11:25   #3
Scream81
Junior Member
 
Join Date: Jul 2009
Posts: 5
thanks I'll try that..
Scream81 is offline   Reply With Quote
Old 10th July 2009, 11:39   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
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
Afrow UK is offline   Reply With Quote
Old 10th July 2009, 12:25   #5
Boyito
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"?
Boyito is offline   Reply With Quote
Old 10th July 2009, 12:28   #6
Afrow UK
Moderator
 
Afrow UK's Avatar
 
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
Afrow UK is offline   Reply With Quote
Old 10th July 2009, 12:31   #7
Boyito
Senior Member
 
Join Date: Nov 2006
Location: Argentina
Posts: 142
Ups, sorry, thanks
Boyito is offline   Reply With Quote
Old 10th July 2009, 15:01   #8
Scream81
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...
Scream81 is offline   Reply With Quote
Old 10th July 2009, 15:54   #9
Afrow UK
Moderator
 
Afrow UK's Avatar
 
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
Afrow UK is offline   Reply With Quote
Old 10th July 2009, 19:38   #10
Scream81
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
Scream81 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