MaxGUI noob after nice graphical buttons?

BlitzMax Forums/MaxGUI Module/MaxGUI noob after nice graphical buttons?

Arowx(Posted 2010) [#1]
OK I've found in the code archives a nice example that creates a window from an image, which is great as I can now have a cool skinned window (on MS windows)!

But how do I turn my nice alpha transparent shadowed png "buttons" into gadgets that will respond to mouse overs and clicks?

And look like this...




Dreamora(Posted 2010) [#2]
Panels are the base to create anything like that on.


Arowx(Posted 2010) [#3]
OK got the button graphic appearing but the transparent border is black?

In Graphics mode I would use setblend ALPHABLEND to ensure alpha was not lost from images, is it the same in GUI mode?


Dreamora(Posted 2010) [#4]
I doubt you can get that through maxgui directly if at all. windows used to use masks for cutting part of the skin


Arowx(Posted 2010) [#5]
I was digging into the code and it looks like setpixmap tries to adapt the alpha channel information using some bittwiddling and maths but the when rendered I just get a black outline?

So no native PNG with alpha support on windows, I think I can work around that as the buttons are part of a skinned window I can just grab the rectangle region, cheers Dreamora!


The example I'm working from uses rastered regions to mask the window, giving you a none rectangular window!

I could do with a dropshadow though, is it possible to get windows to generate it's vista style dropshadow effect for irregular windows?


Arowx(Posted 2010) [#6]
Wierd the masked window shape exmaple I'm working from uses a window sized canvas and draws the pixmap background to it, so thinking I've got a canvas to work with I can just draw the images onto it...

Nope the whole window image blacks out, but my panel/buttons draw OK?

So I don't get a nice skinned window or even the image I'm trying to draw, like I said stranger and stranger...

Here is the example version http://www.blitzbasic.com/Community/posts.php?topic=74604#833647

To test the effect just add a drawimage command to the EVENT_GADGETPAINT case statment before the flip and see if you get the same black window?

Setup: Windows Vista


Arowx(Posted 2010) [#7]
Update BlitzMax 1.37 and now the masked borders are transparent!

But issue with background image appearing black and then appearing when I move it about!

Possibly the repaint event...

Has anyone written an Invisible GUI Gadget that would allow me to capture mouse events on it and update the apps state so I can draw on the canvas using DrawImage?

If not I can hack from the x,y and mouse events but it would be cool to have an invisible gadget!


Arowx(Posted 2010) [#8]
Got it working, well at least on Vista, it looks cool!

Just hacked my Non-GUI code into a more Event based shape, it was never elegant code to begin with but it does the job!