Changeset 112

Show
Ignore:
Timestamp:
12/31/07 22:18:08 (11 months ago)
Author:
ashley
Message:

Added pill.r
Scroller fixes
Major color / theme management changes (in progress)

Files:
1 added
43 modified

Legend:

Unmodified
Added
Removed
  • RebDOC.r

    r111 r112  
    66                110     Initial release 
    77                111     References new requestors object 
     8                112     Added  color panel 
    89        } 
    910] 
     
    1314make object! [ 
    1415 
    15         widgets:        find first ctx-rebgui/widgets 'anim 
     16        widgets:        sort find first ctx-rebgui/widgets 'anim 
    1617        requestors:     find first ctx-rebgui/requestors 'alert 
    1718        functions:      find first ctx-rebgui/functions 'append-widget 
     
    5455                                request-progress        [[ 10 [loop 10 [wait .5 step]] ]] 
    5556                                request-spellcheck      [[ make rebface [text: "wordz"] ]] 
    56                                 splash                          [[ [color: ctx-rebgui/colors/window image: load %images/logo.png size: image/size] unview ]] 
     57                                splash                          [[ %images/logo.png unview ]] 
    5758                        ][ 
    5859                                copy "Text." 
     
    6263                        after 1 
    6364                        heading (either object [form word] [uppercase/part form word 1]) 
    64                         panel 150 white data [ 
     65                        panel 150 snow data [ 
    6566                                after 2 
    6667                                label 20 "Source"       link (rejoin [lnk either object [%rebgui-ctx] [word] %.r]) 
     
    7677                        insert tail lay compose/deep [panel 150 data [button 45x15 (form word) [(word) (arg)]]] 
    7778                ] 
    78                 insert tail lay [panel 150 white data [text txt font [name: font-fixed]]] 
     79                insert tail lay [panel 150 snow data [text txt font [name: font-fixed]]] 
    7980                lay: ctx-rebgui/layout/only lay 
    8081                face/pane/1/pane: lay 
    8182                face/pane/1/size: lay/size 
    8283                face/action/on-resize face 
     84                if scroll/picked = 2 [face/pane/2/data: 0] 
    8385                show face 
    8486        ] 
     87 
     88        scroll: none 
    8589 
    8690        do show-tour: make function! [] [ 
    8791                display "RebGUI Documentation" [ 
    8892                        image %images/logo.png tip "RebGUI logo" 
     93                        return 
     94                        label "Scroll:" 
     95                        scroll: radio-group data [1 "Sticky" "Reset"] 
    8996                        return 
    9097                        tab-panel data [ 
     
    96103                                                after 1 
    97104                                                heading "Widgets" 
    98                                                 panel 150 white data [ 
     105                                                panel 150 snow data [ 
    99106                                                        after 2 
    100107                                                        label 20 "Source"       link http://trac.geekisp.com/rebgui/browser/rebgui-widgets.r 
     
    102109                                                        label 20 "Number"       text (form length? widgets) 
    103110                                                ] 
    104                                                 panel 150 white data [ 
     111                                                panel 150 snow data [ 
    105112                                                        text (func-help ctx-rebgui/widgets) font [name: font-fixed] 
    106113                                                ] 
     
    114121                                                after 1 
    115122                                                heading "Requestors" 
    116                                                 panel 150 white data [ 
     123                                                panel 150 snow data [ 
    117124                                                        after 2 
    118125                                                        label 20 "Source"       link http://trac.geekisp.com/rebgui/browser/rebgui-requestors.r 
     
    120127                                                        label 20 "Number"       text (form length? requestors) 
    121128                                                ] 
    122                                                 panel 150 white data [ 
     129                                                panel 150 snow data [ 
    123130                                                        text (func-help ctx-rebgui/requestors) font [name: font-fixed] 
    124131                                                ] 
     
    132139                                                after 1 
    133140                                                heading "Functions" 
    134                                                 panel 150 white data [ 
     141                                                panel 150 snow data [ 
    135142                                                        after 2 
    136143                                                        label 20 "Source"       link http://trac.geekisp.com/rebgui/browser/rebgui-functions.r 
     
    138145                                                        label 20 "Number"       text (form length? functions) 
    139146                                                ] 
    140                                                 panel 150 white data [ 
     147                                                panel 150 snow data [ 
    141148                                                        text (func-help ctx-rebgui/functions) font [name: font-fixed] 
    142149                                                ] 
     
    150157                                                after 1 
    151158                                                heading "Objects" 
    152                                                 panel 150 white data [ 
     159                                                panel 150 snow data [ 
    153160                                                        after 2 
    154161                                                        label 20 "Source"       link http://trac.geekisp.com/rebgui/browser/rebgui-ctx.r 
     
    156163                                                        label 20 "Number"       text (form length? objects) 
    157164                                                ] 
    158                                                 panel 150 white data [ 
     165                                                panel 150 snow data [ 
    159166                                                        text (func-help ctx-rebgui) font [name: font-fixed] 
    160167                                                ] 
     168                                        ] 
     169                                ] 
     170                                "Colors" [ 
     171                                        group-box snow "Theme" data [ 
     172                                                label-size 25x10 
     173                                                text-size -1x10 
     174                                                after 3 
     175                                                label "page"                    pill ctx-rebgui/colors/page                     text "Main background^/Reversed text" 
     176                                                label "text"                    pill ctx-rebgui/colors/text                     text "Normal text" 
     177                                                label "theme-light"             pill ctx-rebgui/colors/theme-light      text "Over / selection background" 
     178                                                label "theme-dark"              pill ctx-rebgui/colors/theme-dark       text "Heading background^/Edit edge" 
     179                                                label "state-light"             pill ctx-rebgui/colors/state-light      text "Temporary state (e.g. button down)" 
     180                                                label "state-dark"              pill ctx-rebgui/colors/state-dark       text "Permanent state (e.g. radio selection)" 
     181                                                label "outline-light"  pill ctx-rebgui/colors/outline-light     text "Info background^/Non-edit edge^/Slider background" 
     182                                                label "outline-dark"    pill ctx-rebgui/colors/outline-dark     text "Informational text" 
    161183                                        ] 
    162184                                ] 
  • functions/get-values.r

    r111 r112  
    11get-values: make function! [ 
    2         "Gets values from input widgets within a display or tab-panel face." 
     2        "Gets values from input widgets within a display or grouping widget." 
    33        face [object!] "Display face" 
    44        /type "Precede each value with its type" 
    55        /local blk 
    66] [ 
    7         if face/type = 'tab-panel [face: face/pane/1] 
     7        all [ 
     8                find [scroll-panel tab-panel] face/type 
     9                face: either block? face/pane [face: face/pane/1] [face/pane] 
     10        ] 
    811        blk: copy [] 
    912        foreach widget face/pane [ 
    1013                if find [ 
    11                         area check check-group drop-list edit-list field group-box password radio-group slider tab-panel table text-list 
     14                        area check check-group drop-list edit-list field group-box password radio-group scroll-panel slider tab-panel table text-list 
    1215                ] widget/type [ 
    1316                        all [type insert tail blk widget/type] 
     
    1619                                find [check check-group slider] widget/type [widget/data] 
    1720                                find [radio-group table text-list] widget/type [widget/picked] 
    18                                 find [group-box tab-panel] widget/type [ 
    19                                         either type [get-input/type widget] [get-input widget] 
     21                                find [scroll-panel group-box tab-panel] widget/type [ 
     22                                        either type [get-values/type widget] [get-values widget] 
    2023                                ] 
    2124                        ] 
  • functions/set-state.r

    r111 r112  
    1414                                face/action: make face/action [on-focus: make function! [face] [false]] 
    1515                                all [face/type = 'edit-list insert tail face/options 'no-click] 
    16                                 colors/widget 
     16                                colors/outline-light 
    1717                        ][ 
    1818                                face/action: make face/action [on-focus: make function! [face] [true]] 
    1919                                all [face/type = 'edit-list remove find face/options 'no-click] 
    20                                 colors/edit 
     20                                colors/page 
    2121                        ] 
    2222                ] 
  • functions/set-values.r

    r111 r112  
    11set-values: make function! [ 
    2         "Puts values into input widgets within a display or tab-panel face." 
     2        "Puts values into input widgets within a display or grouping widget." 
    33        face [object!] "Display face" 
    44        blk [block!] "Block of values (or 'skip)" 
    55        /local val 
    66] [ 
    7         if face/type = 'tab-panel [face: face/pane/1] 
     7        all [ 
     8                find [scroll-panel tab-panel] face/type 
     9                face: either block? face/pane [face: face/pane/1] [face/pane] 
     10        ] 
    811        foreach widget face/pane [ 
    912                if find [ 
    10                         area check check-group drop-list edit-list field group-box password radio-group slider tab-panel table text-list 
     13                        area check check-group drop-list edit-list field group-box password radio-group scroll-panel slider tab-panel table text-list 
    1114                ] widget/type [ 
    1215                        unless 'skip = val: first blk [ 
    1316                                switch/default widget/type [ 
    14                                         check           [widget/data: val] 
    15                                         check-group     [all [block? val insert clear widget/data val]] 
    16                                         group-box       [all [block? val put-input widget copy/deep val]] 
    17                                         radio-group     [widget/select-item to integer! val] 
    18                                         slider          [widget/data: to decimal! val] 
    19                                         tab-panel       [all [block? val put-input widget copy/deep val]] 
    20                                         table           [widget/select-row val] 
    21                                         text-list       [widget/select-row val] 
     17                                        check                   [widget/data: val] 
     18                                        check-group             [all [block? val insert clear widget/data val]] 
     19                                        group-box               [all [block? val set-values widget copy/deep val]] 
     20                                        radio-group             [widget/select-item to integer! val] 
     21                                        scroll-panel    [all [block? val set-values widget copy/deep val]] 
     22                                        slider                  [widget/data: to decimal! val] 
     23                                        tab-panel               [all [block? val set-values widget copy/deep val]] 
     24                                        table                   [widget/select-row val] 
     25                                        text-list               [widget/select-row val] 
    2226                                ][ 
    2327                                        ;       area drop-list edit-list field password 
  • rebgui-ctx.r

    r111 r112  
    112112ctx-rebgui: make object! [ 
    113113 
    114         build:          111 
     114        build:          112 
    115115        view*:          system/view 
    116116        locale*:        system/locale 
     
    193193        span-size: make function! [face [object!] size [pair!] margin [pair!]] [ 
    194194                if face/span [ 
    195                         all [find face/span #L face/size/x: size/x - face/offset/x - margin/x] 
     195                        all [ 
     196                                find face/span #L 
     197                                face/size/x: size/x - face/offset/x - margin/x 
     198                                all [find [drop-list edit-list] face/type face/pane/offset/x: face/size/x - sizes/line + 1] 
     199                        ] 
    196200                        all [find face/span #V face/size/y: size/y - face/offset/y - margin/y] 
    197201                        all [face/old-size <> face/size object? get in face 'action face/action/on-resize face] 
     
    225229 
    226230        ; 
    227         ;       --- (de)select menu face 
    228         ; 
    229  
    230         select-row: make function! [face] [ 
    231                 face/color: colors/menu 
    232                 face/font/color: white 
     231        ;       --- Hilight funcs --- 
     232        ; 
     233 
     234        select-face: make function! [face] [ 
     235                face/color: colors/state-light 
     236                face/font/color: colors/page 
    233237                show face 
    234238        ] 
    235239 
    236         deselect-row: make function! [face] [ 
    237                 face/color: colors/edit 
    238                 face/font/color: black 
     240        deselect-face: make function! [face /fill] [ 
     241                face/color: either fill [colors/page] [none] 
     242                face/font/color: colors/text 
    239243                show face 
    240244        ] 
     
    245249 
    246250        colors: construct/with either exists? %ui.dat [pick load %ui.dat 3] [[]] make object! [ 
    247                 btn-down:                       216.232.255 
    248                 btn-text:                       77.97.133 
    249                 btn-up:                         200.214.251 
    250                 button:                         white 
    251                 edge:                           127.157.185 
    252                 edit:                           white                   ; area, field, password, etc 
    253                 false:                          red                             ; LED, check-box 
    254                 menu:                           49.106.197              ; menu, popup highlight 
    255                 over:                           gold                    ; active button, tab, splitter, etc 
    256                 tooltip-edge:           0.0.0 
    257                 tooltip-fill:           255.255.225 
    258                 tooltip-text:           0.0.0 
    259                 true:                           leaf                    ; radio-group, LED, check-box 
    260                 widget:                         244.243.238 
    261                 window:                         236.233.216             ; used by display.r 
     251                page:                   white 
     252                text:                   black 
     253                theme-light:    195.221.127 
     254                theme-dark:             136.187.0 
     255                state-light:    255.204.127 
     256                state-dark:             255.153.0 
     257                outline-light:  204.204.204 
     258                outline-dark:   136.136.136 
    262259        ] 
    263260 
     
    284281        effects: construct/with either exists? %ui.dat [pick load %ui.dat 12] [[]] make object! [ 
    285282                arrows-together:        false 
    286                 radius:                         7 
    287                 font:                           either font? "verdana" ["verdana"] [font-sans-serif] 
     283                radius:                         5 
     284                font:                           either font? "arial" ["verdana"] [font-sans-serif] 
    288285                fonts:                          sort reduce [font-sans-serif font-fixed font-serif "verdana"] 
    289286                splash-delay:           1 
  • rebgui-layout.r

    <
    r111 r112  
    8787        view-face: make rebface [ 
    8888                pane:           copy [] ; copy needed to prevent "face in more than one pane" errors 
    89                 color:          colors/window 
     89                color:          colors/page 
    9090                effect:         all [not only effects/window] 
    9191                options:        copy [activate-on-show] 
     
    172172                                if attribute-feel [feel: make feel attribute-feel] 
    173173                                ;       action object 
    174                                 if any [action-away action-alt-click action-click action-dbl-click action-edit action-focus action-key action-over action-resize action-scroll action-unfocus] [ 
    175                                         action: make action [] 
    176                                         all [action-focus       action/on-focus:        make function! [face /local var] action-focus] 
    177                                         all [action-unfocus     action/on-unfocus:      make function! [face /local var] action-unfocus] 
    178                                         all [action-resize      action/on-resize:       make function! [face /local var] action-resize] 
    179                                         ;       action block and associated engage feel 
    180                                         if any [action-alt-click action-click action-dbl-click action-edit action-key action-scroll] [ 
    181                                                 all [action-alt-click   action/on-alt-click:    make function! [face /local var] action-alt-click] 
    182                                                 all [action-click               action/on-click:                make function! [face /local var] action-click] 
    183                                                 all [action-dbl-click   action/on-dbl-click:    make function! [face /local var] action-dbl-click] 
    184                                                 all [action-edit                action/on-edit:                 make function! [face /local var] action-edit] 
    185                                                 all [action-key                 action/on-key:                  make function! [face event /local var] action-key] 
    186                                                 all [action-scroll              action/on-scroll:               make function! [face scroll /page /local var] action-scroll] 
    187                                                 unless get in feel 'engage [ 
    188                                                         feel: make feel [ 
    189                                                                 engage: make function! [face act event] [ 
    190                                                                         case [ 
    191                                                                                 event/double-click      [face/action/on-dbl-click face] 
    192                                                                                 act = 'up                       [face/action/on-click face] 
    193                                                                                 act = 'alt-up           [face/action/on-alt-click face] 
    194                                                                                 act = 'key                      [face/action/on-key face event face/action/on-edit face] 
    195                                                                                 act = 'scroll-line      [face/action/on-scroll face event/offset] 
    196                                                                                 act = 'scroll-page      [face/action/on-scroll/page face event/offset] 
     174                                action: make action [] 
     175                                all [action-alt-click action/on-alt-click: make function! [face /local var] action-alt-click] 
     176                                all [action-away        action/on-away:         make function! [face /local var] action-away] 
     177                                all [action-click       action/on-click:        make function! [face /local var] action-click] 
     178                                all [action-dbl-click action/on-dbl-click: make function! [face /local var] action-dbl-click] 
     179                                all [action-edit        action/on-edit:         make function! [face /local var] action-edit] 
     180                                all [action-focus       action/on-focus:        make function! [face /local var] action-focus] 
     181                                all [action-key         action/on-key:          make function! [face event /local var] action-key] 
     182                                all [action-over        action/on-over:         make function! [face /local var] action-over] 
     183                                all [action-resize      action/on-resize:       make function! [face /local var] action-resize] 
     184                                all [action-scroll      action/on-scroll:       make function! [face scroll /page /local var] action-scroll] 
     185                                all [action-unfocus     action/on-unfocus:      make function! [face /local var] action-unfocus] 
     186                                ;       action block and associated engage feel 
     187                                if any [ 
     188                                        get in action 'on-alt-click 
     189                                        get in action 'on-click 
     190                                        get in action 'on-dbl-click 
     191                                        get in action 'on-edit 
     192                                        get in action 'on-key 
     193                                        get in action 'on-scroll 
     194                                ][ 
     195                                        unless get in feel 'engage [ 
     196                                                feel: make feel [ 
     197                                                        engage: make function! [face act event] [ 
     198                                                                case [ 
     199                                                                        event/double-click      [face/action/on-dbl-click face] 
     200                                                                        act = 'up                       [face/action/on-click face] 
     201                                                                        act = 'alt-up           [face/action/on-alt-click face] 
     202                                                                        act = 'key                      [ 
     203                                                                                face/action/on-key face event 
     204                                                                                face/action/on-edit face 
    197205                                                                        ] 
     206                                                                        act = 'scroll-line      [face/action/on-scroll face event/offset] 
     207                                                                        act = 'scroll-page      [face/action/on-scroll/page face event/offset] 
    198208                                                                ] 
    199209                                                        ] 
    200210                                                ] 
    201211