comboboxes vocab + ui authors, summaries
parent
4c8c1f9626
commit
3cf4f45416
|
@ -46,14 +46,13 @@ mouse-index
|
|||
{ takes-focus? initial: t }
|
||||
focused? ;
|
||||
|
||||
: <table> ( rows renderer -- table )
|
||||
table new-line-gadget
|
||||
swap >>renderer
|
||||
swap >>model
|
||||
f <model> >>selected-value
|
||||
sans-serif-font >>font
|
||||
focus-border-color >>focus-border-color
|
||||
transparent >>column-line-color ;
|
||||
: new-table ( rows renderer class -- table )
|
||||
new-line-gadget swap >>renderer swap >>model
|
||||
f <model> >>selected-value sans-serif-font >>font
|
||||
focus-border-color >>focus-border-color
|
||||
transparent >>column-line-color ;
|
||||
|
||||
: <table> ( rows renderer -- table ) table new-table ;
|
||||
|
||||
<PRIVATE
|
||||
|
||||
|
|
|
@ -36,11 +36,11 @@ M: gadget -> dup make:, output-model ;
|
|||
M: model -> dup , ;
|
||||
M: table -> dup , selected-value>> ;
|
||||
|
||||
: <box> ( models type -- track )
|
||||
[ { } make:make ] dip <track> swap dup [ model>> ] map <product>
|
||||
[ [ f track-add ] each ] dip >>model ; inline
|
||||
: <hbox> ( models -- track ) horizontal <box> ; inline
|
||||
: <vbox> ( models -- track ) vertical <box> ; inline
|
||||
: <box> ( gadgets type -- track )
|
||||
[ { } make:make ] dip <track> swap [ f track-add ] each ; inline
|
||||
: <box*> ( gadgets type -- track ) [ <box> ] [ [ model>> ] map <product> ] bi >>model ; inline
|
||||
: <hbox> ( gadgets -- track ) horizontal <box> ; inline
|
||||
: <vbox> ( gadgets -- track ) vertical <box> ; inline
|
||||
|
||||
! Model utilities
|
||||
TUPLE: multi-model < model ;
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Sam Anklesaria
|
|
@ -0,0 +1 @@
|
|||
Really simple dialog boxes
|
|
@ -0,0 +1 @@
|
|||
Sam Anklesaria
|
|
@ -0,0 +1 @@
|
|||
Easily switch between pages of book views
|
|
@ -0,0 +1 @@
|
|||
Sam Anklesaria
|
|
@ -0,0 +1,22 @@
|
|||
USING: accessors arrays kernel math.rectangles models sequences
|
||||
ui.frp ui.gadgets ui.gadgets.glass ui.gadgets.labels
|
||||
ui.gadgets.tables ui.gestures ;
|
||||
IN: ui.gadgets.comboboxes
|
||||
|
||||
TUPLE: combo-table < table spawner ;
|
||||
|
||||
M: combo-table handle-gesture [ call-next-method ] 2keep swap
|
||||
T{ button-up } = [
|
||||
[ spawner>> ]
|
||||
[ selected-value>> value>> [ swap set-control-value ] [ drop ] if* ]
|
||||
[ hide-glass ] tri drop t
|
||||
] [ drop ] if ;
|
||||
|
||||
TUPLE: combobox < label-control table ;
|
||||
combobox H{
|
||||
{ T{ button-down } [ dup table>> over >>spawner <zero-rect> show-glass ] }
|
||||
} set-gestures
|
||||
|
||||
: <combobox> ( options -- combobox ) [ first [ combobox new-label ] keep <model> >>model ] keep
|
||||
[ 1array ] map <model> trivial-renderer combo-table new-table
|
||||
>>table ;
|
|
@ -0,0 +1 @@
|
|||
Comboxes have a model choosen from a list of options
|
Loading…
Reference in New Issue