Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 31st May 2011, 10:45   #1
FlasH_10
Junior Member
 
Join Date: Feb 2011
Posts: 10
Large Header/Welcome Bitmap

Hey guys,

i got a problem with MUI2.
I want to show one header image and one welcome image.
This is no problem. I use
!define MUI_HEADERIMAGE_BITMAP
!define MUI_WELCOMEFINISHPAGE_BITMAP

But my image is larger then the area and i want that the image is in the background of the text.
I dont want a big background, only a transparent large bitmap for the header and welcome page.

Hope you can help me

Kind regards
FlasH_10 is offline   Reply With Quote
Old 31st May 2011, 13:53   #2
FlasH_10
Junior Member
 
Join Date: Feb 2011
Posts: 10
At the moment I have changed Welcome.nsh
code:
;Image control
${NSD_CreateBitmap} 0u 0u 199u 193u ""
Pop $mui.WelcomePage.Image


It works. But my problem is to bring the image in the background and the text to the front.

would be nice, if anyone has an idea :P
FlasH_10 is offline   Reply With Quote
Old 31st May 2011, 14:35   #3
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,839
Create the bmp control first, then the text after that. Z-order is determined by order of creation.
MSG is offline   Reply With Quote
Old 1st June 2011, 07:41   #4
FlasH_10
Junior Member
 
Join Date: Feb 2011
Posts: 10
THX
And how can i do this?

I have to change the order of Welcome.nsh or in my NSI script? Sorry dont know :P
FlasH_10 is offline   Reply With Quote
Old 1st June 2011, 08:06   #5
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,839
Well you said you changed the welcome page nsh file, so I'm assuming you inserted the bmp control creation in welcome.nsh. In that case you can just move it up a couple of lines so that it's created before the labels etc are created.
MSG is offline   Reply With Quote
Old 1st June 2011, 08:20   #6
FlasH_10
Junior Member
 
Join Date: Feb 2011
Posts: 10
The image controler is already above the text or i am a little stupid : P

code:
!insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE

;Create dialog
nsDialogs::Create 1044
Pop $mui.WelcomePage
nsDialogs::SetRTL $(^RTL)
SetCtlColors $mui.WelcomePage "" "${MUI_BGCOLOR}"

;Image control
${NSD_CreateBitmap} 0u 0u 199u 193u ""
Pop $mui.WelcomePage.Image
!ifndef MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEFINISHPAGE_BITMAP_NOSTRETCH
${NSD_SetStretchedImage} $mui.WelcomePage.Image $PLUGINSDIR\modern-wizard.bmp $mui.WelcomePage.Image.Bitmap
!else
${NSD_SetImage} $mui.WelcomePage.Image $PLUGINSDIR\modern-wizard.bmp $mui.WelcomePage.Image.Bitmap
!endif



;Positiong of controls

;Title
!ifndef MUI_WELCOMEPAGE_TITLE_3LINES
!define MUI_WELCOMEPAGE_TITLE_HEIGHT 28
!else
!define MUI_WELCOMEPAGE_TITLE_HEIGHT 38
!endif



;Text
;17 = 10 (top margin) + 7 (distance between texts)
!define /math MUI_WELCOMEPAGE_TEXT_TOP 17 + ${MUI_WELCOMEPAGE_TITLE_HEIGHT}



;Title
${NSD_CreateLabel} 120u 10u 195u ${MUI_WELCOMEPAGE_TITLE_HEIGHT}u "${MUI_WELCOMEPAGE_TITLE}"
Pop $mui.WelcomePage.Title
SetCtlColors $mui.WelcomePage.Title "" "${MUI_BGCOLOR}"
CreateFont $mui.WelcomePage.Title.Font "$(^Font)" "12" "700"
SendMessage $mui.WelcomePage.Title ${WM_SETFONT} $mui.WelcomePage.Title.Font 0

