Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 27th July 2007, 20:09   #1
kojiroh
Junior Member
 
Join Date: Jun 2007
Posts: 6
dirpage plugin and UI interraction

After using the plugin dirpage with directory page, i test the string entered in the directory field and if the test is wrong, i want to simulate a click on the "back' button or if possible show the directory page again.

So my question is how to simulate a click on the back button or how to show the MUI_PAGE_DIRECTORY

I put the code here for more explication
code:

!macro MUI_FUNCTION_DIRECTORYPAGE PRE SHOW LEAVE

Function "${PRE}"
StrCmp $MUI_INSTALL_ABORTED 1 0 +2
Abort

${If} $MUI_USE_MAINTENANCE_CMDLINE == "TRUE"
!ifdef MUI_SKIP_DIRECTORY_PAGE
Abort
!else
!ifdef MUI_DISABLE_FIRST_BACKBUTTON
GetDlgItem $MUI_TEMP1 $HWNDPARENT 3
EnableWindow $MUI_TEMP1 0
!undef MUI_DISABLE_FIRST_BACKBUTTON
!else ifdef MUI_HIDE_FIRST_BACKBUTTON
GetDlgItem $MUI_TEMP1 $HWNDPARENT 3
ShowWindow $MUI_TEMP1 0
!undef MUI_HIDE_FIRST_BACKBUTTON
!endif
!endif
${EndIf}

!insertmacro MUI_HEADER_TEXT_PAGE $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_DIRECTORY_TITLE) $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_DIRECTORY_SUBTITLE)

!ifdef MUI_USE_DIRPAGEDLL
# Variable for define the default instdir path
Var /GLOBAL DEFAULT_INSTDIR

${IF} $DEFAULT_INSTDIR == ""
StrCpy $DEFAULT_INSTDIR "$INSTDIR"
${ENDIF}

# if $instdir is empty, re-set the default path
${IF} $INSTDIR == ""
StrCpy $INSTDIR "$DEFAULT_INSTDIR"
${ENDIF}

InitPluginsDir
dirpage::show /noicon /spaceavailtext "%d: Total: %t\tFree: %f" /text "$(^DirBrowseText)" $INSTDIR
Pop $R0 ; Get result

StrCmp $R0 "success" ok
StrCmp $R0 "cancel" skip
MessageBox MB_OK "Dir Page error: $R0"
skip:
Return
ok:

;Pop $INSTDIR
pop $R1

${IF} $R1 == ""
; here the code for emulate the back button click
or showing the directory page
${ENDIF}

!else
!insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE
!endif
FunctionEnd

!ifndef MUI_USE_DIRPAGEDLL
Function "${SHOW}"
!insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW
FunctionEnd
!endif

Function "${LEAVE}"
!insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE
messagebox mb_ok "leave end"
FunctionEnd

!macroend




Thanks for your answer
kojiroh is offline   Reply With Quote
Old 27th July 2007, 21:16   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
You can't call that in the pre function of a page.
You can to call it in a custom page show function:

Page Custom CustomPageShow

Function CustomPageShow
...
FunctionEnd

Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK 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