Tentata modifica della gestione delle scrollbar nella finestra di anteprima

git-svn-id: svn://10.65.10.50/trunk@355 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1994-10-12 13:01:07 +00:00
parent 33d18d8089
commit c78072e5c4
2 changed files with 30 additions and 5 deletions

View File

@ -1,4 +1,4 @@
// $Id: relation.cpp,v 1.16 1994-10-11 17:36:31 guy Exp $ // $Id: relation.cpp,v 1.17 1994-10-12 13:01:03 guy Exp $
// relation.cpp // relation.cpp
// fv 12/8/93 // fv 12/8/93
// relation class for isam files // relation class for isam files
@ -661,7 +661,8 @@ FILE* TCursor::open_index(bool create) const
FILE* f = fopen(_indexname, create ? w : r); FILE* f = fopen(_indexname, create ? w : r);
if (f == NULL) if (f == NULL)
fatal_box("Can't use cursor index for file %d: '%s'\n", file().filehnd()->ln, _indexname); fatal_box("Can't use cursor index for file %d: '%s'\n",
file().filehnd()->ln, (const char*)_indexname);
return f; return f;
} }

View File

@ -1180,7 +1180,7 @@ void TViswin::handler (WINDOW win, EVENT * ep)
case SC_PAGE_UP: case SC_PAGE_UP:
if (ep->type == E_VSCROLL) if (ep->type == E_VSCROLL)
{ {
if (origin ().y > 0) if (origin().y > 0)
{ {
kdiff = (int) (_point.y - origin ().y); kdiff = (int) (_point.y - origin ().y);
new_origin = origin ().y > _textrows ? new_origin = origin ().y > _textrows ?
@ -1195,7 +1195,10 @@ void TViswin::handler (WINDOW win, EVENT * ep)
_need_update = FALSE; _need_update = FALSE;
} }
else else
{
beep (); beep ();
update_thumb(-1, 0);
}
} }
else else
{ {
@ -1214,7 +1217,10 @@ void TViswin::handler (WINDOW win, EVENT * ep)
_need_update = FALSE; _need_update = FALSE;
} }
else else
{
beep (); beep ();
update_thumb(0, -1);
}
} }
break; break;
case SC_LINE_UP: case SC_LINE_UP:
@ -1231,7 +1237,10 @@ void TViswin::handler (WINDOW win, EVENT * ep)
_need_scroll = down; _need_scroll = down;
} }
else else
{
beep (); beep ();
update_thumb(-1, 0);
}
} }
else else
{ {
@ -1246,7 +1255,10 @@ void TViswin::handler (WINDOW win, EVENT * ep)
_need_scroll = right; _need_scroll = right;
} }
else else
{
beep (); beep ();
update_thumb(0, -1);
}
} }
break; break;
case SC_PAGE_DOWN: case SC_PAGE_DOWN:
@ -1268,7 +1280,10 @@ void TViswin::handler (WINDOW win, EVENT * ep)
_need_update = FALSE; _need_update = FALSE;
} }
else else
{
beep (); beep ();
update_thumb(-1, _txt.lines()-_textrows-1);
}
} }
else else
{ {
@ -1287,7 +1302,10 @@ void TViswin::handler (WINDOW win, EVENT * ep)
_need_update = FALSE; _need_update = FALSE;
} }
else else
{
beep (); beep ();
update_thumb(255-_textcolumns, -1);
}
} }
break; break;
case SC_LINE_DOWN: case SC_LINE_DOWN:
@ -1304,12 +1322,15 @@ void TViswin::handler (WINDOW win, EVENT * ep)
_need_scroll = up; _need_scroll = up;
} }
else else
{
beep (); beep ();
update_thumb(-1, _txt.lines()-_textrows-1);
}
} }
else else
{ {
_need_update = FALSE; _need_update = FALSE;
if ((origin ().x + _textcolumns) < 255) if ((origin ().x + _textcolumns) < 256)
{ {
if (need_paint_sel (FALSE)) if (need_paint_sel (FALSE))
erase_selection (); erase_selection ();
@ -1319,7 +1340,10 @@ void TViswin::handler (WINDOW win, EVENT * ep)
_point.x++; _point.x++;
} }
else else
{
beep (); beep ();
update_thumb(255-_textcolumns, -1);
}
} }
break; break;
case SC_THUMB: case SC_THUMB:
@ -1332,7 +1356,7 @@ void TViswin::handler (WINDOW win, EVENT * ep)
p.y = ep->type == E_HSCROLL ? origin ().y : ep->v.scroll.pos; p.y = ep->type == E_HSCROLL ? origin ().y : ep->v.scroll.pos;
if ((p.y + _textrows) >= _txt.lines ()) if ((p.y + _textrows) >= _txt.lines ())
p.y = _txt.lines () - _textrows; p.y = _txt.lines () - _textrows -1;
if ((p.x + _textcolumns) >= 255) if ((p.x + _textcolumns) >= 255)
p.x = 255 - _textcolumns; p.x = 255 - _textcolumns;