Changeset 112 for widgets/tab-panel.r
- Timestamp:
- 12/31/07 22:18:08 (11 months ago)
- Files:
-
- 1 modified
-
widgets/tab-panel.r (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
widgets/tab-panel.r
r111 r112 2 2 tip: { 3 3 USAGE: 4 tab-panel data [" One" [field] "Two" [fieldfield]]4 tab-panel data ["A" [field] "B" [field] "C" [field]] 5 5 tab-panel data ["1" [field] action [face/color: red] "2" [field]] 6 6 … … 30 30 pane/(data: num)/show?: true 31 31 ][ 32 pane/(tabs + data)/color: colors/widget 32 pane/(tabs + data)/color: colors/theme-dark 33 pane/(tabs + data)/font/color: colors/page 33 34 pane/(data: num)/show?: true 34 pane/(tabs + data)/color: colors/over 35 pane/(tabs + data)/color: colors/page 36 pane/(tabs + data)/font/color: colors/text 35 37 ] 36 38 pane/(data)/action pane/:data … … 40 42 pane/:num: layout/only block 41 43 pane/:num/offset: as-pair 0 either find options 'no-tabs [0] [sizes/line] 42 pane/:num/color: colors/ widget43 pane/:num/edge: default-edge44 pane/:num/color: colors/page 45 pane/:num/edge: outline-edge 44 46 all [title pane/(tabs + num)/text: text] 45 47 if data <> num [pane/:num/show?: false] … … 60 62 tab: layout/only spec 61 63 tab/offset/y: either find options 'no-tabs [0] [sizes/line] 62 tab/color: colors/ widget63 tab/edge: default-edge64 tab/color: colors/page 65 tab/edge: outline-edge 64 66 tab/show?: false 65 67 tab/span: #LV … … 70 72 insert tail pane make subface [ 71 73 offset: tab-offset 72 size: as-pair 1 sizes/line 74 size: as-pair 1 sizes/line + 1 73 75 text: title 74 effect: reduce ['round colors/ edgeeffects/radius sizes/edge]76 effect: reduce ['round colors/outline-light effects/radius sizes/edge] 75 77 data: tabs 76 color: colors/ widget77 font: make default-font [ align: 'center]78 color: colors/theme-dark 79 font: make default-font [color: colors/page align: 'center] 78 80 para: default-para 79 81 feel: make default-feel [ 80 82 over: make function! [face act pos] [ 81 either act [ 82 face/color: colors/over 83 show face 84 ][ 85 all [ 86 face/data <> face/parent-face/data 87 face/color: colors/widget 88 show face 89 ] 83 face/color: either act [colors/theme-light] [ 84 either face/data = face/parent-face/data [colors/page] [colors/theme-dark] 90 85 ] 86 show face 91 87 ] 92 88 engage: make function! [face act event /local p] [ … … 97 93 tab: last pane 98 94 tab/size/x: sizes/line + first size-text tab ; set tab title width 99 tab-offset/x: tab-offset/x + tab/size/x ; set offset for next tab title95 tab-offset/x: tab-offset/x + tab/size/x + 2 ; set offset for next tab title 100 96 ] 101 97 trigger: none … … 119 115 ; show selected tab 120 116 pane/(data: any [select options 'tab 1])/show?: true 121 unless find options 'no-tabs [ pane/(tabs + data)/color: colors/over]117 unless find options 'no-tabs [select-tab data] ;pane/(tabs + data)/color: colors/page] 122 118 all [find options 'action pane/(data)/action pane/:data] 123 119 ]
