Old 14th September 2021, 14:34   #1
grs1961
Junior Member
 
Join Date: Apr 2009
Posts: 12
How do I replicate MUI_PAGE_DIRECTORY as a "MUI_PAGE_FILE"

To expand, I can use MUI_PAGE_DIRECTORY to select directories, I would like to have a visually similar page that allows me to select files.

I can't see anything that does it.

I can't find anything about the source of MUI or MUI2 to scan for the values used, or any mention in the forum. (No doubt it is all over there ==> and I've just missed it completely! )

I have eyeballed-up something that looks similar, but if the source, or even just the real size and location values and so forth used are around I'd like to know them!

Here is my looks-a-bit-alike code:
PHP Code:
Function MagicFile
    
!insertmacro MUI_HEADER_TEXT "Magic File" ""

    
nsDialogs::Create 1018
    Pop $nsDlg

    
${NSD_CreateGroupBox070u 10034u "Magic File"
    
Pop $0    ; And discard

    
${NSD_CreateFileRequest10u 85u 7012u $Magic.path
    Pop $Magic
.control

    
${NSD_CreateBrowseButton7683u 2015u "Browse..."
    
Pop $Magic.Button.control
    
${NSD_OnClick$Magic.Button.control BrowseMagic

    nsDialogs
::Show
FunctionEnd 
It works, but it isn't quite right.
grs1961 is offline   Reply With Quote
Old 15th September 2021, 12:49   #2
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 916
I don't think there are any templates to use for appearance. Looks fine to me.

You can use ${NSD_GetText} to get the text of the edit box, and ${NSD_SetText} to set it. You could even use ${NSD_OnChange} on the edit box to automatically get the text and store it whenever it changes.

I've written a dialog in the past that fetches a file with an "open file" dialog.

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 16th September 2021, 05:23   #3
grs1961
Junior Member
 
Join Date: Apr 2009
Posts: 12
Oh, I have the OnClick function, and all those bits, and it works fine, I just want to make
my page look identical to the MUI_PAGE_DIRECTORY page.

If the source code for MUI2 (or MUI) was around, I'd just blag it from from there, but I can't find the source.
grs1961 is offline   Reply With Quote
Old 16th September 2021, 08:42   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,418
https://sourceforge.net/p/nsis/code/.../UIs/modern.rc

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 16th September 2021, 09:13   #5
grs1961
Junior Member
 
Join Date: Apr 2009
Posts: 12
Thank you!

Now to resurrect my faded memories of .rc files.
grs1961 is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast 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