Jump to content

labels


Recommended Posts

Hm, in the helpfile is written GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) will set the bk of a label transparent, but it doesn't works o.O?

;Name: Neu AutoIt v3 Script.au3
;Author: Lord_Doominik
;Status: In Progress (0%)
;Version: 0

#include <GUIConstants.au3>

$mainGUI = GUICreate("Sarah - HDL", 392, 183,(@DesktopWidth-392)/2, (@DesktopHeight-183)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)

$Weight_Input = GUICtrlCreateInput("", 50, 40, 60, 20)
$Add_Weight = GUICtrlCreateButton("Neues Gewicht eintragen", 20, 70, 130, 30)
$Show_Table = GUICtrlCreateButton("Tabelle anzeigen", 230, 40, 120, 100)
$KG_Label = GUICtrlCreateLabel("kg", 113, 42, 20, 20)

GUISetState()

While 1
    $msg = GUIGetMsg()
    Select
    Case $msg = $Add_Weight
        $i = IniRead("Blubb.ini", "Allgemein", "i", 0)
        $Weight = GUICtrlRead($Weight_Input)
        IniWrite("Blubb.ini", "Gewicht", "Woche "&$i, $Weight)
        $i += 1
        IniWrite("Blubb.ini", "Allgemein", "i", $i)
        MsgBox(0, "Erfolg", "Ihr Gewicht wurde erfolgreich eingetragen")
        GUICtrlSetData($Weight_Input, "")
    Case $msg = $Show_Table
        ShowTable()
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    EndSelect
WEnd
Exit

Func ShowTable()
GUICreate("Iss nich so viel;)", 392, 323,(@DesktopWidth-392)/2, (@DesktopHeight-323)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS, -1, $mainGUI)
GUISetBkColor(0xFFFFFF)

GUICtrlCreateLabel("", 30, 30, 1, 260)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("", 10, 270, 360, 1)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("", 50, 260, 1, 20)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("", 70, 260, 1, 20)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("", 90, 260, 1, 20)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("", 110, 260, 1, 20)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("", 130, 260, 1, 20)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("", 150, 260, 1, 20)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("", 170, 260, 1, 20)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("", 190, 260, 1, 20)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("", 210, 260, 1, 20)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("", 230, 260, 1, 20)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("", 250, 260, 1, 20)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("", 270, 260, 1, 20)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("", 290, 260, 1, 20)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("", 310, 260, 1, 20)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("", 330, 260, 1, 20)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("", 350, 260, 1, 20)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("", 370, 260, 1, 20)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("", 20, 30, 20, 1)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("", 20, 50, 20, 1)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("", 20, 70, 20, 1)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("", 20, 90, 20, 1)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("", 20, 110, 20, 1)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("", 20, 130, 20, 1)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("", 20, 150, 20, 1)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("", 20, 170, 20, 1)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("", 20, 190, 20, 1)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("", 20, 210, 20, 1)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("", 20, 230, 20, 1)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("", 20, 250, 20, 1)
GUICtrlSetBkColor(-1, 0x000000)

$i = IniRead("Blubb.ini", "Allgemein", "i", 0)
If $i >= 1 Then
    GUICtrlCreateLabel("X", 26, 264, 9, 13)
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
    GUICtrlSetColor(-1, 0xFF0000)
EndIf

GUISetState()

While 1
    $msg2 = GUIGetMsg()
    Select
    Case $msg2 = $GUI_EVENT_CLOSE
        ExitLoop
    EndSelect
WEnd
GUIDelete()
EndFunc
Link to comment
Share on other sites

ahm, lol? that's exactly not what i want... i want a red x with a transparent bk -.-* if i now remove the function for setting the bk transparent this is vry stupid i think... then i got a white background >.<

do you can read? i think no -.-

Edited by Lord_Doominik
Link to comment
Share on other sites

;Name: Neu AutoIt v3 Script.au3
;Author: Lord_Doominik
;Status: In Progress (0%)
;Version: 0

