Risolto (elegantemente) il problema del funzionamento dei tasti PgUp e PgDn
(PG su e giu' a velocita' variabile) con maschere contenenti spreadsheet nelle pagine successive alla prima. git-svn-id: svn://10.65.10.50/trunk@696 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
f86f671813
commit
f8ca78abbf
@ -468,7 +468,6 @@ void TExpression::eval()
|
|||||||
o1 = (real&) evalstack.pop();
|
o1 = (real&) evalstack.pop();
|
||||||
evalstack.push(pow(o1, o2));
|
evalstack.push(pow(o1, o2));
|
||||||
break;
|
break;
|
||||||
case _min:
|
|
||||||
o2 = (real&)evalstack.pop();
|
o2 = (real&)evalstack.pop();
|
||||||
o1 = (real&)evalstack.pop();
|
o1 = (real&)evalstack.pop();
|
||||||
evalstack.push(fnc_min(o1, o2));
|
evalstack.push(fnc_min(o1, o2));
|
||||||
@ -483,6 +482,14 @@ void TExpression::eval()
|
|||||||
s1.upper();
|
s1.upper();
|
||||||
evalstack.push(s1);
|
evalstack.push(s1);
|
||||||
break;
|
break;
|
||||||
|
case _round:
|
||||||
|
{
|
||||||
|
const int ndec = (int)((real&) evalstack.pop()).integer();
|
||||||
|
o1 = (real&) evalstack.pop();
|
||||||
|
o1.round(ndec);
|
||||||
|
evalstack.push(o1);
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -499,11 +506,12 @@ HIDDEN const char* _s;
|
|||||||
HIDDEN char _tok[81];
|
HIDDEN char _tok[81];
|
||||||
HIDDEN const char* _fntable[] = { "sqrt", "sqr", "exp10", "exp", "log10",
|
HIDDEN const char* _fntable[] = { "sqrt", "sqr", "exp10", "exp", "log10",
|
||||||
"log", "sin", "cos", "tan", "left",
|
"log", "sin", "cos", "tan", "left",
|
||||||
"right", "pow", "min", "max", "mid", "upper", NULL };
|
"right", "pow", "min", "max", "mid", "upper",
|
||||||
|
"round", NULL };
|
||||||
|
|
||||||
HIDDEN TCodesym _fntok[] = { _sqrt, _sqr, _exp10, _exp, _log10, _log,
|
HIDDEN TCodesym _fntok[] = { _sqrt, _sqr, _exp10, _exp, _log10, _log,
|
||||||
_sin, _cos, _tan, _left, _right, _pow,
|
_sin, _cos, _tan, _left, _right, _pow,
|
||||||
_min, _max, _mid, _upper};
|
_min, _max, _mid, _upper, _round};
|
||||||
|
|
||||||
TCodesym TExpression::__gettoken(bool reduct)
|
TCodesym TExpression::__gettoken(bool reduct)
|
||||||
|
|
||||||
@ -695,8 +703,7 @@ TCodesym TExpression::__factor(TCodesym startsym)
|
|||||||
sym = __gettoken();
|
sym = __gettoken();
|
||||||
if (sym == _lpar) sym = __gettoken();
|
if (sym == _lpar) sym = __gettoken();
|
||||||
else break;
|
else break;
|
||||||
if ((sym == _number) || (sym == _variable)) sym = __factor(sym);
|
sym = __expression(sym);
|
||||||
else break;
|
|
||||||
if (sym == _rpar) sym = __gettoken();
|
if (sym == _rpar) sym = __gettoken();
|
||||||
else break;
|
else break;
|
||||||
_code.add(startsym);
|
_code.add(startsym);
|
||||||
@ -705,7 +712,7 @@ TCodesym TExpression::__factor(TCodesym startsym)
|
|||||||
sym = __gettoken();
|
sym = __gettoken();
|
||||||
if (sym == _lpar) sym = __gettoken();
|
if (sym == _lpar) sym = __gettoken();
|
||||||
else break;
|
else break;
|
||||||
if ((sym == _string) || (sym == _variable)) sym = __factor(sym);
|
if ((sym == _string) || (sym == _variable)) sym = __expression(sym);
|
||||||
else break;
|
else break;
|
||||||
if (sym == _rpar) sym = __gettoken();
|
if (sym == _rpar) sym = __gettoken();
|
||||||
else break;
|
else break;
|
||||||
@ -716,15 +723,14 @@ TCodesym TExpression::__factor(TCodesym startsym)
|
|||||||
case _pow:
|
case _pow:
|
||||||
case _min:
|
case _min:
|
||||||
case _max:
|
case _max:
|
||||||
|
case _round:
|
||||||
sym = __gettoken();
|
sym = __gettoken();
|
||||||
if (sym == _lpar) sym = __gettoken(TRUE);
|
if (sym == _lpar) sym = __gettoken(TRUE);
|
||||||
else break;
|
else break;
|
||||||
if ((sym == _number) || (sym == _variable)) sym = __factor(sym);
|
sym = __expression(sym);
|
||||||
else break;
|
|
||||||
if (sym == _comma) sym = __gettoken(TRUE);
|
if (sym == _comma) sym = __gettoken(TRUE);
|
||||||
else break;
|
else break;
|
||||||
if ((sym == _number) || (sym == _variable)) sym = __factor(sym);
|
sym = __expression(sym);
|
||||||
else break;
|
|
||||||
if (sym == _rpar) sym = __gettoken();
|
if (sym == _rpar) sym = __gettoken();
|
||||||
else break;
|
else break;
|
||||||
_code.add(startsym);
|
_code.add(startsym);
|
||||||
@ -733,16 +739,14 @@ TCodesym TExpression::__factor(TCodesym startsym)
|
|||||||
sym = __gettoken();
|
sym = __gettoken();
|
||||||
if (sym == _lpar) sym = __gettoken(TRUE);
|
if (sym == _lpar) sym = __gettoken(TRUE);
|
||||||
else break;
|
else break;
|
||||||
if ((sym == _number) || (sym == _variable)) sym = __factor(sym);
|
if ((sym == _string) || (sym == _variable)) sym = __expression(sym);
|
||||||
else break;
|
else break;
|
||||||
if (sym == _comma) sym = __gettoken(TRUE);
|
if (sym == _comma) sym = __gettoken(TRUE);
|
||||||
else break;
|
else break;
|
||||||
if ((sym == _number) || (sym == _variable)) sym = __factor(sym);
|
sym = __expression(sym);
|
||||||
else break;
|
|
||||||
if (sym == _comma) sym = __gettoken(TRUE);
|
if (sym == _comma) sym = __gettoken(TRUE);
|
||||||
else break;
|
else break;
|
||||||
if ((sym == _number) || (sym == _variable)) sym = __factor(sym);
|
sym = __expression(sym);
|
||||||
else break;
|
|
||||||
if (sym == _rpar) sym = __gettoken();
|
if (sym == _rpar) sym = __gettoken();
|
||||||
else break;
|
else break;
|
||||||
_code.add(startsym);
|
_code.add(startsym);
|
||||||
|
@ -22,7 +22,7 @@ enum TCodesym { _invalid, _endsym, _comma, _lpar, _rpar, _variable,
|
|||||||
_chgs, _and, _or, _not, _equal, _match, _noteq, _lt, _gt,
|
_chgs, _and, _or, _not, _equal, _match, _noteq, _lt, _gt,
|
||||||
_lteq, _gteq, _sqrt, _sqr, _exp10, _exp, _log10, _log,
|
_lteq, _gteq, _sqrt, _sqr, _exp10, _exp, _log10, _log,
|
||||||
_sin, _cos, _tan, _left, _right, _pow, _min, _max, _mid,
|
_sin, _cos, _tan, _left, _right, _pow, _min, _max, _mid,
|
||||||
_upper } ;
|
_upper, _round } ;
|
||||||
|
|
||||||
// @DES I tipi di espressioni definiti
|
// @DES I tipi di espressioni definiti
|
||||||
// @T
|
// @T
|
||||||
|
@ -653,7 +653,7 @@ void TMask::set_focus()
|
|||||||
if (pw) show_window(pw, FALSE); // hide old page
|
if (pw) show_window(pw, FALSE); // hide old page
|
||||||
}
|
}
|
||||||
|
|
||||||
set_front_window(f.win());
|
f.highlight();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// $Id: maskfld.cpp,v 1.52 1994-11-24 14:01:01 guy Exp $
|
// $Id: maskfld.cpp,v 1.53 1994-11-28 11:01:17 guy Exp $
|
||||||
#include <xvt.h>
|
#include <xvt.h>
|
||||||
|
|
||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
@ -774,6 +774,10 @@ bool TMask_field::on_key(KEY key)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TMask_field::highlight() const
|
||||||
|
{
|
||||||
|
set_front_window(win());
|
||||||
|
}
|
||||||
|
|
||||||
void TMask_field::set_focus() const
|
void TMask_field::set_focus() const
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $Id: maskfld.h,v 1.12 1994-11-24 14:01:07 guy Exp $ */
|
/* $Id: maskfld.h,v 1.13 1994-11-28 11:01:22 guy Exp $ */
|
||||||
#ifndef __MASKFLD_H
|
#ifndef __MASKFLD_H
|
||||||
#define __MASKFLD_H
|
#define __MASKFLD_H
|
||||||
|
|
||||||
@ -101,6 +101,7 @@ protected:
|
|||||||
|
|
||||||
virtual void create(WINDOW parent);
|
virtual void create(WINDOW parent);
|
||||||
virtual void destroy();
|
virtual void destroy();
|
||||||
|
virtual void highlight() const;
|
||||||
|
|
||||||
virtual const char* get_window_data() const;
|
virtual const char* get_window_data() const;
|
||||||
virtual void set_window_data(const char* data);
|
virtual void set_window_data(const char* data);
|
||||||
|
@ -47,8 +47,6 @@ protected:
|
|||||||
|
|
||||||
TMask_field* cell2field(const XI_OBJ* cell) const;
|
TMask_field* cell2field(const XI_OBJ* cell) const;
|
||||||
void update_rec(int rec);
|
void update_rec(int rec);
|
||||||
void set_focus_cell(int riga, int colonna);
|
|
||||||
|
|
||||||
TMask_field* field(short id) const;
|
TMask_field* field(short id) const;
|
||||||
|
|
||||||
int rec2row(int rec);
|
int rec2row(int rec);
|
||||||
@ -65,6 +63,7 @@ public:
|
|||||||
int insert(int rec);
|
int insert(int rec);
|
||||||
bool destroy(int rec = -1);
|
bool destroy(int rec = -1);
|
||||||
|
|
||||||
|
void set_focus_cell(int riga, int colonna);
|
||||||
void enable(bool on);
|
void enable(bool on);
|
||||||
void enable_column(int col, bool on = TRUE);
|
void enable_column(int col, bool on = TRUE);
|
||||||
void enable_cell(int row, int column, bool on = TRUE);
|
void enable_cell(int row, int column, bool on = TRUE);
|
||||||
@ -323,9 +322,11 @@ void TSpreadsheet::update_rec(int rec)
|
|||||||
|
|
||||||
void TSpreadsheet::set_focus_cell(int riga, int colonna)
|
void TSpreadsheet::set_focus_cell(int riga, int colonna)
|
||||||
{
|
{
|
||||||
|
_firstfocus = FALSE;
|
||||||
set_front_window(win()); // It seems necessary to make xi_set_focus work properly
|
set_front_window(win()); // It seems necessary to make xi_set_focus work properly
|
||||||
|
const int r = rec2row(riga);
|
||||||
XI_OBJ cell;
|
XI_OBJ cell;
|
||||||
XI_MAKE_CELL(&cell, _list, rec2row(riga), colonna);
|
XI_MAKE_CELL(&cell, _list, r, colonna);
|
||||||
xi_set_focus(&cell);
|
xi_set_focus(&cell);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -621,7 +622,7 @@ break;
|
|||||||
switch (ep->type)
|
switch (ep->type)
|
||||||
{
|
{
|
||||||
case E_FOCUS:
|
case E_FOCUS:
|
||||||
if (ep->v.active == FALSE)
|
if (_check_enabled && ep->v.active == FALSE)
|
||||||
{
|
{
|
||||||
const bool ok = (bool)xi_move_focus(_itf);
|
const bool ok = (bool)xi_move_focus(_itf);
|
||||||
if (!ok)
|
if (!ok)
|
||||||
@ -906,14 +907,17 @@ void TSpreadsheet::enable_cell(int row, int column, bool on)
|
|||||||
void TSpreadsheet::enable(bool on)
|
void TSpreadsheet::enable(bool on)
|
||||||
{
|
{
|
||||||
const dword old = xi_get_attrib(_list);
|
const dword old = xi_get_attrib(_list);
|
||||||
const dword att = on ? (old & ~XI_ATR_READONLY) : (old | XI_ATR_READONLY);
|
dword att = on ? (old & ~XI_ATR_NAVIGATE) : (old | XI_ATR_NAVIGATE);
|
||||||
if (old != att)
|
if (old != att)
|
||||||
{
|
{
|
||||||
int num;
|
int num;
|
||||||
XI_OBJ** columns = xi_get_member_list(_list, &num);
|
XI_OBJ** columns = xi_get_member_list(_list, &num);
|
||||||
|
|
||||||
xi_move_focus(_itf); // Set focus to interface
|
xi_move_focus(_itf); // Set focus to interface
|
||||||
|
|
||||||
|
att = on ? (att | XI_ATR_TABWRAP) : (att & ~XI_ATR_TABWRAP);
|
||||||
xi_set_attrib(_list, att);
|
xi_set_attrib(_list, att);
|
||||||
|
|
||||||
for (int col = 1; col < num; col++)
|
for (int col = 1; col < num; col++)
|
||||||
{
|
{
|
||||||
XI_OBJ* column = columns[col];
|
XI_OBJ* column = columns[col];
|
||||||
@ -1164,13 +1168,11 @@ void TSheet_field::force_update(int r)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int TSheet_field::items() const
|
int TSheet_field::items() const
|
||||||
{
|
{
|
||||||
return (int)_sheet->items();
|
return (int)_sheet->items();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int TSheet_field::selected() const
|
int TSheet_field::selected() const
|
||||||
{
|
{
|
||||||
return _sheet->selected();
|
return _sheet->selected();
|
||||||
@ -1181,6 +1183,15 @@ void TSheet_field::set_notify(SPREADSHEET_NOTIFY n)
|
|||||||
_sheet->set_notify(n);
|
_sheet->set_notify(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TSheet_field::highlight() const
|
||||||
|
{
|
||||||
|
#if XVT_OS == XVT_OS_WIN
|
||||||
|
if (items())
|
||||||
|
_sheet->set_focus_cell(0, 1);
|
||||||
|
#else
|
||||||
|
TMask_field::highlight();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void TSheet_field::enable(bool on)
|
void TSheet_field::enable(bool on)
|
||||||
{
|
{
|
||||||
|
@ -24,6 +24,7 @@ protected:
|
|||||||
virtual bool parse_item(TScanner& scanner);
|
virtual bool parse_item(TScanner& scanner);
|
||||||
virtual void create(WINDOW parent);
|
virtual void create(WINDOW parent);
|
||||||
|
|
||||||
|
virtual void highlight() const;
|
||||||
virtual void exchange(bool show_value, const real& n);
|
virtual void exchange(bool show_value, const real& n);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -19,7 +19,9 @@ RCT& resize_rect(short x, short y, short dx, short dy, WIN_TYPE wt, WINDOW paren
|
|||||||
|
|
||||||
void xvt_draw_rect(WINDOW w, const RCT& r, COLOR c1, COLOR c2, short depth = 1);
|
void xvt_draw_rect(WINDOW w, const RCT& r, COLOR c1, COLOR c2, short depth = 1);
|
||||||
|
|
||||||
WINDOW xvt_create_window(WIN_TYPE wt,
|
WINDOW xvt_create_window
|
||||||
|
(
|
||||||
|
WIN_TYPE wt,
|
||||||
short x, short y, short dx, short dy,
|
short x, short y, short dx, short dy,
|
||||||
const char* caption, WINDOW parent,
|
const char* caption, WINDOW parent,
|
||||||
long flags,
|
long flags,
|
||||||
@ -27,7 +29,9 @@ WINDOW xvt_create_window(WIN_TYPE wt,
|
|||||||
long app_data
|
long app_data
|
||||||
);
|
);
|
||||||
|
|
||||||
WINDOW xvt_create_control(WIN_TYPE wt,
|
WINDOW xvt_create_control
|
||||||
|
(
|
||||||
|
WIN_TYPE wt,
|
||||||
short x, short y, short dx, short dy,
|
short x, short y, short dx, short dy,
|
||||||
const char* caption,
|
const char* caption,
|
||||||
WINDOW parent,
|
WINDOW parent,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user