진행 표시 줄 진행률 표시줄을 만드는 방법을 보여 주었습니다. @abmayfield 질문 "응답하지 않음" vs. "여전히 생각 중" 이것을 다시 방문하도록 유도했습니다. 취소 버튼을 포함한 또 다른 테이크가 있습니다.
not cancelednot cancelednot cancelednot canceled취소되지 않음
Cancel button pressed.Cancel button pressed.Cancel button pressed.Cancel button pressed.취소 버튼을 눌렀습니다.
progressBarWidth = 500;
progressUpdatesSeconds = 1 / 4; // 1/2 sec updates -> 1300ips, 1/30 -> 1000ips (1/4 compromise speed vs appearance)
cancel = 0; // clear the cancel flag
New Window( "Progressbar demo", //
V List Box( //
cats = Text Box( "" ), // output from the work function
t = Text Box( "", <<SETWRAP> ^workCalls/runSeconds^ ips" ) );
t << updatewindow; // this works without the wait
);
totalCats = 0;
dowork = Function( {},
x = "";
For( i = 1, i <= 1000, i += 1, x = x || "." );
totalCats += 1000;
cats << settext( Eval Insert( "total concatenations=^totalCats^" ) );
);
While( runSeconds < limitSeconds & !cancel, // change this to represent the work you are doing
// do some work, simulated by concatenating strings...
dowork();
// update the progressbar
workCalls += 1;
nowMicroSeconds = HP Time();
// how often does it need to update on the screen?
If( (nowMicroSeconds - recentUpdateMicroSeconds) / 1e6 > progressUpdatesSeconds,
// in this example I'm using a fixed time duration of "limitSeconds" to represent the
// amount of work to be done. And "runSeconds" to represent the amount of work done so far.
// Usually you'll have something other than time: number of rows in a table perhaps, or
// number of categories to make reports for. As long as you know how many total and how
// many completed, you can compute this fraction...
updateProgress( runSeconds / limitSeconds ); // change this to represent the fraction of work finished
recentUpdateMicroSeconds = nowMicroSeconds;
Wait( 0 ); // this wait is needed to let the cancel button work
);
runSeconds = (nowMicroSeconds - startMicroSeconds) / 1e6;
);
If( cancel, // test the cancel flag
Beep(); // audio flag
left << color( "dark red" ); // visual flag something is awry
right << color( "red" );
, //
updateProgress( 1.0 ); // people like to see the bar go to 100%
);
cancelButton << setbuttonname( "Close" ); // visual flag the button function is changed
cancelButton << setscript( (cancelButton << closewindow) ); // and what to do if the button is pressed
</SETWRAP>
JMP 15와 16 사이에서 테스트한 결과 16이 많은 이 문자열 연결 작업 부하에서 더 빠릅니다! 잘 하셨어요!
편집: JMP가 자체적으로 취소 가능한 진행률 표시줄이 없는 플랫폼을 실행 중이고 오랫동안 실행되는 경우 이는 도움이 되지 않습니다. 기술 지원은 진행률 표시줄에 대한 플랫폼 지원을 요청하기에 좋은 곳입니다. 이것이 없으면 작업이 완료될 때까지 중지할 방법(JMP를 강제로 닫는 것보다 짧음)이 없습니다.
포장하고 싶습니다. 감사합니다!
귀하의 예에서 pb<
제가 놓친 부분도 지적해주셨어요 클래스 정의 사용 방법 : 정의 클래스 프로토타입에 명시적으로 클래스 멤버를 배치해야 한다고 생각했는데, 이것: 그것들도 만들 수 있습니다.
Define Class("bubble",
//not needed: m_xpos = .;
_init_ = Method( {x}, <BR />//because using explicit this: ...
this:m_xpos = x;
감사해요 @Craige_Hales ! 내 스크립트 중 하나에 진행률 표시줄(또는 이와 유사한 것)이 필요했기 때문에 이것을 가져와 내 필요에 맞게 약간 수정했습니다. 나는 그것을 수업으로 바꿨습니다(JMP의 수업과 일반적으로 수업에 대해 매우 초보자입니다) 관행 그리고 그것이 하나에 들어갈 수 있다고 느꼈기 때문입니다. 또한 Natural Docs로 구문 분석할 수 있는 일부 문서를 추가했습니다.
암호:
더보기...자연 문서는 다음과 같이 표시됩니다.
