Archive: welcome page alignment


welcome page alignment
Hi ,
I'm trying to control the aligment of the text for the welcome and finish page text (working with hebrew) , evreything else is o.k using MUI_RTL_UI and i'm working with the last version Nsis .

My problem is only with the welcome and finish page , is there any way to work around this problem ?

here is a few things i've tried (with no success) :

Function onGuiInit

GetDlgItem $R0 $MUI_HWND 1201
SendMessage $R0 ${???}

FunctionEnd

this code will return the control for MUI_TEXT_WELCOME_INFO_TITLE
but what message can i send to order it to align ?

maybe i can use an RTF file (using the RTF file will enable me to write an aligned text) ?

a dll ?

any pointers will be much helpfull !

thx
sharon


The code you need is:

!define GWL_STYLE -16
!define GWL_EXSTYLE -20
!define SS_RIGHT 2
!define BS_RIGHT 0x200

# $0 should contain the HWND returned by GetDlgItem
System::Call "user32::GetWindowLongA(i $0, i ${GWL_EXSTYLE}) i .s"
Pop $1
# comment out the one that is not needed
# for labels
IntOp $1 $1 | ${SS_RIGHT}
# for buttons/check boxes/radio buttons
IntOp $1 $1 | ${BS_RIGHT}
System::Call "user32::SetWindowLongA(i $0, i ${GWL_EXSTYLE}, i r1)"


Hopefully, in a short time, none of these will be needed as I will finally finish full RTL support.

You will have to use the initdialog feature of InstallOptions and set the RTL style after calling initdialog (see InstallOptions / Modern UI documentation for details).


Oh right, I didn't notice you put the code in .onGUIInit. That's not the right place. The right place is where Joost said it should be. The InstallOptions dialog that shows the welcome/finish pages doesn't yet exist when .onGUIInit is called.


thx for your answers , but i did'nt get it , where should i call the code from , is that an event (i mean initdialog) ?
do i have to call it from a function ?


In the welcome page case this code should be in the show function of the welcome page (see MUI_CUSTOMFUNCTION_WELCOME_SHOW in the MUI readme). From there you should get the HWND to the dialog item using the code you've posted on your first question:

GetDlgItem $0 $MUI_HWND 1201

After that, $0 contains the desired HWND and my code should be kicked into action. Note that my code should be changed if you RTL a label or a button/radio button/check box (the IntOp lines that's not needed should be commented).