#include <GUIConstants.au3>

Dim $Label_[32]

$mainGUI = GUICreate("Sarah - HDL", 392, 183,(@DesktopWidth-392)/2, (@DesktopHeight-183)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)

$Weight_Input = GUICtrlCreateInput("", 50, 40, 60, 20)
$Add_Weight = GUICtrlCreateButton("Neues Gewicht eintragen", 20, 70, 130, 30)
$Show_Table = GUICtrlCreateButton("Tabelle anzeigen", 230, 40, 120, 100)
$KG_Label = GUICtrlCreateLabel("kg", 113, 42, 20, 20)

GUISetState()

While 1
    $msg = GUIGetMsg()
    Select
    Case $msg = $Add_Weight
        $i = IniRead("Blubb.ini", "Allgemein", "i", 0)
        $Weight = GUICtrlRead($Weight_Input)
        IniWrite("Blubb.ini", "Gewicht", "Woche "&$i, $Weight)
        $i += 1
        IniWrite("Blubb.ini", "Allgemein", "i", $i)
        MsgBox(0, "Erfolg", "Ihr Gewicht wurde erfolgreich eingetragen")
        GUICtrlSetData($Weight_Input, "")
    Case $msg = $Show_Table
        ShowTable()
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    EndSelect
WEnd
Exit

Func ShowTable()
GUICreate("Iss nich so viel;)", 392, 323,(@DesktopWidth-392)/2, (@DesktopHeight-323)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS, -1, $mainGUI)
GUISetBkColor(0xFFFFFF)

$i = 1;IniRead("Blubb.ini", "Allgemein", "i", 0)
If $i >= 1 Then
    GUICtrlCreateLabel("X", 26, 264, 9, 13)
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
;Set_Focus()
EndIf


$Label_[1] = GUICtrlCreateLabel("", 30, 30, 1, 260)
GUICtrlSetBkColor(-1, 0x000000)
$label_[2] = GUICtrlCreateLabel("", 10, 270, 360, 1)
GUICtrlSetBkColor(-1, 0x000000)
$left = 30
for $x = 3 to 19
$left = $left + 20  
$Label_[$x] = GUICtrlCreateLabel("", $left, 260, 1, 20)
GUICtrlSetBkColor(-1, 0x000000)
Next
$top = 10
for $x = 20 to 31
$top = $top + 20    
$Label_[$x] = GUICtrlCreateLabel("", 20, $top, 20, 1)
GUICtrlSetBkColor(-1, 0x000000)
Next


GUISetState()

While 1
    $msg2 = GUIGetMsg()
    Select
    Case $msg2 = $GUI_EVENT_CLOSE
        ExitLoop
    EndSelect
WEnd
GUIDelete()
EndFunc

Func Set_Focus(); you may need this later if you move the red X
    for $x = 1 to 31
        GUICtrlSetState( $label_[$x], $GUI_ONTOP ); or focus or???
    Next
EndFunc

8)

NEWHeader1.png

Link to comment
Share on other sites

@valuater whoa, nice it works! good job! ^^ but i just don't get, where my mistake is o.O... i'll have a look at it later, now i have to go, i'll write again if i have some more probs with it...

@analritter

but you can't write, too :mellow: look at your post :)... and the white bk isn't a solution, it's the problem... why don't you get it? :)

Edited by Lord_Doominik
Link to comment
Share on other sites

@valuater whoa, nice it works! good job! ^^ but i just don't get, where my mistake is o.O... i'll have a look at it later, now i have to go, i'll write again if i have some more probs with it...

@analritter

but you can't write, too :mellow: look at your post :)... and the white bk isn't a solution, it's the problem... why don't you get it? :)

i never said, that it should be an solution, i only sad, that it's not really bad^^

and you know, that my keyboard is broken

[font="Verdana"]In work:[list=1][*]InstallIt[*]New version of SpaceWar[/list] [/font]

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