Archive: Large Header/Welcome Bitmap


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


At the moment I have changed Welcome.nsh

;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

Create the bmp control first, then the text after that. Z-order is determined by order of creation.


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


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.


The image controler is already above the text or i am a little stupid : P

 !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}"

Thx, solved this problem

;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

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.

;Title text

${NSD_CreateLabel} 120u 10u 195u ${MUI_FINISHPAGE_TITLE_HEIGHT}u "${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_CreateLabel} 120u ${MUI_FINISHPAGE_TEXT_TOP}u 195u ${MUI_FINISHPAGE_TEXT_HEIGHT}u "${MUI_FINISHPAGE_TEXT}"
!else
${NSD_CreateLabel} 120u ${MUI_FINISHPAGE_TEXT_TOP}u 195u ${MUI_FINISHPAGE_TEXT_HEIGHT_BUTTONS}u "${MUI_FINISHPAGE_TEXT}"
!endif
Pop $mui.FinishPage.Text
SetCtlColors $mui.FinishPage.Text "" "transparent"

;Checkboxes
!ifdef MUI_FINISHPAGE_RUN
${NSD_CreateCheckbox} 120u ${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_CHECKED} 0
!endif
${NSD_SetFocus} $mui.FinishPage.Run
!endif
!ifdef MUI_FINISHPAGE_SHOWREADME
${NSD_CreateCheckbox} 120u ${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_CHECKED} 0
!endif
!ifndef MUI_FINISHPAGE_RUN
${NSD_SetFocus} $mui.FinishPage.ShowReadme
!endif
!endif

.......

;Image control
${NSD_CreateBitmap} 0u 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
>

OK solved this problem too, but there is the next problem now.
I have changed the Finish.nsh


ifdef MUI_FINISHPAGE_SHOWREADME

;${NSD_CreateCheckbox} 120u ${MUI_FINISHPAGE_SHOWREADME_TOP}u 195u 10u "${MUI_FINISHPAGE_SHOWREADME_TEXT}"
${NSD_CreateCheckbox} 120u ${MUI_FINISHPAGE_SHOWREADME_TOP}u 9u 9u ""
Pop $0
${NSD_CreateLabel} 132u ${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_CHECKED} 0
!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. -.-

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.