|
|||||||
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Sep 2006
Location: Springfield, Virginia, USA
Posts: 45
|
MUI Components Page -- How can I control features checked and highlighted
I'm using MUI with the Components page. The desired features show up, both checked, and the first one is highlighted. Is there a way to control which features are selected and/or highlighted by default?
-Mark |
|
|
|
|
|
#2 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,337
|
To make a section not selected by default, use the /o switch in the section definition line.
To highlight a different section by default, send the appropriate message to the tree view in the show callback function of the components page. WinMessages.nsh contains definitions of messages, including tree view messages, iirc. NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Sep 2006
Location: Springfield, Virginia, USA
Posts: 45
|
Thanks. Sorry I somehow overlooked the /o switch info in the documentation.
Regarding sending a tree view message, can you point me to some background info to read about using window messages? I don't see anything in the docs about them, other than elliptical references here and there; and I have no idea of the context of WinMessages.nsh. I see all the !defines but I have no idea how to make use of them, and tree-view is mentioned only in the comments. Is it possible to highlight no section by default? That's all I'm trying to do, cause I think the user might confuse the highlight with the check. -Mark |
|
|
|
|
|
#4 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,337
|
Windows messages are probably best described in MSDN. All you need to know is that it's a form of communicating between windows. You can send the tree view a message saying "select nothing".
Use the following as your components page show function. code: NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Sep 2006
Location: Springfield, Virginia, USA
Posts: 45
|
Thanks, kichik. Just got around to trying this, and it does exactly what I need.
-Mark |
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Sep 2006
Location: Springfield, Virginia, USA
Posts: 45
|
Resurrecting this old thread. Kichik gave me a solution for un-highligting sections in my Components page during installation. Now I'd like to do the same thing for uninstalling, but calling the same function doesn't work. I assume one of the values needs to be different, but I'm still completely in the dark as to what all the numbers and symbols in the solution mean, probably cause I'm not a Windows programmer. Can someone help me make this work for uninstalling as well?
-Mark |
|
|
|
|
|
#7 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,784
|
Are you getting compiler errors? If so, make a copy of that function and rename it un.compShow
IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#8 |
|
Junior Member
Join Date: Sep 2006
Location: Springfield, Virginia, USA
Posts: 45
|
That sounds like it may be the problem, but I can't seem to do what you suggested. Here's the function
Function un.compShow FindWindow $0 "#32770" "" $HWNDPARENT GetDlgItem $0 $0 1032 SendMessage $0 ${TVM_SELECTITEM} ${TVGN_CARET} 0 FunctionEnd And here's how I invoke it !define MUI_UNPAGE_CUSTOMFUNCTION_SHOW un.compShow !insertmacro MUI_UNPAGE_COMPONENTS And here's what the compiler says uninstall function "un.compShow" not referenced - zeroing code (284-288) out This is exactly how I do it for the installation components page, except of the "UN" prefixes. I don't understand why the compiler thinks I haven't referenced the function -Mark |
|
|
|
|
|
#9 |
|
Junior Member
Join Date: Sep 2006
Location: Springfield, Virginia, USA
Posts: 45
|
I found the problem
I needed to change !define MUI_UNPAGE_CUSTOMFUNCTION_SHOW un.compShow to !define MUI_PAGE_CUSTOMFUNCTION_SHOW un.compShow i.e. got rid of the "UN" in the macro name I had put the "UN" in earlier when it wasn't working right, not realizing I just needed to use it in the function name. I thought the compiler would warn me if I got it wrong, but I'm just now realizing that since it's a define and not a macro name, there's no way the compiler would know. Thanks for your help. -Mark |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|