Jump to content
Sign in to follow this  
Gillboss

What wrong?

Recommended Posts

this is the code:

GUICreate("aaaa", 540, 540, 100, 100)   
GUICtrlCreateGroup("bbbb", 10, 80, 210, 250)
$optEeNormal = GUICtrlCreateRadio("asd", 20, 100, 190, 20)
GUICtrlSetState(-1, $GUI_CHECKED)
$optEePower = GUICtrlCreateRadio("dsa", 20, 120, 190, 20)
$optSinPoint = GUICtrlCreateRadio("asdasd", 20, 140, 190, 20)
$optMulPoints = GUICtrlCreateRadio("dsadsa", 20, 160, 190, 20)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState()

why i get misstake? its something with the "GUICtrlSetState(-1, $GUI_CHECKED)".

and more thing, how can i know which radio the user checked?

Thanks!

Edited by Gillboss

Share this post


Link to post
Share on other sites

this is the code:

GUICreate("aaaa", 540, 540, 100, 100)   
GUICtrlCreateGroup("bbbb", 10, 80, 210, 250)
$optEeNormal = GUICtrlCreateRadio("asd", 20, 100, 190, 20)
GUICtrlSetState(-1, $GUI_CHECKED)
$optEePower = GUICtrlCreateRadio("dsa", 20, 120, 190, 20)
$optSinPoint = GUICtrlCreateRadio("asdasd", 20, 140, 190, 20)
$optMulPoints = GUICtrlCreateRadio("dsadsa", 20, 160, 190, 20)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState()

why i get misstake? its something with the "GUICtrlSetState(-1, $GUI_CHECKED)".

and more thing, how can i know which radio the user checked?

Thanks!

Have you looked at the helpfile example for GUICtrlCreateRadio() ?

Both questions should be answered when you follow the example.

Edited by Jos

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

Share this post


Link to post
Share on other sites

Whats the mistake?

look:

Posted Image

Have you looked at the helpfile example for GUICtrlCreateRadio() ?

Both questions should be answered when you follow the example.

where it? Edited by Gillboss

Share this post


Link to post
Share on other sites

where it?

You mean: Where is the HelpFile ?

In the AutoIt3 program directory. In SciTE4AutoIt3 press F1 .... :)


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

Share this post


Link to post
Share on other sites

oh found so, this the code:

#include <GUIConstants.au3>
GUICreate("My GUI radio") ; will create a dialog box that when displayed is centered

$radio1 = GUICtrlCreateRadio ("Radio 1", 10, 10, 120, 20)
$radio2 = GUICtrlCreateRadio ("Radio 2", 10, 40, 120, 20)
GUICtrlSetState ($radio2, $GUI_CHECKED)

GUISetState ()      ; will display an  dialog box with 1 checkbox

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $radio1 And BitAND(GUICtrlRead($radio1), $GUI_CHECKED) = $GUI_CHECKED
            MsgBox(64, 'Info:', 'You clicked the Radio 1 and it is Checked.')
        Case $msg = $radio2 And BitAND(GUICtrlRead($radio2), $GUI_CHECKED) = $GUI_CHECKED
            MsgBox(64, 'Info:', 'You clicked on Radio 2 and it is Checked.')
    EndSelect
Wend

so where to change and what to change in my project?

Share this post


Link to post
Share on other sites

i realy dont know what wrong please somone tell me why..

The error you showed in post #4 was that a variable or constant was unknown. The $GUI_.. constants are defined in the include file GUICONSTANTS.AU3, so if you add the first line of the example to the first line of your script it should remove that error.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

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...