Sign in to follow this  
Followers 0
MrTechnik

Default bei Radioboxen

3 posts in this topic

#1 ·  Posted (edited)

Hallo zusammen,

ich bin gerade dabei ein Konfigtool zu schreiben und habe aktuell das Problem,

das ich den Defaulteintrag für mehrere Radioboxen nicht setzen kann.

Für die Erste Radiobox funktioniert alles ohne Probleme. Jedoch wird für die zweite und dritte kein Default gesetzt.

Auszug aus dem Script.

Hello,

have some problems with defaults for the different radioboxes. Only for the first radiobox it will work.

but not for the second or third one.

Thanks for help

*********************************************************

DIM $rb01,$rb02, $rb03,$rb11,$rb12,$rb13,$rb21,$rb22,$rb23

Dim $STANDARD_SELECT_RB01 = $GUI_CHECKED;

Dim $STANDARD_SELECT_RB02 = $GUI_UNCHECKED; Es darf jeweils nur RB0x CHECKED sein

Dim $STANDARD_SELECT_RB03 = $GUI_UNCHECKED;

Dim $STANDARD_SELECT_RB11 = $GUI_UNCHECKED;

Dim $STANDARD_SELECT_RB12 = $GUI_CHECKED; Es darf jeweils nur RB1x CHECKED sein

Dim $STANDARD_SELECT_RB13 = $GUI_UNCHECKED;

Dim $STANDARD_SELECT_RB21 = $GUI_UNCHECKED;

Dim $STANDARD_SELECT_RB22 = $GUI_CHECKED; Es darf jeweils nur RB2x CHECKED sein

Dim $STANDARD_SELECT_RB23 = $GUI_UNCHECKED;

GUICtrlSetState($rb01, $STANDARD_SELECT_RB01)

GUICtrlSetState($rb02, $STANDARD_SELECT_RB02)

GUICtrlSetState($rb03, $STANDARD_SELECT_RB03)

GUICtrlSetState($rb11, $STANDARD_SELECT_RB11)

GUICtrlSetState($rb12, $STANDARD_SELECT_RB12)

GUICtrlSetState($rb13, $STANDARD_SELECT_RB13)

GUICtrlSetState($rb21, $STANDARD_SELECT_RB21)

GUICtrlSetState($rb22, $STANDARD_SELECT_RB22)

GUICtrlSetState($rb23, $STANDARD_SELECT_RB23)

;Radio1

GUICtrlCreateGroup("PageFile", 330, 110, 300, 60)

$rb01 = GUICtrlCreateRadio("1.5x", 340, 123, 40)

GUICtrlSetFont(-1,9, 400, 0, $font)

GUICtrlCreateLabel("(" & Round($totalram1 * 1.5) & " MB)", 340, 146)

GUICtrlSetFont(-1,8, 400, 0, $font)

$rb02 = GUICtrlCreateRadio("2x", 440, 123, 40)

GUICtrlSetFont(-1,9, 400, 0, $font)

GUICtrlCreateLabel("(" & Round($totalram1 * 2) & " MB)", 440, 146)

GUICtrlSetFont(-1,8, 400, 0, $font)

$rb03 = GUICtrlCreateRadio("3x", 540, 123, 40)

GUICtrlSetFont(-1,9, 400, 0, $font)

GUICtrlCreateLabel("(" & Round($totalram1 * 3) & " MB)", 540, 146)

GUICtrlSetFont(-1,8, 400, 0, $font)

GUICtrlCreateGroup("", -399, -399, 1, 1) ;close group

; Radio2

