LTCD_070816.ISO
This commit is contained in:
1 parent
d14bbc24f9
commit
0e9364ff4c
506 files changed
+157705
-41812
No files matched your search
@@ -0,0 +1,126 @@
|
||||
I1 captured_macro_name[128];
|
||||
*captured_macro_name=0;
|
||||
|
||||
I8 PopUpExitRecordPlayStopInsert()
|
||||
{
|
||||
I8 result=0;
|
||||
I1 buf[80];
|
||||
TssCmdStruct *tempc;
|
||||
Ltf *l=LtfNew;
|
||||
LtfEntry *ll;
|
||||
ll=LtfPutSExt(l,"$$DA-P,127,\"Name:%s\"$$");
|
||||
ll->data=captured_macro_name;
|
||||
LtfFormatData(ll);
|
||||
LtfPutSExt(l,"$$CM+LX+TY,2,4$$$$BT, \"RECORD\",1$$");
|
||||
LtfPutSExt(l,"$$CM+LX+TY,18,4$$$$BT, \"PLAY\",2$$");
|
||||
LtfPutSExt(l,"$$CM+LX+TY,2,7$$$$BT, \"STOP\",3$$");
|
||||
LtfPutSExt(l,"$$CM+LX+TY,18,7$$$$BT, \"EXIT\",0$$");
|
||||
LtfPutSExt(l,"$$CM+LX+TY,2,10$$$$BT, \"INSERT\",4$$");
|
||||
l->flags|=LTFF_MIN_SIZE | LTFF_FORM;
|
||||
SPrintF(buf,"DoMenu(0x%X);",l);
|
||||
macro_util_tss=Spawn(&ServantUserCmdLine,"MACRO POPUP",Fs);
|
||||
Fs->popup_tss=macro_util_tss;
|
||||
tempc=QueueTaskRequest(macro_util_tss,Fs,buf,
|
||||
1<<TSSCf_WAKE_MASTER | 1<<TSSCf_FOCUS_MASTER);
|
||||
GetRequestResult(tempc,&result);
|
||||
Fs->popup_tss=NULL;
|
||||
Kill(macro_util_tss);
|
||||
macro_util_tss=NULL;
|
||||
LtfGetData(ll);
|
||||
LtfDel(l);
|
||||
return result;
|
||||
}
|
||||
|
||||
void DelSysMacro()
|
||||
{
|
||||
TssCmdStruct *tempc,*tempc1;
|
||||
tempc=sys_macro_queue.next;
|
||||
while (tempc!=&sys_macro_queue) {
|
||||
tempc1=tempc->next;
|
||||
RemQue(tempc);
|
||||
AFree(tempc);
|
||||
tempc=tempc1;
|
||||
}
|
||||
}
|
||||
|
||||
I1 *SysMacro2Str()
|
||||
{
|
||||
TssCmdStruct *tempc;
|
||||
I8 cnt=0;
|
||||
I1 *ptr,*m;
|
||||
LBtr(&sys_semas[SYS_SEMA_RECORD_MACRO],0);
|
||||
tempc=sys_macro_queue.next;
|
||||
while (tempc!=&sys_macro_queue) {
|
||||
if (tempc->cmd_code==TSSCT_MSG)
|
||||
cnt++;
|
||||
tempc=tempc->next;
|
||||
}
|
||||
m=MAlloc(cnt*54+1);
|
||||
ptr=m;
|
||||
|
||||
tempc=sys_macro_queue.next;
|
||||
while (tempc!=&sys_macro_queue) {
|
||||
if (tempc->cmd_code==TSSCT_MSG) {
|
||||
SPrintF(ptr,"Msg(0x%08X,0x%016X,0x%016X);",
|
||||
tempc->msg_code,tempc->p1,tempc->p2);
|
||||
ptr+=54;
|
||||
}
|
||||
tempc=tempc->next;
|
||||
}
|
||||
return m;
|
||||
}
|
||||
|
||||
void PlaySysMacro()
|
||||
{
|
||||
I1 *m=SysMacro2Str;
|
||||
while (sys_cur_focus_task==Fs)
|
||||
SwapInNext;
|
||||
XTalkStrWithWait(sys_cur_focus_task,m);
|
||||
Free(m);
|
||||
}
|
||||
|
||||
void MacroTask()
|
||||
{
|
||||
I8 i;
|
||||
StrCpy(captured_macro_name,"Click Here");
|
||||
do {
|
||||
i=PopUpExitRecordPlayStopInsert;
|
||||
RefocusWin;
|
||||
switch (i) {
|
||||
case 1:
|
||||
LBtr(&sys_semas[SYS_SEMA_RECORD_MACRO],0);
|
||||
DelSysMacro;
|
||||
LBts(&sys_semas[SYS_SEMA_RECORD_MACRO],0);
|
||||
break;
|
||||
case 2:
|
||||
LBtr(&sys_semas[SYS_SEMA_RECORD_MACRO],0);
|
||||
PlaySysMacro;
|
||||
break;
|
||||
case 3:
|
||||
LBtr(&sys_semas[SYS_SEMA_RECORD_MACRO],0);
|
||||
break;
|
||||
case 4:
|
||||
LBtr(&sys_semas[SYS_SEMA_RECORD_MACRO],0);
|
||||
if (sys_cur_focus_task)
|
||||
QueueMsg(sys_cur_focus_task,0,
|
||||
MSG_KEY_DOWN,0,SC_F2|SCF_SHIFT,0);
|
||||
break;
|
||||
}
|
||||
} while (i>0);
|
||||
}
|
||||
|
||||
void EditMacroUtil()
|
||||
{
|
||||
if (!macro_util_tss)
|
||||
Spawn(&MacroTask,"MACRO TASK");
|
||||
}
|
||||
|
||||
void EditInsertCapturedMacro()
|
||||
{
|
||||
BoolU4 old_preempt=Preempt(OFF);
|
||||
I1 *st=SysMacro2Str;
|
||||
PrintF("$$MA+A+LM+LA,\"%s\",\"%s\"$$",
|
||||
captured_macro_name,st);
|
||||
Free(st);
|
||||
Preempt(old_preempt);
|
||||
}
|
||||
Reference in new issue
Block a user