Jump to content
Sign in to follow this  
Eru

TrayCreateItem (Radio Option Problem)

Recommended Posts

Eru

I'm having problems using the TrayCreateItem command. I create my options and set it to "radio" but only the first three will become checked when selected. The rest don't cause the radio button to change. :) Here's the excerpt from the code that has the items.

Global $ResMen = TrayCreateMenu("Resolution")
TrayCreateItem("", $ResMen, 1)
Global $NoRes = TrayCreateItem ("NoRes", $ResMen, 2, 1)
Global $R800x600 = TrayCreateItem("800x600", $ResMen, 3, 1)
Global $R1024x768 = TrayCreateItem("1024x768", $ResMen, 4, 1)
Global $R1280x1024 = TrayCreateItem("1280x1024", $ResMen, 5, 1)
Global $R1280x800 = TrayCreateItem("1280x800", $ResMen, 6, 1)
Global $R1440x900 = TrayCreateItem("1440x800", $ResMen, 7,1)
TrayCreateItem("", $ResMen, 8)

I haven't tested to see if the buttons still perform the right action when they're selected, but I'm not sure that it's really relevant. I don't see how I've made any syntax errors, but I'm notoriously blind to things right under my nose.

Thanks for the help!

-Eru

Share this post


Link to post
Share on other sites
Xenobiologist

Hi,

cannot test it this way.

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites
PsaltyDS

You didn't post a working demo - shame! Shame on you two time! :)

But we are benevolent...

Opt("TrayMenuMode", 1)
Opt("TrayOnEventMode", 1)

$exit = TrayCreateItem("Exit")
TrayItemSetOnEvent(-1, "_Quit")
Global $ResMen = TrayCreateMenu("Resolution")
TrayCreateItem("", $ResMen, 1)
Global $NoRes = TrayCreateItem("NoRes", $ResMen, 2, 1)
TrayItemSetOnEvent(-1, "_TrayItems")
Global $R800x600 = TrayCreateItem("800x600", $ResMen, 3, 1)
TrayItemSetOnEvent(-1, "_TrayItems")
Global $R1024x768 = TrayCreateItem("1024x768", $ResMen, 4, 1)
TrayItemSetOnEvent(-1, "_TrayItems")
Global $R1280x1024 = TrayCreateItem("1280x1024", $ResMen, 5, 1)
TrayItemSetOnEvent(-1, "_TrayItems")
Global $R1280x800 = TrayCreateItem("1280x800", $ResMen, 6, 1)
TrayItemSetOnEvent(-1, "_TrayItems")
Global $R1440x900 = TrayCreateItem("1440x900", $ResMen, 7, 1)
TrayItemSetOnEvent(-1, "_TrayItems")
TrayCreateItem("", $ResMen, 8)

While 1
    Sleep(20)
WEnd

Func _Quit()
    Exit
EndFunc   ;==>_Quit

Func _TrayItems()
    Switch @TRAY_ID
        Case $NoRes
            MsgBox(64, "Results", "No resolution selected.")
            Return
        Case $R800x600
            $ResSel = "800x600"
        Case $R1024x768
            $ResSel = "1024x768"
        Case $R1280x1024
            $ResSel = "1280x1024"
        Case $R1280x800
            $ResSel = "1280x800"
        Case $R1440x900
            $ResSel = "1440x900"
        Case Else
            Return
    EndSwitch
    MsgBox(64, "Results", "You choose a resolution of " & $ResSel & ".")
EndFunc   ;==>_TrayItems

If this doesn't address your issue, post a working demo that shows the problem...

:)


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
Gif

post whole script or the biggest part of it

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  

×