Skip to content
⌘ NSIS Forum Archive

NSIS Dialog Designer

156 posts

nicorac#

NSIS Dialog Designer

Hello everyone,
after a lot of manually-designed custom dialogs I realized that we need a tool to make this task easier. This tool should be a graphical dialog designer, like the one in Visual Studio.

Here we are, NSIS Dialog Designer is almost ready, and I'd like to hear some feedback from you.
It allows an easier NSIS dialogs design with a modern dockable interface.



It works like this: custom dialog definition is stored into an XML definition file (*.nsddef), which is the file NSIS Dialog Designer manage.
When you save the dialog, NSIS Dialog Designer creates another file (*.nsdinc). This file is a NSIS script containing all the commands needed to create the dialog and all of its controls, including support variables.

For each control you can define name, position and size. You could also link your script functions to control events.

NSIS Dialog Designer is available here: http://coolsoft.altervista.org/

I'd like to hear your feedback...
Afrow UK#
That is very nice! I've stickied the thread. Be cool if you could make a Wiki page for it too.

Stu
Pawel#
Yes, indeed. The tool looks very interesting.
I would like to see there a log field, where user can see in real time compilation progress and eventual errors.
Also, I hope you add more properties for controls (like for example font colour, font type etc).
Keep up good work!
-Pawel
nicorac#
Originally Posted by MSG View Post
Very nice indeed. Could someone port this to a standalone application, please? >__>
What you mean with "standalone"?
NSIS Dialog Designer is already a standalone app, less than 1Mb installed.

Maybe the screenshot is confusing... making you think the IDE has a lot of components.
Actually you only have a toolbox with controls, a property grid and one or more "documents" with your custom dialogs.
nicorac#
Originally Posted by Pawel View Post
I hope you add more properties for controls (like for example font colour, font type etc)
Sure, designer code is modular so adding properties is quite easy.
I referred to this page to add actual properties, and there I can't find a way to set colors.

Is there some macros to do it?
Can you please provide a sample script snippet to set font and color?
nicorac#
Originally Posted by Pawel View Post
I would like to see there a log field, where user can see in real time compilation progress
I'm going to add a (readonly) preview panel where NSIS experienced users can see the generated NSIS script in realtime.
I thought to split the designer tab vertically: the top part will contain the graphical designer and the bottom will have the generated script.

What about it?
Pawel#
Originally Posted by nicorac View Post
Can you please provide a sample script snippet to set font and color?
For example:
; Some text control
${NSD_CreateLabel} 120u 8u 203u 30u "Text to display"
; Set variable for control
Pop $My_Control_Variable
; Set example styles
${NSD_AddStyle} $My_Control_Variable ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS}|${SS_CENTER}

; Create font (http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx)
CreateFont $My_Control_Variable_Font "TAHOMA" "12" "700"
SendMessage $My_Control_Variable ${WM_SETFONT} $My_Control_Variable_Font 0
; Set colours for control (Hwnd, font colour, background colour)
SetCtlColors $My_Control_Variable "0x000000" "Transparent"

-Pawel
Pawel#
Yeah, that is a good idea...
I would like to see GUI designer in main part of window and a source code generated in real time in bottom part of window.
Is it possible user can also edit it in real time (I know that would need a lot work...)?

About compilation preview.. Yeah, that in my opinion should be read only and maybe optional. I like to see what is happening...
-Pawel
nicorac#
Version 0.9.1 was released:
- New dockable content with realtime NSIS generated script preview

Script preview is readonly; its purpose is to allow advanced users to understand what's being generated.
jiake#
1. Most users prefer using dialog unit to pixel, so I think the software should use dialog unit, or you may add an option for user.
2. It will be better if it supports multi-language.
MSG#
Originally Posted by nicorac View Post
What you mean with "standalone"?
NSIS Dialog Designer is already a standalone app, less than 1Mb installed.
I meant something that doesn't require .NET (or other frameworks, like Java). I don't install these things on my systems. Still I'd really like to be able to use this tool, nsDialogs page design takes a lot of time to do manually. :-(
T.Slappy#
Editor looks fantastic!!!
The very first look gave me these ideas:
- add some grid (dotted grid) to main area for better navigation like other IDEs have (+ possibility to turn it on/off) or some kind of ruler
- give some option to choose pixels/units
- name your tool NSIS nsDialogs Editor to be clear that these pages will not work with those deprecated ini files
- add Name into Properties window, all IDEs use the same principe (I suppose you generate name of variable/control as some creepy _fdfjdfjsdh_Label1 which looks terrible)

I am downloading and starting to play with it, great work!

Edit:
I started creating my own form:
- add possibility to generate method name automatically by doubleclick based on controls' name (with Name above)
Example: I have button called Button1
When I double-click in Properties pane into onClick field I expect that method Button1_Click will be generated automatically like Delphi IDE and also appropriate block in script:
Function Button1_Click
; Add your code here
FunctionEnd 
For multiple forms there could be some identifier added:
Form1_Button1_Click or Form1_Edit1_Change etc.
If I want to name my method manually the I need to write it into box (like now)...
nicorac#
Thank you all for thanks and feedbacks!

Originally Posted by jiake View Post
1. Most users prefer using dialog unit to pixel
Added to TODO list

Originally Posted by jiake View Post
2. It will be better if it supports multi-language.
What you mean with multi-language? NSIS Dialog Designer interface or the generated dialogs? If the latter, well, I think you can put variables into control text value, but I'm not so experienced in multilanguage setup scripts...
Can you please provide a code snippet for a multi-language control?

