 ! Copyright (C) 2008, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors arrays colors colors.constants fry kernel math
-math.rectangles math.order math.vectors namespaces opengl sequences
-ui.gadgets ui.gadgets.scrollers ui.gadgets.status-bar
-ui.gadgets.worlds ui.gestures ui.render ui.pens.solid ui.text ui.commands
-ui.images ui.gadgets.menus ui.gadgets.line-support math.rectangles
-models math.ranges sequences combinators fonts locals strings ;
+math.functions math.rectangles math.order math.vectors namespaces
+opengl sequences ui.gadgets ui.gadgets.scrollers ui.gadgets.status-bar
+ui.gadgets.worlds ui.gestures ui.render ui.pens.solid ui.text
+ui.commands ui.images ui.gadgets.menus ui.gadgets.line-support
+math.rectangles models math.ranges sequences combinators fonts locals
+strings ;
 IN: ui.gadgets.tables
 
 ! Row rendererer protocol

    [ 2drop ]
    if ;

M: table model-changed
    [ nip ] [ initial-selected-index ] 2bi {
        [ >>selected-index drop ]
        [ show-row-summary ]
        [ drop update-selected-value ]
        [ drop relayout ]


: next-page ( table -- )
    1 prev/next-page ;

: valid-row? ( row table -- ? )
    control-value length 1- 0 swap between? ;