;Welcome text
${NSD_CreateLabel} 120u ${MUI_WELCOMEPAGE_TEXT_TOP}u 195u 130u "${MUI_WELCOMEPAGE_TEXT}"
Pop $mui.WelcomePage.Text
SetCtlColors $mui.WelcomePage.Text "" "${MUI_BGCOLOR}"

FlasH_10 is offline   Reply With Quote
Old 1st June 2011, 09:28   #7
FlasH_10
Junior Member
 
Join Date: Feb 2011
Posts: 10
Thx, solved this problem

code:
;Title
${NSD_CreateLabel} 120u 10u 195u ${MUI_WELCOMEPAGE_TITLE_HEIGHT}u "${MUI_WELCOMEPAGE_TITLE}"
Pop $mui.WelcomePage.Title
SetCtlColors $mui.WelcomePage.Title "" "transparent"
;SetCtlColors $mui.WelcomePage.Title "" "${MUI_BGCOLOR}"
CreateFont $mui.WelcomePage.Title.Font "$(^Font)" "12" "700"
SendMessage $mui.WelcomePage.Title ${WM_SETFONT} $mui.WelcomePage.Title.Font 0


;Welcome text
${NSD_CreateLabel} 120u ${MUI_WELCOMEPAGE_TEXT_TOP}u 195u 130u "${MUI_WELCOMEPAGE_TEXT}"
Pop $mui.WelcomePage.Text
SetCtlColors $mui.WelcomePage.Text "" "transparent"
;SetCtlColors $mui.WelcomePage.Text "" "${MUI_BGCOLOR}"


;Image control
${NSD_CreateBitmap} 0u 0u 199u 193u ""
Pop $mui.WelcomePage.Image
!ifndef MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEFINISHPAGE_BITMAP_NOSTRETCH
${NSD_SetStretchedImage} $mui.WelcomePage.Image $PLUGINSDIR\modern-wizard.bmp $mui.WelcomePage.Image.Bitmap
!else
${NSD_SetImage} $mui.WelcomePage.Image $PLUGINSDIR\modern-wizard.bmp $mui.WelcomePage.Image.Bitmap
!endif

FlasH_10 is offline   Reply With Quote
Old 3rd June 2011, 08:11   #8
FlasH_10
Junior Member
 
Join Date: Feb 2011
Posts: 10
i got another problem!

Header image and welcome image works fine. But my finish page is not working right.

All text is in the front of the image with transparent background. Only the readme checkbox and readme text has an background and transparent doesn t work.

PHP Code:
 ;Title text
        
${NSD_CreateLabel120u 10u 195u ${MUI_FINISHPAGE_TITLE_HEIGHT}"${MUI_FINISHPAGE_TITLE}"
        
Pop $mui.FinishPage.Title
        SetCtlColors $mui
.FinishPage.Title "" "transparent"
        
CreateFont $mui.FinishPage.Title.Font "$(^Font)" "12" "700"
        
SendMessage $mui.FinishPage.Title ${WM_SETFONT$mui.FinishPage.Title.Font 0

        
;Finish text
        
!ifndef MUI_FINISHPAGE_RUN MUI_FINISHPAGE_SHOWREADME
          
${NSD_CreateLabel120u ${MUI_FINISHPAGE_TEXT_TOP}u 195u ${MUI_FINISHPAGE_TEXT_HEIGHT}"${MUI_FINISHPAGE_TEXT}"
        
!else
          ${
NSD_CreateLabel120u ${MUI_FINISHPAGE_TEXT_TOP}u 195u ${MUI_FINISHPAGE_TEXT_HEIGHT_BUTTONS}"${MUI_FINISHPAGE_TEXT}"
        
!endif
        
Pop $mui.FinishPage.Text
        SetCtlColors $mui
.FinishPage.Text "" "transparent"
    
        
;Checkboxes
        
!ifdef MUI_FINISHPAGE_RUN
          
${NSD_CreateCheckbox120u ${MUI_FINISHPAGE_RUN_TOP}u 195u 10u "${MUI_FINISHPAGE_RUN_TEXT}"
          
Pop $mui.FinishPage.Run
          SetCtlColors $mui
.FinishPage.Run "" "transparent"
          
!ifndef MUI_FINISHPAGE_RUN_NOTCHECKED
            SendMessage $mui
.FinishPage.Run ${BM_SETCHECK} ${BST_CHECKED0
          
!endif
          ${
NSD_SetFocus$mui.FinishPage.Run
        
!endif
        !
ifdef MUI_FINISHPAGE_SHOWREADME
          
${NSD_CreateCheckbox120u ${MUI_FINISHPAGE_SHOWREADME_TOP}u 195u 10u "${MUI_FINISHPAGE_SHOWREADME_TEXT}"
          
Pop $mui.FinishPage.ShowReadme
           SetCtlColors $mui
.FinishPage.ShowReadme "" "transparent"
          
!ifndef MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
            SendMessage $mui
.FinishPage.ShowReadme ${BM_SETCHECK} ${BST_CHECKED0
          
!endif
          !
ifndef MUI_FINISHPAGE_RUN
            
${NSD_SetFocus$mui.FinishPage.ShowReadme
         
!endif
        !endif

.......

 ;
Image control
    
${NSD_CreateBitmap0u 0u 331u 193u ""
    
Pop $mui.FinishPage.Image
    
!ifndef MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEFINISHPAGE_BITMAP_NOSTRETCH
      
${NSD_SetStretchedImage$mui.FinishPage.Image $PLUGINSDIRmodern-wizard.bmp $mui.FinishPage.Image.Bitmap
    
!else
      ${
NSD_SetImage$mui.FinishPage.Image $PLUGINSDIRmodern-wizard.bmp $mui.FinishPage.Image.Bitmap
    
!endif
    
    ;
Show page
    Call 
${MUI_PAGE_UNINSTALLER_FUNCPREFIX}muiPageLoadFullWindow
    
!insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW
    nsDialogs
::Show
    Call 
${MUI_PAGE_UNINSTALLER_FUNCPREFIX}muiPageUnloadFullWindow 
FlasH_10 is offline   Reply With Quote
Old 3rd June 2011, 10:08   #9
FlasH_10
Junior Member
 
Join Date: Feb 2011
Posts: 10
OK solved this problem too, but there is the next problem now.
I have changed the Finish.nsh
PHP Code:
!ifdef MUI_FINISHPAGE_SHOWREADME
          
;${NSD_CreateCheckbox120u ${MUI_FINISHPAGE_SHOWREADME_TOP}u 195u 10u "${MUI_FINISHPAGE_SHOWREADME_TEXT}"
          
${NSD_CreateCheckbox120u  ${MUI_FINISHPAGE_SHOWREADME_TOP}u 9u 9u ""
          
Pop $0
          
${NSD_CreateLabel132u ${MUI_FINISHPAGE_SHOWREADME_TOP}u 195u 10u "${MUI_FINISHPAGE_SHOWREADME_TEXT}"
          
Pop $mui.FinishPage.ShowReadme
          SetCtlColors $mui
.FinishPage.ShowReadme "" "${MUI_BGCOLOR}"
          
!ifndef MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
            SendMessage $mui
.FinishPage.ShowReadme ${BM_SETCHECK} ${BST_CHECKED0
          
!endif
          !
ifndef MUI_FINISHPAGE_RUN
            
${NSD_SetFocus$mui.FinishPage.ShowReadme
          
!endif
        !endif 
But now, my checkbox doesn t work. If i have checked the checkbox, the readme file doesn t open. -.-
FlasH_10 is offline   Reply With Quote
Old 3rd June 2011, 14:04   #10
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,839
You pop the checkbox's HWND to $0. I'm pretty sure MUI2 always pops it to a varaible, which it would then use later on to check the state.
MSG 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