Vertical progress bar?
It is possible to create a vertical progress bars?
6 posts
# Test Progressbar Vertical
Name "NSIS Test"
Caption "NSIS Test"
OutFile "NSIS Test.exe"
InstallDir "$TEMP\NSIS Test"
# COMPRESS
SetCompressor lzma
# RUN
RequestExecutionLevel user
# HIDE # SHOW
ShowInstDetails nevershow
ShowUninstDetails NeverShow
# INCLUDES
!include "MUI2.nsh"
!include "nsDialogs.nsh"
!include "FileFunc.nsh"
!include "WinMessages.nsh"
# Icon & Stye
BrandingText /TRIMRIGHT " "
Icon "Icon\appicon.ico"
!define MUI_ICON "Icon\appicon.ico"
Page custom Page.Custom.Test /ENABLECANCEL
Page instfiles
# LANGUAGES
!insertmacro MUI_LANGUAGE "English" # first language
Function .onInit
FunctionEnd
!define PB_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}
!define PBS_SMOOTH 0x01
!define /math PBM_SETRANGE32 ${WM_USER} + 6
!define PBS_VERTICAL 0x04
Function Page.Custom.Test
Var /GLOBAL Dialog
var /GLOBAL Btn_Test
var /GLOBAL Percent
var /GLOBAL ProgressBar
GetDlgItem $0 $HWNDPARENT 1
ShowWindow $0 ${SW_HIDE}
GetDlgItem $0 $HWNDPARENT 2
ShowWindow $0 ${SW_HIDE}
GetDlgItem $0 $HWNDPARENT 3
ShowWindow $0 ${SW_HIDE}
GetDlgItem $0 $HWNDPARENT 1990
ShowWindow $0 ${SW_HIDE}
GetDlgItem $0 $HWNDPARENT 1991
ShowWindow $0 ${SW_HIDE}
GetDlgItem $0 $HWNDPARENT 1992
ShowWindow $0 ${SW_HIDE}
System::Call "user32::SetWindowPos(i$HWNDPARENT,i,i,i,i 632,i 465,i 0x16)"
nsDialogs::Create /NOUNLOAD 1044
Pop $Dialog
${If} $Dialog == error
Abort
${EndIf}
System::Call "user32::MoveWindow(i$Dialog,i0,i0,i 632,i 465,i0)"
SetCtlColors $Dialog 0xFFD99F 0x0262626
# TEST
nsDialogs::CreateControl /NOUNLOAD STATIC 0x40000000|0x10000000|0x04000000|0x00000100 0x00000020 19%u 15u 8% 10u "0%"
Pop $Percent
SetCtlColors $Percent 0xFFD99F 0x0262626
nsDialogs::CreateControl msctls_progress32 0x40000000|0x10000000|0x04000000|0x01|0x04 0x00000100|0x00000200 5% 30u 5u 205u ""
Pop $ProgressBar
# BTN test
nsDialogs::CreateControl /NOUNLOAD BUTTON 0x40000000|0x10000000|0x04000000|0x00010000 0 50u 220u 60u 15u "&Test Now ..."
Pop $Btn_Test
GetFunctionAddress $0 "on.Click.Test"
nsDialogs::OnClick $Btn_Test $0
SetCtlColors $Btn_Test 0xFFD99F 0x0262626
nsDialogs::Show
FunctionEnd
Function "on.Click.Test"
GetFunctionAddress $0 "ProgressBar"
nsDialogs::CreateTimer $0 100
FunctionEnd
Function ProgressBar
SendMessage $ProgressBar 0x0408 0 0 $1
IntOp $1 $1 + 1
IntCmp $1 100 +1 Done +1
${If} $1 >= 100
GetFunctionAddress $0 "ProgressBar"
nsDialogs::KillTimer $0
${EndIf}
Done:
SendMessage $ProgressBar 0x0402 $1 0
SendMessage $Percent ${WM_SETTEXT} 0 STR:$1%
FunctionEnd
Section
SectionEnd
Function .onGUIEnd
FunctionEnd