cheeseandcereal

Setting group control font colors?

8 posts in this topic

#1 ·  Posted (edited)

So I have this script, and I have recreated the problem in this GUI so that anyone running windows 7 can execute this code(because it uses a windows 7 sample picture):

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=C:UsersDad & MomDocumentsAutoit ScriptsHunter Gametype ChangerHunter client changer - Copy.kxf
$Form1 = GUICreate("Adam's Minecraft Gametype Changer", 630, 346, 392, 196)
$MenuItem4 = GUICtrlCreateMenu("&File")
$MenuItem6 = GUICtrlCreateMenuItem("Help", $MenuItem4)
$MenuItem7 = GUICtrlCreateMenuItem("Exit", $MenuItem4)
$MenuItem5 = GUICtrlCreateMenu("&Change Mode")
$MenuItem2 = GUICtrlCreateMenuItem("Backup and Restore", $MenuItem5)
$MenuItem3 = GUICtrlCreateMenuItem("Server Gametype Changer", $MenuItem5)
GUISetBkColor(0x000000)
$Pic1 = GUICtrlCreatePic("C:UsersPublicPicturesSample PicturesPenguins.jpg", 0, 0, 629, 325, 0)
GUICtrlSetState($Pic1, $GUI_DISABLE)
$Button1 = GUICtrlCreateButton("1.1.0", 256, 88, 113, 41)
$Button2 = GUICtrlCreateButton("1.0.0 with mods", 256, 144, 113, 41)
$Button3 = GUICtrlCreateButton("1.0.0 without mods", 104, 144, 113, 41)
$Button4 = GUICtrlCreateButton("1.8.1 Beta", 409, 88, 113, 41)
$Button6 = GUICtrlCreateButton("Start Minecraft", 178, 248, 113, 41)
$Button13 = GUICtrlCreateButton("1.2.0", 104, 88, 113, 41)
$Group1 = GUICtrlCreateGroup("Gametypes", 96, 72, 433, 121)
GUICtrlSetFont(-1, 8, 400, 0, "arial")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button14 = GUICtrlCreateButton("Start Server", 336, 248, 113, 41)
$Group2 = GUICtrlCreateGroup("Start Services", 168, 232, 289, 65)
GUICtrlSetFont(-1, 8, 400, 0, "arial")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
  Case $GUI_EVENT_CLOSE
   Exit
EndSwitch
WEnd

So I have created this GUI with Koda and set the group font to clWhite color, however when running the code that Koda generates for me, the text is still black and therefor I can't see the group text. I was wondering if there was a way to change the text color for groups? Koda doesn't seem to do it properly. I have attached the Koda file I used if you wish to see it. The only thing I changed between the code that Koda generates and the code I have posted here, Is that I moved the picture and disabled it to be a background image. Any help will be greatly appreciated.

Test.zip

Edited by cheeseandcereal

Share this post


Link to post
Share on other sites



cheeseandcereal,

Your threads are continually being reported because you mention a game (;)) within them - and you have already had a couple of similar threads locked for reasons that were quite clear. Although I am content (for the moment) that your later scripts are merely setting the environment for you to run the game, you are getting perilously close to the limit of the Forum Rules. Please do us all a favour and use more neutral terms for the controls you create in your posted scripts in future - or I will get to use the padlock icon more often, which is not at all what I like doing. Deal? :)

