Archive: Bold Text in text area


Bold Text in text area
How can i format some of the lines in a text area of the finish page to be bold?


http://forums.winamp.com/showthread....ght=createfont
See the last post.

Stu


Sorry but i didn't succeed

currently i am using the:

!define MUI_FINISHPAGE_TEXT "Hurray finished the installation\r\nTHIS SHOULD BE A BOLD LINE"

i want the capitalized letters to be bold


You cannot do it that way. You have to add another label and set its font individually with CreateFont and SendMessage with WM_SETFONT.

Stu


Thanks i finally got it


!define MUI_PAGE_CUSTOMFUNCTION_PRE fin_pre
!define MUI_PAGE_CUSTOMFUNCTION_SHOW fin_show
!insertmacro MUI_PAGE_FINISH

Function fin_show

ReadINIStr $0 "$PLUGINSDIR\iospecial.ini" "Field 6" "HWND"
MessageBox MB_OK "${MUI_ICON}"
SetCtlColors $0 0x000000 0xFFFFFF
FindWindow $0 "#32770" "" $HWNDPARENT
GetDlgItem $1 $0 1205 ;1200 + Field number - 1
CreateFont $0 "$(^Font)" "8" "700"; size 8 weight 700 makes it bold
SendMessage $1 ${WM_SETFONT} $0 0
FunctionEnd

Function fin_pre

WriteINIStr "$PLUGINSDIR\iospecial.ini" "Settings" "NumFields" "7"
WriteINIStr "$PLUGINSDIR\iospecial.ini" "Field 6" "Type" "Label"
WriteINIStr "$PLUGINSDIR\iospecial.ini" "Field 6" "Text" "THIS IS THE BOLDED TEXT"
WriteINIStr "$PLUGINSDIR\iospecial.ini" "Field 6" "Left" "120"
WriteINIStr "$PLUGINSDIR\iospecial.ini" "Field 6" "Right" "300"
WriteINIStr "$PLUGINSDIR\iospecial.ini" "Field 6" "Top" "100"
WriteINIStr "$PLUGINSDIR\iospecial.ini" "Field 6" "Bottom" "120"
FunctionEnd

This would be more efficient:


Function fin_show
GetDlgItem $1 $MUI_HWND 1205 ;1200 + Field number - 1
SetCtlColors $1 0x000000 0xFFFFFF
CreateFont $0 "$(^Font)" "8" "700"; size 8 weight 700 makes it bold
SendMessage $1 ${WM_SETFONT} $0 0
FunctionEnd


Stu

Thanks once again
I encountered a very strange behavior:
I have 2 installers that use both some of the function.
One of these functions is the fin_show.
I located all these functions in a lib.nsh file (in order not to write them twice) and included the lib.nsh in the main script of each installer.

If the function is located in the lib - the text is not bolded.
if it is in the main script it works great.


Make sure that you include it after including WinMessages.nsh and MUI.nsh.

Stu


Hi,

I have tried this code to set the MUI_UNPAGE_CONFIRM text to bold but I can't manage to make it work. If I set the code to MUI_PAGE_WELCOME that works correctly. I have tried WinSpy to get ID but don't know what value to take. I must precise that the text of the uninstall confirm is set by !define MUI_UNCONFIRMPAGE_TEXT_TOP "$(TEXT_UNINSTALL)"
Thank you.


In WinSpy its probably Control Id or something like that and the number might be in hex so you have to prefix it with 0x


Ty, i'll try that.