Jump to content

Scripting fonts


lm1
 Share

Recommended Posts

I am currently designing a script for the addons with world of warcraft. And i cant seem to figure out if there is a command in autoit that i can use to make something along the lines of the background box of font (contrasting against a colorful background) invisible.? There should be a screen shot of what the addon screen currently looks like.

Posted Image

As you can see the grey boxes behind the font kinda make the screen look icky. Is there a way to make the background to the font invisible?

Link to comment
Share on other sites

Search the helpfile for GUICtrlSetBkColor with the color being $GUI_BK_TRANSPARENT

I did attempt to set this however my Autoit gives me an error, $GUI_BK_TRANSPARENT - undeclared global variable.

If I declare this variablke myself, I don't know what hex value to assign it to work as transparent.

I can change it to another colour, but what do I use for the $GUI_BK_TRANSPARENT?

Thanks

Link to comment
Share on other sites

  • 2 weeks later...

It is: $GUI_BKCOLOR_TRANSPARENT, and it does'nt work with checkboxes...

You will have to create a seperate checkbox and label if you wish to have it transparent.. Smoke'N wrote a script I think to do it for you :whistle:

I changed Smoke'N's code around a little but here it is:

#include <Guiconstants.au3>
GUICreate("test")
GUICtrlCreatePic(@WindowsDir & "\Greenstone.bmp", 0, 0, 300, 300)
GUICtrlSetState(-1, $GUI_DISABLE)
$test = _GUICtrlCreateCheckbox("Testing", 0, 0, 50, 25, $GUI_BKCOLOR_TRANSPARENT)
GUISetState()
While (GUIGetMSg() <> -3)
WEnd

Func _GUICtrlCreateCheckbox($sText, $nLeft, $nTop, $nWidth, $nHeight, $nColor)
    Local $aCkBoxEx[3]
    $aCkBoxEx[1] = GUICtrlCreateCheckbox('', $nLeft, $nTop, 13, 13)
    $aCkBoxEx[2] = GUICtrlCreateLabel($sText, $nLeft + 20, $nTop, $nWidth, $nHeight)
    GUICtrlSetBkColor($aCkBoxEx[2], $nColor)
    Return $aCkBoxEx
EndFunc
oÝ÷ Úf²mæzÛ^­ìZ^jëh×6
#include <Guiconstants.au3>
Global $show = 0
GUICreate("test")
GUICtrlCreatePic(@WindowsDir & "\Greenstone.bmp", 0, 0, 300, 300)
GUICtrlSetState(-1, $GUI_DISABLE)
$test = _GUICtrlCreateCheckbox("Testing", 0, 0, 50, 25, $GUI_BKCOLOR_TRANSPARENT)
GUISetState()
While (GUIGetMSg() <> -3)
    $msg = GUIGetMsg()
    if ($msg == $test[2]) Then
        ToggleState($test[1])
    EndIf

    if (GUICtrlRead($test[1]) == $GUI_CHECKED) Then
        ShowOnce()
    Else
        $show = 1
    EndIf
    
WEnd

Func _GUICtrlCreateCheckbox($sText, $nLeft, $nTop, $nWidth, $nHeight, $nColor)
    Local $aCkBoxEx[3]
    $aCkBoxEx[1] = GUICtrlCreateCheckbox('', $nLeft, $nTop, 13, 13)
    $aCkBoxEx[2] = GUICtrlCreateLabel($sText, $nLeft + 20, $nTop, $nWidth, $nHeight)
    GUICtrlSetBkColor($aCkBoxEx[2], $nColor)
    Return $aCkBoxEx
EndFunc

Func ToggleState($control)
    if (GUICtrlRead($control) == $GUI_CHECKED) Then
        GUICtrlSetState($test[1], $GUI_UNCHECKED)
    Else
        GUICtrlSetState($test[1], $GUI_CHECKED)
    EndIf
EndFunc

Func ShowOnce()
    if ($show == 1) Then
        MsgBox(0, "", "YOu Clicked me!")
    EndIf
    $show = 0
EndFunc

Original Post: http://www.autoitscript.com/forum/index.ph...=Checkbox+Color

Edited by CHRIS95219
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...