Jump to content
Sign in to follow this  
sshrum

Picture-on-Picture object / GUIGetMsg() issues; anyone have a workaround?

Recommended Posts

Is there a way to get around the issue of being able to click on picture objects on top of another picture object? This is in regards to the GUIGetMsg not returning the pic object control ID when it's clicked on.

I have a GUI that I've created a pic object to act as a background onto which I'm creating picture "buttons". The problem is when setup this way, the picture "buttons" don't return their control IDs. Simply not creating the background pic object fixes that problem...but I want a background pic and would like to keep using GUIGETMSG.

There are a number of other picture control issues I'd love to see addressed (like the ability to do true transparency instead of having the image transparency just do the GUIBGCOLOR) but I've seen a number of people working with the piture control in the same boat as I. Any chance that this will be addressed in a future version or is there a non-convoluted workaround?

TIA


Sean Shrum :: http://www.shrum.net

All my published AU3-based apps and utilities

'Make it idiot-proof, and someone will make a better idiot'

 

Share this post


Link to post
Share on other sites

Why don't you do it like this ...

#include-once
#include <GuiConstants.au3>

$background = 'C:\AnyWhere\AnyWhereElse\MyBackground.bmp'
$button = 'C:\AnyWhere\AnyWhereElse\MyButton.bmp'

$hWndGUI = GUICreate('GUI with picture button', 400, 250, -1, -1)
GUICtrlCreatePic($background, 0, 0)
GUICtrlSetState(-1, $GUI_DISABLE)
$btnPic = GUICtrlCreateButton('', 20, 20, 80, 25, $BS_BITMAP)
GUICtrlSetImage(-1, $button)

GUISetState()

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $btnPic
            MsgBox(64, 'Example', 'ID is: ' & $btnPic, 10)
    EndSwitch
WEnd

Greetz

Greenhorn

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...