Old 12th June 2018, 19:29   #1
MyPC8MyBrain
Member
 
Join Date: Nov 2015
Posts: 96
Question custom background for a custom button possible?

Hi everyone
im trying to assign a custom image background for a custom button i am calling with NSD_CreateButton ,
is that even possible?

this is the first button of 10

PHP Code:
${NSD_CreateButton85.92u 46.15u 48.71u 45.54u "Button1"
    
Pop $Button1
    SendMessage $Button1 
${WM_SETFONT$hCtl_TestDesigner_Font2 0

${NSD_OnClick$Button1 Button1Action
    SetCtlColors $Button1 
"${GRAPHICAL_INSTALLER_LABELS_TEXT_COLOR}transparent

${NSD_AddExStyle$Button1 ${WS_EX_TRANSPARENT}|${WS_EX_TOPMOST}
    
Pop $
(i am also using Graphical installer, Tomas you around? )

TIA
Chris
MyPC8MyBrain is offline   Reply With Quote
Old 12th June 2018, 19:40   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,844
The normal button provided by Windows (and NSD_CreateButton) does not allow a lot of customization. If you look on MSDN you should be able to find which messages you can send to set a picture on the button but it does not support background images behind the button text, for that you need a custom draw button.

I believe there is a skinned button plug-in on the wiki...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 12th June 2018, 19:43   #3
MyPC8MyBrain
Member
 
Join Date: Nov 2015
Posts: 96
Thank you Anders <3

ATB
Chris
MyPC8MyBrain is offline   Reply With Quote
Old 13th June 2018, 01:39   #4
MyPC8MyBrain
Member
 
Join Date: Nov 2015
Posts: 96
Red face

i found your fixed SkinnedButton-1.2 Anders

went about recreating a new CustomUI with 20 Buttons directly in it;
instead of drawing them with NSD_CreateButton so i can use SkinnedButtons,

as i'm inching closer to implementing Skinned Buttons;
i find myself stuck now with the 8 ButtonEvent limit!

Why 8 Stu why... eight?

anyone has any suggestions how to get ButtonEvent to work if i have more than 8 Buttons on the same page?
or am i out of luck with this one?

TIA
Chris
MyPC8MyBrain is offline   Reply With Quote
Old 13th June 2018, 12:41   #5
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,844
A limit like that seems strange.

Maybe you could ask Stu to rewrite it and store the address on the button HWND with SetProp/GetProp/RemoveProp if he does not want to allocate memory for whatever reason. Or just raise the limit to 25 or something.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 13th June 2018, 15:42   #6
MyPC8MyBrain
Member
 
Join Date: Nov 2015
Posts: 96
Thank you Anders <3

i have found Stu's source included with the package,
in it i see the direct 8 limit hard coded which i manually changed to 32;
and now trying to recompile,

right now i am in compiler hell!
trying to recompile throws every possible environmental error i can hit

ATB
Chris
MyPC8MyBrain is offline   Reply With Quote
Old 13th June 2018, 23:40   #7
MyPC8MyBrain
Member
 
Join Date: Nov 2015
Posts: 96
Red face

no luck so far recompiling this with new 32 limit or any for that matter,
i am getting every error on this planet and it just keeps failing on me

on my XP where i compile NISS just fine im getting an error that its a newer VS version,
downloaded the latest VS community; and that gives me every error available about missing files and expired commands,


anyone has suggestions?

@Stu
you around?


TIA
Chris
MyPC8MyBrain is offline   Reply With Quote
Old 14th June 2018, 03:08   #8
MyPC8MyBrain
Member
 
Join Date: Nov 2015
Posts: 96
Thumbs up

YaY \ o / Success!!!
managed to compile a new ButtonEvent builds with a new 32 limit!

now we try SkinnedButton

ATB
Chris
MyPC8MyBrain 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