Jump to content

kylomas

MVPs
  • Posts

    4,425
  • Joined

  • Last visited

  • Days Won

    15

kylomas last won the day on January 20 2018

kylomas had the most liked content!

About kylomas

Profile Information

  • Member Title
    BOHICA
  • Location
    Milwaukee, Wisconsin
  • Interests
    What, me worry?

Recent Profile Visitors

1,139 profile views

kylomas's Achievements

  1. Efo74, This will do what you've asked... #include <EditConstants.au3> #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <array.au3> #include <Misc.au3> #include <WinAPI.au3> #include <WinAPIvkeysConstants.au3> #include <APISysConstants.au3> #include <WinAPISys.au3> #include <GuiEdit.au3> #AutoIt3Wrapper_Add_Constants=n Local $hDLL = DllOpen("user32.dll") ; keep track of which input control has focus Local $who_has_focus ; max input characters Local $maxchars = 10 Local $gui010 = GUICreate('Input Control Tabbing Demo') Local $ctlInputIDS[6] For $1 = 0 To 5 GUICtrlCreateLabel('Input # ' & $1 + 1, 10, $1 * 25 + 10, 100, 20) $ctlInputIDS[$1] = GUICtrlCreateInput('', $1 + 70, $1 * 25 + 10, 100, 20, $es_left) Next GUISetState() $who_has_focus = $ctlInputIDS[0] GUIRegisterMsg($WM_COMMAND, 'WM_COMMAND') While 1 Switch GUIGetMsg() Case $gui_event_close Exit EndSwitch If _IsPressed("08", $hDLL) Then While _IsPressed("08", $hDLL) Sleep(100) WEnd ; if the input control is blank then tab backward If GUICtrlRead($who_has_focus) = '' Then ControlSend('', '', $who_has_focus, '+{tab}') ; the following deselects highlighting for the control tabbed to _GUICtrlEdit_SetSel(ControlGetHandle('', '', $who_has_focus), -1, 0) EndIf EndIf WEnd Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) Switch BitAND($wParam, 0xFFFF) Case $ctlInputIDS[0] To $ctlInputIDS[UBound($ctlInputIDS) - 1] Switch BitShift($wParam, 16) Case $EN_setfocus $who_has_focus = BitAND($wParam, 0xFFFF) Case $EN_change If StringLen(GUICtrlRead(BitAND($wParam, 0xffff))) >= $maxchars Then ControlSend('', '', BitAND($wParam, 0xffff), '{tab}') EndIf EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_COMMAND kylomas *** delay is answering can be blamed on a river full of large mouth bass!!!
  2. Subz...yes, was offering an explanation to what seemed to be a question. Playing with other alternatives...
  3. Efo74, Per MS Doc for EM_MAXTEXT In short, the edit control consumes the character and we have no accessibility to it that I see. Here is another take on you task... #include <EditConstants.au3> #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <array.au3> #include <Misc.au3> #AutoIt3Wrapper_Add_Constants=n Local $hDLL = DllOpen("user32.dll") ; keep track of which input control has focus Local $who_has_focus Local $gui010 = GUICreate('Input Control Tabbing Demo') Local $ctlInputIDS[6] For $1 = 0 To 5 GUICtrlCreateLabel('Input # ' & $1 + 1, 10, $1 * 25 + 10, 100, 20) $ctlInputIDS[$1] = GUICtrlCreateInput('', $1 + 70, $1 * 25 + 10, Random(50, 80, 1), 20, $es_left) Next GUISetState() GUIRegisterMsg($WM_COMMAND, 'WM_COMMAND') While 1 Switch GUIGetMsg() Case $gui_event_close Exit EndSwitch If _IsPressed("08", $hDLL) Then While _IsPressed("08", $hDLL) Sleep(100) WEnd ; if the input control is blank then tab backward If GUICtrlRead($who_has_focus) = '' Then ControlSend('', '', $who_has_focus, '+{tab}') EndIf WEnd Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) Switch BitAND($wParam, 0xFFFF) Case $ctlInputIDS[0] To $ctlInputIDS[UBound($ctlInputIDS) - 1] Switch BitShift($wParam, 16) Case $EN_setfocus $who_has_focus = BitAND($wParam, 0xFFFF) Case $EN_maxtext ControlSend('', '', BitAND($wParam, 0xffff), '{tab}') EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_COMMAND kylomas
  4. hemal, The scripts do not have to be compiled although they certainly can be. Script 1 calls script 2 below... ; script 1 #include <MsgBoxConstants.au3> msgbox($mb_ok,'Script 1',"Hi, I'm script 1" & @crlf & 'Hit Enter to call script 2') ShellExecute('C:\Users\Tom\Documents\AI Help Scripts\script 2.au3') ; script 2 #include <MsgBoxConstants.au3> msgbox($mb_ok,'Script 2',"Hi, I'm script 2") There are other ways to do this also. All of them described in the Help file. kylomas
  5. RTFC, FMS, jchd, Thank you for the insight and links! Kylomas
  6. RTFC & FMS I watched the video and understand the concept (no math background) but do not understand the practicality of it. Can you give a real life example of matrix math? Thanks, Kylomas
  7. Adapted from OP code... #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> Global $DoubleClicked = False $Form1 = GUICreate("Form1", 259, 296, 192, 124) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") $ListV1 = GUICtrlCreateListView("ListView 1", 32, 32, 186, 182, -1, BitOR($LVS_EX_CHECKBOXES, $WS_EX_CLIENTEDGE)) For $i = 1 To 5 GUICtrlCreateListViewItem("Item" & $i, $ListV1) Next GUISetState(@SW_SHOW) While 1 If $DoubleClicked Then DoubleClickFunc() $DoubleClicked = False EndIf $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func DoubleClickFunc() MsgBox(64, "OK", "Double Clicked: " & _GUICtrlListView_GetItemTextString($ListV1, -1)) ClipPut(_GUICtrlListView_GetItemTextString($ListV1, -1)) EndFunc ;==>DoubleClickFunc Func WM_NOTIFY($hWnd, $MsgID, $wParam, $lParam) Local $tagNMHDR, $event, $hwndFrom, $code $tagNMHDR = DllStructCreate("int;int;int", $lParam) If @error Then Return 0 $code = DllStructGetData($tagNMHDR, 3) If $wParam = $ListV1 And $code = -3 Then $DoubleClicked = True Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY kylomas
  8. CFLam, If your intent is to produce a string of numbers by column without duplicates then try this... #include <Array.au3> Local $aLine[8] $aLine[0] = "17,1,2,3,4,5,6,7,10,11,12,13,15,16,20,22,24,26,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,," $aLine[1] = "16,1,2,3,4,5,6,7,8,9,10,11,12,16,17,21,26,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,," $aLine[2] = "23,4,5,6,7,8,9,10,12,13,14,15,16,17,18,19,20,23,25,26,28,29,35,36,,,,,,,,,,,,,,,,,,,,,,,,,," $aLine[3] = "27,8,9,11,12,13,14,15,17,19,20,21,22,23,24,26,27,28,29,30,31,32,34,37,39,40,41,42,,,,,,,,,,,,,,,,,,,,,," $aLine[4] = "27,14,16,17,18,19,20,22,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,42,43,44,,,,,,,,,,,,,,,,,,,,,," $aLine[5] = "24,20,24,26,27,28,29,30,31,32,33,34,35,36,37,39,40,41,42,43,44,45,46,47,48,,,,,,,,,,,,,,,,,,,,,,,,," $aLine[6] = "16,33,34,35,36,37,38,39,41,42,43,44,45,46,47,48,49,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,," $aLine[7] = "14,35,37,38,39,40,41,42,43,44,45,46,47,48,49,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,," ; fimd max # of columns Local $imaxcol = 0 For $1 = 0 To UBound($aLine) - 1 StringReplace($aLine[$1], ',', ',') $imaxcol = ($imaxcol > @extended ? $imaxcol : @extended) Next Local $a2D[UBound($aLine)][$imaxcol + 1], $atmp ; populate working array For $1 = 0 To UBound($aLine) - 1 $atmp = StringSplit($aLine[$1], ',', 3) For $2 = 0 To UBound($atmp) - 1 ;ConsoleWrite($1 & ' - ' & $2 & @CRLF) $a2D[$1][$2] = $atmp[$2] Next Next ; process each column producing a string of numbers without duplicates, comma delimited Local $oDict = ObjCreate("Scripting.Dictionary") Local $atmp, $output _ArrayDisplay($a2D) For $1 = 1 To UBound($a2D, 2) - 1 For $2 = 0 To UBound($a2D) - 1 If $a2D[$2][$1] = '' Then ContinueLoop $oDict.Item($a2D[$2][$1]) Next $atmp = $oDict.keys() If UBound($atmp) > 0 Then $output &= _ArrayToString($atmp, ',') & @CRLF $oDict.removeall() Next ConsoleWrite($output & @CRLF) if not, I have no idea what you are trying to do... kylomas
  9. Similar to _ArrayUnique... #include <Array.au3> Local $aLine[8] $aLine[0] = "17,1,2,3,4,5,6,7,10,11,12,13,15,16,20,22,24,26,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,," $aLine[1] = "16,1,2,3,4,5,6,7,8,9,10,11,12,16,17,21,26,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,," $aLine[2] = "23,4,5,6,7,8,9,10,12,13,14,15,16,17,18,19,20,23,25,26,28,29,35,36,,,,,,,,,,,,,,,,,,,,,,,,,," $aLine[3] = "27,8,9,11,12,13,14,15,17,19,20,21,22,23,24,26,27,28,29,30,31,32,34,37,39,40,41,42,,,,,,,,,,,,,,,,,,,,,," $aLine[4] = "27,14,16,17,18,19,20,22,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,42,43,44,,,,,,,,,,,,,,,,,,,,,," $aLine[5] = "24,20,24,26,27,28,29,30,31,32,33,34,35,36,37,39,40,41,42,43,44,45,46,47,48,,,,,,,,,,,,,,,,,,,,,,,,," $aLine[6] = "16,33,34,35,36,37,38,39,41,42,43,44,45,46,47,48,49,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,," $aLine[7] = "14,35,37,38,39,40,41,42,43,44,45,46,47,48,49,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,," Local $oDict = ObjCreate("Scripting.Dictionary") Local $atmp, $output For $1 = 0 To UBound($aLine) - 1 $atmp = StringSplit($aLine[$1], ',', 3) For $2 = 1 To UBound($atmp) - 1 If $atmp[$2] = '' Then ContinueLoop $oDict.Item($atmp[$2]) Next $atmp = $oDict.keys() $output &= _ArrayToString($atmp) & @CRLF $oDict.removeall() Next ConsoleWrite($output & @CRLF) kylomas
  10. BatMan22, Look at TraySetOnEvent ($TRAY_EVENT_PRIMARYDOWN) in the Help file. kylomas
  11. Atoxis, Share your solution so we can all learn something... kylomas
  12. Since it has warnings about the "bug", probably not!
  13. Ttamari, As you delete rows you are no longer bumping through the array sequentially. Delete them in reverse order like for $x = ubound($array) - 1 to 0 kylomas
×
×
  • Create New...