This is some code I threw together for creating Skinned Buttons.
I do not take any credit for the code however.
It's a blend of the bitmapped buttons from masm lib, and a function made for skinning windows using a reference bitmap to create a "Region".
Anyway, the result is that you get buttons that have separate button up/down bitmaps, can be any shape, are color-keyed transparent by the color of the topleft pixel, and the user must click on a non-tranparent pixel to activate.
Apart from the way they look, they operate like any normal button.
May your masm gui's look the nicer for this code. Mine do :)
Posted on 2003-03-19 22:29:02 by Homer
Did I mention they can be any size?? Doh.
Anyone use this yet? you like? :)
Posted on 2003-03-23 04:02:07 by Homer
Don't know how to write my own custom controls yet... i want to learn how to do that before i use someone else's. However, if you post a pre-assembled program, i'd be happy to give you my opinion on the buttons themselves :alright:
Posted on 2003-03-23 10:32:09 by jademtech
Here's a work in progress...

The GUI is cheap, with the exception of the use of skinned buttons.
One instance of the button just makes a messagebox.
The program is beta - for demonstration of the button only.
Try clickling on a transparent pixel of the button image - nothing happens :)

I'll write an animated skinned button too, using ImageLists.
I am currently working on the stage 2 compression code of this project.
The gui will be beautified further later.

Note that the skinning function is perfect for creating skinned windows without using the button code - you can make bubble shaped popups for example.
In fact I might just throw together some code to force dialog boxes into a bubble-skinned window, if anyone asks nicely :)

Have a nice day.
Posted on 2003-03-24 01:43:04 by Homer
Hehheh... pretty cool :) btw, the bottom button looks kinda weird (the background gray is "interrupted")
Posted on 2003-03-24 16:18:28 by jademtech
Thats my art, not the algo or the code - sorry.
I touched it up now.

Anyways, I realized a limitation:
if the DOWN bitmap had a fundamentally different mask, it looked odd...
we were only skinning the UP image of the button.

The attatched code corrects that situation.
I had to butcher the original code to implement it.

Also, I have done away with the DLL dependancy...
MakeRegion core procedure has been added to the source.

We actually have for each button, TWO buttons (one hidden).
In the buttons code, we switch which one is hidden depending on the mousebutton position.

Finally, when the button is released over an active pixel, we send a WM to the main window , so it can catch the click.

Also attatched is an example executable.
See how you like this version :)
You can play with the linkedlist buttons in this example if you like :)
It's the beginnings of a LL hierarchy realtime monitor/editor for a realtime game environment development console which I am working on.
The idea is that you can waltz about in any part of the LL hierarchy with gametime frozen, allowing you to more easily refine your gamelogic network.
It is being modularly coded to be a plugin monitor for all my LL apps.

Posted on 2003-03-28 09:12:10 by Homer
Were to get the code???
Posted on 2010-11-05 11:26:57 by hmi222

Were to get the code???

You do know that this was posted 7 years ago don't you?  :)

But if Homer or someone else still has a copy of it, I would not mind having a look too..
Posted on 2010-11-05 16:20:04 by WillASM
There is a very beautiful example of wave effects. Hope you love it, hah, hah.
Posted on 2010-11-08 09:45:36 by G-Spider
wow, that is nice. thanks!
Posted on 2010-12-26 15:46:19 by caseys
Happy happy, joy joy :)
Posted on 2011-01-07 01:10:35 by Homer