Sign in to follow this  
Followers 0
Terrified

Radio Buttons on a picture

7 posts in this topic

Hi everyone, first of all please excuse me for my bad english.

I have a problem with a sript i tried to write.

I wanted to add this picture on GUI:

Posted Image

And on every slot to add a radio button.

But for some reason that thing didnt work,

i was unable to "select" the radio button, i think that its because it was on the picture.

some one can help me with that?

thanks you very much :D

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

there are 2 solutions.

1) the button is most likely behind the image. I do not know how to put it in front of it.

2) use GDI+ to make the GUI this way you get nice & cool Gui & it should let you put stuff on your image. I have only 1 project where I used it. You can take a look at it if you like. Check the screenshots also.

See my Signature for Winhide project.

Check the UDF_Skin_GUI.au3 file so if you want to put radio use this:

$Radio_ = _UDF_SKINGUI_RADIO("Radio1",0x000000,0xEAF3FA, 488, 446, 97, 17,-1) 

;~ ==========================================
;~ UDF _RADIO
;~ ;[Text],[T_Color],[BG_Color],[LEFT],[TOP],[WIDTH],[HEIGHT],[State -1 = Checkked / State 0 = UNCheckked ]
;~ $Radio_ = _UDF_SKINGUI_RADIO("Radio1",0x000000,0xEAF3FA, 488, 446, 97, 17,-1) 
;~ ==========================================
Func _UDF_SKINGUI_RADIO($TEXT_COLOR,$TEXT_BKCOLOR,$TEXT,$LEFT,$TOP,$WIDTH,$HEIGHT,$STATE)
        
    $Radio_Create = GUICtrlCreateRadio($TEXT, $LEFT, $TOP, $WIDTH, $HEIGHT)     
        GUICtrlSetBkColor(-1, $TEXT_BKCOLOR)
        GUICtrlSetColor(-1, $TEXT_COLOR)
        If $STATE = -1 Then GUICtrlSetState(-1, $GUI_CHECKED)
            
    Return $Radio_Create
EndFunc
Edited by goldenix

My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]

Share this post


Link to post
Share on other sites

1) the button is most likely behind the image. I do not know how to put it in front of it.

Check out GUICtrlSetState in the help file.

Pay attention to this line:

$GUI_ONTOP               Control will be have the ontop attribute for the window (zOrdering).

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

i tried this:

#include <GUIConstantsEx.au3>

#include <WindowsConstants.au3>

Opt('MustDeclareVars', 1)

Global $gui, $guiPos, $pic, $picPos

Example1()

;----- example 1 ----

Func Example1()

Local $n, $msg, $b1

GUICreate("My GUI picture", 650, 350, -1, -1) ; will create a dialog box that when displayed is centered

;GUISetBkColor(0xFFFFFF)

$n = GUICtrlCreatePic(@SystemDir & "\oobe\images\14.jpg", 10, 10, 647, 323)

GUISetState()

$b1 = GuiCtrlCreateRadio( "",200 , 200 , 15 , 15 )

GUISetState(-1, $GUI_ONTOP )

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop

WEnd

GUIDelete()

EndFunc ;==>Example1

still not going well :\

EDIT: lol sry i forgot the "CTRL"

Edited by Terrified

Share this post


Link to post
Share on other sites

The image was capturing the event. The image default style was $SS_NOTIFY which causes this behavior. I simply set the image style to 0, removing the $SS_NOTIFY flag and it worked.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Opt('MustDeclareVars', 1)

Global $gui, $guiPos, $pic, $picPos

Example1()

;----- example 1 ----
Func Example1()
Local $n, $msg, $b1

GUICreate("My GUI picture", 650, 350, -1, -1) ; will create a dialog box that when displayed is centered

;GUISetBkColor(0xFFFFFF)

$n = GUICtrlCreatePic("C:\Users\Jos\Desktop\Dump 9-11\Angelina Jolie\3.jpg", 10, 10, 647, 323, 0)

$b1 = GuiCtrlCreateRadio( "", 200 , 200 , 15 , 15 )

GUISetState()







While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd

GUIDelete()
EndFunc ;==>Example1

Share this post


Link to post
Share on other sites

why i cant uncheck the button in this script:

#NoTrayIcon

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****

