add

  • Ho do make double click > Program Start and End and opeb box.
    And last. Here come result :
    1000
    TEST
    2500

    But need:
    01000;
    (-- TEST --)
    G97M3S2500;

    [autoit]

    #include <GUIConstantsEx.au3>

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

    #region GUI1
    $GUI1 = GUICreate("CNC list", 614, 390)
    $btnGO = GUICtrlCreateButton("&GO", 10, 330, 75, 25)

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

    GUICtrlCreateButton("M list", 85, 330, 75, 25)
    GUICtrlSetFont(-1, 10, 700, -1, "MS Sans Serif")

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

    $List_1 = GUICtrlCreateList("", 10, 10, 150, 330)
    GUICtrlSetData($List_1, "Program Start and End|G1")

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

    $tbChosen = GUICtrlCreateEdit("", 175, 10, 420, 315)

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

    GUISetState(@SW_SHOW, $GUI1)
    #endregion GUI1

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

    #region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("", 428, 205, 339, 527)
    $Group1 = GUICtrlCreateGroup("", 0, 16, 417, 145)
    $Label1 = GUICtrlCreateLabel("Program number [1000-6000 ]", 144, 40, 144, 17)
    $Input1 = GUICtrlCreateInput("", 16, 40, 121, 21)
    $Input2 = GUICtrlCreateInput("", 16, 72, 121, 21)
    $Input3 = GUICtrlCreateInput("", 16, 104, 121, 21)
    $Label2 = GUICtrlCreateLabel("Program description", 144, 80, 97, 17)
    $Label3 = GUICtrlCreateLabel("Max spindle speed", 144, 112, 92, 17)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Button1 = GUICtrlCreateButton("OK", 336, 176, 75, 25)
    #endregion ### END Koda GUI section ###

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

    While 1
    $aMsg = GUIGetMsg(1)

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

    Switch $aMsg[1]
    Case $GUI1
    Switch $aMsg[0]
    Case $GUI_EVENT_CLOSE
    Exit
    Case $btnGO
    $sListRead = GUICtrlRead($List_1)

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

    WinSetTitle($Form1, "", "Insert: " & $sListRead)
    GUICtrlSetData($Group1, "Parameters for '" & $sListRead & "'")
    GUISetState(@SW_SHOW, $Form1)
    EndSwitch
    Case $Form1
    Switch $aMsg[0]
    Case $GUI_EVENT_CLOSE
    GUISetState(@SW_HIDE, $Form1)
    Case $Button1
    GUICtrlSetData($tbChosen, GUICtrlRead($Input1) & @CRLF & _
    GUICtrlRead($Input2) & @CRLF & _
    GUICtrlRead($Input3) & @CRLF, 1)

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

    GUISetState(@SW_HIDE, $Form1)
    EndSwitch
    EndSwitch
    WEnd

    [/autoit]

    Einmal editiert, zuletzt von qwerty00 (10. November 2012 um 14:49)

  • I still don't understand why you don't ask for help in an english-speaking forum like http://www.autoitscript.com...
    Not everyone here understands english, so you might not get much help for your problem.
    I also noticed that your english is about as well written as your broken german, complete with grammatical errors, so the propability of anyone understanding what you write is quite low.

    Despite all that, I'd still be willing to help you - unfortunately I can't. I didn't even get the gist of what you wanted to say..
    Good idea to provide screenshots though. At least I know that you don't want the output you're getting in your program. ^^
    Maybe someone else understands what your problem is, otherwise you'll need to formulate your question again. Sorry.

  • Hi,

    I have possibly understood the goal of your program. I think you want to build something like a simulator for a CNC-milling machine, don't you?
    I learnt something about that last school year, but I think I have already forgotten most of this topic. :D

    However,
    I think you need this Operator (Is this an Operator? I think so, but I'm not sure):

    [autoit]

    &

    [/autoit]

    . With this character you are able to put different strings together.

    An example:

    [autoit]


    $sText = "Hello, my name is "
    $sName = "stay"
    MsgBox(0, "", $sText & $sName & ".")

    [/autoit]


    Written online, but I think it should work :)


    Possibly you will need other string-functions like

    [autoit]

    StringInStr

    [/autoit]

    ,

    [autoit]

    StringLeft()

    [/autoit]

    or somethink like that.
    To help you better I would need more informations about your program.

    Greetings,
    stay


    Edit: Sorry, I did not see that you have used "&" already. But with this knowledge you should be able to solve your problem - in case I have understood it correctly ;)

    PS: If there are some mistakes with the language, please give me a look on them... Thanks!

    2 Mal editiert, zuletzt von stayawayknight (3. November 2012 um 01:02)

  • Do you search for Doubleclic on Items?

    [autoit]

    #include <StructureConstants.au3>
    #include <WindowsConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <GuiListView.au3>

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

    #Region GUI1
    $GUI1 = GUICreate("CNC list", 614, 390)
    $btnGO = GUICtrlCreateButton("&GO", 10, 330, 75, 25)

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

    GUICtrlCreateButton("M list", 85, 330, 75, 25)
    GUICtrlSetFont(-1, 10, 700, -1, "MS Sans Serif")

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

    ;$List_1 = GUICtrlCreateListView(" ", 10, 10, 150, 315) ;you can specify ColHeader Text insted of " "
    $List_1 = GUICtrlCreateListView("test ", 10, 10, 150, 315,$LVS_NOCOLUMNHEADER) ;without ColHeader
    GUICtrlCreateListViewItem("G1", $List_1)
    GUICtrlCreateListViewItem("Program Start and End", $List_1)
    _GUICtrlListView_SetColumnWidth($List_1,0,146)

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

    $tbChosen = GUICtrlCreateEdit("", 175, 10, 420, 315)

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

    GUISetState(@SW_SHOW, $GUI1)
    GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") ;<========== Nessages for Listview

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

    #EndRegion GUI1

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

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("", 428, 205, 339, 527)
    $Group1 = GUICtrlCreateGroup("", 0, 16, 417, 145)
    $Label1 = GUICtrlCreateLabel("Program number [1000-6000 ]", 144, 40, 144, 17)
    $Input1 = GUICtrlCreateInput("", 16, 40, 121, 21)
    $Input2 = GUICtrlCreateInput("", 16, 72, 121, 21)
    $Input3 = GUICtrlCreateInput("", 16, 104, 121, 21)
    $Label2 = GUICtrlCreateLabel("Program description", 144, 80, 97, 17)
    $Label3 = GUICtrlCreateLabel("Max spindle speed", 144, 112, 92, 17)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Button1 = GUICtrlCreateButton("OK", 336, 176, 75, 25)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $aMsg = GUIGetMsg(1)

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

    Switch $aMsg[1]
    Case $GUI1
    Switch $aMsg[0]
    Case $GUI_EVENT_CLOSE
    Exit
    Case $btnGO
    $aItem = _GUICtrlListView_GetItemTextArray($List_1)
    _go($aItem[1])
    EndSwitch
    Case $Form1
    Switch $aMsg[0]
    Case $GUI_EVENT_CLOSE
    GUISetState(@SW_HIDE, $Form1)
    Case $Button1
    GUICtrlSetData($tbChosen, GUICtrlRead($Input1) & @CRLF & _
    GUICtrlRead($Input2) & @CRLF & _
    GUICtrlRead($Input3) & @CRLF, 1)

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

    GUISetState(@SW_HIDE, $Form1)
    EndSwitch
    EndSwitch
    WEnd

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

    Func _go($sListRead)
    WinSetTitle($Form1, "", "Insert: " & $sListRead)
    GUICtrlSetData($Group1, "Parameters for '" & $sListRead & "'")
    GUISetState(@SW_SHOW, $Form1)
    EndFunc ;==>_go

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

    Func WM_NOTIFY($HWND, $MSGID, $WPARAM, $LPARAM)
    Local $TAGNMHDR, $CODE
    $TAGNMHDR = DllStructCreate("INT;INT;INT", $LPARAM)
    If @error Then Return 0
    $CODE = DllStructGetData($TAGNMHDR, 3)
    If $WPARAM = $List_1 Then
    ;CONSOLEWRITE($CODE & @CRLF)
    Switch $CODE
    Case $NM_DBLCLK ;DoppeöKLICK
    $aItem = _GUICtrlListView_GetItemTextArray($List_1)
    ;MsgBox(0, "DoubleClick", $aItem[1])
    _go($aItem[1])
    #cs
    Case $NM_RCLICK ;RECHTSKLICK
    MsgBox(0, "","RightClick")
    #ce
    EndSwitch
    EndIf
    Return $GUI_RUNDEFMSG
    EndFunc ;==>WM_NOTIFY

    [/autoit]

    i have changed your Listbox to a Listview, i don't work with Listboxes

    mfg autoBert

  • The Germans generally are friendly and helpful people.
    Doubleclick - thanks

    Result not good - right box

    Now:
    1000 - Program number
    TEST- Descriptions
    2500 - Spindel speed

    But need:

    01000; Program number
    (-- TEST --) -Descriptions
    G97M3S2500; - Speed

    :)

  • just change the lines:

    [autoit]

    Case $Button1
    GUICtrlSetData($tbChosen, GUICtrlRead($Input1) & @CRLF & _
    GUICtrlRead($Input2) & @CRLF & _
    GUICtrlRead($Input3) & @CRLF, 1)

    [/autoit]

    into similar like:

    [autoit]

    Case $Button1
    GUICtrlSetData($tbChosen, '0' & GUICtrlRead($Input1) & ';' & @CRLF & _
    '(-- ' & GUICtrlRead($Input2) & ' --)' & @CRLF & _
    'G97M3S' & GUICtrlRead($Input3) & ';' & @CRLF, 1)

    [/autoit]

    you can combine Strings with the "&"-operator like you want/need

  • If I add one data name more how to make then?
    I'm trying to make 3rd

    Results: G00 X100. Z100.;


    [Blockierte Grafik: http://img593.imageshack.us/img593/4540/seconds.png

    [autoit]

    #include <StructureConstants.au3>
    #include <WindowsConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <GuiListView.au3>

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

    #Region GUI1
    $GUI1 = GUICreate("CNC list", 614, 390)
    $btnGO = GUICtrlCreateButton("&GO", 10, 330, 75, 25)

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

    GUICtrlCreateButton("M list", 85, 330, 75, 25)
    GUICtrlSetFont(-1, 10, 700, -1, "MS Sans Serif")

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

    ;$List_1 = GUICtrlCreateListView(" ", 10, 10, 150, 315) ;you can specify ColHeader Text insted of " "
    $List_1 = GUICtrlCreateListView("test ", 10, 10, 150, 315,$LVS_NOCOLUMNHEADER) ;without ColHeader
    GUICtrlCreateListViewItem("GO Rapid move", $List_1)
    GUICtrlCreateListViewItem("Program Start and End", $List_1)
    _GUICtrlListView_SetColumnWidth($List_1,0,146)

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

    $tbChosen = GUICtrlCreateEdit("", 175, 10, 420, 315)

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

    GUISetState(@SW_SHOW, $GUI1)
    GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") ;<========== Nessages for Listview

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

    #EndRegion GUI1

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

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("", 428, 205, 339, 527)
    $Group1 = GUICtrlCreateGroup("", 0, 16, 417, 145)
    $Label1 = GUICtrlCreateLabel("Program number [1000-6000 ]", 144, 40, 144, 17)
    $Input1 = GUICtrlCreateInput("", 16, 40, 121, 21)
    $Input2 = GUICtrlCreateInput("", 16, 72, 121, 21)
    $Input3 = GUICtrlCreateInput("", 16, 104, 121, 21)
    $Label2 = GUICtrlCreateLabel("Program description", 144, 80, 97, 17)
    $Label3 = GUICtrlCreateLabel("Max spindle speed", 144, 112, 92, 17)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Button1 = GUICtrlCreateButton("OK", 336, 176, 75, 25)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $aMsg = GUIGetMsg(1)

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

    Switch $aMsg[1]
    Case $GUI1
    Switch $aMsg[0]
    Case $GUI_EVENT_CLOSE
    Exit
    Case $btnGO
    $aItem = _GUICtrlListView_GetItemTextArray($List_1)
    _go($aItem[1])
    EndSwitch
    Case $Form1
    Switch $aMsg[0]
    Case $GUI_EVENT_CLOSE
    GUISetState(@SW_HIDE, $Form1)
    Case $Button1
    GUICtrlSetData($tbChosen, '0' & GUICtrlRead($Input1) & ';' & @CRLF & _
    '(-- ' & GUICtrlRead($Input2) & ' --)' & @CRLF & _
    'G97M3S' & GUICtrlRead($Input3) & ';' & @CRLF, 1)

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

    GUISetState(@SW_HIDE, $Form1)
    EndSwitch
    EndSwitch
    WEnd

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

    Func _go($sListRead)
    WinSetTitle($Form1, "", "Insert: " & $sListRead)
    GUICtrlSetData($Group1, "Parameters for '" & $sListRead & "'")
    GUISetState(@SW_SHOW, $Form1)
    EndFunc ;==>_go

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

    Func WM_NOTIFY($HWND, $MSGID, $WPARAM, $LPARAM)
    Local $TAGNMHDR, $CODE
    $TAGNMHDR = DllStructCreate("INT;INT;INT", $LPARAM)
    If @error Then Return 0
    $CODE = DllStructGetData($TAGNMHDR, 3)
    If $WPARAM = $List_1 Then
    ;CONSOLEWRITE($CODE & @CRLF)
    Switch $CODE
    Case $NM_DBLCLK ;DoppeöKLICK
    $aItem = _GUICtrlListView_GetItemTextArray($List_1)
    ;MsgBox(0, "DoubleClick", $aItem[1])
    _go($aItem[1])
    #cs
    Case $NM_RCLICK ;RECHTSKLICK
    MsgBox(0, "","RightClick")
    #ce
    EndSwitch
    EndIf
    Return $GUI_RUNDEFMSG
    EndFunc ;==>WM_NOTIFY

    [/autoit]
  • Then you have different Input-Forms??

    A simple possibility is to choose which Listview-Row is selected an then decide what to do like

    [autoit]

    ...
    Case $Button1
    Local $iNum = _GUICtrlListView_GetSelectionMark($List_1)
    Switch $iNum
    Case 0
    GUICtrlSetData($tbChosen, $iNum , 1)
    MsgBox(64,"Test", $iNum & " selected")
    Case 1
    GUICtrlSetData($tbChosen, $iNum , 1)
    MsgBox(64,"Test", $iNum & " selected")
    EndSwitch
    GUISetState(@SW_HIDE, $Form1)
    EndSwitch
    ...

    [/autoit]

    p.s.: I'm not a professional-scripter, so do not expect to much from me, hrhr