Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 04:52

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Autoit Unchecken Fails

Discussion on Autoit Unchecken Fails within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Dec 2009
Posts: 1,622
Received Thanks: 2,070
Autoit Unchecken Fails

Hey.

Ich will in einem Script, mehere checkboxen haben.

Und es soll immer nur eine checkbox auswählbar sein.

Dazu verwende ich folgendes:

Quote:
Case $Radio1
GuiCtrlSetState($Radio2, 4)
Aber es will einfach nicht funktionieren.

Hier mein Momentaner Source:

Quote:
#include <GDIPlus.au3>
#include <GuiListBox.au3>
#include <String.au3>
#include <EditConstants.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>
#include <StructureConstants.au3>
#include <WinAPI.au3>
#include <IE.au3>



Opt("GUIOnEventMode", 1)
Global Const $AC_SRC_ALPHA = 1


#Region
$GUI = GUICreate("Anrufliste", 799, 510, -1, -1, $WS_POPUP, BitOR($WS_EX_CONTROLPARENT, $WS_EX_LAYERED))
_GDIPlus_Startup()
$pngSrcGUIBK = "gui_bg.png"
Global $hImageGUIBK = _GDIPlus_ImageLoadFromFile($pngSrcGUIBK)
SetBitmap($GUI, $hImageGUIBK, 255)
#EndRegion
; de en fr it es ru
#Region
$GUI_Main = GUICreate("sss", 799, 510, 0, 0, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $GUI)
GUISetBkColor(0x585858)
_WinAPI_SetLayeredWindowAttributes($GUI_Main, 0x585858)
$Radio1 = GUICtrlCreateRadio(" German", 290, 470, 17, 17, $WS_GROUP)
$Radio2 = GUICtrlCreateRadio(" English", 373, 470, 17, 17, $WS_GROUP)
$Radio3 = GUICtrlCreateRadio(" France", 456, 470, 17, 17, $WS_GROUP)
$Radio4 = GUICtrlCreateRadio(" Italian", 539, 470, 17, 17, $WS_GROUP)
$Radio5 = GUICtrlCreateRadio(" Spanish", 622, 470, 17, 17, $WS_GROUP)
$Radio6 = GUICtrlCreateRadio(" Russian", 705, 470, 17, 17, $WS_GROUP)


Global $Button1 = GUICtrlCreateButton("Start", 17, 342, 246, 34, $BS_BITMAP)
Global $Button2 = GUICtrlCreateButton("Register", 35, 380, 212, 29, $BS_BITMAP)
GUICtrlSetOnEvent(-1, "_Register")
Global $Button3 = GUICtrlCreateButton("Cancel", 53, 418, 176, 25, $BS_BITMAP)
GUICtrlSetOnEvent(-1, "_Schliessen")
$object = ObjCreate("Shell.Explorer.2")
$object_ctrl = GUICtrlCreateObj($object, 300, 185, 461, 260)

_IENavigate($object, "http://s4.de.alaplaya.net/pages/patcher")
GUICtrlSetImage($Button1, @ScriptDir&"\Start.bmp", 0)
GUICtrlSetImage($Button2, @ScriptDir&"\Register.bmp", 0)
GUICtrlSetImage($Button3, @ScriptDir&"\Cancel.bmp", 0)

#EndRegion


GUISetState(@SW_SHOW, $GUI)
GUISetState(@SW_SHOW, $GUI_Main)

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

Case $Radio1
guictrlsetstate($Radio2, 0)
EndSwitch
WEnd


Func _Register()
If GUICtrlRead($Radio1) = $GUI_CHECKED Then
ShellExecute("http://s4.de.alaplaya.net/landingpage/patcher")
Endif

If GUICtrlRead($Radio2) = $GUI_CHECKED Then
ShellExecute("http://s4.en.alaplaya.net/landingpage/patcher")
Endif

If GUICtrlRead($Radio3) = $GUI_CHECKED Then
ShellExecute("http://s4.fr.alaplaya.net/landingpage/patcher")
Endif

If GUICtrlRead($Radio4) = $GUI_CHECKED Then
ShellExecute("http://s4.it.alaplaya.net/landingpage/patcher")
Endif

If GUICtrlRead($Radio5) = $GUI_CHECKED Then
ShellExecute("http://s4.es.alaplaya.net/landingpage/patcher")
Endif