GUICtrlCreateGroup("Installverzeichniss \INSTALL\", 330, 180, 300, 40)

$rb11 = GUICtrlCreateRadio("C:", 340, 193, 40)

GUICtrlSetFont(-1,9, 400, 0, $font)

$rb12 = GUICtrlCreateRadio("D:", 440, 193, 40)

GUICtrlSetFont(-1,9, 400, 0, $font)

$rb13 = GUICtrlCreateRadio("E:", 540, 193, 40)

GUICtrlSetFont(-1,9, 400, 0, $font)

GUICtrlCreateGroup("", -399, -399, 1, 1) ;close group

; SelectFelder Hintergund

GUICtrlCreateGroup("Hintergrundfarbe", 330, 230, 300, 40)

$rb21 = GUICtrlCreateRadio($HGCOLOR1N, 340, 243, 99)

GUICtrlSetFont(-1,9, 400, 0, $font)

$rb22 = GUICtrlCreateRadio($HGCOLOR2N, 440, 243, 99)

GUICtrlSetFont(-1,9, 400, 0, $font)

$rb23 = GUICtrlCreateRadio($HGCOLOR3N, 540, 243, 99)

GUICtrlSetFont(-1,9, 400, 0, $font)

GUICtrlCreateGroup("", -399, -399, 1, 1) ;close group

******************************

Vielleicht habt ihr mir ne Idee.

Vielen Dank

Mfg

MrTechnik

Edited by MrTechnik

Share this post


Link to post
Share on other sites



Hallo zusammen,

ich bin gerade dabei ein Konfigtool zu schreiben und habe aktuell das Problem,

das ich den Defaulteintrag für mehrere Radioboxen nicht setzen kann.

Für die Erste Radiobox funktioniert alles ohne Probleme. Jedoch wird für die zweite und dritte kein Default gesetzt.

Auszug aus dem Script.

Hello,

have some problems with defaults for the different radioboxes. Only for the first radiobox it will work.

but not for the second or third one.

Thanks for help

*********************************************************

CODE
DIM $rb01,$rb02, $rb03,$rb11,$rb12,$rb13,$rb21,$rb22,$rb23

Dim $STANDARD_SELECT_RB01 = $GUI_CHECKED;

Dim $STANDARD_SELECT_RB02 = $GUI_UNCHECKED; Es darf jeweils nur RB0x CHECKED sein

Dim $STANDARD_SELECT_RB03 = $GUI_UNCHECKED;

Dim $STANDARD_SELECT_RB11 = $GUI_UNCHECKED;

Dim $STANDARD_SELECT_RB12 = $GUI_CHECKED; Es darf jeweils nur RB1x CHECKED sein

Dim $STANDARD_SELECT_RB13 = $GUI_UNCHECKED;

Dim $STANDARD_SELECT_RB21 = $GUI_UNCHECKED;

Dim $STANDARD_SELECT_RB22 = $GUI_CHECKED; Es darf jeweils nur RB2x CHECKED sein

Dim $STANDARD_SELECT_RB23 = $GUI_UNCHECKED;

GUICtrlSetState($rb01, $STANDARD_SELECT_RB01)

GUICtrlSetState($rb02, $STANDARD_SELECT_RB02)

GUICtrlSetState($rb03, $STANDARD_SELECT_RB03)

GUICtrlSetState($rb11, $STANDARD_SELECT_RB11)

GUICtrlSetState($rb12, $STANDARD_SELECT_RB12)

GUICtrlSetState($rb13, $STANDARD_SELECT_RB13)

GUICtrlSetState($rb21, $STANDARD_SELECT_RB21)

GUICtrlSetState($rb22, $STANDARD_SELECT_RB22)

GUICtrlSetState($rb23, $STANDARD_SELECT_RB23)

;Radio1

GUICtrlCreateGroup("PageFile", 330, 110, 300, 60)

$rb01 = GUICtrlCreateRadio("1.5x", 340, 123, 40)

GUICtrlSetFont(-1,9, 400, 0, $font)

GUICtrlCreateLabel("(" & Round($totalram1 * 1.5) & " MB)", 340, 146)

GUICtrlSetFont(-1,8, 400, 0, $font)

$rb02 = GUICtrlCreateRadio("2x", 440, 123, 40)

GUICtrlSetFont(-1,9, 400, 0, $font)

GUICtrlCreateLabel("(" & Round($totalram1 * 2) & " MB)", 440, 146)

GUICtrlSetFont(-1,8, 400, 0, $font)

$rb03 = GUICtrlCreateRadio("3x", 540, 123, 40)

GUICtrlSetFont(-1,9, 400, 0, $font)

GUICtrlCreateLabel("(" & Round($totalram1 * 3) & " MB)", 540, 146)

GUICtrlSetFont(-1,8, 400, 0, $font)

GUICtrlCreateGroup("", -399, -399, 1, 1) ;close group

; Radio2

GUICtrlCreateGroup("Installverzeichniss \INSTALL\", 330, 180, 300, 40)

$rb11 = GUICtrlCreateRadio("C:", 340, 193, 40)

GUICtrlSetFont(-1,9, 400, 0, $font)

$rb12 = GUICtrlCreateRadio("D:", 440, 193, 40)

GUICtrlSetFont(-1,9, 400, 0, $font)

$rb13 = GUICtrlCreateRadio("E:", 540, 193, 40)

GUICtrlSetFont(-1,9, 400, 0, $font)

GUICtrlCreateGroup("", -399, -399, 1, 1) ;close group

; SelectFelder Hintergund

GUICtrlCreateGroup("Hintergrundfarbe", 330, 230, 300, 40)

$rb21 = GUICtrlCreateRadio($HGCOLOR1N, 340, 243, 99)

GUICtrlSetFont(-1,9, 400, 0, $font)

$rb22 = GUICtrlCreateRadio($HGCOLOR2N, 440, 243, 99)

GUICtrlSetFont(-1,9, 400, 0, $font)

$rb23 = GUICtrlCreateRadio($HGCOLOR3N, 540, 243, 99)

GUICtrlSetFont(-1,9, 400, 0, $font)

GUICtrlCreateGroup("", -399, -399, 1, 1) ;close group

******************************

Vielleicht habt ihr mir ne Idee.

Vielen Dank

Mfg

MrTechnik

You've got it backwards in setting those variables then setting them to the control IDs, and setting states on controls before you create them. Create the control, then set it's state. I also had to provide some undeclared variables:

#include <GuiConstants.au3>

; Set missing variables
$font = "Arial"
$totalram1 = 512000000
$HGCOLOR1N = "Red"
$HGCOLOR2N = "Blue"
$HGCOLOR3N = "Green"

Dim $STANDARD_SELECT_RB01 = $GUI_CHECKED;
Dim $STANDARD_SELECT_RB02 = $GUI_UNCHECKED; Es darf jeweils nur RB0x CHECKED sein
Dim $STANDARD_SELECT_RB03 = $GUI_UNCHECKED;

Dim $STANDARD_SELECT_RB11 = $GUI_UNCHECKED;
Dim $STANDARD_SELECT_RB12 = $GUI_CHECKED; Es darf jeweils nur RB1x CHECKED sein
Dim $STANDARD_SELECT_RB13 = $GUI_UNCHECKED;

Dim $STANDARD_SELECT_RB21 = $GUI_UNCHECKED;
Dim $STANDARD_SELECT_RB22 = $GUI_CHECKED; Es darf jeweils nur RB2x CHECKED sein
Dim $STANDARD_SELECT_RB23 = $GUI_UNCHECKED;

;Radio1
GUICtrlCreateGroup("PageFile", 330, 110, 300, 60)

$rb01 = GUICtrlCreateRadio("1.5x", 340, 123, 40)
GUICtrlSetFont(-1, 9, 400, 0, $font)
GUICtrlCreateLabel("(" & Round($totalram1 * 1.5) & " MB)", 340, 146)
GUICtrlSetFont(-1, 8, 400, 0, $font)
GUICtrlSetState($rb01, $STANDARD_SELECT_RB01)
$rb02 = GUICtrlCreateRadio("2x", 440, 123, 40)
GUICtrlSetFont(-1, 9, 400, 0, $font)
GUICtrlCreateLabel("(" & Round($totalram1 * 2) & " MB)", 440, 146)
GUICtrlSetFont(-1, 8, 400, 0, $font)
GUICtrlSetState($rb02, $STANDARD_SELECT_RB02)
$rb03 = GUICtrlCreateRadio("3x", 540, 123, 40)
GUICtrlSetFont(-1, 9, 400, 0, $font)
GUICtrlCreateLabel("(" & Round($totalram1 * 3) & " MB)", 540, 146)
GUICtrlSetFont(-1, 8, 400, 0, $font)
GUICtrlSetState($rb03, $STANDARD_SELECT_RB03)

GUICtrlCreateGroup("", -399, -399, 1, 1)  ;close group

; Radio2
GUICtrlCreateGroup("Installverzeichniss \INSTALL\", 330, 180, 300, 40)

$rb11 = GUICtrlCreateRadio("C:", 340, 193, 40)
GUICtrlSetFont(-1, 9, 400, 0, $font)
GUICtrlSetState($rb11, $STANDARD_SELECT_RB11)
$rb12 = GUICtrlCreateRadio("D:", 440, 193, 40)
GUICtrlSetFont(-1, 9, 400, 0, $font)
GUICtrlSetState($rb12, $STANDARD_SELECT_RB12)
$rb13 = GUICtrlCreateRadio("E:", 540, 193, 40)
GUICtrlSetFont(-1, 9, 400, 0, $font)
GUICtrlSetState($rb13, $STANDARD_SELECT_RB13)

GUICtrlCreateGroup("", -399, -399, 1, 1)  ;close group

; SelectFelder Hintergund
GUICtrlCreateGroup("Hintergrundfarbe", 330, 230, 300, 40)

$rb21 = GUICtrlCreateRadio($HGCOLOR1N, 340, 243, 99)
GUICtrlSetFont(-1, 9, 400, 0, $font)
GUICtrlSetState($rb21, $STANDARD_SELECT_RB21)
$rb22 = GUICtrlCreateRadio($HGCOLOR2N, 440, 243, 99)
GUICtrlSetFont(-1, 9, 400, 0, $font)
GUICtrlSetState($rb22, $STANDARD_SELECT_RB22)
$rb23 = GUICtrlCreateRadio($HGCOLOR3N, 540, 243, 99)
GUICtrlSetFont(-1, 9, 400, 0, $font)
GUICtrlSetState($rb23, $STANDARD_SELECT_RB23)

GUICtrlCreateGroup("", -399, -399, 1, 1)  ;close group

Cheers, and good luck against Argentina! :D


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Thanks a lot - it works!

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