안녕하세요
바코드 스캐너로 데이터베이스의 항목을 확인하려고 합니다.
숫자를 입력하고 마지막에 "텍스트 편집 상자"의 스크립트를 트리거하는 엔터를 제공합니다.
작동하지 않는 것은 상자에 다시 초점을 재설정하여 다음 숫자를 입력하는 것입니다.
Names Default To Here( 1 );
dt = current data table();
try(win1<<CLOSE window=""></CLOSE>
의 도움으로 내 현재 해결 방법 https://community.jmp.com/t5/Discussions/JSL-to-input-an-Enter-keystroke/td-p/5872
기본적으로 다음과 같습니다. 텍스트 편집 상자 주위에 마우스 상자를 놓습니다. 마우스 상자에 초점을 설정하고 TAB 마녀를 누르면 텍스트 편집 상자에 초점이 설정됩니다.
Names Default To Here( 1 );
clear log();
if(1==1,
VK_TAB = Hex to Number( "00000009" ); //&H9
KEYEVENTF_EXTENDEDKEY = Hex to Number( "00000001" ); //&H1
KEYEVENTTF_KEYDOWN = 0;
KEYEVENTF_KEYUP = Hex to Number( "00000002" ); //&H2
kernel32 = Load Dll( "kernel32" );
kernel32 << DeclareFunction( "Sleep", Convention( STDCALL ), Alias( "Sleep" ),
Arg( Int32, "dwMilliseconds" ),Returns( Void ) );
user32 = Load Dll( "User32" );
user32 << DeclareFunction( "FindWindowA", Convention( STDCALL ), Alias( "FindWindow2" ),
Arg( UInt32, input, "lpClassName" ),Arg( AnsiString( 200 ), input, "lpCaption" ),Returns( UIntPtr ) );
user32 << DeclareFunction( "SetForegroundWindow", Convention( STDCALL ), Alias( "SetForegroundWindow" ),
Arg( UIntPtr, "hWnd" ),Returns( UInt32 ));
user32 << DeclareFunction( "keybd_event", Convention( STDCALL ), Alias( "keybd_event" ),
Arg( UInt8, "bVk" ),Arg( UInt8, "bScan" ),Arg( UInt32, "dwFlags" ),Arg( UIntPtr, "dwExtraInfo" ),Returns( Void ));
user32 << DeclareFunction( "GetKeyState", Convention( STDCALL ), Alias( "GetKeyState" ),
Arg( Int32, "nVirtKey" ),Returns( Int32 ) );
shell32 = Load Dll( "shell32" );
shell32 << DeclareFunction( "ShellExecuteA", Convention( STDCALL ), Alias( "ShellExecute" ),
Arg( UIntPtr, input, "hWnd" ),Arg( AnsiString( 20 ), "lpOperation" ),Arg( AnsiString( 256 ), "lpFile" ),
Arg( AnsiString( 256 ), "lpParameters" ), /* Arg( UInt32, "lpParameters" ), */Arg( UInt32, "lpDirectory" ),
Arg( UInt32, "nShowCmd" ),Returns( UInt32 ));
key = function( { l_key },
user32 << keybd_event( l_key, 0, 0, 0 ); // press key
user32 << keybd_event( l_key, 0, KEYEVENTF_KEYUP, 0 ); // release key
);
); // Setup the win key command code from the JMP community: https://community.jmp.com/t5/Discussions/JSL-to-input-an-Enter-keystroke/td-p/5872
reset_focus = expr(
wait(0.1);
mb<<SETFOCUS></SETFOCUS>
편집: bb1 = 버튼 박스 ( "확인하다" , reset_focus ; ) 포커스를 엉망으로 만드는 것 같습니다(다시 자체로 설정한 다음 다음 항목으로 설정).
누락에 대해 알고 있다면 요점이 무엇입니까?
해결 방법을 원하십니까? 그렇다면 누군가 이 토론에서 당신을 도울 수 있을 것입니다.
새로운 기능을 원하십니까? 그렇다면 JMP 커뮤니티의 위시리스트 부분으로 이동하십시오. 누군가가 이러한 필요와 같은 것을 이미 요청했는지 확인하십시오. 그렇지 않은 경우 고려를 위해 추가하십시오.
이 토론에서 원하는 것이 명확하지 않습니다.
THX, 알아요. 하지만 그 기능은 아직 없습니다.
MouseBox와 SetKey 기능을 사용하여 최소한 TAB을 한 번 눌러 TextEditBox에 집중하도록 줄일 수 있습니다.
Names Default To Here( 1 );
dt = current data table();
try(win1<<CLOSE window=""></CLOSE>
TextEditBox(...,...,...,TAB 또는 ENTER를 눌렀을 때 다음 개체)의 매개변수에 설정하면 좋을 것입니다.
나의 경우에는:
pnr = text edit box("example",set width(160),set nlines(1),<<SETSCRIPT></SETSCRIPT>
<< Set Focus 및 << Restore Focus After Click 메시지는 텍스트 편집 상자에 대한 프로토콜의 일부가 아닌 것으로 보입니다.
도움말 > 스크립팅 인덱스를 선택하여 직접 확인할 수 있습니다. 목록을 표시 상자로 변경한 다음 TextEditBox 항목을 선택합니다. 전체 프로토콜을 표시하는 두 번째 목록에서는 이 메시지를 찾을 수 없습니다.
예를 들어 필터 상자에 'search'를 입력하여 이 메시지를 검색할 수 있습니다. 이 메시지와 함께 다른 개체를 찾을 수 없습니다.
프로토콜에 대해 표시 상자 개체에 직접 요청할 수도 있습니다.
Show Properties( Text Edit Box( "test" ) );