#AutoIt3Wrapper_outfile=razerhid.exe

#AutoIt3Wrapper_Compression=4

#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

;IMPORTANT NOTICE: When you compile this file to work as MU BOT you must name it as "razerhid.exe" otherwise it will not work.

;for compiling this script go TOOLS > COMPILE, or simple press CTRL+F7

;btw, this example forks for 1280x1024 resolution only, couse it uses 1280x1024 screen coordinates

#include <GuiConstants.au3>

HotKeySet( "{F11}" , "AEKILL")

HotKeySet( "{F10}" , "_STOP")

Opt ("WinTitleMatchMode", 3 )

Opt ("MouseClickDownDelay", 55)

Opt ("MouseClickDelay", 1 )

Opt ("SendKeyDownDelay", 10 )

Opt ("SendKeyDelay", 1 )

Opt ("CaretCoordMode", 2 )

Dim $AP = 0

$j = 0

Global $kill = 0, $b1

Local $n

$DLBot=GuiCreate( "Simple AE BOT", 650, 350 , 500 , 600,-1)

$n = GUICtrlCreatePic(@SystemDir & "\oobe\images\14.jpg", 10, 10, 647, 323)

GUISetState()

$b1 = GuiCtrlCreateRadio( "",330 , 309 , 11, 11 )

GUICTRLSetState(-1, $GUI_ONTOP )

Func AEKILL ()

$kill = 1

While $kill = 1

if $kill = 0 then ExitLoop

if GUICtrlRead($b1) = $GUI_CHECKED then

MouseMove( 640 , 745 )

MouseDown( "Left")

Sleep( "620")

if $kill = 0 then ExitLoop

endif

WEnd

Return

EndFunc

Func _STOP ()

$kill = 0

MouseUp("Right")

Return

EndFunc

While 1

$msg = GuiGetMsg()

Select

Case $msg == $Gui_Event_close

Exit

EndSelect

Sleep(1)

Wend

Share this post


Link to post
Share on other sites

That was stupid. I just showed you working code and explained what you had to change in the code to get the desired effect.

#NoTrayIcon
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_outfile=razerhid.exe
#AutoIt3Wrapper_Compression=4
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
;IMPORTANT NOTICE: When you compile this file to work as MU BOT you must name it as "razerhid.exe" otherwise it will not work.
;for compiling this script go TOOLS > COMPILE, or simple press CTRL+F7
;btw, this example forks for 1280x1024 resolution only, couse it uses 1280x1024 screen coordinates

#include <GuiConstants.au3>
HotKeySet( "{F11}" , "AEKILL")
HotKeySet( "{F10}" , "_STOP")
Opt ("WinTitleMatchMode", 3 )
Opt ("MouseClickDownDelay", 55)
Opt ("MouseClickDelay", 1 )
Opt ("SendKeyDownDelay", 10 )
Opt ("SendKeyDelay", 1 )
Opt ("CaretCoordMode", 2 )
Dim $AP = 0
$j = 0
Global $kill = 0, $b1
Local $n
$DLBot=GuiCreate( "Simple AE BOT", 650, 350 , 500 , 600,-1)
$n = GUICtrlCreatePic(@SystemDir & "\oobe\images\14.jpg", 10, 10, 647, 323, 0) ; Image needs STYLE which is the 6th parameter to be 0
$b1 = GuiCtrlCreateRadio( "",330 , 309 , 11, 11 )

GUISetState()

; $b1 = GuiCtrlCreateRadio( "",330 , 309 , 11, 11 ) ; All controls should be created before the GUI is shown, so move this up
; GUICTRLSetState(-1, $GUI_ONTOP ) ; Remove this monster


Func AEKILL ()
$kill = 1
While $kill = 1
if $kill = 0 then ExitLoop
if GUICtrlRead($b1) = $GUI_CHECKED then
MouseMove( 640 , 745 )
MouseDown( "Left")
Sleep( "620")
if $kill = 0 then ExitLoop
endif

WEnd
Return
EndFunc

Func _STOP ()
$kill = 0
MouseUp("Right")
Return
EndFunc


While 1
$msg = GuiGetMsg()
Select
Case $msg == $Gui_Event_close
Exit
EndSelect
Sleep(1)
Wend

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  
Followers 0