Form non l'occambiato

Invecie viswin l'ocambiata
ecciomesso l'uppdate cuando glie si da il focus


git-svn-id: svn://10.65.10.50/trunk@2647 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
villa 1996-02-28 09:43:52 +00:00
parent 5d08350c49
commit 677751be4d
2 changed files with 35 additions and 37 deletions

View File

@ -3434,7 +3434,7 @@ void TForm::arrange_form()
// _ipy viene assunto uguale per entrambi i posizionamneti // _ipy viene assunto uguale per entrambi i posizionamneti
str_pos = "\017"; // Questo e' 15 in ottale... str_pos = "\017"; // Questo e' 15 in ottale...
for (i=1; i < _ipy; i++) str_pos << "\n"; for (i=1; i < _ipy; i++) str_pos << "\n";
#if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT #if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT
SpoolRow((char *) (const char *) str_pos, str_pos.len()); SpoolRow((char *) (const char *) str_pos, str_pos.len());
#else #else
@ -3454,11 +3454,11 @@ void TForm::arrange_form()
// TString bspc; bspc.fill('\b',str_pos.len()); // Questi servono per tornare indietro... // TString bspc; bspc.fill('\b',str_pos.len()); // Questi servono per tornare indietro...
do do
{ {
#if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT #if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT
SpoolRow((char *)(const char *) str_pos, str_pos.len()); SpoolRow((char *)(const char *) str_pos, str_pos.len());
#else #else
lpt = fopen(device,"w"); lpt = fopen(device,"w");
if (lpt == NULL) fatal_box("Non rieso ad aprire il device %s.",device); if (lpt == NULL) fatal_box("Non riesco ad aprire il device %s.",device);
// fprintf(lpt,"%s",(const char*) bspc); // fprintf(lpt,"%s",(const char*) bspc);
fprintf(lpt,"%s\r",(const char*) str_pos); fprintf(lpt,"%s\r",(const char*) str_pos);
fflush(lpt); fflush(lpt);

View File

@ -1266,7 +1266,8 @@ void TViswin::handler (WINDOW win, EVENT * ep)
static bool ignore = FALSE; static bool ignore = FALSE;
bool tlnk = FALSE; bool tlnk = FALSE;
int kdiff; int kdiff;
long new_origin; long new_origin;
bool scrollated = FALSE;
switch (ep->type) switch (ep->type)
{ {
case E_USER: case E_USER:
@ -1288,7 +1289,7 @@ void TViswin::handler (WINDOW win, EVENT * ep)
if (_txt.lines () > 1l) if (_txt.lines () > 1l)
_need_update = FALSE; _need_update = FALSE;
else else
force_update (); /*force_*/update ();
} }
autoscroll (FALSE); autoscroll (FALSE);
_textrows = TEXTROWS; _textrows = TEXTROWS;
@ -1514,18 +1515,6 @@ void TViswin::handler (WINDOW win, EVENT * ep)
break; break;
case E_MOUSE_MOVE: case E_MOUSE_MOVE:
{ {
/*
if (!_selecting && !_iscross) // no buttons pressed
{
p = ep->v.mouse.where;
if (in_text (p))
{
p.x += (origin ().x - 6);
p.y += (origin ().y - 1);
check_link (&p);
}
}
*/
if (_selecting || _iscross) if (_selecting || _iscross)
{ {
p = ep->v.mouse.where; p = ep->v.mouse.where;
@ -1807,8 +1796,8 @@ void TViswin::handler (WINDOW win, EVENT * ep)
// for failed scrollings // for failed scrollings
if (!_selecting && _need_scroll == none) if (!_selecting && _need_scroll == none)
{ {
check_link (&_point); check_link(&_point);
display_point (); display_point();
} }
} }
break; break;
@ -1818,27 +1807,34 @@ void TViswin::handler (WINDOW win, EVENT * ep)
if (_need_scroll != none) if (_need_scroll != none)
{ {
_need_update = FALSE; _need_update = FALSE;
scrollated = TRUE;
scroll tmp = _need_scroll; scroll tmp = _need_scroll;
_need_scroll = none; _need_scroll = none;
shift_screen (tmp); shift_screen (tmp);
if (!_selecting) if (!_selecting)
{ {
check_link (&_point); check_link(&_point);
display_point (); display_point();
} }
if (_isselection) if (_isselection)
display_selection (); display_selection();
} }
if (ep->type != E_UPDATE || _need_update) if (ep->type != E_UPDATE || _need_update)
TWindow ::handler (win, ep); TWindow::handler(win, ep);
else if (ep->type == E_UPDATE) else if (ep->type == E_UPDATE)
update (); {
if (!scrollated)
_need_update = TRUE;
update();
if (scrollated) display_point();
}
} }
bool TViswin::on_key (KEY key) bool TViswin::on_key (KEY key)
{ {
EVENT_TYPE type = E_USER; EVENT_TYPE type = E_USER;
bool disp = FALSE;
if (_istimer) if (_istimer)
return TRUE; return TRUE;
_timer = xvt_timer_create (win (), 50l); _timer = xvt_timer_create (win (), 50l);
@ -1880,14 +1876,14 @@ bool TViswin::on_key (KEY key)
break; break;
case CTRL_R: case CTRL_R:
_need_update = TRUE; _need_update = TRUE;
check_link (); check_link();
force_update (); force_update();
do_events (); do_events();
check_link (&_point); check_link(&_point);
break; break;
case K_ESC: case K_ESC:
if (_isopen) if (_isopen)
abort_print (); abort_print();
else else
{ {
@ -2009,17 +2005,16 @@ bool TViswin::on_key (KEY key)
dispatch_e_scroll (win(), K_TAB); dispatch_e_scroll (win(), K_TAB);
break; break;
case K_CTRL_UP: case K_CTRL_UP:
dispatch_e_scroll (win(), K_UP); disp = TRUE; dispatch_e_scroll (win(), K_UP);
break; break;
case K_CTRL_DOWN: case K_CTRL_DOWN:
// TBI condizioniamo qui ?? disp = TRUE; dispatch_e_scroll (win(), K_DOWN);
dispatch_e_scroll (win(), K_DOWN);
break; break;
case K_ALT_LEFT: case K_ALT_LEFT:
dispatch_e_scroll (win(), K_LEFT); disp = TRUE; dispatch_e_scroll (win(), K_LEFT);
break; break;
case K_ALT_RIGHT: case K_ALT_RIGHT:
dispatch_e_scroll (win(), K_RIGHT); disp = TRUE; dispatch_e_scroll (win(), K_RIGHT);
break; break;
case K_UP: case K_UP:
case K_SHIFT_UP: case K_SHIFT_UP:
@ -2161,15 +2156,18 @@ bool TViswin::on_key (KEY key)
} }
if (_need_scroll != none) if (_need_scroll != none)
{ {
disp = TRUE;
_need_update = FALSE; _need_update = FALSE;
scroll tmp = _need_scroll; scroll tmp = _need_scroll;
_need_scroll = none; _need_scroll = none;
shift_screen (tmp); shift_screen (tmp);
} }
if (_isselection) if (_isselection)
display_selection (); display_selection ();
check_link (&_point); check_link (&_point);
force_update (); if (!disp)
update();
else display_point();
} }
break; break;
default: default: