Old 20th July 2008, 17:59   #121
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Because I haven't had time to apply any patches. Once I got some free time, I made the release to get back on schedule.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 20th July 2008, 18:11   #122
TobbeSweden
Senior Member
 
Join Date: Oct 2006
Posts: 106
Ok, thanks for the explanation
TobbeSweden is offline   Reply With Quote
Old 2nd August 2008, 21:32   #123
Pawel
Moderator
 
Pawel's Avatar
 
Join Date: Aug 2004
Location: Poland
Posts: 528
Send a message via ICQ to Pawel
Can you tell me is it possible to create link using nsdialogs?
Don't know why my code doeasnt work...

PHP Code:
VAR Link

${NSD_CreateLink0 0 250 14 "http://www.winamp.com"
Pop $LINK
${NSD_OnClick$LINK MyLink 
SetCtlColors $LINK 
"0XFF0000" "${MUI_BGCOLOR}"

Function MyLink
  ExecShell 
"open" "http://www.winamp.com"
FunctionEnd 
When i click the link nothing happens
Regards,
-Pawel
Pawel is offline   Reply With Quote
Old 3rd August 2008, 16:45   #124
Comperio
Major Dude
 
Comperio's Avatar
 
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
AFAIK shell commands only work with an actual file.

What I've done before is create a URL shortcut in TEMP and then use the ExecShell open command on the shortcut instead of the URL.

Internet shortcuts are basically just INI files, so you can use WriteIniStr to create them like this:
code:

WriteIniStr "$TEMP\ShortcutFile.url" "InternetShortcut" "URL" "http://www.winamp.com"

(You could also use $PLUGINSDIR instead of $TEMP.)
Comperio is offline   Reply With Quote
Old 3rd August 2008, 17:59   #125
Pawel
Moderator
 
Pawel's Avatar
 
Join Date: Aug 2004
Location: Poland
Posts: 528
Send a message via ICQ to Pawel
Quote:
Originally posted by Comperio
AFAIK shell commands only work with an actual file.

What I've done before is create a URL shortcut in TEMP and then use the ExecShell open command on the shortcut instead of the URL.

Internet shortcuts are basically just INI files, so you can use WriteIniStr to create them like this:
code:

WriteIniStr "$TEMP\ShortcutFile.url" "InternetShortcut" "URL" "http://www.winamp.com"

(You could also use $PLUGINSDIR instead of $TEMP.)
I am not sure I understand you well, but the main reason to use nsDialogs was eliminate writing to ini files. So, I don't want to use any ini files, I just want to run default browser by clicking the link on page created by nsdialogs...
Regards,
-Pawel
Pawel is offline   Reply With Quote
Old 3rd August 2008, 18:07   #126
Sheik
Senior Member
 
Join Date: Feb 2007
Posts: 152
It worked for me, without any troubles. This is the code I use, which looks to be exactly the same as yours...


${NSD_CreateLInk} 364 33 80 16 "Privacy Policy"
Pop $DIGI.Registration.Link
${NSD_OnClick} $DIGI.Registration.Link onClickPrivacyLink


Function onClickPrivacyLink
Pop $0
ExecShell "open" "http://www.digi.com/privacy.jsp"
FunctionEnd
Sheik is offline   Reply With Quote
Old 3rd August 2008, 18:31   #127
Comperio
Major Dude
 
Comperio's Avatar
 
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
hmm... weird.
I'm was certain in a prior project, I was not able to make that work...

FWIW: I did find this article from Microsoft that explains how ShellExecute is supposed to work for launching URLs, and indeed, it seems it should have worked as PepeSoft first posted.

Sorry about the misleading post.
When I get back to my work computer, I'll have to experiment with this more. Maybe there is something else at work here...
Comperio is offline   Reply With Quote
Old 4th August 2008, 15:17   #128
Comperio
Major Dude
 
Comperio's Avatar
 
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
I can't make it fail this time. Sheik's code works correctly no matter what I do. Very strange. I probably wasn't totally awake the first time. (Or an update to NSIS fixed something.) Either way, it's working now. (I'm using NSIS 2.37 in case you're wondering.) And again, sorry for the confusion.
Comperio is offline   Reply With Quote
Old 4th August 2008, 16:21   #129
Pawel
Moderator
 
Pawel's Avatar
 
Join Date: Aug 2004
Location: Poland
Posts: 528
Send a message via ICQ to Pawel
Quote:
Originally posted by Comperio
I can't make it fail this time. Sheik's code works correctly no matter what I do.
Thanks for help. Everything works ok for me now.

@Sheik
Thanks, your example works very good.

Ps: My example works very well too, but I had one label expanded on all page, so I couldn't click on link, because link was under this label
Now, I have to wait for implementing "Hand" cursor over the lnk and color change on hower.
Regards,
-Pawel
Pawel is offline   Reply With Quote
Old 4th August 2008, 21:51   #130
Nicholi
Junior Member
 
Join Date: Jul 2001
Posts: 11
Are multistate checkboxes now available with nsDialogs? Or rather something as simple as a checkbox with three states: unchecked, checked, and greyed?

I know for the Sections at least this is possible, but for custom dialog pages with nsDialogs I don't see anything pre-setup like the other nsDialog macros yet. I did note a few definitions for things like BS_3STATE and BS_AUTO3STATE, if those may have anything to do with it. However I'm not too well aware of the basics of the Styles and ExStyles sent to nsDialogs::CreateControl. Is there anything from msdn/etc I could read to figure out what to do to get this done? Or would it just be a monumental feat of work to make a 3-state checkbox?

Also I think this has been asked many times in NSIS past before, sorry if the answer is already there somewhere. Whether you call them 3-state or multi-state or intermediate states...not sure of the proper term.
Nicholi is offline   Reply With Quote
Old 5th August 2008, 12:45   #131
Sheik
Senior Member
 
Join Date: Feb 2007
Posts: 152
Quote:
Originally posted by PepeSoft
Thanks for help. Everything works ok for me now.

@Sheik
Thanks, your example works very good.

Ps: My example works very well too, but I had one label expanded on all page, so I couldn't click on link, because link was under this label
Now, I have to wait for implementing "Hand" cursor over the lnk and color change on hower.
Regards,
-Pawel
Good deal! I am glad it worked for you.
Its funny about not being able to click on the link because it was under a label... I also had that problem, so I have this comment before the code I posted:

/* We need to create our Link before the Privacy Text, as we need to be "on top" */
Sheik is offline   Reply With Quote
Old 10th September 2008, 22:45   #132
ZmAn3
Senior Member
 
Join Date: Oct 2003
Posts: 178
anyone figure out the code to make a transparent label so i can overlay it on a bmp ive tried the things mentioned earlier in this thread to no avail --thanks
ZmAn3 is offline   Reply With Quote
Old 14th September 2008, 22:32   #133
ZmAn3
Senior Member
 
Join Date: Oct 2003
Posts: 178
For future referance if anyone needs to make a transparent label in Nsdialogs this example works ..

code:

;--create some some label

${NSD_CreateLabel} 10 27 300 16 "Updates Complete."
Pop $HeaderLabelNoUpdates

CreateFont $1 "$(^Font)" "10" "700"
SendMessage $HeaderLabelNoUpdates ${WM_SETFONT} $1 0
SetCtlColors $HeaderLabelNoUpdates FFFFFF "transparent"
ShowWindow $HeaderLabelNoUpdates ${SW_HIDE}
ShowWindow $HeaderLabelNoUpdates ${SW_SHOW}

;--End of create some label

ZmAn3 is offline   Reply With Quote
Old 15th September 2008, 07:12   #134
TobbeSweden
Senior Member
 
Join Date: Oct 2006
Posts: 106
ZmAn3: Thanks for sharing
TobbeSweden is offline   Reply With Quote
Old 7th October 2008, 02:25   #135
ZmAn3
Senior Member
 
Join Date: Oct 2003
Posts: 178
is there a way to set a controls extended style instead of the windows extended style for a control like if i send 0x00000020 which is LVS_EX_FULLROWSELECT it sets the windows style for the control instead so it sets WS_EX_TRANSPARENT thanks
ZmAn3 is offline   Reply With Quote
Old 7th October 2008, 07:26   #136
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,116
you need to send a message to the listview to apply that style, check msdn

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 22nd October 2008, 22:30   #137
ZmAn3
Senior Member
 
Join Date: Oct 2003
Posts: 178
anyone know if and how i can create a child window in nsdialogs winspy shows the it as #32770 with ws_child ws_visible ws_vscroll ws_tabstop ds_setfont ds_3dlook and ds_control thanks
ZmAn3 is offline   Reply With Quote
Old 22nd October 2008, 23:31   #138
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,116
#32770 is the standard windows dialog class, so you would use CreateDialog or DialogBox with the system plugin...but, there is no way to actually implement the message proc needed so there would be no way to handle messages

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 1st December 2008, 11:58   #139
roy204
Junior Member
 
Join Date: May 2004
Posts: 10
Right aligned link control with nsDialogs ?

Hi folks,

I am trying to create a link control that is right aligned and so far I haven't been able to. Is this possible?

I've tried this:

code:

${NSD_CreateLink} 0 176 100% 12u "Some Link"
Pop $MyLabel
${NSD_AddStyle} $MyLabel ${SS_RIGHT}
${NSD_AddExStyle} $MyLabel ${WS_EX_RIGHT}



But to no avail. I understand that if the link is an ownerdrawn custom control (not a static) then it should not accept SS_RIGHT, but even WS_EX_RIGHT does nothing.

Am I out of luck ?
Thanks!
Damien.
roy204 is offline   Reply With Quote
Old 1st December 2008, 21:44   #140
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
The relevant code only cares for the RTL setting of nsDialog itself and not for the applied control styles.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 2nd December 2008, 15:30   #141
roy204
Junior Member
 
Join Date: May 2004
Posts: 10
Sorry to be a pain but I don't think I fully understand the answer (sorry not a native english speaker here).

Is there a way to make a link control have it's text right aligned ?
roy204 is offline   Reply With Quote
Old 2nd December 2008, 21:27   #142
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
No, there's not currently a way to do that.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 5th December 2008, 11:22   #143
roy204
Junior Member
 
Join Date: May 2004
Posts: 10
Thank you for the answer I'll find a way around it.
Cheers,
D.
roy204 is offline   Reply With Quote
Old 10th February 2009, 22:04   #144
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 1,173
alright, well underway to getting everything over to nsDialogs - doing a complete rewrite as I go as there's just too much that was relying on InstallOptions(Ex).

Here's two quick questions...
1. when might an 'error' occur when creating a dialog?
The examples all trap for the 'error' response out of 'nsDialogs::Create' and then call Abort (page gets skipped) - but I'm not seeing anything in the documentation as to what might cause an 'error' response to begin with.

2. I had a peek about and I think there was a thread where it was suggest to file a feature request for an onMouseover callback - has one been logged? If not, where might I log one?
( this would be nice to combine with the SetCursor plugin so that I can make it visually obvious when, for example, a bitmap control is clickable; might use the ToolTips plugin as an alternative of sorts? )
Animaether is offline   Reply With Quote
Old 11th February 2009, 00:24   #145
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Currently, the only "error" would be failure to create the dialog which should never happen.

onMouseOver: https://sourceforge.net/tracker2/ind...49&atid=373088

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 11th February 2009, 00:30   #146
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 1,173
excellent - thanks, kichik; I'll keep the error check in and make a note to do some minor error log handling there
Animaether is offline   Reply With Quote
Old 17th March 2009, 09:26   #147
silo5
Junior Member
 
Join Date: Mar 2009
Posts: 16
I want to create a custom page with a scrollable status message box, similar to the status (details) control in the standard installation page. Is this something that nsDialogs could do, or am I going against a wall? If nsdialogs could do it, would someone sketch it out for me, please? If it couldn't, would someone give me some alternative ideas based on other plugins?
I have looked at the nsis source code to see how the installation page does its thing, I see it's based on a listview control, but the code is way over my head...

The crucial point is that I should append text to the control synchronously, in a way to the text looks like a growing log and the user can scroll back.
---
If nsdialogs could handle controls on the installation page I would use the standard details control, but I read that nsdialogs controls don't work on standard pages, although that was one of the initial design considerations.
silo5 is offline   Reply With Quote
Old 17th March 2009, 10:45   #148
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,116
whats wrong with a listbox? You need some code to set the width of the longest line (But it has already been done, I posted the code on the forum a while back) I also does not have the tooltip like the instfiles page has. It would also be possible to use a listview if thats what you really want, but it will require a bit of system plugin use to handle the LV_ITEM struct

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 17th March 2009, 17:03   #149
silo5
Junior Member
 
Join Date: Mar 2009
Posts: 16
Quote:
Originally posted by Anders
whats wrong with a listbox? ... set the width of the longest line ... does not have the tooltip
Thanks. So I tried the Listbox and it seems good enough. What I'm missing is some way to export the text (like copy to clipboard in instfiles) and horizontal scrolling, which I don't think is possible, and that's maybe why instfiles does have the tooltip. I don't know the maximum length of a line in advance, why did you hint at setting the maximum line width?
silo5 is offline   Reply With Quote
Old 17th March 2009, 17:35   #150
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,116
you can get the scrollbar, http://forums.winamp.com/showthread....hreadid=300489

You could probably pull off the tooltip using my subclass plugin, but if you want a tooltip that bad, you are better off going with a listview and not the simpler listbox

When it comes to export, just having a button that does it is the easy way (I'm sure the wiki or forum has existing clipboard code sample) If you really really want ctrl+c or a context menu, you would have to subclass (My subclass plugin is very much in the alpha stage and you need to know win32 programming to use it)

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 17th March 2009, 18:33   #151
silo5
Junior Member
 
Join Date: Mar 2009
Posts: 16
Thanks Anders, that thread is illuminating!
I need to find out how to Vscroll programmatically. I googled and found a hint about setting the top index with a message, but I haven't fleshed it out yet. Now I'm off to do the Hscroll bar. As regards exporting, I think I will do a simple button.
silo5 is offline   Reply With Quote
Old 15th April 2009, 07:22   #152
silo5
Junior Member
 
Join Date: Mar 2009
Posts: 16
My installer has a single custom page built with nsDialogs.
Sometimes it doesn't repaint custom page areas that were temporarily covered by another window. What techniques are available to work around this kind of repainting issues?

Specifically, when my installer shows a MessageBox over the custom page title area, when I OK the MessageBox parts of the title area may not be repainted. It also happens with the progress bar control which is placed right below the title area.

Andi it may also happen when I replace the MessageBox with a directory or file browse dialog, after OKing the dialog.
silo5 is offline   Reply With Quote
Old 16th April 2009, 04:43   #153
Static_VoiD
Junior Member
 
Join Date: Apr 2009
Location: Lensk, Yakutia
Posts: 16
Send a message via ICQ to Static_VoiD
Hi everybody. I'm new on this forums, but I've been using NSIS for 2 years already. NsDialogs plugin is some awesome thing in the System. So I haven't found any suggestions about my additions so I post 'em here:
(Addressing 2 kichik)
Why don't you add ListView and TreeView support as in InstallOptionsEx?

Thanks, Static_VoiD
Static_VoiD is offline   Reply With Quote
Old 16th April 2009, 07:15   #154
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 1,173
Static - just a matter of time/interest/etc. You can always contribute a solution to the Wiki..
http://nsis.sourceforge.net/Category:NsDialogs_Examples
..or submit a patch to the repository
Animaether is offline   Reply With Quote
Old 16th April 2009, 13:07   #155
Static_VoiD
Junior Member
 
Join Date: Apr 2009
Location: Lensk, Yakutia
Posts: 16
Send a message via ICQ to Static_VoiD
Yeah, i'm aware of the Plugin's NSDialogs examples section, but I wish I had a native support for the controls mentioned. Just add the ability to create them - i'll take care of the rest .
Static_VoiD is offline   Reply With Quote
Old 16th April 2009, 13:19   #156
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 1,173
The difference between 'native' and another header is a single additional "!include <file>" line ; no more, no less.

Creating them is relatively simple, in fact. Adding e.g. treeview items, getting them, etc. are far more involved (requiring the System plugin). So if you can take care of that, surely a !include can't hurt?
Animaether is offline   Reply With Quote
Old 16th April 2009, 14:15   #157
Static_VoiD
Junior Member
 
Join Date: Apr 2009
Location: Lensk, Yakutia
Posts: 16
Send a message via ICQ to Static_VoiD
If you mean I can take sources, modify them and compile - that's Great! But you see, i don't have VC compiler , and i'm dial-up user :-P . So I want you, Animaether, or anybody else to add the necessary lines and compile the plugin. Can anyone here handle it? I'll appreciate that a lot.

- Edit -
Oh, I see plugin can create what I want (AFAIK, early versions didn't support this trick) ! So the thing is how to manage it? If the NSdialogs.nsh lacks of it, them I'm gonna make it possible ! Thanks for replies.

Last edited by Static_VoiD; 16th April 2009 at 14:37.
Static_VoiD is offline   Reply With Quote
Old 16th April 2009, 17:31   #158
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 1,173
Yay for the edit

Not sure how long it's supported this, but it's been there for some time. Have a peek at, for example:
http://nsis.sourceforge.net/NsDialog...eTextMultiline

That's a pretty basic extension of nsDialogs that uses the very same code conventions that all the other nsDialogs controls use in terms of naming, styles, etc. Makes it easier for users/developers to integrate it with their nsDialogs.nsh (although it can be kept separate from it.. it will still depend on nsDialogs.nsh, of course).

In your case, you'd just need to define SysListView32 as the class name and then ponder what styles you might need. You may need to define several classes if some of the styles you're interested in cannot be set after the control has been created; hence why CreateTextMultiline exists - you can't set the multiline style on an Edit control after it has been created.

But, like I said, that's the easy part Good luck!
Animaether is offline   Reply With Quote
Old 16th April 2009, 21:18   #159
Static_VoiD
Junior Member
 
Join Date: Apr 2009
Location: Lensk, Yakutia
Posts: 16
Send a message via ICQ to Static_VoiD
Yep, I know about that too . Another "weird" thing comes to mind: it would be easier to make a plugin which will handle all the operations with getting and setting text into the controls instead of writing .nsh ...Err...I'll give it (.nsh writing) a try anyway .
Static_VoiD is offline   Reply With Quote
Old 17th April 2009, 04:31   #160
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 1,173
Quote:
Originally posted by Nicholi
Are multistate checkboxes now available with nsDialogs? Or rather something as simple as a checkbox with three states: unchecked, checked, and greyed?
Looks like that's one of those styles that you have to set upon creation (can't use NSD_AddStyle / SetWindowLong trickery; which should get abstracted to an NSD_SetStyle, but anyway), so you would have to use something like:

code:

nsDialogs::CreateControl "Button" ${DEFAULT_STYLES}|${WS_TABSTOP}|${BS_TEXT}|${BS_MULTILINE}|${BS_VCENTER}|${BS_AUTO3STATE} 0 0 0 100% 8% "Checkbox"



Most of that is copied from the existing checkbox code in nsDialogs.nsh, except that BS_AUTOCHECKBOX was replaced with BS_AUTO3STATE.

Actually, perusing MSDN some more, it looks like you can set the button style on-the-fly using the BM_SETSTYLE message;
code:

${NSD_CreateCheckbox} 0 0 100% 8% "Checkbox"
Pop $0
StrCpy $1 0
IntOp $1 $1 | ${DEFAULT_STYLES}
IntOp $1 $1 | ${BS_TEXT}
IntOp $1 $1 | ${BS_MULTILINE}
IntOp $1 $1 | ${BS_VCENTER}
IntOp $1 $1 | ${BS_AUTO3STATE}
SendMessage $0 ${BM_SETSTYLE} $1 1



Pretty sure you don't need most of those styles (most are implied, others don't apply to a checkbox-style 'button') and you can just use:
code:
SendMessage $0 ${BM_SETSTYLE} ${BS_AUTO3STATE} 1
Animaether 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