Originally Posted by MSG View Post
I meant something that doesn't require .NET (or other frameworks, like Java)
You're right, I thought the same till WinXP.
But Vista and 7 comes with .NET integrated, so for these users there's no requirements at all 😉. .NET software development is really fast and safe, (I'm an old time C++ dev)

Originally Posted by T.Slappy View Post
add some grid (dotted grid) to main area for better navigation like other IDEs have (+ possibility to turn it on/off) or some kind of ruler
Added to TODO list

Originally Posted by T.Slappy View Post
name your tool NSIS nsDialogs Editor to be clear that these pages will not work with those deprecated ini files
"Dialog" is a generic word that includes nsDialogs 😁
I'm thinking about import support for old INI file styles...

Originally Posted by T.Slappy View Post
add Name into Properties window
Name is already there, I'm investigating why it does not appear 😔
Afrow UK#
Originally Posted by MSG View Post
I meant something that doesn't require .NET (or other frameworks, like Java). I don't install these things on my systems. Still I'd really like to be able to use this tool, nsDialogs page design takes a lot of time to do manually. :-(
.NET/Java makes programming tools like this much faster. Why would you not install them? Lack of disk space 🙂? To port this to native C/C++ would be a lot of work and is probably why a tool such as this has not been written already. I know if I had the choice I would go with .NET every time.

Stu
MSG#
Originally Posted by Afrow UK View Post
Why would you not install them? Lack of disk space 🙂?
JAVA because it's a system hog. .NET I'm not sure anymore, but iirc the boot time increased (that was a long time ago though). But either way I prefer to keep my system clean.

Originally Posted by nicorac View Post
You're right, I thought the same till WinXP.
But Vista and 7 comes with .NET integrated, so for these users there's no requirements at all 😉. .NET software development is really fast and safe, (I'm an old time C++ dev)
I'm sure it's a lot easier to code in .NET, otherwise people wouldn't be using it so much. But I use Win Server 2k3, not XP. And don't forget old laptops or whatever that run XP out of necessity. So there's probably a lot of users who'd have to install .NET to use this tool. Not saying you made a bad choice, just that I wish you had made a different one. :-)
Afrow UK#
Java is far from a system hog. Perhaps you are thinking back to Windows 95 or something when it was in its early days. I would say .NET is much more of a system hog. My .NET apps generally use a lot of memory even for a couple of lines of code. My NSIS assembler uses around 5000K of memory which is tiny considering the size of its code base.

Java can also often be faster than C/C++ because in Java you can't play around with memory pointers. This allows the compiler to do some very sophisticated optimisations which are just not possible in a language like C. Anyway I'm not going to argue with you but I'll just say it's your loss lol 🙂.

Stu
nicorac#
Version 0.9.2 was released:
- missing property "Name" is now shown (Dialog does not have it because name is the same as its definition filename)
Highcoder#
Sure coding in .NET is much easier. But i don´t like these dependencies with frameworks, runtimes etc.

You always have to ensure that they are installed (properly) on target system. And the first startup of a little .NET application with just a dialog an a few buttons feels like eternity.
That´s why i like NSIS installers. They only need themselves. One exe, that´s it.
So I´ve discovered Delpi for me. Easy to learn, fast, GUI designer like MS Visual but no dependencies to runtimes exept you want it.

Cheers

@nicorac: Nice work, I like it a lot. Thumbs up!
jiake#
I mean that I hope your program has a multi-language interface. In a NSIS QQ group, there are many NSIS newbies, they hardly understand English. Although my English is not good, but it is not difficult for me to use an English software.
nicorac#
Originally Posted by jiake View Post
I mean that I hope your program has a multi-language interface
Multilanguage support in .NET is bundled, so quite easy... if you have translators 😁

Added to TODO list.
Let's get out of the beta stage, then I'll publish strings to translate.
nicorac#
Originally Posted by T.Slappy View Post
- add possibility to generate method name automatically by doubleclick based on controls' name (with Name above)
When I double-click in Properties pane into onClick field I expect that method Button1_Click will be generated automatically like Delphi IDE and also appropriate block in script:
What you ask is not so difficult to achieve, but:
- I must generate function Button1_Click inside *.nsdinc file;
- this file is meant to be managed only by NSIS Dialog Designer, and it only WRITES it;

That said you'll be forced to edit Button1_Click function content through NSIS Dialog Designer only, because each time you save the dialog, *.nsdinc file is overwritten.

I think is better to keep things splitted: *.nsdinc contains only dialog creation related script, optionally calling functions defined into your own (main) script.

What about a function to copy a skeleton function into clipboard?
nicorac#
Version 0.9.3 released

NEW: Added new properties ForeColor and BackColor
(not working for: Button, ComboBox, DropList, GroupBox, HLine, VLine, ProgressBar)
NEW: Added new property Font
NEW: Designer now can show a grid (see Tools | Options menu)
BUG: Editor does not save dialogs when exiting with close button.
BUG: Script preview not updated when a new control is added
T.Slappy#
Originally Posted by nicorac View Post
You're welcome.
Stay tuned, right now I'm working on old format INI file import.
I am sorry about this but is it really necessary?
There are a lot of troubles with those ini files and I suppose they should be removed from new NSIS release (I heard about it here on forum)...
MSG#
Originally Posted by T.Slappy View Post
and I suppose they should be removed from new NSIS release (I heard about it here on forum)...
Noone said that InstallOptions support will be removed for NSIS Unicode. Some people merely said that they personally think it should be. That most certainly doesn't mean that it will happen.