Hi Guys,

thought you might like this little utility to display a window at a specific
time
(I use it to to remind me to go home at 5:30 and write some more Rebol
programs)

Cheers Phil

(I have attached bay.jpg as it uses it as a bckground ....)


REBOL [
    Title: "messenger"
    Date: 16-Jun-2000
    File: %messenger.r
    Purpose: "Display a Reminder at a specified time"
]

pic: %bay.jpg

scroll-left: function [str] [t-str]
[
    t-char: first str
    t-str: remove str
    t-str: join t-str t-char
    return t-str
]

l-test: stylize 
    [ 
        ltext text [font: [align: 'right size: 60 color: 255.255.0]]
    ]

f-disp-msg: function [t-mess] []
[
    t-mess: join "...." [t-mess "...."]
    view/new layout 
    [
        styles l-test
        backdrop pic effect [gradcol 1x1 0.0.80 100.0.0 fit]
        time: ltext t-mess
        with 
        [
            rate: 2
            feel: make feel 
            [
                engage: func [face action event i] 
                [
                    face/text: scroll-left face/text
                    show face
                ]
            ]
        ]
    ]
]


f-wait: function [i-time t-mess] [u-time t-time tm-time]
[
    t-time: join "Waiting until " i-time
    u-time: to-time i-time
    
    view/new layout 
    [
        backdrop pic effect [gradcol 1x1 0.0.80 100.0.0 fit] 
        c-time: text "Time : 00:00:00"
        with 
        [
            rate: 1
            feel: make feel 
            [
                engage: func [face action event i] 
                [
                    if u-time < now/time
                    [
                        unview/all
                        f-disp-msg t-mess
                    ]
                    ; show current time
                    tm-time: to-string now/time
                    either (length? tm-time) < 6 
                        [c-time/text: join "Time : " [tm-time ":00"]]
                        [c-time/text: join "Time : " tm-time]
                    show face
                ]
            ]
        ]
        text t-time
    ]
]


t-time: to-string now/time

view layout
[
    backdrop pic effect [gradcol 1x1 0.0.80 100.0.0 fit]
    t-mess: field ""
    t-time: field t-time 60x24
    button "OK" 60x24 
        [
                system/view/vid/vid-feel/focus none
            unview/all
            f-wait t-time/text t-mess/text
        ]
]

bay.jpg

Reply via email to