Jump to content

help again :\


uznut
 Share

Recommended Posts

ok i need some help here

Opt("GUICoordMode", 1)
Opt("GUINotifyMode", 1)
;----------------------------------------------------------------------------------------------------------------------------------------
GuiCreate("ACH PROCESSING", 294,187,10,10,0x04CF0000)
GUISetControl("button", "OK", 30,89, 85,55)
GUISetControl("button", "CANCEL", 180,89, 85,55)

GUISetControl("label", "Please check the DATE and choose one of the following", 10, 15, 290, 20 )

$radio1 = GuiSetControl("radio", "Morning ACH",  110, 35, 100)
$radio2 = GuiSetControl("radio", "ONUS ACH",  110, 55, 50)  
$t = FileGettime("C:\Documents and Settings\tsmith\Desktop\AUTOIT\diablo.au3" )
$yyyymd = $t[1] & "/" & $t[2] & "/" & $t[0]
GuiSetControl("Label",  $yyyymd,  30, 150, 185)

GuiShow()

While 1
    sleep(100)
    $msg = GuiMsg(0)
    If $msg = -3 Then ExitLoop
WEnd
Exit

If guiread($radio1)=1 Then
msgbox(0,"","Radio1 is Checked!")
ElseIf guiread($radio1)=4 Then
msgbox(0,"","Radio1 is Unchecked!")
EndIf

If guiread($radio2)=1 Then
msgbox(0,"","Radio2 is Checked!")
ElseIf guiread($radio2)=4 Then
msgbox(0,"","Radio2 is Unchecked!")
EndIf

ok what i want to do is when radio1 is active and you click ok then it does something

and the same for radio2

but im not sure how to do something like that like the radio's do not work when i check them can i get a bit of help :\

Link to comment
Share on other sites

I had this example lying around in my code folder when I was learning to do this exact thing myself. The relative position is a bit sloppy, but you're going to want to look at how I handeled the radio button notify states. Hope this helps. It's eaisier to understand if you run my code first, and then look at the source.

#include <GuiConstants.au3>

Opt("GuiCoordMode", 2)
GuiCreate("Gui title", 200, 150)
  $ExitButton = GuiSetControl("button", "Exit Button", 0, 0)
    GuiSetControlNotify()
  $Part1 = GuiSetControl("radio", "Part 1", -1, 0, 100)
    GuiSetControlEx(-1, $GUI_CHECKED)
    GuiSetControlNotify()
  $Part2 = GuiSetControl("radio", "Part 2", 0, -1)
    GuiSetControlNotify()
  GuiSetCoord(0, 30)
  $Label1 = GuiSetControl("label", "Input 1:", -1, 0)
  $Text1 = GuiSetControl("input", "", -1, 0)
  $In1Choice1 = GuiSetControl("radio", "type 1", -1, 0, 50)
    GuiSetControlEx(-1, $GUI_CHECKED)
  $In1Choice2 = GuiSetControl("radio", "type 2", 0, -1)
  GuiSetCoord(0, 30, 100)
  $Label2 = GuiSetControl("label", "Input 2:", 0, 0)
    GuiSetControlEx(-1, $GUI_DISABLE)
  $Text2 = GuiSetControl("input", "", -1, 0)
    GuiSetControlEx(-1, $GUI_DISABLE)
GuiShow()

While 1
  Sleep(200)
  $n = GuiMsg(0)
  Select
    Case $n = -3
      GuiDelete()
      MsgBox(0, "Red exit", "You pressed the red exit button. Now exiting")
      Exit
    Case $n = $Part1
      GuiSetControlEx($Label1, $GUI_ENABLE)
      GuiSetControlEx($Text1, $GUI_ENABLE + $GUI_FOCUS)
      GuiSetControlEx($In1Choice1, $GUI_ENABLE)
      GuiSetControlEx($In1Choice2, $GUI_ENABLE)
      GuiSetControlEx($Label2, $GUI_DISABLE)
      GuiSetControlEx($Text2, $GUI_DISABLE)
    Case $n = $Part2
      GuiSetControlEx($Label2, $GUI_ENABLE)
      GuiSetControlEx($Text2, $GUI_ENABLE + $GUI_FOCUS)
      GuiSetControlEx($Label1, $GUI_DISABLE)
      GuiSetControlEx($Text1, $GUI_DISABLE)
      GuiSetControlEx($In1Choice1, $GUI_DISABLE)
      GuiSetControlEx($In1Choice2, $GUI_DISABLE)
    Case $n = $ExitButton
      GuiHide()
      MsgBox(0, "Exit Button", "You pressed the exit button. Now exiting")
      Exit
  EndSelect
Wend

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Link to comment
Share on other sites

thats kinda what i was talking about

Opt("GUICoordMode", 1)
;----------------------------------------------------------------------------------------------------------------------------------------
GuiCreate("ACH PROCESSING", 294,187,10,10,0x04CF0000)
$1e = GUISetControl("button", "OK", 30,89, 85,55)
GUISetControl("button", "CANCEL", 180,89, 85,55)

GUISetControl("label", "Please check the DATE and choose one of the following", 10, 15, 290, 20 )

$radio1 = GuiSetControl("radio", "Morning ACH",  110, 35, 100)
   GuiSetControlNotify()
