Hallo,
ich krieg das einfach nicht hin.
1. Ich öffne meine Text-Gui (Text öffnen im Menü)
2. Dort trage ich den Text ein und übergebe ihn an die Form
3. Ich positioniere den Text nun mit den Pfeiltasten
Das Problem:
Es kommen weitere Texte hinzu.
Diese müsste ich aber nachträglich einzeln anwählen können und in der Farbe/Größe ändern.
Spoiler anzeigen
#include <Array.au3>
#include <GUIConstantsEx.au3>
#include <gdiplus.au3>
#include <misc.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
$x = 140
$y = 110
Global $afont, $mnText, $Label, $mnFarbe, $mnpFarbe
$Form1 = GUICreate("Form1", 800, 600)
_Menue()
[/autoit] [autoit][/autoit] [autoit]$Form2 = GUICreate("Texte", 625, 443, 192, 124)
$Edit1 = GUICtrlCreateEdit("", 32, 40, 545, 321, BitOR($ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_WANTRETURN, $WS_VSCROLL))
GUICtrlSetData(-1, "")
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$btnMnText = GUICtrlCreateButton("Text auf Form", 400, 376, 179, 41, $WS_GROUP)
GUISetState(@SW_SHOW, $Form1)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $mnFarbe
$afont = _ChooseFont()
Case $mnText
GUISetState(@SW_SHOW, $Form2)
Case $btnMnText
GUISetState(@SW_SHOW, $Form2)
$mnEintrag = GUICtrlRead($Edit1)
GUISetState(@SW_SHOW, $Form1)
$Label = GUICtrlCreateLabel($mnEintrag, $x, $y, 146, 89)
EndSwitch
[/autoit] [autoit][/autoit] [autoit]#Region Positionieren Text
If _IsPressed("25") Then
$x -= 1
Update()
ElseIf _IsPressed("27") Then
$x += 1
Update()
ElseIf _IsPressed("26") Then
$y -= 1
Update()
ElseIf _IsPressed("28") Then
$y += 1
Update()
EndIf
#EndRegion Positionieren Text
WEnd
Func Update()
[/autoit] [autoit][/autoit] [autoit]GUICtrlSetPos($Label, $x, $y)
EndFunc ;==>Update
Func _Menue()
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]$mnpText = GUICtrlCreateMenu("Text")
$mnText = GUICtrlCreateMenuItem("öffnen", $mnpText)
$mnpFarbe = GUICtrlCreateMenu("Farbe")
$mnFarbe = GUICtrlCreateMenuItem("öffnen", $mnpFarbe)
EndFunc ;==>_Menue
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit]Die Var $Label muß irgendwie bei jedem anlegen
erweitert werden und ich muß jede $Label editieren.... huh
Hoffe Ihr habt das ne Idee
Grüße
Ilse