Archive: New and improved skinnedbutton plugin


New and improved skinnedbutton plugin
Hi folks,

after playing around with alternative UIs, I found that particularly the UltraModernUI looks pretty ugly (haha, nice pun) without properly skinned buttons. So I examined what I could find and the preliminary result is a new version of the skinnedbutton plugin. However, this is not the only component required for proper skinning at the moment. I included some basic instructions for everybody who is interested in properly skinned buttons with NSIS.

Most problems with skinned buttons are caused by two lines in the NSIS source file ui.c, namely lines 98 and 553 (line numbers taken from 2.15 release version source), where a button gets set to BS_PUSHBUTTON resp. BS_DEFPUSHBUTTON which voids the flag BS_OWNERDRAW that is mandatory for skinned buttons. The obvious solution to this would be checking the button status and leaving the button alone if it has BS_OWNERDRAW set. For my tests, I hardcoded BS_OWNERDRAW here, which works nicely, it just demands a skinning plugin then :)

The second change I did was editing the GUI exe, dialog 106, resource ID 1027 ("Show Details" button) where I replaced BS_PUSHBUTTON with BS_OWNERDRAW again.

With these modification, I now have a UMUI interface with properly skinned buttons. :D

And by the way, I also fixed the crash bug in the skinnedbutton.dll :)

Please test the plugin and my suggestions and let me know what you think of it!


I shouldn't have clicked on the preview button :( Here is the attachment :)


Fine, but... where are the examples? I could not find them inside the .rar file.


Ok, I have followed the txt file and it is working fine, except for the buttons created inside custom pages (.ini), the back buttons of custom pages and message alerts like MessageBox.


Oops, forgot to package the examples :( However, they didn't change from the last version and I need to create a better version anyway :) Can you please attach a sample script so I can get an idea of what does not work? Thanks :)


Now I can see that it is working, I have something wrong with my code... sorry.


No problem, I know the plugin is not perfect yet, Windows is all nice and okay as long as you don't take a peek inside. ;) As soon as you want some extra eye-candy, hell breaks loose :)


Ok, I have found out the problem, if any messagebox appears before the custom page, the back button and all buttons created with .ini file become unskinned in the custom page. See your e-mail for the script and ini file.


Thanks for testing, I'll have a look at that combination and see if I can fix it today. If not, you'll have to wait till monday :)


This is happening with wansis too...


This is happening with wansis too...
SkinnedButton is based on wansis, therefore they tend to share bugs. ;)

@OldGrumpy: Feature request: buttons change image on mouse hover

Great work :)

-dandaman32

Very good work!

I will include your modifications to my future 1.2 version that I currently develop.

If, moreover, you know how to make a color of the image of the button transparent (the pixel in top left will indicate the color has to make transparent) if the option /transparency is used.

Good idea which the image change on mouse over, i don't know how to do that.


Good evening,


I had made some modifications on the code of SkinnedButton for the next version (based on the very last version published of wansis).

OldGrumpy, if you want to correct the bugs, can you do it on this version?

You found a attach file with a development version of the future 1.2 version.
I saw that with the plugin 1.1b, when we did not apply the instructions to correct the problems of unskinned buttons, if we clicks on the button "show detail", the next an back buttons are unskinned, this work in the version being in the file.


Okay, I'll continue work with the updated 1.2dev version. Button effect on mouse hover can be done, it's just a bit of math necessary without a framework ;) Unfortunately, the current approach seems to be a bit limited because I found out that not every button can be reached with the current method. I am currently looking into a "completely different" approach which should deliver more reliability, more flexibility and more features. Btw, for the mouse effect, I'd need a new bitmap, modifying the color values on mouse hover is not a good idea, painting a bitmap is much faster. Could anyone lay their hands on the sample bitmaps that come with the skinnedbutton plugin and create bitmaps with three or preferrably four states?
(disabled, normal, pushed, highlighted, pick your order as you like, just stay consistent :) )


@SuperPat45:

What are these lines in FrameWndProc() for?

static HMENU pm;
static HWND tt; //Tooltip control

I don't see them referenced anywhere but in a DestroyWindow(tt) call shortly after.