Cambiata gestione switch messaggi dei campi
git-svn-id: svn://10.65.10.50/trunk@207 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
2342287312
commit
ae0cec1973
@ -1,4 +1,4 @@
|
||||
// $Id: maskfld.cpp,v 1.14 1994-09-08 14:26:37 guy Exp $
|
||||
// $Id: maskfld.cpp,v 1.15 1994-09-09 11:19:42 guy Exp $
|
||||
#include <xvt.h>
|
||||
|
||||
#include <applicat.h>
|
||||
@ -525,7 +525,26 @@ HIDDEN const char* copy_value(TToken_string& msg, const TString& val)
|
||||
|
||||
// Certified 50%
|
||||
bool TMask_field::do_message(int num)
|
||||
{
|
||||
{
|
||||
const int MAX_CMD = 14;
|
||||
static const char* commands[MAX_CMD] =
|
||||
{
|
||||
"ADD", // 0
|
||||
"CLEAR", // 1
|
||||
"CO", // 2
|
||||
"DEL", // 3
|
||||
"DIRTY", // 4
|
||||
"DISABLE", // 5
|
||||
"ENABLE", // 6
|
||||
"ENABLEDEF", // 7
|
||||
"EXIT", // 8
|
||||
"HIDE", // 9
|
||||
"PUSH", // 10
|
||||
"RESET", // 11
|
||||
"SHOW", // 12
|
||||
"UNDO" // 13
|
||||
};
|
||||
|
||||
TToken_string* message = (TToken_string*)_message.objptr(num);
|
||||
if (message == NULL || message->empty()) return FALSE;
|
||||
|
||||
@ -539,8 +558,27 @@ bool TMask_field::do_message(int num)
|
||||
value = msg.get();
|
||||
value.trim();
|
||||
const char* dlg = msg.get();
|
||||
|
||||
int cmd = -1;
|
||||
if (isalpha(value[0])) // binary search
|
||||
{
|
||||
int f = 0, l = MAX_CMD-1;
|
||||
while (TRUE)
|
||||
{
|
||||
cmd = (f+l)>>1;
|
||||
const int cmp = strcmp(value, commands[cmd]);
|
||||
if (cmp == 0) break;
|
||||
if (cmp > 0) f = cmd+1;
|
||||
else l = cmd-1;
|
||||
if (f > l)
|
||||
{
|
||||
cmd = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (value == "EXIT")
|
||||
if (cmd == 8)
|
||||
{
|
||||
mask().stop_run(atoi(dlg));
|
||||
continue;
|
||||
@ -549,22 +587,37 @@ bool TMask_field::do_message(int num)
|
||||
short fld = (dlg && dlg[0] > ' ') ? atodlg(dlg) : 0;
|
||||
bool broadcast = dlg && strchr(dlg, '@');
|
||||
if (value[0] == '"') value = value.strip("\"'");
|
||||
else
|
||||
else switch (cmd)
|
||||
{
|
||||
if (value == "CO") value = copy_value(msg, get()); else
|
||||
if (value == "CLEAR") key = 11000+'c'; else
|
||||
if (value == "DISABLE") key = 11000+'d'; else
|
||||
if (value == "ENABLE") key = 11000+'e'; else
|
||||
if (value == "SHOW") key = 11000+'s'; else
|
||||
if (value == "HIDE") key = 11000+'h'; else
|
||||
if (value == "ENABLEDEF")key = 11000+'E'; else
|
||||
if (value == "PUSH") key = K_SPACE; else
|
||||
if (value == "RESET") key = K_F2; else
|
||||
if (value == "UNDO") key = K_F3; else
|
||||
if (value == "ADD") { modify_list(TRUE, mask().field(fld), msg); continue; } else
|
||||
if (value == "DEL") { modify_list(FALSE, mask().field(fld), msg); continue; } else
|
||||
if (value == "DIRTY") { mask().field(fld).set_dirty(); continue; }
|
||||
else key = atoi(value);
|
||||
case 0:
|
||||
modify_list(TRUE, mask().field(fld), msg); continue;
|
||||
case 1:
|
||||
key = 11000+'c'; break;
|
||||
case 2:
|
||||
value = copy_value(msg, get()); break;
|
||||
case 3:
|
||||
modify_list(FALSE, mask().field(fld), msg); continue;
|
||||
case 4:
|
||||
mask().field(fld).set_dirty(); continue;
|
||||
case 5:
|
||||
key = 11000+'d'; break;
|
||||
case 6:
|
||||
key = 11000+'e'; break;
|
||||
case 7:
|
||||
key = 11000+'E'; break;
|
||||
case 9:
|
||||
key = 11000+'h'; break;
|
||||
case 10:
|
||||
key = K_SPACE; break;
|
||||
case 11:
|
||||
key = K_F2; break;
|
||||
case 12:
|
||||
key = 11000+'s'; break;
|
||||
case 13:
|
||||
key = K_F3; break;
|
||||
default:
|
||||
key = atoi(value);
|
||||
break;
|
||||
}
|
||||
|
||||
if (key)
|
||||
|
@ -2,6 +2,7 @@
|
||||
#define _FLD_MOV_H
|
||||
|
||||
#define MOV_ANNOES "ANNOES"
|
||||
#define MOV_ANNOIVA "ANNOIVA"
|
||||
#define MOV_NUMREG "NUMREG"
|
||||
#define MOV_DATAREG "DATAREG"
|
||||
#define MOV_TIPO "TIPO"
|
||||
@ -21,8 +22,8 @@
|
||||
#define MOV_STAMPATO "STAMPATO"
|
||||
#define MOV_NUMGIO "NUMGIO"
|
||||
#define MOV_PROVVIS "PROVVIS"
|
||||
#define MOV_OCFPI "OCFPI"
|
||||
#define MOV_CORRLIRE "CORRLIRE"
|
||||
#define MOV_OCFPI "OCFPI"
|
||||
#define MOV_CORRLIRE "CORRLIRE"
|
||||
#define MOV_CORRVALUTA "CORRVALUTA"
|
||||
|
||||
|
||||
|
@ -1 +1 @@
|
||||
#define VERSION 1.0
|
||||
#define VERSION 1.1
|
||||
|
Loading…
x
Reference in New Issue
Block a user