- NSIS Discussion
- label transparents with background-image
Archive: label transparents with background-image
TobWen
4th June 2006 12:29 UTC
label transparents with background-image
Hey,
I've created a custom page with an image in the background.
Of course, the text-labels have gray background.
I've changed them the normal way (SetCtlColors).
It's possible to set every color, but transparency is always set to gray.
I think, it sets the color of the dialog behind the image, not the image itself.
Is there a work-around? I've searched already, but didn't find a working solution :(
Best regards,
Tobias
Afrow UK
4th June 2006 12:33 UTC
You may need to refresh the control. Easiest way to do this is to hide the control and then show it again using:
ShowWindow $R0 ${SW_HIDE}
ShowWindow $R0 ${SW_SHOW}
-Stu
TobWen
4th June 2006 12:46 UTC
thanks ... it works!
TobWen
4th June 2006 13:33 UTC
; Give labels a transparent background
GetDlgItem $0 $0 1200
SetCtlColors $0 0xFFFFFF transparent
GetDlgItem $0 $0 1208
SetCtlColors $0 0xFFFFFF transparent
; Reload window
GetDlgItem $0 $HWNDPARENT 1
ShowWindow $0 ${SW_HIDE}
ShowWindow $0 ${SW_SHOW}
it only changes "item 1200" ... and it doesn't work for buttons :-(
Afrow UK
4th June 2006 14:04 UTC
You should change controls in the parent window (i.e. Next button, Back button etc) in .onGUIInit.
If you're using Modern UI then you'd need to !define MUI_CUSTOMFUNCTION_GUIINIT onGUIInit
-Stu
TobWen
4th June 2006 14:30 UTC
I mean checkboxes and their labels. I'm using classic UI.
But why is just the first label changed (1200) and not the second (1208) ?
Afrow UK
4th June 2006 18:19 UTC
Are you using Windows XP and XPStyle on?
-Stu
TobWen
4th June 2006 18:22 UTC
WinXP and XPStyle OFF :-)
Afrow UK
4th June 2006 18:25 UTC
Please attach the entire code in question.
-Stu
TobWen
4th June 2006 18:43 UTC
here it is ...
Afrow UK
4th June 2006 19:53 UTC
Hmm strange. Transparent doesn't seem to be working for it at all. And by the way, the control ID is 1210 for the check box (it's Field 8 - 1 + 3)... +3 because each DirRequest control has two controls; the text box and the command button.
Interestingly, if I use transparent for its background and use XPStyle on, the background turns black!
Perhaps you should contact kichik about this (or wait for him to reply).
-Stu
TobWen
5th June 2006 17:41 UTC
LoL ... I just realized the crap I wrote in topic :-))
"label transparents" ... OMG :-)
kichik
16th June 2006 09:08 UTC
Check boxes are a bit problematic:
http://forums.winamp.com/showthread....x+setctlcolors
TobWen
18th June 2006 23:35 UTC
It doesn't even work with labels :-(
kichik
30th June 2006 21:49 UTC
At least for the labels, you're using the wrong dialog item id. You should read the HWND value from the INI after calling initDialog. It's much simpler than calculating the correct id. To get the HWND of the browse button, read HWND2. Use:
ReadINIStr $0 "$PLUGINSDIR\options.ini" "Field 2" "HWND"
SetCtlColors $0 0x000000 transparent
ReadINIStr $0 "$PLUGINSDIR\options.ini" "Field 3" "HWND"
SetCtlColors $0 0x000000 transparent
ReadINIStr $0 "$PLUGINSDIR\options.ini" "Field 8" "HWND"
SetCtlColors $0 0x000000 transparent