chuehbueb Posted September 3, 2006 Share Posted September 3, 2006 Hi, i want to use a script, that works like this: #include <guiconstants.au3> #include "LabelClick.au3" $MainWindow = GUICreate("my gui", 295, 89, 455, 340, BitOR($WS_POPUPWINDOW, $WS_BORDER)) $Status = GUICtrlCreatePic("images\default\bg.gif", 0, 0, 295, 89, BitOR($SS_NOTIFY,$WS_GROUP)) $Play = GUICtrlCreatePic("images\default\play.gif", 242, 4, 51, 15) GUICtrlSetState(-1, $GUI_DISABLE) $Pause = GUICtrlCreatePic("images\default\pause.gif", 242, 20, 51, 15) GUICtrlSetState(-1, $GUI_DISABLE) $PlayLabel = GUICtrlCreateLabel('', 242, 4, 51, 15, $GUI_BKCOLOR_TRANSPARENT) $PauseLabel = GUICtrlCreateLabel('', 242, 20, 51, 15, $GUI_BKCOLOR_TRANSPARENT) GUISetState() While 1 $msg = GUIGetMsg() If $msg = - 3 Then Exit If _LabelClicked($MainWindow, $PlayLabel) Then MsgBox(0, 'Pic', 'Play') If _LabelClicked($MainWindow, $PauseLabel) Then MsgBox(0, 'Pic', 'Pause') WEnd is that possible? Link to comment Share on other sites More sharing options...
Danny35d Posted September 3, 2006 Share Posted September 3, 2006 Any reason why you could not use buttons instead? #include <GUIConstants.au3> ; == GUI generated with Koda == $Form1 = GUICreate("AForm1", 192, 51, -1, -1) $Pic1 = GUICtrlCreateIcon("shell32.dll", 137, 12, 20, 16, 16) GUICtrlSetStyle(-1, BitOr($SS_ICON, $SS_NOTIFY)) $Button1 = GUICtrlCreateButton("Play", 8, 16, 75, 25, $WS_CLIPSIBLINGS) $Pic2 = GUICtrlCreateIcon("shell32.dll", 27, 108, 21, 16, 16) GUICtrlSetStyle(-1, BitOr($SS_ICON, $SS_NOTIFY)) $Button2 = GUICtrlCreateButton("Stop", 104, 16, 75, 25, $WS_CLIPSIBLINGS) GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Switch $msg Case $GUI_EVENT_CLOSE ExitLoop Case $Button1, $Pic1 MsgBox(0, 'Testing', 'You press play.') Case $Button2, $Pic2 MsgBox(0, 'Testing', 'You press stop.') Case Else ;;;;;;; EndSwitch WEnd Exit AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line Link to comment Share on other sites More sharing options...
chuehbueb Posted September 4, 2006 Author Share Posted September 4, 2006 Design Reasons. Link to comment Share on other sites More sharing options...
Danny35d Posted September 4, 2006 Share Posted September 4, 2006 Design Reasons.Check this post about using labels as colored buttons, may be can give you an idea of how to apply the same concept. If you can show LabelClick.au3 I may be able to help you better. AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line Link to comment Share on other sites More sharing options...
chuehbueb Posted September 4, 2006 Author Share Posted September 4, 2006 It can be, that i'm to dumb, to edit this UDF to using it with pictures. But i think it doesnt work.The "LabelClick.au3" is the one from Smoke N -> http://www.autoitscript.com/forum/index.ph...=LabelClick.au3 Link to comment Share on other sites More sharing options...
Danny35d Posted September 5, 2006 Share Posted September 5, 2006 Try this it should work for you... #include <guiconstants.au3> $MainWindow = GUICreate("my gui", 295, 89, 455, 340, BitOR($WS_POPUPWINDOW, $WS_BORDER)) $Status = GUICtrlCreatePic("images\default\bg.gif", 0, 0, 295, 89, BitOR($SS_NOTIFY,$WS_GROUP)) $Play = GUICtrlCreatePic("images\default\play.gif", 242, 4, 51, 15) GUICtrlSetCursor($Play, 0) $Pause = GUICtrlCreatePic("images\default\pause.gif", 242, 20, 51, 15) GUICtrlSetCursor($Pause, 0) GUISetState() While 1 $msg = GUIGetMsg() If $msg = - 3 Then Exit $m_info = GUIGetCursorInfo($MainWindow) If IsArray($m_info) Then If $m_info[2] And $m_info[4] = $Play Then MsgBox(0, 'Pic', 'Play') If $m_info[2] And $m_info[4] = $Pause Then MsgBox(0, 'Pic', 'Pause') EndIf WEnd AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now