$radio2 = GuiSetControl("radio", "ONUS ACH",  110, 55, 50)  
   GuiSetControlNotify()
$t = FileGettime("C:\Documents and Settings\tsmith\Desktop\AUTOIT\diablo.au3" )
$yyyymd = $t[1] & "/" & $t[2] & "/" & $t[0]
GuiSetControl("Label",  $yyyymd,  30, 150, 185)

GuiShow()

While 1
    sleep(100)
    $msg = GuiMsg(0)
    If $msg = -3 Then ExitLoop
WEnd
Exit
$n = GuiMsg(0)
Select
Case $n = $radio1
    If GuiSetControlEx($radio1, $GUI_ENABLE) Then
       msgbox(0,"","Radio1 is Checked!")
    ElseIf guiread($radio1)=4 Then
       msgbox(0,"","Radio1 is Unchecked!")
    EndIf
Case $n = $radio2
    If GuiSetControlEx($Radio2, $GUI_ENABLE) Then
       msgbox(0,"","Radio2 is Checked!")
    ElseIf guiread($radio2)=4 Then
       msgbox(0,"","Radio2 is Unchecked!")
    EndIf
EndSelect

like what i wanted to do was like

when ok clicked then

is radio1 is checked

if yes then send msg box

if not checked then goto

is radio2 is checked

if yes then do this

i don't know how to put that into code im still a big newbie

Link to comment
Share on other sites

  • Developers

Something like this ?

GUIShow()
While 1
   $MSG = GUIMsg()
   If $MSG = -3 Then ExitlOOP
Wend
If GUIRead($RADIO1) = 1 Then
   MsgBox(0, "", "Radio1 is Checked!")
Else
   MsgBox(0, "", "Radio1 is Unchecked!")
EndIf
If GUIRead($RADIO2) = 1 Then
   MsgBox(0, "", "Radio2 is Checked!")
Else
   MsgBox(0, "", "Radio2 is Unchecked!")
EndIf

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

ok i added that ending but know all it does is close out

GuiCreate("ACH PROCESSING", 294,187,10,10,0x04CF0000)
$ll = GUISetControl("button", "OK", 30,89, 85,55)
GUISetControl("button", "CANCEL", 180,89, 85,55)

GUISetControl("label", "Please check the DATE and choose one of the following", 10, 15, 290, 20 )

$radio1 = GuiSetControl("radio", "Morning ACH",  110, 35, 100)
   GuiSetControlNotify()
$radio2 = GuiSetControl("radio", "ONUS ACH",  110, 55, 50)  
   GuiSetControlNotify()
$t = FileGettime("C:\Documents and Settings\tsmith\Desktop\AUTOIT\diablo.au3" )
$yyyymd = $t[1] & "/" & $t[2] & "/" & $t[0]
GuiSetControl("Label",  $yyyymd,  30, 150, 185)

GuiShow()

While 1
    sleep(100)
    $msg = GuiMsg(0)
    If $msg = -3 Then ExitLoop
WEnd
Exit
GUIShow()
While 1
  $MSG = GUIMsg()
  If $MSG = -3 Then ExitlOOP
Wend
If GuiRead($ll) = 1 then 
  MsgBox(0, "", "OK was Clicked!")
endif
If GUIRead($radio1) = 1 Then
  MsgBox(0, "", "Radio1 is Checked!")
Else
  MsgBox(0, "", "Radio1 is Unchecked!")
EndIf
If GUIRead($Radio2) = 1 Then
  MsgBox(0, "", "Radio2 is Checked!")
Else
  MsgBox(0, "", "Radio2 is Unchecked!")
EndIf
Link to comment
Share on other sites

  • Developers

While 1
sleep(100)
$msg = GuiMsg(0)
If $msg = -3 Then ExitLoop
WEnd
Exit
GUIShow()
While 1
 $MSG = GUIMsg()
 If $MSG = -3 Then ExitlOOP
Wend

This doesn't look correct. You have an EXIT after the first While-Wend.

Try this version:

GUISetControl("label", "Please check the DATE and choose one of the following", 10, 15, 290, 20)

$RADIO1 = GUISetControl("radio", "Morning ACH", 110, 35, 100)
GUISetControlNotify()
$RADIO2 = GUISetControl("radio", "ONUS ACH", 110, 55, 50)  
GUISetControlNotify()
$T = FileGetTime("C:\Documents and Settings\tsmith\Desktop\AUTOIT\diablo.au3")
$YYYYMD = $T[1] & "/" & $T[2] & "/" & $T[0]
GUISetControl("Label", $YYYYMD, 30, 150, 185)

GUIShow()

While 1
   $MSG = GUIMsg()
   If $MSG = -3 Then ExitLoop
Wend
If GUIRead($LL) = 1 Then 
   MsgBox(0, "", "OK was Clicked!")
EndIf
If GUIRead($RADIO1) = 1 Then
   MsgBox(0, "", "Radio1 is Checked!")
Else
   MsgBox(0, "", "Radio1 is Unchecked!")
EndIf
If GUIRead($RADIO2) = 1 Then
   MsgBox(0, "", "Radio2 is Checked!")
Else
   MsgBox(0, "", "Radio2 is Unchecked!")
EndIf

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...