Old 9th March 2015, 06:50   #121
nicorac
NSIS Dialog Designer Author
 
Join Date: Apr 2011
Posts: 69
I'm still missing the point, sorry.
Can't you call fnc_XXX_Create (that doesn't show the dialog) instead of fnc_XXX_Show and do all of your testing outside the .nsi file?

My intent is to keep NSISDialogDesigner as much "code-free" as possible, because it's not a code editor.
The code-related control properties (*CustomScript) are there to take care of very special designer related needings, not covered by the designer itself.

If I missed something, please post a very simple example, maybe with pseudo-code, to explain your needings.
nicorac is offline   Reply With Quote
Old 9th March 2015, 19:41   #122
shadowpoa
Member
 
Join Date: Jun 2011
Posts: 52
Ok

I undestand that.. thanks!
shadowpoa is offline   Reply With Quote
Old 9th March 2015, 20:13   #123
shadowpoa
Member
 
Join Date: Jun 2011
Posts: 52
some more few little bugs

When changing the attribute readonly on number control I found these errors...

PHP Code:
; === ins_txt_cnpj (typeNumber) ===
  ${
NSD_CreateNumber53.32u 158.77u 80.96u 12.92u ""
  
Pop $R0
 SetCtlColors $R0 0x000000 0xECE9D8 
TextLimit also doesn't work, nothing happens!
shadowpoa is offline   Reply With Quote
Old 10th March 2015, 09:42   #124
nicorac
NSIS Dialog Designer Author
 
Join Date: Apr 2011
Posts: 69
Thumbs up New version 1.3.3 released

Quote:
Originally Posted by shadowpoa View Post
When changing the attribute readonly on number control I found these errors...
PHP Code:
; === ins_txt_cnpj (typeNumber) ===
  ${
NSD_CreateNumber53.32u 158.77u 80.96u 12.92u ""
  
Pop $R0
 SetCtlColors $R0 0x000000 0xECE9D8 
TextLimit also doesn't work, nothing happens!
Thanks for reporting it.
I've just released version 1.3.3 that fixes those bugs.

You can download it from here: http://coolsoft.altervista.org/nsisdialogdesigner
nicorac is offline   Reply With Quote
Old 16th March 2015, 16:13   #125
shadowpoa
Member
 
Join Date: Jun 2011
Posts: 52
Hi,

Another little problem:

When creating hline control, nsis wants you to pop his handle from stack, but edit doesn't add the code automatically, it just creates the control but doesn't pop it.

Here´s a sample.


; handle variables
Var hCtl_teste2

PHP Code:
dialog create function
Function 
fnc_teste2_Create
  
  
; === teste2 (typeDialog) ===
  
nsDialogs::Create 1018
  Pop $hCtl_teste2
  
${If} $hCtl_teste2 == error
    Abort
  
${EndIf}
  !
insertmacro MUI_HEADER_TEXT "Dialog title..." "Dialog subtitle..."
  
  
; === HLine1 (typeHLine) ===
  ${
NSD_CreateHLine42.13u 47.38u 229.06u 1.23u "HLine1"
  
FunctionEnd 
shadowpoa is offline   Reply With Quote
Old 16th March 2015, 20:44   #126
shadowpoa
Member
 
Join Date: Jun 2011
Posts: 52
ChangeUI

can you add an option to specify other exe for ui than modern.exe?
I know I can change the rect in dialog id field, but not all options are supported..

as say the text below:
PHP Code:
ChangeUI



Replaces dialog 
(IDD_LICENSEIDD_DIRIDD_SELCOMIDD_INSTIDD_INSTFILESIDD_UNINST or IDD_VERIFYby a dialog with the same resource ID in ui_file.exeYou can also specify 'all' as the dialog if you wish to replace all 7 of the dialogs at once from the same UI file. For some example UIs look at Contrib\UIs under your NSIS directory.


IDD_LICENSE must contain IDC_EDIT1 (RICHEDIT control).
IDD_DIR must contain IDC_DIR (edit box), IDC_BROWSE (button) and IDC_CHECK1 (checkbox).
IDD_SELCOM must contain IDC_TREE1 (SysTreeView32 control), and IDC_COMBO1 (combo box).
IDD_INST must contain IDC_BACK (button), IDC_CHILDRECT (static control the size of all other dialogs), IDC_VERSTR (static), IDOK (button), and IDCANCEL (button). If an image control (static with SS_BITMAP stylewill be found in this dialog it will be used as the default for SetBrandingImage

IDD_INSTFILES must contain IDC_LIST1 
(SysListView32 control), IDC_PROGRESS (msctls_progress32 control), and IDC_SHOWDETAILS (button).
IDD_UNINST must contain IDC_EDIT1 (edit box).
IDD_VERIFY must contain IDC_STR (static).


Parameters:

dialog ui_file.exe


Example
:

ChangeUI all "${NSISDIR}\Contrib\UIs\sdbarker_tiny.exe" 
shadowpoa is offline   Reply With Quote
Old 17th March 2015, 09:42   #127
nicorac
NSIS Dialog Designer Author
 
Join Date: Apr 2011
Posts: 69
Version 1.4.0 released

Just released version 1.4.0.

Quote:
Originally Posted by shadowpoa View Post
When creating hline control, nsis wants you to pop his handle from stack...
You're right, it will also cause a (small) stack leak.
Now fixed, thanks.

Quote:
can you add an option to specify other exe for ui than modern.exe?
I know I can change the rect in dialog id field, but not all options are supported..
You can set custom size only if dialogID is different from 1018 and 1040, and some other UIs use these values (but with different sizes).
I added a new property DialogUI: when set to custom you're now free to set any DialogID and Size.
DialogUI default value is "modern" (corresponding to "modern.exe"), so dialogs created with previous versions are still working.

Should be great to have a list of known <DialogUIs, DialogIDs, width, height>, like:
code:
"modern.exe", 1018, <width>, <height>
"modern.exe", 1040, <width>, <height>
"sdbarker_tiny.exe", xxx, <width>, <height>
"sdbarker_tiny.exe", yyy, <width>, <height>
...


but it's a long task and I actually don't have the time to prepare it.

If you could help... I'll add it to next version .
Thanks for your help.
nicorac is offline   Reply With Quote
Old 17th March 2015, 12:25   #128
shadowpoa
Member
 
Join Date: Jun 2011
Posts: 52
thanks!

I´ll be glad to help, what you need me to do?

Other small but annoyng thing, is it possible to make labels transparent on designer window?

Thanks for the fast response and version...
shadowpoa is offline   Reply With Quote
Old 17th March 2015, 15:19   #129
nicorac
NSIS Dialog Designer Author
 
Join Date: Apr 2011
Posts: 69
Quote:
Originally Posted by shadowpoa View Post
I´ll be glad to help, what you need me to do?
Thanks for your offer, but this is not an easy task unless you're a C++ programmer...

You should open each available UI exe with a resource editor (or with VisualStudio, see the attached image), then find contained dialogs (but only the ones used as "containers") and extract their dialogID, width and height. Width and Height are represented in DialogUnits, so they must also be converted to pixels...
Once I have these informations (in a .txt file) I could make DialogID property of the editor show only the dialogs belonging to the given DialogUI.

Not an easy task, I hope I'll find some more spare time to dedicate to this.
Attached Thumbnails
Click image for larger version

Name:	2015-03-17_17-07-10.jpg
Views:	339
Size:	110.3 KB
ID:	51743  
nicorac is offline   Reply With Quote
Old 17th March 2015, 16:34   #130
shadowpoa
Member
 
Join Date: Jun 2011
Posts: 52
but...

Thinking of that, I just created the new dialogui with resource hacker, cant I just select the UI I have and the editor show the files instead of "custom" and adds to test script

PHP Code:
ChangeUI all "${NSISDIR}\Contrib\UIs\sdbarker_tiny.exe" 
for example... and then we can test with our own UI instead of creating one?

Sure, creating new UI´s on dialog designer would be a Cool option, but this should be good enough to test out own code...

Other thing that would be cool to support is the great plugin nswindows:

http://forums.winamp.com/showthread....ight=nswindows
shadowpoa is offline   Reply With Quote
Old 18th March 2015, 18:50   #131
shadowpoa
Member
 
Join Date: Jun 2011
Posts: 52
little bug... and suggestion.

CreateFuncionCustomScript and FooterCustomScript are inverted...

And to be more understandable fields should appear in the order that are included in the script, and not in alphabetical order.
shadowpoa is offline   Reply With Quote
Old 19th March 2015, 13:05   #132
nicorac
NSIS Dialog Designer Author
 
Join Date: Apr 2011
Posts: 69
Quote:
Originally Posted by shadowpoa View Post
CreateFuncionCustomScript and FooterCustomScript are inverted...
What you mean?
CreateFuncionCustomScript is meant con contain custom code to be added at the end of Create function, when all controls have been created. Property description (show them by right-clicking the property grid and check "Descriptions") says "NSIS script you want to append to the *Create function of generated .nsdinc script".
FooterCustomScript is custom code added at the end of the .nsdinc file.

As for the properties ordering, that's out of my control.
PropertyGrid is a .NET Framework component and properties are self read by that component through reflection... VisualStudio has the same... issue.
nicorac is offline   Reply With Quote
Old 19th March 2015, 18:19   #133
shadowpoa
Member
 
Join Date: Jun 2011
Posts: 52
my mistake!

sorry... dont have read the description "CreateFuncionCustomScript" sends me to "create a function" that is done by "FooterCustomScript


Quote:
PropertyGrid is a .NET Framework component and properties are self read by that component through reflection... VisualStudio has the same... issue.
I understand that... but thanks for always fast reply...

and on the suggestion of ChangeUI?
shadowpoa is offline   Reply With Quote
Old 20th March 2015, 16:57   #134
shadowpoa
Member
 
Join Date: Jun 2011
Posts: 52
New little bug:

when saving an archive with another name, titlebar doesn't update, making difficult to have sure of what archive is being written...

In print attached I "saved as" from "tela_lalala.nsdef" to "tela_uninst.nsdef", but the name have been updated only in tab...

See attachment...

Thanks!!
Attached Thumbnails
Click image for larger version

Name:	Capturar.PNG
Views:	156
Size:	3.1 KB
ID:	51747  
shadowpoa is offline   Reply With Quote
Old 23rd March 2015, 18:29   #135
shadowpoa
Member
 
Join Date: Jun 2011
Posts: 52
Just one Label RTL

After some testing, I figured out that Ex Style for just one label RTL is ${WS_EX_LAYOUTRTL} not ${WS_EX_RTLREADING}.. please fix or add this stype, its already included on nsdialogs.nsh by default.

Here some reference... https://msdn.microsoft.com/en-us/lib...(v=vs.85).aspx

for me, just add WS_EX_LAYOUTRTL did the trick... below and example.

PHP Code:
  ; === sr_lbl_prcnt (typeLabel) ===
  ${
NSD_CreateLabel487 263 111 23 ""
  
Pop $lbl_prcnt
  
${NSD_AddExStyle$lbl_prcnt ${WS_EX_LAYOUTRTL
Thanks!

Last edited by shadowpoa; 23rd March 2015 at 18:32. Reason: add example and additional info
shadowpoa is offline   Reply With Quote
Old 23rd March 2015, 21:09   #136
nicorac
NSIS Dialog Designer Author
 
Join Date: Apr 2011
Posts: 69
Quote:
Originally Posted by shadowpoa View Post
and on the suggestion of ChangeUI?
Still working on it, but actually I'm a bit... out of spare time
nicorac is offline   Reply With Quote
Old 24th March 2015, 12:39   #137
shadowpoa
Member
 
Join Date: Jun 2011
Posts: 52
:d

do not worry, just asked to know ...
shadowpoa is offline   Reply With Quote
Old 26th March 2015, 19:13   #138
shadowpoa
Member
 
Join Date: Jun 2011
Posts: 52
Hi,

I am doing some cleanup in my code, i have noticed the code below:

PHP Code:
nsDialogs::Show $hCtl_dialog 
What is the problem:

Using like this, a memory leak, NSIS will put on the top of stack the dialog's Handle..

Using like this the problem is not shown anymore:
PHP Code:
nsDialogs::Show 
Looking at NSDialogs docs, I dont see a handle passed to the show function.

Here's the doc:
http://nsis.sourceforge.net/Docs/nsD...html#step-show

Correct If I am wrong... thanks!
shadowpoa is offline   Reply With Quote
Old 2nd April 2015, 16:03   #139
shadowpoa
Member
 
Join Date: Jun 2011
Posts: 52
If I use !include on HeaderCustomScript it gets ommited from generated script, but it appears on below panel...

See prints to better understand..

print1.jpg - script opened with hm nsis editor
print2.jpg - script being visualized on coolsoft editor.

Thanks!
Attached Thumbnails
Click image for larger version

Name:	print1.JPG
Views:	165
Size:	47.1 KB
ID:	51771   Click image for larger version

Name:	print2.JPG
Views:	182
Size:	41.4 KB
ID:	51772  
shadowpoa is offline   Reply With Quote
Old 7th April 2015, 12:39   #140
shadowpoa
Member
 
Join Date: Jun 2011
Posts: 52
Other little thing

for vline and hline we can have it visible true or false... but cant do it on designer...

thanks!
shadowpoa is offline   Reply With Quote
Old 3rd June 2015, 20:45   #141
Squirre1
Member
 
Join Date: Aug 2001
Posts: 55
Send a message via ICQ to Squirre1
It there anything I can do that is similar to an "OnLoad" function, unless I am just missing the fact that I can do it already...

Once the form becomes visible, I would like it to go ahead an start kicking off a particular function, not requiring user interaction. If I try to do it in the ControlCustomScript, it has to wait for that execution to finish before it loads/shows the dialog, and the function may take a few minutes to execute. Not to mention, I would like that function to be able to report status back to the dialog and it has to exist first...

Thanks...
Squirre1 is offline   Reply With Quote
Old 3rd June 2015, 23:26   #142
aerDNA
Senior Member
 
aerDNA's Avatar
 
Join Date: Feb 2007
Location: Rijeka, Croatia
Posts: 224
This doesn't belong in the Dialog Designer thread. You can use a timer:

Function PageCreatorFunction
; ...
${NSD_CreateTimer} BgStuff 1
nsDialogs::Show
FunctionEnd

Function BgStuff
${NSD_KillTimer} BgStuff
; do your stuff here
FunctionEnd

PostEnd:
aerDNA is offline   Reply With Quote
Old 7th September 2015, 06:56   #143
nicorac
NSIS Dialog Designer Author
 
Join Date: Apr 2011
Posts: 69
Version 1.4.1 released

v.1.4.1 - 2015-09-07
  • FIX: Fixed small memory leak in generated NSIS script (dialog handle left on the stack when calling nsDialogs::Show).
New version can be found here, as usual.
nicorac is offline   Reply With Quote
Old 2nd October 2015, 08:36   #144
Mircea M
Junior Member
 
Join Date: Aug 2014
Posts: 44
Can't get a "post" function to be called...

Hi,

First off, thanks for this great tool! It saved a lot of time for me.

I do have one "small" issue with it. I am trying to add a "post" function to the page that gets the values from the elements selected / entered in the function created by the designer:
code:
Name "IDI Remote Installer"
OutFile "IDI_Remote_Installer.exe"

!include Sections.nsh
!include MUI2.nsh
!include nsDialogs.nsh
!include LogicLib.nsh
!include Remote_Installer.nsdinc

Var arg

Page custom fnc_Remote_Installer_Show fnc_Remote_Installer_Leave
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"

Function fnc_Remote_Installer_Leave
StrCpy $arg "/S"
${NSD_GetText} $hCtl_Remote_Installer_dbcacheValue_Txt $0
StrCpy $arg '$arg /dbcache="$0"'
DetailPrint "Argument is: $arg"
FunctionEnd

Section
SectionEnd



Problem is, the fnc_Remote_Installer_Leave function is never called. The dialog is displayed, the "Install" button is there but when I click it, the installation just "completes". Nothing is written with DetailPrint.

Any ideas what I'm doing wrong?

Thanks!
Mircea M is offline   Reply With Quote
Old 2nd October 2015, 09:11   #145
Mircea M
Junior Member
 
Join Date: Aug 2014
Posts: 44
OMG, too early in the morning. I just realized I had actually put the DetailPrint in the "post" instead of in the section.
Never mind me...

Once more, really great tool! Thanks!
Mircea M is offline   Reply With Quote
Old 5th October 2015, 07:44   #146
nicorac
NSIS Dialog Designer Author
 
Join Date: Apr 2011
Posts: 69
Glad you sorted it out by yourself
nicorac is offline   Reply With Quote
Old 31st October 2015, 11:57   #147
meoit
Junior Member
 
Join Date: Oct 2014
Posts: 26
Thanks Nicorac!. Always keep it working!.
meoit is offline   Reply With Quote
Old 8th April 2016, 11:56   #148
shirosakichi
Junior Member
 
Join Date: Apr 2016
Posts: 8
Can I edit mui2 pages with NSI Dialog Designer?
shirosakichi is offline   Reply With Quote
Old 11th April 2016, 08:09   #149
nicorac
NSIS Dialog Designer Author
 
Join Date: Apr 2011
Posts: 69
NSIS Dialog Designer only generates new .nsi files to be included in your existing NSIS script.
It manages 2 kinds of file: .nsddef which is an XML style dialog definition (used by NSIS Dialog Designer) and a .nsdinc file which is a plain NSIS script to be included in existing scripts (output only, can only be edited with its source .nsddef).

It cannot import existing files, sorry; you have to start your dialogs from scratch.
nicorac is offline   Reply With Quote
Old 11th April 2016, 08:54   #150
shirosakichi
Junior Member
 
Join Date: Apr 2016
Posts: 8
Thanks for fast replay, well, i soppose i'd have to start from scratch(sorry for my bad english). Again, thanks.
shirosakichi is offline   Reply With Quote
Old 25th July 2017, 19:19   #151
tnteverett
Junior Member
 
Join Date: Jul 2017
Posts: 17
Dialog Units

I used the InstallOptions plugin and got dimensions in an initial file as follows.
Content of INI file:
[settings]
numfields=4
State=0
[field 1]
type=groupbox
left=0
right=-1
top=10
bottom=-11
text=Select Application and Version
HWND=331822
[field 2]
type=label
left=40
right=-40
top=30
bottom=50
text="Application"
HWND=266368
[field 3]
type=droplist
left=40
right=-40
top=50
bottom=60
Listitems=Select Application|1|2|3|4
state="1"
HWND=462816
[field 4]
type=label
left=40
right=-40
top=70
bottom=80
text="Version"
HWND=200754
[field 4]
type=droplist
text="Version"
left=40
right=-40
top=100
bottom=120
Listitems=A|B|C\D
state="A"
HWND=2690908

I then attempted to use the "CoolSoft NSIS Dialog Designer" version 1.4.2.0 and set units to "DialogUnits" at the top and everything else to "Inherit".
The problem is that the designer does not appear to understand "InstallOptions plugin" and it creates a template using "nsDialogs". I have no way to translate or adjust dimensions to work in my NSI project file.
Is there a way to get the designer to adjust dimensions to something I can use or must I use "nsDialogs"?
What am I missing?
tnteverett is offline   Reply With Quote
Old 27th July 2017, 07:58   #152
nicorac
NSIS Dialog Designer Author
 
Join Date: Apr 2011
Posts: 69
NSISDialogDesigner does not generate InstallOptions INI-style files.
It is meant to generate an include script in nsDialogs format only, sorry.
nicorac is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

Tags
designer, ide, nsdialogs

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