Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/24/2013 in all areas

  1. Encouraging something by not allowing something else is nazi. And gay. I agree with you BTW. But since you don't agree with me, you're gay too.
    2 points
  2. Hi all, Huge progress since the above was posted - so I have deleted the code. I would be grateful if some readers could run this current Beta version and example and let me have their comments: See newer Beta below M23
    1 point
  3. That's true. If you want to be able to easily debug your code visually than you wouldn't use one liners. Ideal programming language doesn't have limitations. That language allows programmer to write everything in one line if one chooses to, it doesn't require $ for variables, etc, etc... It's up to programmer to set limits, not language. Don't you agree?
    1 point
  4. Wingens, Something like this perhaps? #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> Global $iChar_Limit = 5, $aInput[5] $hGUI = GUICreate("Input Autofocus", 500, 500) ; ###################### ; It is important that these controls are created in immediate succession For $i = 0 To UBound($aInput) - 1 $aInput[$i] = GUICtrlCreateInput("", 20 + (60 * $i), 20, 40, 20) GUICtrlSetLimit(-1, $iChar_Limit) If $i Then GUICtrlSetState(-1, $GUI_DISABLE) EndIf Next $hButton = GUICtrlCreateButton("OK", 75, 60, 80, 30) GUICtrlSetState(-1, $GUI_DISABLE) ; ###################### For $i = 0 To 3 GUICtrlCreateLabel("-", 70 + (60 * $i), 20, 10, 20) Next GUIRegisterMsg($WM_COMMAND, "On_WM_COMMAND") GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $hButton $sString = "" For $i = 0 To UBound($aInput) - 1 $sString &= GUICtrlRead($aInput[$i]) Next MsgBox(0, "Result", $sString) EndSwitch WEnd Func On_WM_COMMAND($hWnd, $Msg, $wParam, $lParam) $iCode = BitShift($wParam, 16) $iID = BitAND($wParam, 0x0000FFFF) Switch $iCode Case $EN_UPDATE ; 0x400 ; If StringLen(GUICtrlRead($iID)) = $iChar_Limit Then GUICtrlSetState($iID + 1, $GUI_ENABLE) GUICtrlSetState($iID + 1, $GUI_FOCUS) EndIf EndSwitch EndFunc ;==>On_WM_COMMAND Please ask if you have any questions. M23
    1 point
  5. Myicq, I would use an array like this: #include <GUIConstantsEx.au3> #include <WinAPI.au3> ; Number of inputs Global $iCount = 3 ; Array to hold input ControlID and handle Global $aInput[$iCount + 1][2] = [[$iCount]] $hGUI = GUICreate("Test", 500, 500) For $i = 1 To $iCount ; Store the ControlID and handle $aInput[$i][0] = GUICtrlCreateInput("999", 10, 20 * $i, 200, 20) $aInput[$i][1] = GUICtrlGetHandle($aInput[$i][0]) Next $cButton = GUICtrlCreateButton("Focus Taker", 380, 10, 100, 30) $cUp = GUICtrlCreateDummy() $cDown = GUICtrlCreateDummy() GUISetState() ; Set GUIAccelerators for the dummy controlIDs Global $aAccelKeys[2][2] = [["{UP}", $cUp],["{DOWN}", $cDown]] GUISetAccelerators($aAccelKeys) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $cUp ; Get handle of focused control $hFocus = _WinAPI_GetFocus() ; See if it is an input For $i = 1 To $iCount If $aInput[$i][1] = $hFocus Then ; Chnage the input $iValue = GUICtrlRead($aInput[$i][0]) + 1 If $iValue = 1001 Then $iValue = 0 GUICtrlSetData($aInput[$i][0], $iValue) ; No point in looping any more ExitLoop EndIf Next Case $cDown $hFocus = _WinAPI_GetFocus() For $i = 1 To $iCount If $aInput[$i][1] = $hFocus Then $iValue = GUICtrlRead($aInput[$i][0]) - 1 If $iValue = -1 Then $iValue = 1000 GUICtrlSetData($aInput[$i][0], $iValue) ExitLoop EndIf Next EndSwitch WEnd All clear? M23
    1 point
  6. ZeeXEez

    Classes and Objects

    <EMOticONS> I like them... 12... I wish,,, ;-)
    1 point
  7. BrewManNH

    Basic SQLite question

    Thats what I've been asking him for 3 days now, don't expect an answer any time soon that makes any kind of sense.
    1 point
  8. czardas

    Is AutoIT perfect?

    @Jos For what it's worth, I'm personally very grateful to see you back on board. I would not like to see AutoIt without SciTE4AutoIt. Your contributions are most valued by many around here.
    1 point
×
×
  • Create New...