1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. UEZ

Beiträge von UEZ

  • _ArraySort2D_MC 2D Array nach mehreren Spalten sortieren (Stand 08.08.2012)

    • UEZ
    • 27. Februar 2010 um 21:52

    Schön schnell :thumbup: und nette Idee! Kann mich nur Oscar anschließen!

    Nur, wenn ich _arraySort2D_MC($array, "3%D|2%N|0|1") benutze, wird das Array nicht richtig erstellt! Spalte 2 wird nicht erstellt! Scheint noch ein Bug zu sein!

    Gruß,
    UEZ

  • _ArraySort2D_MC 2D Array nach mehreren Spalten sortieren (Stand 08.08.2012)

    • UEZ
    • 27. Februar 2010 um 19:26

    Da stimmt immer noch was nicht!

    Der Dateianghang ist gleich dem Code im Spoiler, aber wo ist die #include <arraySort2D_MC.au3> Datei?

    UEZ

  • _ArraySort2D_MC 2D Array nach mehreren Spalten sortieren (Stand 08.08.2012)

    • UEZ
    • 27. Februar 2010 um 19:05

    Wo ist denn die arraySort2D_MC.au3 Datei? Oder bin ich blind? 8)

    Gruß,
    UEZ

  • GDIPlus Text spiegeln

    • UEZ
    • 27. Februar 2010 um 17:48
    Spoiler anzeigen
    [autoit]


    ;Example by UEZ
    ;#NoTrayIcon
    #include <GDIPlus.au3>
    #include <Misc.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Opt("GUIOnEventMode", 1)

    [/autoit] [autoit][/autoit] [autoit]

    Global $hWnd, $hGraphic, $hBitmap, $hBackbuffer, $hImage
    Global $ScreenDc, $dc, $tSize, $pSize, $tSource, $pSource, $tBlend, $pBlend, $tPoint, $pPoint, $gdibitmap
    Global $title = "GDI+ Beispiel: Text spiegeln", _
    $width = 500, _
    $height = 130

    [/autoit] [autoit][/autoit] [autoit]

    Global $reflect, $MousePos

    [/autoit] [autoit][/autoit] [autoit]

    $hWnd = GUICreate($title, $width, $height, -1, -1, 0x80000000, BitOR(0x00000080, 0x00080000, 0x00000008))

    [/autoit] [autoit][/autoit] [autoit]

    _Startup()
    _GDIPlus_GraphicsClear($hBackbuffer, 0x00000000)
    Draw_Text($hBackbuffer, "Spiegel Schrift", $width, $height)

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_GraphicsReflectImageRect($hBackbuffer, $hBitmap, 0, 60, -1, 40, 0)

    [/autoit] [autoit][/autoit] [autoit]

    $gdibitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
    _WinAPI_SelectObject($dc, $gdibitmap)
    _WinAPI_UpdateLayeredWindow($hWnd, $ScreenDc, 0, $pSize, $dc, $pSource, 0, $pBlend, 2)
    _WinAPI_DeleteObject($gdibitmap)
    _GDIClose()
    GUISetOnEvent(-3, "_Close")
    GUISetState()

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    While Sleep(100000)
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func Draw_Text($hGFX, $text, $w, $h, $fs = 40, $fn = "Comic Sans MS", $fc = 0xFF0000A0, $fa = 1)
    $hBrush = _GDIPlus_BrushCreateSolid($fc)
    $hFamily = _GDIPlus_FontFamilyCreate($fn)
    $hFont = _GDIPlus_FontCreate($hFamily, $fs)
    $hLayout = _GDIPlus_RectFCreate(0, 0, $w, $h)
    $hStringFormat = _GDIPlus_StringFormatCreate()
    _GDIPlus_StringFormatSetAlign($hStringFormat, $fa)
    _GDIPlus_GraphicsDrawStringEx($hGFX, $text, $hFont, $hLayout, $hStringFormat, $hBrush)
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_FontFamilyDispose($hFamily)
    _GDIPlus_FontDispose($hFont)
    _GDIPlus_StringFormatDispose($hStringFormat)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _Startup()
    _GDIPlus_Startup()
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd)
    $hBitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $hGraphic)
    $hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    _GDIPlus_GraphicsSetSmoothingMode($hBackbuffer, 2)

    [/autoit] [autoit][/autoit] [autoit]

    $ScreenDc = _WinAPI_GetDC($hWnd)
    $dc = _WinAPI_CreateCompatibleDC($ScreenDc)

    [/autoit] [autoit][/autoit] [autoit]

    $tSize = DllStructCreate($tagSIZE)
    $pSize = DllStructGetPtr($tSize)
    DllStructSetData($tSize, "X", $width)
    DllStructSetData($tSize, "Y", $height)
    $tSource = DllStructCreate($tagPOINT)
    $pSource = DllStructGetPtr($tSource)
    $tBlend = DllStructCreate($tagBLENDFUNCTION)
    $pBlend = DllStructGetPtr($tBlend)
    DllStructSetData($tBlend, "Alpha", 0xFF)
    DllStructSetData($tBlend, "Format", 1)
    $tPoint = DllStructCreate($tagPOINT)
    $pPoint = DllStructGetPtr($tPoint)
    DllStructSetData($tPoint, "X", 0)
    DllStructSetData($tPoint, "Y", 0)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _GDIClose()
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_GraphicsDispose($hBackbuffer)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_Shutdown()
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _Close()
    Exit
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ==========================================================================================================
    ; Name...........: _GDIPlus_GraphicsReflectImageRect
    ; Description ...: Spiegelt ein Bildobjekt mit abfallender Transparents und einstellbarer Schräge.
    ; Syntax.........: _GDIPlus_GraphicsReflectImageRect($hGraphic, $hImage, $xpos, $ypos, [$dwidth, [$dheight, [$divx]]])
    ; Parameters ....: $hGraphics - Handle zu einem Graphicobjekt
    ; $hImage - Handle zu einem Bildobjekt
    ; $xpos - Die X Koordinate des Startzeichenpunktes
    ; $ypos - Die Y Koordinate des Startzeichenpunktes
    ; $dwidth - Breite des zu zeichnenden Bildes
    ; $dheight - Höhe des zu zeichnenden Bildes (!FEHLERHAFT)
    ; $divx - Die Anzahl der Pixel, die pro Zeile nach links eingerückt werden
    ; Return values .: Success - True
    ; Failure - @error
    ; Author ........: h2112
    ; Remarks .......: Die Funktion _GDIPlus_GraphicsDrawImageRectRectTrans wird benötigt
    ;======================================================================================================================
    Func _GDIPlus_GraphicsReflectImageRect($hGraphic, $hImage, $xpos, $ypos, $dwidth = -1, $dheight = -1, $divx = 0.7)
    Local $height, $width, $clone, $stat, $check
    Local $divy, $divtrans, $trans, $x, $y, $olddivy

    [/autoit] [autoit][/autoit] [autoit]

    $height = _GDIPlus_ImageGetHeight($hImage)
    $width = _GDIPlus_ImageGetWidth($hImage)

    [/autoit] [autoit][/autoit] [autoit]

    If $dheight = -1 Then $dheight = $height
    If $dwidth = -1 Then $dwidth = $width

    [/autoit] [autoit][/autoit] [autoit]

    $divtrans = 255 / $height
    $divy = $dheight / $height

    [/autoit] [autoit][/autoit] [autoit]

    For $i = $height To 0 Step -1
    $trans = 1 / 255 * $divtrans * $i
    $x = $divx * ($height - $i)
    $y = $divy * ($height - $i)
    If Int($y) <> Int($divy) * ($height - $i) + $stat Then
    $stat += 1
    $check = 1
    $olddivy = $divy
    $divy += Int($y) - Int($divy) * ($height - $i) + $stat
    EndIf
    $clone = _GDIPlus_BitmapCloneArea($hImage, 0, $i, $width, 1, $GDIP_PXF64PARGB)
    _GDIPlus_GraphicsDrawImageRectRectTrans($hGraphic, $clone, 0, 0, $width, $height, $xpos - $x, $y + $ypos, $dwidth, $divy, "", $trans)
    If $check = 1 Then
    $divy = $olddivy
    $check = 0
    EndIf
    Next
    If Not @error Then
    Return True
    Else
    Return @error
    EndIf
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ===================================================================================================
    ; Name...........: _GDIPlus_GraphicsDrawImageRectRectTrans
    ; Description ...: Draw an Image object with transparency
    ; Syntax.........: _GDIPlus_GraphicsDrawImageRectRect($hGraphics, $hImage, $iSrcX, $iSrcY, [$iSrcWidth, _
    ; [$iSrcHeight, [$iDstX, [$iDstY, [$iDstWidth, [$iDstHeight[, [$iUnit = 2]]]]]]])
    ; Parameters ....: $hGraphics - Handle to a Graphics object
    ; $hImage - Handle to an Image object
    ; $iSrcX - The X coordinate of the upper left corner of the source image
    ; $iSrcY - The Y coordinate of the upper left corner of the source image
    ; $iSrcWidth - Width of the source image
    ; $iSrcHeight - Height of the source image
    ; $iDstX - The X coordinate of the upper left corner of the destination image
    ; $iDstY - The Y coordinate of the upper left corner of the destination image
    ; $iDstWidth - Width of the destination image
    ; $iDstHeight - Height of the destination image
    ; $iUnit - Specifies the unit of measure for the image
    ; $nTrans - Value range from 0 (Zero for invisible) to 1.0 (fully opaque)
    ; Return values .: Success - True
    ; Failure - False
    ; Author ........: Siao
    ; Modified.......: Malkey
    ; Remarks .......:
    ; Related .......:
    ; Link ..........; http://www.autoitscript.com/forum/index.ph…ndpost&p=517195
    ; Example .......; Yes
    Func _GDIPlus_GraphicsDrawImageRectRectTrans($hGraphics, $hImage, $iSrcX, $iSrcY, $iSrcWidth = "", $iSrcHeight = "", _
    $iDstX = "", $iDstY = "", $iDstWidth = "" , $iDstHeight = "", $iUnit = 2, $nTrans = 1)
    Local $tColorMatrix, $x, $hImgAttrib, $iW = _GDIPlus_ImageGetWidth($hImage), $iH = _GDIPlus_ImageGetHeight($hImage)
    If $iSrcWidth = 0 or $iSrcWidth = "" Then $iSrcWidth = $iW
    If $iSrcHeight = 0 or $iSrcHeight = "" Then $iSrcHeight = $iH
    If $iDstX = "" Then $iDstX = $iSrcX
    If $iDstY = "" Then $iDstY = $iSrcY
    If $iDstWidth = "" Then $iDstWidth = $iSrcWidth
    If $iDstHeight = "" Then $iDstHeight = $iSrcHeight
    If $iUnit = "" Then $iUnit = 2
    ;;create color matrix data
    $tColorMatrix = DllStructCreate("float[5];float[5];float[5];float[5];float[5]")
    ;blending values:
    $x = DllStructSetData($tColorMatrix, 1, 1, 1) * DllStructSetData($tColorMatrix, 2, 1, 2) * DllStructSetData($tColorMatrix, 3, 1, 3) * _
    DllStructSetData($tColorMatrix, 4, $nTrans, 4) * DllStructSetData($tColorMatrix, 5, 1, 5)
    ;;create an image attributes object and update its color matrix
    $hImgAttrib = DllCall($ghGDIPDll, "int", "GdipCreateImageAttributes", "ptr*", 0)
    $hImgAttrib = $hImgAttrib[1]
    DllCall($ghGDIPDll, "int", "GdipSetImageAttributesColorMatrix", "ptr", $hImgAttrib, "int", 1, _
    "int", 1, "ptr", DllStructGetPtr($tColorMatrix), "ptr", 0, "int", 0)
    ;;draw image into graphic object with alpha blend
    DllCall($ghGDIPDll, "int", "GdipDrawImageRectRectI", "hwnd", $hGraphics, "hwnd", $hImage, "int", $iDstX, "int", _
    $iDstY, "int", $iDstWidth, "int", $iDstHeight, "int", $iSrcX, "int", $iSrcY, "int", $iSrcWidth, "int", _
    $iSrcHeight, "int", $iUnit, "ptr", $hImgAttrib, "int", 0, "int", 0)
    ;;clean up
    DllCall($ghGDIPDll, "int", "GdipDisposeImageAttributes", "ptr", $hImgAttrib)
    Return
    EndFunc ;==>_GDIPlus_GraphicsDrawImageRectRectTrans

    [/autoit]

    Ist eine Modifikation des Beispiels von H2112: _GDIPlus_GraphicsReflectImageRect


    Gruß,
    UEZ ;)

  • _ArraySort sortiert "komisch"

    • UEZ
    • 26. Februar 2010 um 22:01

    Freut mich, dass ich dir helfen konnte! 8o

    Gruß,
    UEZ :rolleyes:

  • [Beispiel] Slide GUI

    • UEZ
    • 26. Februar 2010 um 09:20
    Zitat von SEuBo

    Hallo UEZ,
    Funktioniert das jetzt besser auf deinem Dual-Monitor?

    Spoiler anzeigen
    [autoit]

    #include <Array.au3>
    #include <WindowsConstants.au3>
    HotKeySet("{ESC}", "_Exit") ; Set the Hotkey to exit.
    $hDLL = DllOpen("user32.dll") ; Open the DLL for _WinIsHovered() (faster with DLL-handle)

    [/autoit] [autoit][/autoit] [autoit]

    $h_Left = GUICreate("SlideGUI left", 155, 350, -1, -1, -1, $WS_EX_TOPMOST)
    $_Button1 = GUICtrlCreateButton("Example Button", 40, 40, 100, 30)
    GUICtrlCreateEdit("Sample Edit...", 20, 90, 120, 200)
    $h_Right = GUICreate("SlideGUI Right", 155, 350, -1, -1, -1, $WS_EX_TOPMOST)
    GUICtrlCreateEdit("Sample Edit...", 20, 20, 150, 300)
    $h_Bottom = GUICreate("SlideGUI Bottom", 350, 155, -1, -1, -1, $WS_EX_TOPMOST)
    GUICtrlCreateCheckbox("Sample Checkbox", 40, 30)
    GUICtrlCreateCombo("Combo", 140, 50)
    $h_Top = GUICreate("SlideGUI Top", 350, 155, -1, -1, -1, $WS_EX_TOPMOST)
    $_ListView = GUICtrlCreateListView("Columnd 1|Column 2", 5, 5, 340, 145)
    GUICtrlCreateListViewItem("Item 1_1|Item 1_2",$_ListView)
    GUICtrlCreateListViewItem("Item 2_1|Item 2_2",$_ListView)
    GUICtrlCreateListViewItem("Item 3_1|Item 3_2",$_ListView)

    [/autoit] [autoit][/autoit] [autoit]

    ; Move GUI's to the right place and set the Variables State to False
    Global $LEFT_IN = False, $RIGHT_IN = False, $BOTTOM_IN = False, $TOP_IN = False
    _SlideWin($h_Left, "out", "left")
    _SlideWin($h_Right, "out", "right")
    _SlideWin($h_Bottom, "out", "bottom")
    _SlideWin($h_Top, "out", "top")

    [/autoit] [autoit][/autoit] [autoit]

    ; Show GUI's
    GUISetState(@SW_SHOWNOACTIVATE, $h_Left)
    GUISetState(@SW_SHOWNOACTIVATE, $h_Right)
    GUISetState(@SW_SHOWNOACTIVATE, $h_Bottom)
    GUISetState(@SW_SHOWNOACTIVATE, $h_Top)

    [/autoit] [autoit][/autoit] [autoit]

    While 1 * Sleep(10)
    $nMsg = GUIGetMsg(1)
    Select
    Case $nMsg[0] = -3
    Exit
    Case $nMsg[0] = $_Button1
    MsgBox(0, "", "Example Button clicked.")
    Case _WinIsHovered($h_Left, $hDLL) ; Check if we need to Slide in a GUI.
    If Not $LEFT_IN Then ; If not already slide-in,
    _SlideWin($h_Left, "in", "left") ; Slide in GUI
    $LEFT_IN = True ; Set var to True.
    EndIf
    Case _WinIsHovered($h_Right, $hDLL)
    If Not $RIGHT_IN Then
    _SlideWin($h_Right, "in", "right")
    $RIGHT_IN = True
    EndIf
    Case _WinIsHovered($h_Bottom, $hDLL)
    If Not $BOTTOM_IN Then
    _SlideWin($h_Bottom, "in", "bottom")
    $BOTTOM_IN = True
    EndIf
    Case _WinIsHovered($h_Top, $hDLL)
    If Not $TOP_IN Then
    _SlideWin($h_Top, "in", "top")
    $TOP_IN = True
    EndIf
    Case Else ; No window is hovered. Check if we need to Slide out a GUI.
    Select
    Case $LEFT_IN
    _SlideWin($h_Left, "out", "left")
    $LEFT_IN = False
    Case $RIGHT_IN
    _SlideWin($h_Right, "out", "right")
    $RIGHT_IN = False
    Case $TOP_IN
    _SlideWin($h_Top, "out", "top")
    $TOP_IN = False
    Case $BOTTOM_IN
    _SlideWin($h_Bottom, "out", "bottom")
    $BOTTOM_IN = False
    EndSelect
    EndSelect
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _SlideWin($hWnd, $sMode, $sSide)
    ;$hWnd = Window to slide.
    ;$sMode = Slide-In or -out (in|out)
    ;$sSide = Side where you want the GUI to slide. (left|right|top|bottom)
    Local $aScreen_Res = WinGetPos(WinGetHandle("Program Manager"))
    Local $aWPos = WinGetPos($hWnd), $m = 0 - ($sMode = "in") + ($sMode = "out")
    Local $h = 0 - ($sSide = "left") + ($sSide = "right"), $v = 0 - ($sSide = "top") + ($sSide = "bottom")

    [/autoit] [autoit][/autoit] [autoit]

    WinMove($hWnd, "", _ ; Move GUI according to $sMode and $sSide.
    0 - (($h = -1) * ($m = -1) * ($aWPos[2] - 10)) _
    + (($h = 1) * (($h = 1) * $aScreen_Res[2] - (10 * ($m = -1)) - ($m <> -1) * $aWPos[2])) _
    + (($h = 0) * (($h = 0) * ($aScreen_Res[2] / 2) - ($aWPos[2] / 2))) _
    , _
    0 - (($v = -1) * ($m = -1) * ($aWPos[3] - 10)) _
    + (($v = 1) * (($v = 1) * $aScreen_Res[3] - (10 * ($m = -1)) - ($m <> -1) * $aWPos[3])) _
    + (($v = 0) * (($v = 0) * ($aScreen_Res[3] / 2) - ($aWPos[3] / 2))) _
    )

    [/autoit] [autoit][/autoit] [autoit]

    $aWPos = WinGetPos($hWnd)
    ; Slide GUI.
    Switch $sSide
    Case "left", "right"
    Local $STEP = (((($h = 1) And ($m = 1)) Or (($h = -1) And ($m = -1))) - ((($h = -1) And ($m = 1)) Or (($h = 1) And ($m = -1)))) * 10
    Local $FROM = $aWPos[0], $TO = $aWPos[0] _
    + (((($h = 1) And ($m = 1)) Or (($h = -1) And ($m = -1))) * ($aWPos[2])) _
    - (((($h = 1) And ($m = -1)) Or (($h = -1) And ($m = 1))) * ($aWPos[2])) - $STEP
    For $i = $aWPos[0] To $TO Step $STEP
    WinMove($hWnd, "", $i, $aWPos[1])
    Sleep(10)
    Next
    Case "top", "bottom"
    Local $STEP = (((($v = 1) And ($m = 1)) Or (($v = -1) And ($m = -1))) - ((($v = -1) And ($m = 1)) Or (($v = 1) And ($m = -1)))) * 10
    Local $FROM = $aWPos[1], $TO = $aWPos[1] _
    + (((($v = 1) And ($m = 1)) Or (($v = -1) And ($m = -1))) * ($aWPos[3])) _
    - (((($v = 1) And ($m = -1)) Or (($v = -1) And ($m = 1))) * ($aWPos[3])) - $STEP
    For $i = $aWPos[1] To $TO Step $STEP
    WinMove($hWnd, "", $aWPos[0], $i)
    Sleep(10)
    Next
    EndSwitch
    EndFunc ;==>_SlideWin

    [/autoit] [autoit][/autoit] [autoit]

    Func _WinIsHovered($hWnd, $vDLL = "User32.dll")
    Local $aResult, $aWPos = WinGetPos($hWnd), $aMPos = MouseGetPos()
    Local $tRect = DllStructCreate("int Left;int Top;int Right;int Bottom")
    Local $iLeft = $aWPos[0], $iTop = $aWPos[1], $iWidth = $aWPos[2], $iHeight = $aWPos[3]
    Local $iX = $aMPos[0], $iY = $aMPos[1]
    DllStructSetData($tRect, "Left", $iLeft)
    DllStructSetData($tRect, "Top", $iTop)
    DllStructSetData($tRect, "Right", $iLeft + $iWidth)
    DllStructSetData($tRect, "Bottom", $iTop + $iHeight)

    [/autoit] [autoit][/autoit] [autoit]

    $aResult = DllCall($vDLL, "int", "PtInRect", "ptr", DllStructGetPtr($tRect), "int", $iX, "int", $iY)
    If @error Then Return SetError(@error, 0, False)

    [/autoit] [autoit][/autoit] [autoit]

    Return $aResult[0] <> 0
    EndFunc ;==>_WinIsHovered

    [/autoit] [autoit][/autoit] [autoit]

    Func _Exit()
    DllClose($hDLL) ; Dont forget to close your DLL-Handle
    Exit
    EndFunc ;==>_Exit

    [/autoit]
    Alles anzeigen

    Ist die selbe falsche Darstellung. Meine Laptop hat die Auflösung 1920x1200 und mein 2.ter Monitor 1280x1024 => 1920x2224! Laptop unten, Monitor oben!

    Display Array:
    [0]: 0
    [1]: -1024
    [2]: 1920
    [3]: 2224

    Gruß,
    UEZ

    Dateien

    Zwischenablage01.jpg 129,09 kB – 0 Downloads
  • _ArraySort sortiert "komisch"

    • UEZ
    • 25. Februar 2010 um 17:28

    Nun ja für eine handvoll ist die Laufzeit -> O(n^2) ja noch akzeptable! Aber versuche es doch mal mit den 9999 Daten :D

    Intern wird ja Quicksort benutzt, das im schlechtesten Fall auch quadratische Laufzeit hat, wenn man nicht irgendwelche Tricks benutzt!

    Gruß,
    UEZ

  • CSV-Editor V0.8 (Stand 23.04.2010)

    • UEZ
    • 25. Februar 2010 um 13:03
    Zitat von funkey


    Wollte ich eigentlich auch, habe ich aber auf die schnelle nicht hinbekommen. Werde ich bei nächster Gelegenheit umsetzen.


    Jetzt muss ich mir nur noch überlegen, wie ich das umsetzen kann / soll!?


    Natürlich. Nimm dir was du brauchen kannst. :)

    Hier mit dem Index:

    [autoit]


    Func _Array1DTo2D($a1D, $sDelim = ";", $iSeveral = 0)
    ;funkey 17.02.2010
    Local $iUbound = UBound($a1D) - 1
    Local $iTemp = 0, $iColumn = 0
    For $i = 0 To $iUbound
    If $iSeveral Then
    $iTemp = UBound(StringRegExp($a1D[$i], $sDelim & "+", 3))
    Else
    $iTemp = UBound(StringSplit($a1D[$i], $sDelim, 3))
    EndIf
    If $iTemp > $iColumn Then $iColumn = $iTemp
    Next
    Local $a2D[UBound($a1D)][$iColumn + 2]
    Local $aTemp
    For $i = 0 To $iUbound
    If $iSeveral Then
    $aTemp = StringSplit(StringRegExpReplace($a1D[$i], $sDelim & "+", $sDelim), $sDelim, 3)
    Else
    $aTemp = StringSplit($a1D[$i], $sDelim, 3)
    EndIf
    For $j = 0 To UBound($aTemp) - 1
    $a2D[$i][0] = $i
    $a2D[$i][$j + 1] = $aTemp[$j]
    Next
    $a2D[0][0] = "Index"
    Next
    Return SetExtended($iColumn, $a2D)
    EndFunc ;==>_Array1DTo2D

    [/autoit]

    Für SIC2 wollte ich dein Tools komplett dazu tun (nicht in SIC2 integrieren), damit man die CSV's sich anschauen kann!

    Mache mich gleich an die Farben...

    Gruß,
    UEZ

  • [Beispiel] Slide GUI

    • UEZ
    • 25. Februar 2010 um 10:49
    [autoit]


    #include <Array.au3>
    Global $hScreen = WinGetHandle("Program Manager")
    Global $aScreen_Res = WinGetPos($hScreen)
    #cs
    $array[0] = X position
    $array[1] = Y position
    $array[2] = Width
    $array[3] = Height
    #ce
    _ArrayDisplay($aScreen_Res)
    Exit

    [/autoit]

    Gruß,
    UEZ

  • CSV-Editor V0.8 (Stand 23.04.2010)

    • UEZ
    • 25. Februar 2010 um 09:32
    Zitat von funkey

    Vielen Dank für die Vorschläge. Habe weitere Verbesserungen eingebaut! Siehe Post#1

    Update auf Version 0.4
    --> Farbe für das Listview (zum selber auswählen)
    --> Optionales OnTop-Fenster
    --> Drag and drop von Dateien in das Listview
    --> Resizing des Fensters
    --> HTML-Export 8)

    Bei den Farben dachte ich eher daran, das z.B. ungerade Zeilen eine andere farben haben als gerade Zeilen (zur besseren Übersicht) wie in dem HTML Export!

    Nette Idee mit dem HTML Export!

    Ein fortlaufender Index ganz links wäre auch nicht schlecht!

    Darf ich dein Tool mit in SIC2 packen? Passt nämlich wunderbar!

    Gruß,
    UEZ

  • [Beispiel] Slide GUI

    • UEZ
    • 25. Februar 2010 um 09:25

    Nette Idee, aber bei Multimonitoren funzt es nicht richtig!

    Gruß,
    UEZ

  • _ArraySort sortiert "komisch"

    • UEZ
    • 25. Februar 2010 um 09:20
    Zitat von AutoBert

    Hallo UEZ,

    ich habe einmal deine und meine Lösung gegenübergestellt: deine Laufzeit 7384 ms, meine 5741 ms. Eine anschliessende Überprüfung auf Übereinstimmung erbrachte nur Unterschiede in Spalte 1 von 3, was ja laut Vorgabe von Oscar zulässig ist.
    Hier das Skript dazu:

    Spoiler anzeigen
    [autoit]

    #include <array.au3>
    Dim $array[9999][3] ; = [['abc', 'a11', '555'],['bcd', 'a11', '444'],['cde', 'a11', '666']]
    Dim $aNew[9999][3]
    For $i = 0 To 9998
    $array[$i][0] = Chr(Random(65, 90, 1)) & Chr(Random(65, 90, 1)) & Chr(Random(65, 90, 1))
    $array[$i][1] = Chr(Random(65, 90, 1)) & Random(0, 99, 1)
    $array[$i][2] = Random(100, 999, 1)
    Next
    $bench_start = TimerInit()
    For $i = 0 To UBound($array, 1) - 1
    $aNew[$i][0] = $array[$i][1] & "|" & $array[$i][2] & "|" & $array[$i][0]
    ;ConsoleWrite($array[$i][1] & "|" & $array[$i][2] & "|" & $array[$i][0] & @CRLF)
    Next
    _ArraySort($aNew, 0, 0, 0, 0)
    For $i = 0 To UBound($array, 1) - 1
    $aSplit = StringSplit($aNew[$i][0], "|")
    $aNew[$i][0] = $aSplit[3]
    $aNew[$i][1] = $aSplit[1]
    $aNew[$i][2] = $aSplit[2]
    Next
    $bench_end = Round(TimerDiff($bench_start), 2)
    ConsoleWrite("Laufzeit: " & $bench_end & " ms!" & @CRLF)
    ;_ArrayDisplay($aNew)

    [/autoit] [autoit][/autoit] [autoit]

    $1ste_spalte = 1
    $2te_spalte = 2
    $j = 0
    $k = 1

    [/autoit] [autoit][/autoit] [autoit]

    $bench_start = TimerInit()
    _ArraySort($array, 0, 0, 0, $1ste_spalte)

    [/autoit] [autoit][/autoit] [autoit]

    While $k < UBound($array)
    If $array[$j][$1ste_spalte] <> $array[$k][$1ste_spalte] Then
    If $k - $j > 1 Then
    _ArraySort($array, 0, $j, $k - 1, $2te_spalte)
    $j = $k
    Else
    $j = $k
    EndIf
    EndIf
    $k += 1
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    If $k - $j > 1 Then _ArraySort($array, 0, $j, $k, $2te_spalte)

    [/autoit] [autoit][/autoit] [autoit]

    $bench_end = Round(TimerDiff($bench_start), 2)
    ConsoleWrite("Laufzeit: " & $bench_end & " ms!" & @CRLF & @crlf)
    ;_ArrayDisplay($array)

    [/autoit] [autoit][/autoit] [autoit]

    ConsoleWrite("Jetzt wird noch auf Übereinstimmung geprüft!" & @CRLF)

    [/autoit] [autoit][/autoit] [autoit]

    For $i = 0 To UBound($array, 1) - 1
    For $j = 0 To 2 ;alle 3 Spalten vergleichen
    If $aNew[$i][$j] <> $array[$i][$j] Then
    ConsoleWrite("Unterschied in ARRAYS Zeile: " & $i & " Spalte: " & $j & @CRLF)
    if $j <> 0 then ;Spalte 0 darf sich unterscheiden
    ConsoleWrite("Eine der beiden Sortiermethoden ist fehlerhaft" & @CRLF)
    Exit
    EndIf
    EndIf
    Next
    Next

    [/autoit]


    @kleiner27, deine Routine ist fehlerhaft (Unterschied in Spalte 2, schon in der 1. Zeile)

    mfg (Auto)Bert

    Alles anzeigen

    Ich hatte eine Idee und die habe ich versucht zu implementieren 8)

    Nur was mir bei dir aufgefallen ist, dass deine Sortierung nicht ganz stimmt:

    Der Inhalt kann nicht angezeigt werden, da er nicht mehr verfügbar ist.

    In Zeile 2 ist die 85 nach 590 und 710! Anscheinend wird "nur" nach der ersten Ziffer links sortiert ;)

    Gruß,
    UEZ

    Bilder

    • Array.png
      • 8,77 kB
      • 241 × 722
  • _ArraySort sortiert "komisch"

    • UEZ
    • 25. Februar 2010 um 00:13

    Hier mein zweiter Versuch:

    [autoit]


    #include <array.au3>
    $max = 9999
    Dim $array[$max][3]
    for $i = 0 to $max - 1
    $array[$i][0]= Chr(Random(65,90,1)) & Chr(Random(65,90,1)) & Chr(Random(65,90,1))
    $array[$i][1]= Chr(Random(65,90,1)) & Random(0,99,1)
    $array[$i][2]= Random(0,999,1)
    Next

    [/autoit][autoit][/autoit][autoit]

    ;~ Dim $array[4][3] = [['AAB', 'S60', '127'], _
    ;~ ['AAA', 'Z27', '256'], _
    ;~ ['AAC', 'A11', '550'], _
    ;~ ['AAG', 'Z47', '406']]

    [/autoit][autoit][/autoit][autoit]

    $1ste_spalte = 1
    $2te_spalte = 2
    $j = 0
    $k = 1

    [/autoit][autoit][/autoit][autoit]

    $bench_start = TimerInit()

    [/autoit][autoit][/autoit][autoit]

    _ArraySort($array, 0, 0, 0, $1ste_spalte)

    [/autoit][autoit][/autoit][autoit]

    While $k < UBound($array)
    If $array[$j][$1ste_spalte] <> $array[$k][$1ste_spalte] Then
    If $k - $j > 1 Then
    _ArraySort($array, 0, $j, $k - 1, $2te_spalte)
    $j = $k
    Else
    $j = $k
    EndIf
    EndIf
    $k += 1
    WEnd

    [/autoit][autoit][/autoit][autoit]

    If $k - $j > 1 Then _ArraySort($array, 0, $j, $k, $2te_spalte)

    [/autoit][autoit][/autoit][autoit]

    $bench_end = Round(TimerDiff($bench_start), 2)
    ConsoleWrite("Laufzeit: " & $bench_end & " ms!" & @CRLF)

    [/autoit][autoit][/autoit][autoit]

    _ArrayDisplay($array)

    [/autoit]

    Meine Laufzeit: 2596.75 ms!

    Ich hoffe, dass der Code fehlerfrei ist :S
    Gruß,
    UEZ

  • GDI+ Notitzzettel

    • UEZ
    • 24. Februar 2010 um 21:49

    Cool wäre es, wenn ich in den Notizzettel klicken könnte, so dass die Eingabe direkt auf den Zettel geschrieben werden könnte oder mit der Maus (vielleicht zu schwierig)!

    Fontauswahl wäre auch von Vorteil :D

    Gruß,
    UEZ

  • _ArraySort sortiert "komisch"

    • UEZ
    • 24. Februar 2010 um 21:43

    Und so?

    [autoit]


    #include <Array.au3>
    Dim $array[3][3] = [['abc', 'a11', '555'],['bcd', 'a11', '444'],['cde', 'a11', '666']]
    _ArrayDisplay($array)
    _ArraySort($array,1,0,0,2)
    _ArraySort($array,0,0,0,1)
    _ArrayDisplay($array)

    [/autoit]

    Gruß,
    UEZ

    Edit: Führt auch nicht zum Ziel :thumbdown:

  • Wieviel Arbeitsspeicher belegt ein Programm?

    • UEZ
    • 24. Februar 2010 um 11:56
    Zitat von chip

    Compile Script (x86) geht aber wie bei ProcessGetStats mit großen Abweichungen.

    Im calc.exe Beispiel wird 11540 KB angezeigt laut Taskmanager sind es aber nur 5004

    Komisch! Und die Datei im Anhang?

    Richtig: unter x64 wird der Mem doppelt so viel angezeigt. Muss mal nachforschen!

    UEZ

    Dateien

    Process_Info.exe 305,7 kB – 320 Downloads
  • Wieviel Arbeitsspeicher belegt ein Programm?

    • UEZ
    • 24. Februar 2010 um 11:50
    Zitat von chip

    Win 7 x64.

    Hast recht! Auf Win7 x64 im native 64-bit mode geht's nicht! Kompiliere es doch mal vorher mit der Option: #AutoIt3Wrapper_UseX64=n oder RMT -> Compile Script (x86)!

    Ich muss mal sehen, wie der Code unter x64 im native mode umgestrickt werden muss...

    UEZ

  • Wieviel Arbeitsspeicher belegt ein Programm?

    • UEZ
    • 24. Februar 2010 um 11:43

    Was für ein OS benutzt du?

    Bei mir ist es Vista x32!

    Gruß,
    UEZ

  • Wieviel Arbeitsspeicher belegt ein Programm?

    • UEZ
    • 24. Februar 2010 um 11:38
    Zitat von chip

    Da kommt bei mir leider nur CPU: 0 und Ram:0

    CPU 0% ist ja klar, da Calc.exe ja nichts macht! Kannst ja mal 999999! berechnen!

    Bei mir sieht es so aus: calc.exe | PID: 7712 | CPU time: 0:00:00.046 (h:m:s.ms) | Mem usage: 5264 KB | CPU usage: 0 %

    Gruß,
    UEZ

  • Wieviel Arbeitsspeicher belegt ein Programm?

    • UEZ
    • 24. Februar 2010 um 11:32

    Schaue mal hier rein: [ offen ] CPU Auslastung

    Vielleicht hilft es ja das, was du suchst!


    Gruß,
    UEZ

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™