Archive: SkinnedControls not working


SkinnedControls not working
Masters

I am new to NSIS, Basically a web developer, given a task to make a Installer in NSIS.

It require rich function such as button colors ,fill all texts received from API response, few custom pages etc.

I googled, Find ExperienceUI and Resource Hacker to accomplish same.

Now i want to change buttons color with specified images. I try to do it with SkinnedControls. but if does not taking effect.

Please help to solved this.:rolleyes:

Here is my full stuff..



;--------------------------------
;Include Modern UI
!include "MUI2.nsh"
!include "InstallOptions.nsh"
;--------------------------------
Name "Modern UI"
OutFile "ModernUI.exe"

Caption "Test Caption for all pages"

!define MUI_CUSTOMFUNCTION_GUIINIT myGUIInit
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_WELCOME

Function .onInit

InitPluginsDir
File "/oname=$PLUGINSDIR\button.bmp" "C:\button.bmp"
File "/oname=$PLUGINSDIR\scrollbar.bmp" "C:\screen.bmp"

FunctionEnd

Function myGUIInit
MessageBox MB_ICONEXCLAMATION|MB_OK "SkinnedControls error:"
SkinnedControls::skinit /NOUNLOAD \
/disabledtextcolor=808080 \
/selectedtextcolor=000080 \
/textcolor=000000 \
"/button=$PLUGINSDIR\button.bmp" \
"/scrollbar=$PLUGINSDIR\button.bmp"

Pop $0
StrCmp $0 "success" noerror
MessageBox MB_ICONEXCLAMATION|MB_OK "SkinnedControls error: $0"
noerror:

FunctionEnd

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

Section DummySection
!insertmacro MUI_LANGDLL_DISPLAY
SectionEnd


i have a vague memory it has to do with the xpstyle setting, but it has been asked on this forum more than once - search!


SkinnedControls not working
Thank you Yathosho for quick reply,

As you mention with xpstyle setting, i tried that too but without luck.

I also tried with SkinnedButton-v1.2.zip plugin then after, it worked for me but in that i am suffering from font color and style changing problem. I am attaching that also.

Here is my enhanced stuff..

Name "Modern UI"
OutFile "ModernUI.exe"
InstallDir $PROGRAMFILES\NSIS
Caption "Test Caption for all pages"

;--------------------------------
;Include Modern UI
!include "MUI2.nsh"
!include "InstallOptions.nsh"
;--------------------------------

!define MUI_ABORTWARNING
!define MUI_UNABORTWARNING
!define MUI_COMPONENTSPAGE_NODESC
!define MUI_CUSTOMFUNCTION_GUIINIT myGUIInit
!define MUI_CUSTOMFUNCTION_UNGUIINIT un.myGUIInit

!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH

XPStyle off
SetFont Verdana 10
!insertmacro MUI_LANGUAGE "English"


Function .onInit
InitPluginsDir
File "/oname=$PLUGINSDIR\button.bmp" "C:\button.bmp"

FunctionEnd

Function myGUIInit

SkinnedControls::skinit /NOUNLOAD \
/disabledtextcolor=808080 \
/selectedtextcolor=000080 \
/textcolor=000000 \
"/button=$PLUGINSDIR\button.bmp"
Pop $0
StrCmp $0 "success" noerror
MessageBox MB_ICONEXCLAMATION|MB_OK "skinned button error: $0"
noerror:

FunctionEnd


Section DummySection

SectionEnd

PFA.


OK: there are several problems in you examples:

1. in first example:
- rename myGUIInit to .onGUIInit [now line !define MUI_CUSTOMFUNCTION_GUIINIT myGUIInit is useless]
- remove MessageBox immediately after Function .onGUIInit
Now the buttons are shown correctly.

2nd example: this is working fine for me
- are you sure path to button is correct?

3rd example: [attached one]
- there is probably some problem with skinnedbutton - I can remember I have corrected some problems in it but I cannot see buttons now.
- use SkinnedControls plug-in - it works better


So - both 1 and 2 are working fine, even SetFont method is working fine.
SkinnedControls and skinnedbutton are NOT related to XPStyle off/on issue.


If you are looking for a professional solution try my product - see my signature.


SkinnedControls not working
Thank you T.Slappy,

I tried as you suggested, but immediately throws error .onGUIInit already defined.
I search it says if you are using Modern UI then you have to do it by
!define MUI_CUSTOMFUNCTION_GUIINIT myGUIInit method

true?


Originally posted by dipal
Thank you T.Slappy,

I tried as you suggested, but immediately throws error .onGUIInit already defined.
I search it says if you are using Modern UI then you have to do it by
!define MUI_CUSTOMFUNCTION_GUIINIT myGUIInit method

true?
Yes, true. Slappy is mistaken.

SkinnedControls not working
Friends,

So, Is there any way to come out from this?
I am trapped here very badly..Please help
:rolleyes:


Forget the .onGUIInit and do everything in .onInit function.