Old 6th June 2006, 17:10   #1
zeeh3
Senior Member
 
Join Date: Aug 2005
Posts: 121
SetCtlColors and button text color

NSIS manual says that "SetCtlColors Sets a background color and the text color for a static control, edit control, button or a dialog." But I couldn't change the text color of buttons to white using it. Any ideas excluding wansis plugin?
zeeh3 is offline   Reply With Quote
Old 6th June 2006, 17:23   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
No I can't get it to work either!

-Stu
Afrow UK is offline   Reply With Quote
Old 11th August 2006, 19:41   #3
T.Slappy
Major Dude
 
T.Slappy's Avatar
 
Join Date: Jan 2006
Location: Slovakia
Posts: 531
Send a message via ICQ to T.Slappy
Buttons text color

I tried it too, but no success
Maybe I am doing something wrong?

code:

!define BUTTONS_TEXT_COLOR "0xFFFFFF"

FindWindow $0 "#32770" "" $HWNDPARENT
GetDlgItem $0 $HWNDPARENT 1
SetCtlColors $0 ${BUTTONS_TEXT_COLOR} transparent GetDlgItem $0 $HWNDPARENT 2
SetCtlColors $0 ${BUTTONS_TEXT_COLOR} transparent GetDlgItem $0 $HWNDPARENT 3
SetCtlColors $0 ${BUTTONS_TEXT_COLOR} transparent



This code works with labels, but with buttons no!

Cool looking installer with custom design: www.graphical-installer.com
I offer NSIS scripting, C/C++/C#/Delphi programming: www.unsigned.sk
Develop NSIS projects in Visual Studio 2005-2019: www.visual-installer.com
or RAD Studio 2009, 2010, XE-10.3 Rio: www.rad-installer.com
T.Slappy is offline   Reply With Quote
Old 11th August 2006, 20:08   #4
scully13
Senior Member
 
Join Date: Apr 2004
Posts: 130
You can't use variables for the colors. You would need to do something like this:

PHP Code:
FindWindow $"#32770" "" $HWNDPARENT
GetDlgItem 
$0 $HWNDPARENT 1   
SetCtlColors 
$0 0xFFFFFF transparent
GetDlgItem 
$0 $HWNDPARENT 2   
SetCtlColors 
$0 0xFFFFFF transparent
GetDlgItem 
$0 $HWNDPARENT 3   
SetCtlColors 
$0 0xFFFFFF transparent 
A feature request has been made for it but no progress yet.
https://sourceforge.net/tracker/inde...49&atid=373088
scully13 is offline   Reply With Quote
Old 11th August 2006, 23:02   #5
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
T.Slappy wasn't using variables. He was using a compile time constant.

It doesn't work due to issues with Windows XP styles. If you don't use XPStyle on then it should work (you may still need to refresh the static control though).

-Stu
Afrow UK is offline   Reply With Quote
Old 12th August 2006, 06:57   #6
dandaman32
Senior Member
 
dandaman32's Avatar
 
Join Date: Jan 2005
Location: Look behind you.
Posts: 209
AFAIK there is no way to skin a button. Using the compile-time constants is fine (I do it all the time in the ExperienceUI) but I have never been able to get buttons to work with SetCtlColors. The SkinnedButton plugin has worked pretty well in my tests, but I haven't messed with it in over a year, and as far as I can remember it requires you to explicitly specify XPStyle off if you are using the Modern UI.

Also, I know this is totally off topic, but I need to announce this somewhere: my old e-mail address dandaman32@isp.com will cease to exist as of this coming Monday, as I am finally biting the bullet and getting DSL, thus involving a switch to another ISP. My new e-mail address, which I have been using all summer, is <my screen name> AT gmail <dot> com.

-dandaman32

ExperienceUI for NSIS | Latest project: Enano CMS
Do not PM me on the Winamp forums, I hardly ever check my messages here; you are more likely to get my attention through the ExperienceUI forum.
dandaman32 is offline   Reply With Quote
Old 12th August 2006, 07:16   #7
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,144
Quote:
Originally posted by dandaman32

