Commit d871ed7f authored by claes's avatar claes

Autoscrolling in table object

parent ebf937b9
...@@ -4118,6 +4118,11 @@ int grow_GetSelectedCell( grow_tObject object, int *column, int *row) ...@@ -4118,6 +4118,11 @@ int grow_GetSelectedCell( grow_tObject object, int *column, int *row)
return ((GrowTable *)object)->get_selected_cell( column, row); return ((GrowTable *)object)->get_selected_cell( column, row);
} }
int grow_TableMakeCellVisible( grow_tObject object, int column, int row)
{
return ((GrowTable *)object)->make_cell_visible( column, row);
}
void grow_Convert( grow_tCtx ctx, glow_eConvert version) void grow_Convert( grow_tCtx ctx, glow_eConvert version)
{ {
((GrowCtx *)ctx)->convert( version); ((GrowCtx *)ctx)->convert( version);
......
...@@ -2696,6 +2696,14 @@ typedef GlowTraceData glow_sTraceData; ...@@ -2696,6 +2696,14 @@ typedef GlowTraceData glow_sTraceData;
*/ */
int grow_GetSelectedCell( grow_tObject object, int *column, int *row); int grow_GetSelectedCell( grow_tObject object, int *column, int *row);
//! Check if a cell is visible, and scroll if not.
/*!
\param object Table object.
\param column Cell column.
\param row Cell row.
*/
int grow_TableMakeCellVisible( grow_tObject object, int column, int row);
void grow_Convert( grow_tCtx ctx, glow_eConvert version); void grow_Convert( grow_tCtx ctx, glow_eConvert version);
//! Check if a nodeclass is extern. //! Check if a nodeclass is extern.
......
...@@ -250,6 +250,24 @@ void GrowScrollBar::nav_erase( GlowTransform *t, void *node) ...@@ -250,6 +250,24 @@ void GrowScrollBar::nav_erase( GlowTransform *t, void *node)
glow_eDrawType_LineErase); glow_eDrawType_LineErase);
} }
double GrowScrollBar::set_value( double value, double length)
{
bar_value = value;
if ( length != 0)
bar_length = length;
if ( bar_value < min_value)
bar_value = min_value;
if ( bar_value > max_value - bar_length)
bar_value = max_value - bar_length;
if ( !fill)
erase();
draw();
return bar_value;
}
void GrowScrollBar::set_range( double min, double max) void GrowScrollBar::set_range( double min, double max)
{ {
max_value = max; max_value = max;
......
...@@ -146,10 +146,9 @@ class GrowScrollBar : public GrowRect { ...@@ -146,10 +146,9 @@ class GrowScrollBar : public GrowRect {
/*! /*!
\param value Bar value. \param value Bar value.
\param length Bar length. \param length Bar length.
\return The actual new bar value.
*/ */
void set_value( double value, double length) { bar_value = value; bar_length = length; double set_value( double value, double length = 0);
if ( !fill) erase();
draw();};
//! Set the range for the bar value //! Set the range for the bar value
/*! /*!
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment