Jump to content

How to set font color on radio? :O


Recommended Posts

Hey scripters.

Ive got this code. and as you can see all my label text is red with the func GUICtrlSetColor($label1, 0xFF0000) easy easy. But how do i make the text in my radio become red also?

GUICtrlSetColor($radio1, 0xFF0000) neither do GUICtrlSetFont($radio1, 0xFF0000) anyone know how to solve this problem?

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
Global $Form1 = GUICreate("Champion Builder - Copyright©", 332, 437, 192, 124)
GUISetBkColor(0x342826)
Global $Input1 = GUICtrlCreateInput("Insert champion name here", 8, 16, 233, 21)
Global $Input2 = GUICtrlCreateInput("", 10, 90, 310, 21)
Global $Input3 = GUICtrlCreateInput("", 10, 133, 310, 21)
Global $Input4 = GUICtrlCreateInput("", 10, 177, 310, 21)
Global $Input5 = GUICtrlCreateInput("", 10, 220, 310, 21)
Global $Input6 = GUICtrlCreateInput("", 10, 263, 310, 21)
Global $Input7 = GUICtrlCreateInput("", 10, 306, 310, 21)
Global $Button1 = GUICtrlCreateButton("Build!", 241, 10, 89, 33)
Global $Radio1 = GUICtrlCreateRadio("Ap", 20, 40, 40, 25)
Global $Radio2 = GUICtrlCreateRadio("Ad", 60, 40, 40, 25)
Global $Radio3 = GUICtrlCreateRadio("Hybird", 100, 40, 50, 25)
Global $Radio4 = GUICtrlCreateRadio("Tank", 155, 40, 40, 25)
Global $Radio5 = GUICtrlCreateRadio("Support", 200, 45, 80, 15)
Global $Label2 = GUICtrlCreateLabel("Starter item", 10, 70, 70, 15)
Global $Label1 = GUICtrlCreateLabel("Made by Tobias Brodersen All - rights reserved - Copyright©", 20, 415, 300, 20)
Global $Label3 = GUICtrlCreateLabel("Next items you should rush for is", 10, 114, 300, 20)
Global $Label4 = GUICtrlCreateLabel("Your next items should be", 10, 157, 300, 20)
Global $Label5 = GUICtrlCreateLabel("Next item should be", 10, 200, 300, 20)
Global $Label6 = GUICtrlCreateLabel("Next item", 10, 243, 300, 20)
Global $Label7 = GUICtrlCreateLabel("Final item", 10, 286, 300, 20)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
GUICtrlSetColor($Label1, 0xFF0000)
GUICtrlSetColor($Label2, 0xFF0000)
GUICtrlSetColor($Label3, 0xFF0000)
GUICtrlSetColor($Label4, 0xFF0000)
GUICtrlSetColor($Label5, 0xFF0000)
GUICtrlSetColor($Label6, 0xFF0000)
GUICtrlSetColor($Label7, 0xFF0000)
While 1
    $msg = GUIGetMsg()
    If $msg =-3 Then Exit
    If $msg = $button1 Then button1()
    WEnd

Func Button1()
    $champname = GUICtrlRead($Input1)
    $akali = "akali"
    $alistar = "alistar"
    ;If no champion style is picked start
If $champname And GUICtrlRead($Radio1) = $GUI_UNCHECKED And GUICtrlRead($Radio2) = $GUI_UNCHECKED And GUICtrlRead($Radio3) = $GUI_UNCHECKED And GUICtrlRead($Radio4) = $GUI_UNCHECKED And GUICtrlRead($Radio5) = $GUI_UNCHECKED Then
    MsgBox(0, "Pick a style", "Please pick a champion style")
EndIf
;if no champion style is picked stop
    ;akali start
    If $champname = $akali And GUICtrlRead($Radio1) = $GUI_CHECKED Then
        GUICtrlSetData($input2, "Amplifying Tome (20 Ap) + 1 Health pot")
        GUICtrlSetData($input3, "Sheen -> Boots of Speed -> Needlessly Large Rod")
        GUICtrlSetData($input4, "Lich Bane -> Sorcerer's Shoes -> Deathcap")
        GUICtrlSetData($input5, "Will of the Ancients or/and Rylai's Crystal Scepter")
        GUICtrlSetData($input6, "Will of the Acients or/and Rylai's Crystal Scepter")
        GUICtrlSetData($input7, "Void Staff")
    ElseIf $champname = $akali And GUICtrlRead($Radio2) = $GUI_CHECKED Then
        MsgBox(0, "Not recommened", "It is not Recommened to go full ad")
        GUICtrlSetData($input2, "Long Sword (10 Ad) + 1 Health pot")
        GUICtrlSetData($input3, "Berserker Greves -> Zeal -> The Brutalizer")
        GUICtrlSetData($input4, "Phantom Dancer -> Youmuu's Ghostblade")
        GUICtrlSetData($input5, "Infinty's Edge")
        GUICtrlSetData($input6, "Phantom Dancer")
        GUICtrlSetData($input7, "Infinity edge")
    ElseIf $champname = $akali And GUICtrlRead($Radio3) = $GUI_CHECKED Then
        GUICtrlSetData($input2, "Amplifying Tome (20 Ap) + 1 Health pot")
        GUICtrlSetData($input3, "Sheen -> Boots of speed -> Pickaxe")
        GUICtrlSetData($input4, "Trinity Force -> Berserker Greves -> Rageblade")
        GUICtrlSetData($input5, "Deathcap")
        GUICtrlSetData($input6, "Hextech Gunblade")
        GUICtrlSetData($input7, "Phantom Dancer")
    ElseIf $champname = $akali And GUICtrlRead($Radio4) = $GUI_CHECKED Then
        GUICtrlSetData($input2, "Akali should not play this style")
        GUICtrlSetData($Input3, "Akali should not play this style")
        GUICtrlSetData($input4, "Akali should not play this style")
        GUICtrlSetData($input5, "Akali should not play this style")
        GUICtrlSetData($input6, "Akali should not play this style")
        GUICtrlSetData($input7, "Akali should not play this style")
    ElseIf $champname = $akali And GUICtrlRead($Radio5) = $GUI_CHECKED Then
        GUICtrlSetData($input2, "Akali should not play this style")
        GUICtrlSetData($input3, "Akali should not play this style")
        GUICtrlSetData($input4, "Akali should not play this style")
        GUICtrlSetData($input5, "Akali should not play this style")
        GUICtrlSetData($input6, "Akali should not play this style")
        GUICtrlSetData($input7, "Akali should not play this style")
    EndIf
    ;akali stop
EndFunc

Getting hang on the basic, still much to learn.If I take high class, taking high test im getting highscore right?

Link to comment
Share on other sites

That looks game related. We can't help you as that is against the forum rules.

It is game related yes, but it is not like cracking a game. It dosent give me more gold or do mig stronger, its a reminder.

For an example, if i play a hunter, and I want to kill a cow in just 1 shot. i need to buy a new rifle. this script just tells me which rifle is good to buy. I cloud go check the game website. but im doing some practice with autoit. So if i want to shot a cow in 1 shot, i just type in the name of what animal i want to shot, and then it tells me what rifle i should buy

like this:

What animal do you want to shot: Cow

Then you should buy Cow rifle. you see? dosent do anything to my game. but tells me what is good to buy ingame

Getting hang on the basic, still much to learn.If I take high class, taking high test im getting highscore right?

Link to comment
Share on other sites

Well I dunno, but I guess we could give you this.

Fist step is: learn to always check the helpfile when you have a question. The helpfile explains this on the GUICtrlSetColor() page.

Remarks

Only Button, Label, Checkbox, Group, Radio, Edit, Input, List, Listview, ListviewItem, Treeview, TreeviewItem, Graphic, Progress and Combo controls can currently be colored.

Checkbox, Radio, Group or Progress controls cannot be painted if the "Windows XP/Vista style" is used.

Button controls are always painted in "Windows Classic style".

And if you're wondering how to disable theming:

You can make only the group-control run without any theme by doing like so:

#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>

$Form1_1 = GUICreate("Amortization Plus", 644, 303, 207, 200)
GUISetBkColor(0x000080)
$Group1 = GUICtrlCreateGroup("Amortization Table", 8, 0, 625, 81, BitOR($BS_CENTER, $BS_FLAT))
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($Group1), "wstr", 0, "wstr", 0)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 10, 400, 0, "System")

GUISetState(@SW_SHOW)

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

(this of course also works on Checkbox, Radio and Progress)

Or disable it for the whole gui like so:

#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>

DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0)

$Form1_1 = GUICreate("Amortization Plus", 644, 303, 207, 200)
GUISetBkColor(0x000080)
$Group1 = GUICtrlCreateGroup("Amortization Table", 8, 0, 625, 81, BitOR($BS_CENTER, $BS_FLAT))
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 10, 400, 0, "System")

GUISetState(@SW_SHOW)

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

Edited by AdmiralManHairAlkex
Link to comment
Share on other sites

  • 4 months later...

Use GUICtrlSetFont, GUICtrlSetBkColor and GUICtrlSetColor.

It's all in the help file all you would have needed to do is search for font label, color label and those would have shown up in the search.

Edited by BrewManNH

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

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