Jetzt hat er die Qual der Wahl: Simple, Medium oder Professionell? Natürlich mit den entsprechenden Vorteilen.
Beiträge von stayawayknight
-
-
linke Maustaste hat übrigens "01".
[autoit]
Also, ich würde das so machen:
[/autoit][autoit][/autoit][autoit]
#include <Misc.au3>
While 1
If _ispressed(01) Then
DoUntil Not _ispressed(01)
[/autoit][autoit][/autoit][autoit]
funcx()
EndIf
WEndFunc funcx()
[/autoit]
MsgBox(0, "hi", "Func nach dem Mausklick!")
EndFunc -
Ja, danke, hab ich inzwischen bereits herausgefunden, siehe oben.
Trotzdem vielen Dank für die Mühe! -
Ah, der Benutzer ist ja neu

Warum hab ich deinen Beitrag dann zu Begin gar nicht bemerkt? -
Jop:
[autoit]
[/autoit]
MsgBox(0, "hi", "Lalalala" & @CRLF & @CRLF & "Nächste Zeile")Progandy war mal wieder schneller
-
Hallo Autoit.de Mitlgieder,
heute mal wieder ein Problem, dass nach Grübeln in der Shotbox, bisher noch nicht gelöst wurde.
Es geht um _GUICtrlListView_GetItemTextArray; das zurückgegebene Array lass ich mir in _ArrayDisplay anzeigen - das aber bis auf das Elemet [0] leer ist.Hier das Script, könnt's auch gerne testen un ausprobieren, es werden keine weiteren Daten benötigt:
Spoiler anzeigen
[autoit]
[/autoit] [autoit][/autoit] [autoit]
#include <ButtonConstants.au3>
#include <SliderConstants.au3>
#include <GuiSlider.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
#include <GDIPlus.au3>
#include <SliderConstants.au3>
#include <GuiListView.au3>
#include <Array.au3>;###User Options Start
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
$sGridColor = 0xFF800000 ;Gitterfarbe in ARGB
$sCoordfarbe = 0xFF99FFFF ;Koordinatensystemfarbe in ARGB
$sBackgroundcolor = 0x000000 ;Hintergrundfarbe in RGB
$sXColor = 0xFFFFFFFF ;Farbe der X, die beim Klicken erscheinen in ARGB
$iLineWidth = 6 ;Graphenlinienbreite
;###User Options Ende;###Options Start
[/autoit] [autoit][/autoit] [autoit]
Opt("GuiOnEventMode", 1)
HotKeySet("{ESC}", "ende")
OnAutoItExitRegister("ende")
Const $iNullx = Round(@DesktopWidth / 2)
Const $iNully = Round(@DesktopHeight / 2)
$sTitle = "Funktionsgraph"
$sTitle2 = "Einstellungsmenü"
;###Options Ende;###Gui Start
[/autoit] [autoit][/autoit] [autoit]
$hGui = GUICreate($sTitle, @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, $WS_EX_TOOLWINDOW)
GUISetBkColor($sBackgroundcolor, $hGui)
GUISetState(@SW_SHOW, $hGui)
;Neue Gui:
$hSettings = GUICreate($sTitle2, 350, 280, @DesktopWidth - 350, @DesktopHeight - 280, BitOR($WS_CAPTION, $WS_GROUP), $WS_EX_TOPMOST, $hGui)
GUISetBkColor(0xFFFFFF, $hSettings)
$cMousePos = GUICtrlCreateLabel("MousePos:", 0, 0, 300, 20)
GUICtrlSetFont(-1, 10, 800, 0, "Tahoma")
$cCGrid = GUICtrlCreateCheckbox("Grid", 0, 25, 50, 20)
GUICtrlSetFont(-1, 10, 800, 0, "Tahoma")
GUICtrlSetState(-1, $GUI_CHECKED)
$cCUnitCircle = GUICtrlCreateCheckbox("Unit Circle", 52, 25, 85, 20)
GUICtrlSetFont(-1, 10, 800, 0, "Tahoma")
$cCScale = GUICtrlCreateCheckbox("Scale", 140, 25, 60, 20)
GUICtrlSetFont(-1, 10, 800, 0, "Tahoma")
GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlCreateButton("Generate", 202, 25, 80, 20)
GUICtrlSetOnEvent(-1, "generate")
GUICtrlCreateButton("Add function", 0, 60, 90, 20)
GUICtrlSetOnEvent(-1, "addfunc")
GUICtrlCreateButton("Delete function", 95, 60, 100, 20)
GUICtrlCreateButton("Quit", 200, 60, 100, 20)
GUICtrlSetOnEvent(-1, "ende")
$cObjektlist = GUICtrlCreateListView("Objekttyp |Wert |Farbe ", 0, 82, 300, 140)
$cZoom = GUICtrlCreateSlider(310, 55, 25, 165, $TBS_VERT)
GUICtrlSetLimit(-1, 200, 1)
GUICtrlSetData($cZoom, 20)
$cZoomlabel = GUICtrlCreateLabel("Zoom:" & @CRLF & GUICtrlRead($cZoom), 296, 0, 40, 60)
GUICtrlSetFont(-1, 10, 800, 0, "Tahoma")
For $i = 10 To 200 Step 10
_GUICtrlSlider_SetTic($cZoom, $i)
Next
ControlFocus($sTitle2, "", $cObjektlist)
GUISetState(@SW_SHOW, $hSettings)
;###Gui Ende;###GDIPlus Start
[/autoit] [autoit][/autoit] [autoit]
_GDIPlus_Startup()
$hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGui)
$Pen1 = _GDIPlus_PenCreate($sGridColor, 1)
$Pen2 = _GDIPlus_PenCreate($sCoordfarbe, 1)
$Pen3 = _GDIPlus_PenCreate($sXColor, 1)
$Brush1 = _GDIPlus_BrushCreateSolid(0xFFFFFFFF)
;###GDIPlus Ende;generate()
[/autoit] [autoit][/autoit] [autoit]While 1
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
$aPos = MouseGetPos()
$iZoom = GUICtrlRead($cZoom) ;Zoom
$iAbstand = Round(@DesktopHeight / $iZoom)
GUICtrlSetData($cMousePos, "Mousepos: (" & Round(($aPos[0] - $iNullx) / $iAbstand, 2) & "|" & Round(calcytocoords($aPos[1]) / $iAbstand, 2) & ")")
If _IsPressed(01) Then
drawX()
Do
Until Not _IsPressed(01)
EndIf
GUICtrlSetData($cZoomlabel, "Zoom:" & @CRLF & GUICtrlRead($cZoom))
Sleep(100)
WEnd
ende()Func generate()
[/autoit] [autoit][/autoit] [autoit]
GUISetBkColor($sBackgroundcolor, $hGui)
$hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGui)
If GUICtrlRead($cCGrid) = $GUI_CHECKED Then
$bGrid = True
Else
$bGrid = False
EndIfIf GUICtrlRead($cCScale) = $GUI_CHECKED Then
[/autoit] [autoit][/autoit] [autoit]
$bScale = True
Else
$bScale = False
EndIfIf GUICtrlRead($cCUnitCircle) = $GUI_CHECKED Then
[/autoit] [autoit][/autoit] [autoit]
$bEinheitskreis = True
Else
$bEinheitskreis = False
EndIf
;###Netz erstellen Start
For $i = 1 To @DesktopWidth / $iAbstand ;Beschriftung
If $bGrid = True Then
_GDIPlus_GraphicsDrawLine($hGraphics, $iNullx + $iAbstand * $i, 0, $iNullx + $iAbstand * $i, @DesktopHeight, $Pen2) ;x rechts
_GDIPlus_GraphicsDrawLine($hGraphics, 0, $iNully - $iAbstand * $i, @DesktopWidth, $iNully - $iAbstand * $i, $Pen2);y oben
_GDIPlus_GraphicsDrawLine($hGraphics, 0, $iNully + $iAbstand * $i, @DesktopWidth, $iNully + $iAbstand * $i, $Pen2);y unten
_GDIPlus_GraphicsDrawLine($hGraphics, $iNullx - $iAbstand * $i, 0, $iNullx - $iAbstand * $i, @DesktopWidth, $Pen2);x links
EndIfIf $bScale = True Then
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
_GDIPlus_GraphicsDrawLine($hGraphics, $iNullx + $iAbstand * $i, $iNully - 10, $iNullx + $iAbstand * $i, $iNully + 10, $Pen1) ;x rechts
_GDIPlus_GraphicsDrawLine($hGraphics, $iNullx - 10, $iNully - $iAbstand * $i, $iNullx + 10, $iNully - $iAbstand * $i, $Pen1);y oben
_GDIPlus_GraphicsDrawLine($hGraphics, $iNullx - 10, $iNully + $iAbstand * $i, $iNullx + 10, $iNully + $iAbstand * $i, $Pen1);y unten
_GDIPlus_GraphicsDrawLine($hGraphics, $iNullx - $iAbstand * $i, $iNully - 10, $iNullx - $iAbstand * $i, $iNully + 10, $Pen1);x links
EndIf
Next
_GDIPlus_GraphicsDrawLine($hGraphics, 0, $iNully, @DesktopWidth, $iNully, $Pen1) ;x-Achse
_GDIPlus_GraphicsDrawLine($hGraphics, $iNullx, 0, $iNullx, @DesktopHeight, $Pen1);y-Achse
If $bEinheitskreis = True Then
_GDIPlus_GraphicsDrawEllipse($hGraphics, $iNullx - ($iAbstand * 1), $iNully - ($iAbstand * 1), $iAbstand * 2, $iAbstand * 2, $Pen1)
EndIfGUISetState(@SW_DISABLE, $hSettings)
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
Sleep(1000)
;###Netz erstellen Ende
$Y = _GUICtrlListView_GetItemTextArray($cObjektlist, 1)
;For $c = 0 To $Y[0]
; If $Y[$c][0] <> "" Then
; draw($Y[$c][0], $Y[$c][1])
; EndIf
;Next
_ArrayDisplay($Y)
GUISetState(@SW_ENABLE, $hSettings)
ToolTip("Done!")
Sleep(5000)
ToolTip("")
EndFunc ;==>generateFunc draw($sFunktion, $sColor)
[/autoit] [autoit][/autoit] [autoit]
Local $Brush1 = _GDIPlus_BrushCreateSolid($sColor)
$sFunktion = StringReplace($sFunktion, "x", "($i / $iAbstand)")
ToolTip(StringReplace(StringReplace($sFunktion, "$i", "x"), " / xAbstand", ""))
Sleep(2000)
For $i = -(@DesktopWidth / 2) To @DesktopWidth / 2
ToolTip("i = " & $i & "; X = " & Round(Calcxtocoords($i)) & "; Y = " & Round(calcytocoords(Execute($sFunktion))) & "; Funktionswert = " & Execute($sFunktion))
_GDIPlus_GraphicsFillEllipse($hGraphics, Round(Calcxtocoords($i) - ($iLineWidth / 2)), Round(calcytocoords(Execute($sFunktion) * ($iAbstand)) - ($iLineWidth / 2)), $iLineWidth, $iLineWidth, $Brush1)
Next
EndFunc ;==>drawFunc drawX()
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
$aPos = MouseGetPos()
_GDIPlus_GraphicsDrawLine($hGraphics, $aPos[0] - 7, $aPos[1] - 7, $aPos[0] + 7, $aPos[1] + 7, $Pen3)
_GDIPlus_GraphicsDrawLine($hGraphics, $aPos[0] + 7, $aPos[1] - 7, $aPos[0] - 7, $aPos[1] + 7, $Pen3)
EndFunc ;==>drawXFunc addfunc()
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
Do
Local $sInputFunktion = InputBox("Function", "Enter a function, please!" & @CRLF & "Use x for the variable!" & @CRLF & "Y=", Default, Default, Default, Default, Default, Default, $hGui)
Until $sInputFunktion <> "" Or @error
If @error Then Return
Do
Local $sColor = _ChooseColor(2, 0x990000, Default, $hGui)
Until $sColor <> -1 Or @error
If @error Then Return
$sColor = StringReplace($sColor, "0x", "0xFF")
GUICtrlCreateListViewItem("Function|" & $sInputFunktion & "|" & $sColor, $cObjektlist)
EndFunc ;==>addfuncFunc calcxtocoords($iX)
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
Return $iX + $iNullx
EndFunc ;==>calcxtocoordsFunc calcytocoords($iY)
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
Return (-$iY + $iNully)
EndFunc ;==>calcytocoordsFunc ende()
[/autoit]
_GDIPlus_PenDispose($Pen1)
_GDIPlus_PenDispose($Pen2)
_GDIPlus_PenDispose($Pen3)
_GDIPlus_BrushDispose($Brush1)
_GDIPlus_GraphicsDispose($hGraphics)
_GDIPlus_Shutdown()
Exit
EndFunc ;==>endeVielen Dank für eure Hilfe im Vorraus,
viele Grüße,
stayawayknightEdit: Hat sich dank nuts gelöst; Fehler lag beim Index.
Danke! -
Die Bass.dll interessiert mich auch besonders, da ich noch keine Ahnung von ihr habe.
-
Etwas genauere Infos wären nicht schlecht!
Was für Zugriffe? Dateien öffnen, kopieren, löschen, Ordner öffnen oder was? -
Klingt gut finde ich!
-
Wenn du Autoit wirklich kannst, dann sind die andern eigentlich im Nu gelernt.
Die Syntax ist zwar meist anders, und viele sind auch objektorientiert, aber du hast die Grundlagen über Variablen, Schleifen, Arrays etc. die sich dann um weites einfacher weiterbilden lassen als wenn man ohne voriges Lernen von einfachen Sprachen eine neue Programmiersprache beginnt. -
Alles Gute zum Geburtstag!
HAPPY Birthday!
Jetzt auch im 15er Kreis
-
Stichwort Arrays!
-
Überrascht mich bei Alizame auch, das es auftritt, ist bei GDI ja sonst eigentlich nie der Fall

-
Mhm, bei mir tritt dieses Problem nicht auf
Tritt es bei irgendwelchen anderen Personen hier auf? -
Alles Gute zum B-Day, Antispeed! Bist jetzt auch im Kreis der 15er!
Ein Musiktutorial kann man immer gut brauchen -
Danke für euer nettes Feedback!
Wollte nur wissen, ob ihr das gut findet, so bau ich jetzt etwas größeres draus!
Sind u. a. meine ersten Versuche mi GDI+, daher auch als Übung gedacht.Vollbildmodus werde ich aber erstmal lassen, ist am praktischsten
-
Habe von Musik keine Ahnung, hätte dein Tutorial aber früher brauchen können, hab heute ne Musikarbeit bezüglich der geschilderten Themen geschrieben

-
[autoit]
WinGetTitle
[/autoit] -
-
Zeig mal was du da geschrieben hast, an Errors kann man arbeiten;
Am besten gleich die Art des Errors dazu