Also, I know this is totally off topic, but I need to announce this somewhere: my old e-mail address dandaman32@isp.com will cease to exist as of this coming Monday, as I am finally biting the bullet and getting DSL, thus involving a switch to another ISP. My new e-mail address, which I have been using all summer, is <my screen name> AT gmail <dot> com.

-dandaman32
Maybe you should make the switch to 64 bit aswell

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 12th August 2006, 14:58   #8
T.Slappy
Major Dude
 
T.Slappy's Avatar
 
Join Date: Jan 2006
Location: Slovakia
Posts: 531
Send a message via ICQ to T.Slappy
buttons

I set XPStyle off, beacuse I use skinnedbutton plugin.

I want to have full skin in my installer (I wrote my own script and publish it in another topic), but when I use dark bitmaps for buttons (see attachment) buttons texts cannot be read.

Upper code works fine with labels...
Attached Images
File Type: jpg button.jpg (56.1 KB, 722 views)

Cool looking installer with custom design: www.graphical-installer.com
I offer NSIS scripting, C/C++/C#/Delphi programming: www.unsigned.sk
Develop NSIS projects in Visual Studio 2005-2019: www.visual-installer.com
or RAD Studio 2009, 2010, XE-10.3 Rio: www.rad-installer.com
T.Slappy is offline   Reply With Quote
Old 12th August 2006, 20:57   #9
dandaman32
Senior Member
 
dandaman32's Avatar
 
Join Date: Jan 2005
Location: Look behind you.
Posts: 209
Quote:
Originally posted by Anders
Maybe you should make the switch to 64 bit aswell
well i just finished downloading openSuSE 10.1 final x86 edition, and i already wasted a DVD on it, so i'm stuck with x86 for now don't feel like downloading that gigantic ISO again besides NSIS doesn't have 64bit support yet so why bother?

Slappy - my guess for coloring button text would be to call SetCtlColors and then send the control WM_REDRAW or something, though I have no experience with C or anything with the Win32 API for that matter so I don't know. I think kichik wrote that doc page so he's probably the one you should ask.

-dandaman32

ExperienceUI for NSIS | Latest project: Enano CMS
Do not PM me on the Winamp forums, I hardly ever check my messages here; you are more likely to get my attention through the ExperienceUI forum.
dandaman32 is offline   Reply With Quote
Old 12th August 2006, 22:28   #10
SuperPat
Senior Member
 
SuperPat's Avatar
 
Join Date: Mar 2006
Location: France
Posts: 211
Re: buttons

Quote:
Originally posted by T.Slappy I want to have full skin in my installer (I wrote my own script and publish it in another topic), but when I use dark bitmaps for buttons (see attachment) buttons texts cannot be read.
The next version of the SkinnebButton plugin will implement this feature.

I develop also an other plugin named SkinnedControls that can skin Buttons AND/OR ScrollBars.

I will release these plugins soon at the same time as UltraModernUI beta2.

And I try to make so that the next and back buttons skin then even after having used the startmenu plugin, but I do not arrive to fix it.

It would be possible to modify 2 lines in the file ui.c?
The lines 98 and 553, where a button gets set to BS_PUSHBUTTON resp. BS_DEFPUSHBUTTON, it voids the flag BS_OWNERDRAW that is mandatory for skinned buttons.
Can your modify BS_PUSHBUTTON and BS_DEFPUSHBUTTON by the BS_OWNERDRAW in this file for the next NSIS version since that does not influence the unskinned installers?

An other change is to editing the GUI exe, dialog 106, resource ID 1027 ("Show Details" button) where we must replace BS_PUSHBUTTON by BS_OWNERDRAW again to keep this button skinned.

This 3 changes make SkinnedButton, SkinnedControls and Wansis work better...


Last edited by SuperPat; 12th August 2006 at 22:45.
SuperPat is offline   Reply With Quote
Old 13th August 2006, 10:22   #11
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
I think you should post a feature request on the NSIS Source Forge page.

-Stu
Afrow UK is offline   Reply With Quote
Old 13th August 2006, 13:27   #12
SuperPat
Senior Member
 
SuperPat's Avatar
 
Join Date: Mar 2006
Location: France
Posts: 211
OK I will do that

SuperPat 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