As to the current question, you need to remove the theme from certain controls (Checkbox, Radio, Group) before you can colour the text: ;)

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#region ### START Koda GUI section ### Form=C:UsersDad & MomDocumentsAutoit ScriptsHunter Gametype ChangerHunter client changer - Copy.kxf
$Form1 = GUICreate("Adam's Minecraft Gametype Changer", 630, 346, 392, 196)
$MenuItem4 = GUICtrlCreateMenu("&File")
$MenuItem6 = GUICtrlCreateMenuItem("Help", $MenuItem4)
$MenuItem7 = GUICtrlCreateMenuItem("Exit", $MenuItem4)
$MenuItem5 = GUICtrlCreateMenu("&Change Mode")
$MenuItem2 = GUICtrlCreateMenuItem("Backup and Restore", $MenuItem5)
$MenuItem3 = GUICtrlCreateMenuItem("Server Gametype Changer", $MenuItem5)
GUISetBkColor(0x000000)
$Pic1 = GUICtrlCreatePic("M:ProgramAu3 ScriptsImagesFacepalm.jpg", 0, 0, 629, 325, 0)
GUICtrlSetState($Pic1, $GUI_DISABLE)
$Button1 = GUICtrlCreateButton("1.1.0", 256, 88, 113, 41)
$Button2 = GUICtrlCreateButton("1.0.0 with mods", 256, 144, 113, 41)
$Button3 = GUICtrlCreateButton("1.0.0 without mods", 104, 144, 113, 41)
$Button4 = GUICtrlCreateButton("1.8.1 Beta", 409, 88, 113, 41)
$Button6 = GUICtrlCreateButton("Start Minecraft", 178, 248, 113, 41)
$Button13 = GUICtrlCreateButton("1.2.0", 104, 88, 113, 41)
$Group1 = GUICtrlCreateGroup("Gametypes", 96, 72, 433, 121)
; Remove the theme
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($Group1), "wstr", 0, "wstr", 0)
GUICtrlSetFont(-1, 8, 400, 0, "arial")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button14 = GUICtrlCreateButton("Start Server", 336, 248, 113, 41)
$Group2 = GUICtrlCreateGroup("Start Services", 168, 232, 289, 65)
; Remove the theme
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($Group2), "wstr", 0, "wstr", 0)
GUICtrlSetFont(-1, 8, 400, 0, "arial")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Ok, thank you for the fix on my script. As for the rules, does this mean that I can't mention the game's name (I didn't see that in the Forum rules)? And also, I realize my first couple topics were locked for obvious reasons and I can say with confidence that this is a completely different script and, as you said, just sets the environment for when I run the game. Also, just to check, were the codes in my posts after my first two topics too "perilously close to the limit of the Forum Rules"? I just want to clarify for future posts so that I don't get in any trouble or break any more rules because that's not what I'm here to do, I just want to learn! Thanks for all your help.

Share this post


Link to post
Share on other sites

cheeseandcereal,

As I said above, I am content that you are legal at the moment but your threads get reported because of the "game" nature of your controls and labels. I would be grateful if you could amend the scripts before you post so that they do not attract so much attention. Something like this perhaps: ;)

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

$Form1 = GUICreate("Adam's Script", 630, 346, 392, 196)
$MenuItem4 = GUICtrlCreateMenu("&File")
$MenuItem6 = GUICtrlCreateMenuItem("Help", $MenuItem4)
$MenuItem7 = GUICtrlCreateMenuItem("Exit", $MenuItem4)
$MenuItem5 = GUICtrlCreateMenu("&Change Mode")
$MenuItem2 = GUICtrlCreateMenuItem("Backup and Restore", $MenuItem5)
$MenuItem3 = GUICtrlCreateMenuItem("Server Changer", $MenuItem5)
GUISetBkColor(0x000000)
$Pic1 = GUICtrlCreatePic("M:ProgramAu3 ScriptsImagesFacepalm.jpg", 0, 0, 629, 325, 0)
GUICtrlSetState($Pic1, $GUI_DISABLE)
$Button1 = GUICtrlCreateButton("1.1.0", 256, 88, 113, 41)
$Button2 = GUICtrlCreateButton("1.0.0 with mods", 256, 144, 113, 41)
$Button3 = GUICtrlCreateButton("1.0.0 without mods", 104, 144, 113, 41)
$Button4 = GUICtrlCreateButton("1.8.1 Beta", 409, 88, 113, 41)
$Button6 = GUICtrlCreateButton("Start", 178, 248, 113, 41)
$Button13 = GUICtrlCreateButton("1.2.0", 104, 88, 113, 41)
$Group1 = GUICtrlCreateGroup("Types", 96, 72, 433, 121)
; Remove the theme
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($Group1), "wstr", 0, "wstr", 0)
GUICtrlSetFont(-1, 8, 400, 0, "arial")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button14 = GUICtrlCreateButton("Start Server", 336, 248, 113, 41)
$Group2 = GUICtrlCreateGroup("Start Services", 168, 232, 289, 65)
; Remove the theme
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($Group2), "wstr", 0, "wstr", 0)
GUICtrlSetFont(-1, 8, 400, 0, "arial")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)

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

Not a lot of changes but enough to stop the reports - I hope! ;)

All clear? :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Sure thing! Thank's for the suggestion and I will be sure to do that in the future! :)

Share this post


Link to post
Share on other sites

cheeseandcereal,

Thanks a lot. :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Melba23,

Thanks again, you make my life easier on a daily basis!!!!

Share this post


Link to post
Share on other sites

JoshuaBarnette,

Very pleased to hear it! :D

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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