SkinnedControls plug-in: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
No edit summary
m (Fixed links)
 
(12 intermediate revisions by 4 users not shown)
Line 1: Line 1:
== Download Link ==
== Download Link ==
v1.0 by SuperPat [[Image:Zip.gif]] [http://forums.winamp.com/showpost.php?p=2483668&postcount=165 Download from this forum thread] (XXX KB)
[[Image:Zip.gif]] [https://sourceforge.net/projects/ultramodernui/files/SkinnedControls%20plug-in/SkinnedControls%201.4/SkinnedControls1.4.zip/download SkinnedControls1.4.zip] (236 KB)
 
[[Image:Exe.gif]] [https://sourceforge.net/projects/ultramodernui/files/SkinnedControls%20plug-in/SkinnedControls%201.4/SkinnedControls1.4.exe/download SkinnedControls1.4.exe] (512 KB)
or
 
v1.1 by Tallmaris [[Image:Zip.gif]] [http://forums.winamp.com/showpost.php?p=2735682&postcount=240 Download in this forum thread] (235.2 KB)
 
or
 
v1.2 by Slappy <attach>SkinnedControls-v1.2.zip</attach> [http://forums.winamp.com/showpost.php?p=2756948&postcount=6 Forum thread for this version]  


[http://forums.winamp.com/showthread.php?p=3076026 SkinnedControls Forum Thread]


== Description ==
== Description ==
This plug-in allows to skin ALL installer's buttons - even those on nsDialogs page. Also it allows to skin Scrollbars and added possibility to select color for texts on buttons.
This NSIS plug-in allows to skin all buttons and scroll bars of your installer and allows to select text colors on buttons even those on custom pages.


'''This plug-in has several versions - each version was created by another person, so there might be a large differences between them! There are also several builds - an Unicode and normal version and so on! Be careful what version you use!'''
It was developed with an aim of integrate it in UltraModernUI, an new user interface with a style like the most recent installers for NSIS. (http://ultramodernui.sourceforge.net)


This plug-in started as a part on UltraModernUI, but later several changes had been made into it.
This plugin was used in early version of Graphical Installer: [http://www.graphical-installer.com www.graphical-installer.com] (see image below) so I (Slappy) fixed some bugs in version 1.2.


[[File:SkinnedControls-Example.jpg]]
[[File:SkinnedControls-Example.jpg]]
Two versions of the plugin are available: an ANSI and an UNICODE.


== How To Use ==
== How To Use ==


See example and documentation in {UltraModernUI package}\Examples\SkinnedControls\Example_MUI.nsi from [http://forums.winamp.com/showpost.php?p=2483668&postcount=165 http://forums.winamp.com/showpost.php?p=2483668&postcount=165]
See example and documentation in Examples\SkinnedControls\ from package
 
=== SkinnedControls::skinit Function ===
=== SkinnedControls::skinit Function ===


Skins the installer's buttons and scrollbars with selected bitmaps and sets colours for texts on buttons.
Skins the installer's buttons and scrollbars with selected bitmaps and sets colors for texts on buttons.


==== Syntax ====
==== Syntax ====
Line 48: Line 43:
"/scrollbar=$PLUGINSDIR\scrollbar.bmp" \
"/scrollbar=$PLUGINSDIR\scrollbar.bmp" \
"/button=$PLUGINSDIR\button.bmp"
"/button=$PLUGINSDIR\button.bmp"
  Pop $0
  StrCmp $0 "success" noerror  MessageBox MB_ICONEXCLAMATION|MB_OK "SkinnedControls error: $0"
  noerror:
FunctionEnd
</highlight-nsis>
</highlight-nsis>


==== Parameters ====
==== Parameters ====


/disabledtextcolor=808080
;/SetReturn
:Color of text when button is disabled (Format is in hex: RRGGBB as CSS colors)
:Force the method to return "success" on the stack or an error string if there was an error.
This parameter must be set first.
 
;/scrollbar=$PLUGINSDIR\scrollbar.bmp
:Scrollbar image (se below).


/selectedtextcolor=000080
;/button=$PLUGINSDIR\button.bmp
:Color of text when button is being clicked (Format is in hex: RRGGBB as CSS colors)
:Button image (se below).


/textcolor=000000
;/disabledtextcolor=808080
:Color for normal state of button (Format is in hex: RRGGBB as CSS colors)
:Color of text when button is disabled (Format is in hex: RRGGBB as CSS colors).


"/scrollbar=$PLUGINSDIR\scrollbar.bmp"
;/selectedtextcolor=000080
:Scrollbar image (several little images in one file)
:Color of text when button is being clicked (Format is in hex: RRGGBB as CSS colors).


"/button=$PLUGINSDIR\button.bmp"
;/textcolor=000000
:A 47x45 image file containing three button images of 47x15 each, the first button image is used when the button is not clicked, the second being the button image used when the button is clicked by the user and the third image is used for disabled state.
:Color for normal state of button (Format is in hex: RRGGBB as CSS colors).
 
One of /scrollbar and /button parameter is required, other is optionnal.
 
If /SetReturn is set, the method returns "success" on the stack or an error string if there was an error.
Else, error message boxes displayed automatically.
 
Parameter names are now ignore case.
 
=== SkinnedControls::setskin DLL Function ===
 
Modifiy parameter. Use the same parameters as skinit


=== SkinnedControls::unskinit DLL Function ===
=== SkinnedControls::unskinit DLL Function ===


Releases the plug-in resources.
Releases the plug-in resources (usually called in the (un).onGUIEnd function). This method is now optional thanks to the new NSIS plug-in API.


==== Syntax ====
==== Syntax ====
Line 84: Line 90:


== Problems ==
== Problems ==
* During the installation, the button "Show Detail" is unskinned => this issue was fixed in version 1.1.
*During the installation, the "Show Detail" button is unskinned:


* When you use MessageBox function on some page (or some other pop-up windows like Banner plug-in), the next page's buttons got unskinned:
You can insert this instruction on your script to workaround this bug, for classic UI:
<highlight-nsis>
ChangeUI IDD_INSTFILES "${NSISDIR}\Contrib\UIs\default_sb.exe"
</highlight-nsis>
for ModernUI:
<highlight-nsis>
ChangeUI IDD_INSTFILES "${NSISDIR}\Contrib\UIs\modern_sb.exe"
</highlight-nsis>


*When using the previous workaround the "Show Detail" button is invisible:
Modern UI set the XPStyle instruction to On automatically. XPStyle must be set to Off with the previous workaround otherwise the "Show Detail" button will disappear:
<highlight-nsis>
XPStyle Off
</highlight-nsis>
*When you use MessageBox function on some page (or some other pop-up windows like Banner plug-in), the some page buttons and scrollbars got unskinned:
[[File:SkinnedControls-bug.jpg]]
[[File:SkinnedControls-bug.jpg]]


This issue has been fixed in version 1.2, but it is a little tricky:
You can use this tricky workaround to fix this:
 
<highlight-nsis>
<highlight-nsis>
MessageBox MB_OK "This message causes SkinnedControls bug..."  
MessageBox MB_OK "This message causes SkinnedControls bug..."  
; After clicking OK the buttons lost their skin
; After clicking OK the buttons lost their skin
SendMessage $HWNDPARENT ${WM_MENUDRAG} 0 0 ; Do this to force reskin
SendMessage $HWNDPARENT ${WM_MENUDRAG} 0 0 ; Do this to force reskin
;If you use UMUI or MUIEx interfaces, you can simply insert macro:
!insertmacro UMUI_FIX_BUTTONS_SKIN
</highlight-nsis>
</highlight-nsis>
We used WM_MENUDRAG message (which is normally unused) to notify window to put another refresh message into queue -> to force redrawing. See the source code how it works.
*The plug-in does not work on Windows 95:


I used WM_MENUDRAG message [which is normally unused] to notify window to put another refresh message into queue -> to force redrawing. See the source code how it works.
Plug-ins compiled with Visual Studio 2008 is not executed... Microsoft says:
"Beginning with Visual C++ 2008, Visual C++ does not support targeting Windows 95, Windows 98, Windows ME, or Windows NT [4]."


*If you use Unicode build of this plugin with non-Unicode NSIS (and vice versa) you can get this error (mentioned [http://forums.winamp.com/showpost.php?p=2347664&postcount=1 in this forum]):
*Scrollbars are not skinned on Windows 9x/Me:


[[File:SkinnedControls-error.png]]
The Cool Scrollbar Library, that the plug-in use, work only on Windows NT kernel.


Use appropriate build of plug-in to solve it (Unicode SkinnedControls + Unicode NSIS and so on).
== TODO ==


* When the plug-in is used, if you used this code line:
Help wanted for improve this plug-in:
<highlight-nsis>
*Find better ways to fix buttons which unskin to avoid crappy workaround.
SendMessage $HWNDPARENT "0x408" "-1" ""
*Support transparency for buttons.
</highlight-nsis>
*Ability to skin checkboxes and radio buttons (transparency background required).
to automatically return to the previous page, the installer will crash.
*Ability to skin dropdown scroll bars and arrow down button.
*Ability to skin MessageBox buttons and text and background colors.


== Versions History ==
== Versions History ==
;1.4 (December 25, 2016)
*Migrate to the new NSIS plug-in API;
*The unskinit function in now optional thanks to the new NSIS plug-in API;
*Parameter names now ignore case.
;1.3 (August 27, 2016)
*Button image size are no more limited to allow smoother gradients (see above);
*"success" or error messages is no longer pushed in the stack by skinit and setskin methods unless the new /SetReturn parameter is set;
*Fix License text and other RichText scrollbars was not skinned in Unicode Build;
*Code cleanup;
*Rewritten documentation.
;1.2 (2011)
;1.2 (2011)
*Fixed unskinning buttons after MessageBox is shown (see above)
*Fixed unskinning buttons after MessageBox is shown (see above)
*Project was converted to Visual Studio 2008 format
*Project was converted to Visual Studio 2008 format
;1.1 (2010)
;1.1 (2010)
*Littles bug fixes & Unicode build
*Little bug fixes & Unicode build
 
;1.0 (2009)
;1.0 (2009)
*First version
*First public release.
*Replace the former SkinnedButton plug-in.


== Credits ==
== Credits ==
*Version 1.0, written by [[User:SuperPat|SuperPat]]
Based on [nsis.sourceforge.net/Wansis_plug-in wansis], a Plug-in written by Saivert that skins NSIS like Winamp
**http://ultramodernui.sourceforge.net/
 
*Based on the [[Wansis]] plug-in of [[User:Saivert|Saivert]]
and use the wa_dlg.h courtesy of Nullsoft, Inc.
*Uses wa_dlg.h courtesy of Nullsoft, Inc.
 
as well as the Cool Scrollbar Library Copyright (c) J Brown 2001.
 
*Version 1.0, 1.3, 1.4, written by [[User:SuperPat|SuperPat]]


*Version 1.1 by [[User:Tallmaris|Tallmaris]]
*Version 1.1 by [[User:Tallmaris|Tallmaris]]


*Version 1.2 by [[User:Slappy|Slappy]] Graphical installers: [http://www.unsigned-softworks.sk www.unsigned-softworks.sk]
*Version 1.2 by [[User:Slappy|Slappy]] Graphical Installer: [http://www.graphical-installer.com www.graphical-installer.com]
[[Category:Plugins]]
[[Category:Plugins]]

Latest revision as of 05:21, 10 December 2018

Download Link

Zip.gif SkinnedControls1.4.zip (236 KB) Exe.gif SkinnedControls1.4.exe (512 KB)

SkinnedControls Forum Thread

Description

This NSIS plug-in allows to skin all buttons and scroll bars of your installer and allows to select text colors on buttons even those on custom pages.

It was developed with an aim of integrate it in UltraModernUI, an new user interface with a style like the most recent installers for NSIS. (http://ultramodernui.sourceforge.net)

This plugin was used in early version of Graphical Installer: www.graphical-installer.com (see image below) so I (Slappy) fixed some bugs in version 1.2.

SkinnedControls-Example.jpg

Two versions of the plugin are available: an ANSI and an UNICODE.

How To Use

See example and documentation in Examples\SkinnedControls\ from package

SkinnedControls::skinit Function

Skins the installer's buttons and scrollbars with selected bitmaps and sets colors for texts on buttons.

Syntax

; Skin the button
 
Function .onInit
  InitPluginsDir
  ; Extract bitmaps for buttons
  File "/oname=$PLUGINSDIR\button.bmp" "${NSISDIR}\Contrib\SkinnedControls\skins\defaultbtn.bmp"
  File "/oname=$PLUGINSDIR\scrollbar.bmp" "${NSISDIR}\Contrib\SkinnedControls\skins\defaultsb.bmp"
FunctionEnd
 
Function myGUIInit
  ; start the plugin
  ; the /disabledtextcolor, /selectedtextcolor and /textcolor parameters are optionnal
  SkinnedControls::skinit /NOUNLOAD \
			/disabledtextcolor=808080 \
			/selectedtextcolor=000080 \
			/textcolor=000000 \
			"/scrollbar=$PLUGINSDIR\scrollbar.bmp" \
			"/button=$PLUGINSDIR\button.bmp"

Parameters

/SetReturn
Force the method to return "success" on the stack or an error string if there was an error.

This parameter must be set first.

/scrollbar=$PLUGINSDIR\scrollbar.bmp
Scrollbar image (se below).
/button=$PLUGINSDIR\button.bmp
Button image (se below).
/disabledtextcolor=808080
Color of text when button is disabled (Format is in hex: RRGGBB as CSS colors).
/selectedtextcolor=000080
Color of text when button is being clicked (Format is in hex: RRGGBB as CSS colors).
/textcolor=000000
Color for normal state of button (Format is in hex: RRGGBB as CSS colors).

One of /scrollbar and /button parameter is required, other is optionnal.

If /SetReturn is set, the method returns "success" on the stack or an error string if there was an error. Else, error message boxes displayed automatically.

Parameter names are now ignore case.

SkinnedControls::setskin DLL Function

Modifiy parameter. Use the same parameters as skinit

SkinnedControls::unskinit DLL Function

Releases the plug-in resources (usually called in the (un).onGUIEnd function). This method is now optional thanks to the new NSIS plug-in API.

Syntax

Function .onGUIEnd
  ; stop the plugin
  SkinnedControls::unskinit
FunctionEnd

Problems

  • During the installation, the "Show Detail" button is unskinned:

You can insert this instruction on your script to workaround this bug, for classic UI:

ChangeUI IDD_INSTFILES "${NSISDIR}\Contrib\UIs\default_sb.exe"

for ModernUI:

ChangeUI IDD_INSTFILES "${NSISDIR}\Contrib\UIs\modern_sb.exe"
  • When using the previous workaround the "Show Detail" button is invisible:

Modern UI set the XPStyle instruction to On automatically. XPStyle must be set to Off with the previous workaround otherwise the "Show Detail" button will disappear:

XPStyle Off
  • When you use MessageBox function on some page (or some other pop-up windows like Banner plug-in), the some page buttons and scrollbars got unskinned:

SkinnedControls-bug.jpg

You can use this tricky workaround to fix this:

MessageBox MB_OK "This message causes SkinnedControls bug..." 
; After clicking OK the buttons lost their skin
SendMessage $HWNDPARENT ${WM_MENUDRAG} 0 0 ; Do this to force reskin
;If you use UMUI or MUIEx interfaces, you can simply insert macro:
!insertmacro UMUI_FIX_BUTTONS_SKIN

We used WM_MENUDRAG message (which is normally unused) to notify window to put another refresh message into queue -> to force redrawing. See the source code how it works.

  • The plug-in does not work on Windows 95:

Plug-ins compiled with Visual Studio 2008 is not executed... Microsoft says: "Beginning with Visual C++ 2008, Visual C++ does not support targeting Windows 95, Windows 98, Windows ME, or Windows NT [4]."

  • Scrollbars are not skinned on Windows 9x/Me:

The Cool Scrollbar Library, that the plug-in use, work only on Windows NT kernel.

TODO

Help wanted for improve this plug-in:

  • Find better ways to fix buttons which unskin to avoid crappy workaround.
  • Support transparency for buttons.
  • Ability to skin checkboxes and radio buttons (transparency background required).
  • Ability to skin dropdown scroll bars and arrow down button.
  • Ability to skin MessageBox buttons and text and background colors.

Versions History

1.4 (December 25, 2016)
  • Migrate to the new NSIS plug-in API;
  • The unskinit function in now optional thanks to the new NSIS plug-in API;
  • Parameter names now ignore case.
1.3 (August 27, 2016)
  • Button image size are no more limited to allow smoother gradients (see above);
  • "success" or error messages is no longer pushed in the stack by skinit and setskin methods unless the new /SetReturn parameter is set;
  • Fix License text and other RichText scrollbars was not skinned in Unicode Build;
  • Code cleanup;
  • Rewritten documentation.
1.2 (2011)
  • Fixed unskinning buttons after MessageBox is shown (see above)
  • Project was converted to Visual Studio 2008 format
1.1 (2010)
  • Little bug fixes & Unicode build
1.0 (2009)
  • First public release.
  • Replace the former SkinnedButton plug-in.

Credits

Based on [nsis.sourceforge.net/Wansis_plug-in wansis], a Plug-in written by Saivert that skins NSIS like Winamp

and use the wa_dlg.h courtesy of Nullsoft, Inc.

as well as the Cool Scrollbar Library Copyright (c) J Brown 2001.

  • Version 1.0, 1.3, 1.4, written by SuperPat