If GUICtrlRead($Radio6) = $GUI_CHECKED Then
ShellExecute("http://s4.ru.alaplaya.net/landingpage/patcher")
Endif

EndFunc

Func _Schliessen()
_GDIPlus_ImageDispose($hImageGUIBK)
_WinAPI_DeleteObject($hImageGUIBK)
_GDIPlus_Shutdown()
Exit
EndFunc



Func SetBitmap($hGUI, $hImage, $iOpacity)
Local $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend

$hScrDC = _WinAPI_GetDC(0)
$hMemDC = _WinAPI_CreateCompatibleDC($hScrDC)
$hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
$hOld = _WinAPI_SelectObject($hMemDC, $hBitmap)
$tSize = DllStructCreate($tagSIZE)
$pSize = DllStructGetPtr($tSize)
DllStructSetData($tSize, "X", _GDIPlus_ImageGetWidth($hImage))
DllStructSetData($tSize, "Y", _GDIPlus_ImageGetHeight($hImage))
$tSource = DllStructCreate($tagPOINT)
$pSource = DllStructGetPtr($tSource)
$tBlend = DllStructCreate($tagBLENDFUNCTION)
$pBlend = DllStructGetPtr($tBlend)
DllStructSetData($tBlend, "Alpha", $iOpacity)
DllStructSetData($tBlend, "Format", $AC_SRC_ALPHA)
_WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA)
_WinAPI_ReleaseDC(0, $hScrDC)
_WinAPI_SelectObject($hMemDC, $hOld)
_WinAPI_DeleteObject($hBitmap)
_WinAPI_DeleteDC($hMemDC)
EndFunc
Bevor ihr aber antworten wollt, würde ich euch bitten den source selbst testen, und erst wenn es auch funktioniert mir tipps geben, weil ich mehrere wege probiert habe, und bei manchen konnte man boxen garnicht mehr auswählen.
freehuntx is offline  
Old 11/11/2011, 07:26   #2
 
BlackHybrid's Avatar
 
elite*gold: 52
The Black Market: 101/0/0
Join Date: Oct 2010
Posts: 1,998
Received Thanks: 389
Wenn du immer nur eine Ceckbox ausgewählt haben willst warum benutzt du dann eine Checkbox? Ein Radio ist eigentlich dafür gemacht, dass immer nur einer ausgewählt erden kann.
BlackHybrid is offline  
Old 11/11/2011, 07:36   #3
 
elite*gold: 0
Join Date: Dec 2009
Posts: 1,622
Received Thanks: 2,070
Ich habe mich verschrieben.

Ich möchte Radioboxen haben, und davon soll immer nur eine auswählbar sein.

Aber bei meinem script bleiben die anderen an, und ich kanns nich ändern.

Mit checkboxen passiert das selbe.
freehuntx is offline  
Old 11/11/2011, 08:19   #4
 
elite*gold: 0
Join Date: Mar 2011
Posts: 8,645
Received Thanks: 3,454
Quote:
Originally Posted by freehuntx View Post
Ich habe mich verschrieben.

Ich möchte Radioboxen haben, und davon soll immer nur eine auswählbar sein.

Aber bei meinem script bleiben die anderen an, und ich kanns nich ändern.

Mit checkboxen passiert das selbe.
Du musst die $WS_Group hinter den Creates wegmachen.
Freddy​ is offline  
Thanks
1 User
Old 11/11/2011, 08:24   #5
 
elite*gold: 0
Join Date: Dec 2009
Posts: 1,622
Received Thanks: 2,070
lol

das kommt davon wenn man parameter copy und pasted ohne zu wissen wozu sie geeignet sind xD

Danke butter
freehuntx is offline  
Reply


Similar Threads Similar Threads
[Sammelthread]Fails & Epic-Fails
10/01/2011 - Off Topic - 12 Replies
Hallo e*pvpers^^ Ich sehe in den Signaturen von vielen membern immer wieder lustige Fails deswegen wäre ich für einen Sammelthread ,aber nicht posten wenn es den anderen beleidigt :)
S4 Fails
08/02/2011 - S4 League - 9 Replies
Was sind euer groessten S4 Fails? Bei Fumbi meine Lieblings Haare perm. bekommen und weiter geklickt, zum Glueck nach 4x Dancen nochmal :3
Fails
02/17/2010 - Cabal Online - 0 Replies
How I make cabal site



All times are GMT +2. The time now is 04:52.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.