#!/bin/rv -s
REBOL [
Title: "The SEA"
Long-Title: "Simple Easy Addressbook"
author: "Ingo Hohmann"
email: ingo@2b1.de
www-home: http://www.h-o-h.org/
date: 31-Oct-2000
file: %the_sea.r
history: [
0.0.9 [ 8-Apr-2001
"renamed to the_sea (Simple Easy Addressbook)"
"Search as pane"
"scrolling to entry after search"
"first / last entry (^s ^f)" "iho" ]
0.0.8 [ 3-Nov-2000 "some clean-ups, search" "iho" ]
0.0.7 [ 31-Oct-2000 "changed 'update to 'updated in data-file" "iho" ]
0.0.6 [ 31-Oct-2000 "added note display" "iho" ]
0.0.5 [ 31-Oct-2000 "added help" "iho" ]
0.0.4 [ 31-Oct-2000 "added add / delete" "iho" ]
0.0.3 [ 30-Oct-2000 "except for persons add works" "iho" ]
0.0.2 [ 29-Oct-2000 "cleaned up" "iho" ]
0.0.1 [ 28-Oct-2000 "first preview" "iho" ]
]
version: first history
version-text: "testing"
comments: {
This is a little address database system, with an NQA Interface
(No Questions Asked) what you type in, will immediately be part
of the database (once save is called on exit,
BTW how can I catch the close event?).
}
known-bugs: [
{no testing if changed file-as already exists}
{no testing if " is present in fields} ; "
{in Communication, when there is not yet any data, you first have to
click the list}
]
todo: [
{a lot of cleanups}
{update 'update}
{sorting}
]
]
;yamm/import %xml-helper.r
do %xml-helper.r
addressbook: make object! [
; %h-o-hs.png
logo: make image! [58x43 #{
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000909096F6F6F7F7F7F212121
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000696969FBFBFBBABABA151515000000000000
000000000000000000151515434343111111000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000292929CCCCCCF1F1F14B4B4B000000000000000000000000000000
161616C2C2C2E3E3E3373737000000000000000000000000000000000000
0000000B0B0B1B1B1B2B2B2B101010000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000020202050505000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000808086A6A6A
F8F8F8BDBDBD0A0A0A0000000000000000000000000A0A0A6E6E6EF9F9F9
8585850101010000000000000000000000000101012F2F2F6D6D6D949494
A1A1A1A4A4A4A3A3A3898989444444030303000000000000000000000000
000000070707454545ACACAC636363000000000000000000000000222222
6E6E6EF0F0F08B8B8B000000000000000000000000000000000000000000
0000000000000000000000000000000000002D2D2D9B9B9BFEFEFE6C6C6C
0000000000000000000000000000003B3B3BB4B4B4E8E8E8282828000000
0000000000000000000909095A5A5A8A8A8AA1A1A1B5B5B5C3C3C3CBCBCB
C4C4C4C6C6C6B6B6B68585851414140000000000000000000B0B0B3C3C3C
474747A5A5A5EAEAEA1313130000000303032D2D2D4343434A4A4AB4B4B4
F3F3F31F1F1F000000000000000000000000000000000000000000000000
0000000000000000000101014B4B4BC1C1C1F2F2F2343434000000000000
000000000000121212595959E0E0E0B8B8B8020202000000000000000000
0606065A5A5A8383839E9E9EBEBEBEDFDFDFB0B0B0656565999999636363
929292BFBFBF8D8D8D0F0F0F000000000000333333434343444444666666
EDEDED6B6B6B0000000909094040404343434444446F6F6FF7F7F77F7F7F
000000000000000000000000000000000000000000000000000000000000
000000151515535353D7D7D7E3E3E3171717000000000000000000000000
313131666666F5F5F57D7D7D0000000000000000000000003E3E3E787878
949494B3B3B3E6E6E6BCBCBC5353534949498383837070704B4B4B767676
B5B5B56D6D6D0000000000001010104444444545454C4C4CC6C6C6C1C1C1
000000000000222222444444454545515151D2D2D2D4D4D4030303000000
000000000000000000000000000000000000000000000000000000272727
565656E1E1E1D8D8D8A5A5A5BEBEBEB3B3B3A4A4A4939393757575767676
FCFCFC7F7F7F4545454848483B3B3B363636676767818181A0A0A0C4C4C4
F7F7F75C5C5C4B4B4B4A4A4A7B7B7B7E7E7E5454544646469F9F9FA4A4A4
2121210000000000003434344646464747479C9C9CF0F0F0121212000000
040404424242464646484848A9A9A9F7F7F7232323000000000000000000
000000000000000000000000000000000000000000333333555555E2E2E2
DADADAF7F7F7FEFEFEFEFEFEFEFEFEFEFEFEDFDFDF878787FDFDFDCDCDCD
EEEEEEF2F2F2EEEEEEEAEAEA8F8F8F8282829C9C9CC4C4C4E7E7E7A7A7A7
A4A4A49C9C9CA5A5A5A7A7A7A3A3A38D8D8D848484A9A9A96464643A3A3A
2F2F2F3838385050504C4C4C7F7F7FFBFBFB3232320000000000002C2C2C
474747484848868686FEFEFE4F4F4F000000000000000000000000000000
000000000000000000000000000000383838525252D9D9D9E0E0E0DFDFDF
F0F0F0F4F4F4F8F8F8FAFAFAF1F1F1818181FCFCFCDFDFDFFEFEFEFEFEFE
FEFEFEFEFEFE9595957C7C7C8A8A8AAAAAAAE4E4E4888888C1C1C1ABABAB
8E8E8E7C7C7C5151515E5E5E8282829A9A9A9B9B9BEDEDEDECECECE8E8E8
CACACA9898987A7A7AFBFBFBADADADAFAFAFA3A3A3999999838383686868
787878FDFDFD717171000000000000000000000000000000000000000000
0000000000000000003737374C4C4CC5C5C5EEEEEE7979797575757A7A7A
8080808484848181816C6C6CF4F4F4B7B7B7AEAEAEB7B7B7BFBFBFC5C5C5
838383777777878787999999C3C3C3B9B9B9F5F5F5D3D3D3B1B1B16C6C6C
4949494949498080809999998B8B8BFFFFFFFEFEFEFFFFFFFEFEFEF4F4F4
848484FAFAFAD9D9D9FFFFFFFFFFFFFEFEFEF6F6F6CCCCCC7D7D7DFAFAFA
808080000000000000000000000000000000000000000000000000000000
000000353535484848A3A3A3FCFCFC6363633535353838383F3F3F444444
4D4D4D595959DEDEDEB7B7B75454545656565959595B5B5B5E5E5E6C6C6C
7D7D7D8181819A9A9ABEBEBEE6E6E6C9C9C9B0B0B06868684949495F5F5F
9191918E8E8E828282B9B9B9C3C3C3CBCBCBD2D2D2C0C0C0898989FCFCFC
CCCCCCEFEFEFF4F4F4F7F7F7FAFAFAE8E8E8848484FCFCFC7E7E7E000000
0000000000000000000000000000000000000000000000000000002B2B2B
474747737373FBFBFB8989890000000000000000000B0B0B4444444A4A4A
B7B7B7E2E2E21414140F0F0F1313132A2A2A515151626262727272707070
7D7D7D8F8F8F9D9D9D8E8E8E9393937070707676768A8A8A8585857B7B7B
5E5E5E5757576262626666666767676363639C9C9CF5F5F5757575777777
8080808686868A8A8A7E7E7E898989FEFEFE6A6A6A000000000000000000
0000000000000000000000000000000000000000001D1D1D464646535353
DBDBDBDEDEDE0B0B0B0000000000000101014141414646467C7C7CFAFAFA
4C4C4C0000000000000909094545455656565A5A5A6161616A6A6A737373
7C7C7C8383838282828282827C7C7C7575757474746767671A1A1A111111
1414141B1B1B414141565656C4C4C4DCDCDC3333333535353B3B3B424242
505050575757A5A5A5FCFCFC464646000000000000000000000000000000
0000000000000000000000000000000A0A0A454545464646979797FDFDFD
616161000000000000000000323232454545525252CFCFCFC4C4C4030303
0000000000002828284646464D4D4D5555555B5B5B616161666666696969
6969696A6A6A6868686363635E5E5E3A3A3A000000000000000000030303
484848656565EEEEEE9C9C9C000000000000000000050505454545555555
CECECEEAEAEA1F1F1F000000000000000000000000000000000000000000
000000000000000000000000393939444444575757CFCFCFCACACA111111
0000000000001B1B1B4444444444446A6A6AA2A2A2383838000000000000
0202023434344545454A4A4A4F4F4F5353535656565858585A5A5A595959
575757535353414141050505000000000000000000161616525252A4A4A4
F4F4F44242420000000000000000001212124E4E4E6C6C6CF3F3F3BABABA
030303000000000000000000000000000000000000000000000000000000
0000000000001C1C1C4343434242424242423E3E3E0F0F0F000000000000
0303033E3E3E424242424242393939080808000000000000000000040404
2F2F2F4343434646464949494B4B4B4E4E4E4D4D4D4C4C4C4A4A4A363636
060606000000000000000000000000393939606060C3C3C3A3A3A3060606
0000000000000000002C2C2C535353AFAFAFFBFBFB5E5E5E000000000000
000000000000000000000000000000000000000000000000000000000000
0202022D2D2D313131353535131313000000000000000000000000101010
1A1A1A202020070707000000000000000000000000000000000000151515
313131414141444444464646434343343434181818000000000000000000
0000000000001010104A4A4A4242423939390E0E0E000000000000000000
0202024C4C4C707070E7E7E7CBCBCB121212000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000020202
111111090909020202000000000000000000000000000000000000000000
1B1B1B2A2A2A2525250404040000000000000000000000002525254B4B4B
4343433F3F3F1E1E1E000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000303032F2F2F3434342F2F2F080808
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000
}]
doc: {This object encapsulates the address database}
xml-data-block: block! ; parse-xml created block of blocks
addressdb-block: block! ; addressdb block in xml-data-block
current-data-block: block! ; is set to the block containing the current data
current-data-pos: 0 ; position of current-data in addressdb-block
current-address-pos: 1 ; position in addressdb-block list
current-comm-pos: 1 ; position in communication list
current-sub-pos: 1 ; set to either current-comm-pos or current-address-pos
current-view-name: string! ; the tag name of the currently shown data ["person" "address" "comm"]
add-new-data?: false ; true, if a lists last position is shown (don't change data)
current-view: none ; function to show current view
current-fields: ; fields shown in current view
names: copy [] ; list of names for main list
last-search: "" ; string that has last been searched for
name-l: none ; text-list for names
xml-data-file: %address.xml
current-view: function! ; function to show the current view
; helper
intercept: func ["intercept a block with values" blk [block!] val /local i][
blk: copy blk
for i ((length? blk) + 1) 2 -1 [insert at blk i copy ""]
blk
]
; todo: error handling
; xml-data-block: copy [document none [["addressdb" none [["data" ["file-as" "new-data"] [["person" ["name" none] none]]]]]]] ; copy an empty database
load-xml: func [
"load xml data file and parse it"
] [
if error? try [xml-data-block: trim-xml parse-xml read xml-data-file] [
xml-data-block: trim-xml parse-xml {
Here comes a note
}
]
addressdb-block: xml-data-block/3/1/3
]
save-xml: func ["save xml data"] [
write xml-data-file xdump xml-data-block
]
;layouts
person-layout: [
backdrop blue effect [gradient -1x-1 0.100.0 border 2]
across
text bold "Personal"
text "Address" #"^A" [leave show-address]
text "Communication" #"^O" [leave show-comm]
text "Notes" #"^N" [leave show-note]
return
tabs 110
text "Filed as" [create-names] tab file-as: field updated: text 200x20 return
text "Name" tab first-name: field return
text "Last" tab last-name: field return
text "Nickname" tab nick-name: field return
text "Middle" tab middle-name: field return
text "Prefix" tab name-prefix: field return
text "Suffix" tab name-suffix: field return
text "Birthday" tab birthday: field return
tab tab tab button "Delete" [delete-data]
]
address-layout: [
backdrop 0.0.0 effect [ key 0.0.0 ]
across
text "Personal" #"^P" [leave address-fields show-person]
text bold "Address"
text "Communication" #"^O" [leave address-fields show-comm]
text "Notes" #"^N" [leave show-note]
return
tabs 110
text "extended" tab extended: field here: at return
text "street" tab street: field return
text "postal-code" tab postal-code: field return
text "city" tab city: field return
text "region" tab region: field return
text "post-office" tab post-office: field return
text "Country" tab country: field return
text "Type" tab attr: field return
at here address-list: text-list [
leave
current-address-pos: index? find address-list/data value
add-new-data?: either current-address-pos = length? address-list/data [true][false]
show-address
]
return
tab tab tab button "Delete" [delete-data]
]
comm-layout: [
backdrop effect [ key ]
across
text "Personal" #"^P" [leave comm-fields show-person]
text "Address" #"^A" [leave comm-fields show-address]
text bold "Communication"
text "Notes" #"^N" [leave show-note]
return
tabs 110
text "Value" tab value: field here: at return text "" return
text "Type" tab type: field return
text "Attributes" tab attr: field return
at here comms-list: text-list [
leave
current-comm-pos: index? find comms-list/data value
add-new-data?: either current-comm-pos = length? comms-list/data [true][false]
show-comm
]
return
tab tab tab button "Delete" [delete-data]
]
note-layout: [
across
text "Personal" #"^P" [leave comm-fields show-person]
text "Address" #"^A" [leave show-address]
text "Communication" #"^O" [leave show-comm]
text bold "Notes" #"^N"
return
note: area 450x300
return
tab tab tab button "Delete" [delete-data]
]
note-fields: copy [ note ]
help-layout: [
help-text: area 450x350 para [tabs: 20]
across
button "View" [show-help/topic 'howto-view]
button "Update" [show-help/topic 'howto-update]
button "misc" [show-help/topic 'howto-misc]
tab
button "Close help" [current-view]
]
search-layout: [
search-string: field last-search
across
button "ok" #"^M" [do-search search-string/text current-view]
button "cancel" #"^C" [current-view]
do [focus search-string]
]
; lists of fields, to set/get them easily
person-fields: copy []
forall person-layout [
if all [ set-word? person-layout/1 'field = person-layout/2 ] [
append person-fields to-word person-layout/1
]
]
person-layout: head person-layout
person-fields: next person-fields ; assuming 'file-as is first field
address-fields: copy []
forall address-layout [
if all [ set-word? address-layout/1 'field = address-layout/2 ] [
append address-fields to-word address-layout/1
]
]
address-layout: head address-layout
comm-fields: copy []
forall comm-layout [
if all [ set-word? comm-layout/1 'field = comm-layout/2 ] [
append comm-fields to-word comm-layout/1
]
]
comm-layout: head comm-layout
;
; display functions
;
show-person: func ["displays the name data"][
disp/pane: layout/offset person-layout 0x0
current-view: :show-person
current-view-name: "person"
current-fields: :person-fields
foreach pos current-data-block/3 [
if pos/1 = "person" [
foreach [attr val] pos/2 [
set in get to-word attr 'text val
]
break
]
]
file-as/text: second find current-data-block/2 "file-as"
updated/text: second find current-data-block/2 "updated"
show disp
]
current-view: :show-person
current-fields: person-fields
show-address: func [
"displays address data"
/local addr-pos
][
current-view: :show-address
current-view-name: "address"
current-fields: :address-fields
disp/pane: layout/offset address-layout 0x0
addr-pos: 0
clear address-list/data
foreach pos current-data-block/3 [
if all [pos/1 = "address" block? pos/2] [
addr-pos: addr-pos + 1
append address-list/data rejoin [
select pos/2 "postal-code" "," select pos/2 "city" "," select pos/2 "street"
]
if addr-pos = current-address-pos [
foreach [attr val] pos/2 [
set in get to-word attr 'text val
]
]
]
]
append address-list/data ""
append address-list/picked pick address-list/data current-address-pos
show disp
]
show-comm: func [
"displays communication data"
/local comm-pos
][
current-view: :show-comm
current-view-name: "comm"
current-fields: :comm-fields
disp/pane: layout/offset comm-layout 0x0
comm-pos: 0
clear comms-list/data
foreach pos current-data-block/3 [
if all [pos/1 = "comm" block? pos/2] [
comm-pos: comm-pos + 1
append comms-list/data rejoin [
select pos/2 "value"
either not none? select pos/2 "attr" [rejoin [", " select pos/2 "attr"]][""]
]
if comm-pos = current-comm-pos [
foreach [attr val] pos/2 [
set in get to-word attr 'text val
]
]
]
]
append comms-list/data ""
append comms-list/picked pick comms-list/data current-comm-pos
show disp
]
show-note: func [
"displays the note"
/local found?
][
disp/pane: layout/offset note-layout 0x0
current-view: :show-note
current-view-name: "note"
current-fields: :note-fields
found?: false
foreach pos current-data-block/3 [
if pos/1 = "note" [
if none? pos/3 [
change at pos 3 [""]
]
note/text: pos/3/1
found?: true
break
]
]
if not found? [
append/only current-data-block/3 copy/deep compose [(current-view-name) none [""]]
pos: back tail current-data-block/3
note/text: pos/1/3/1
]
file-as/text: second find current-data-block/2 "file-as"
updated/text: second find current-data-block/2 "updated"
show disp
]
show-help: func [
"displays the help screen"
/topic "show specific help-text"
show-this [word!] "the topic string"
][
disp/pane: layout/offset help-layout 0x0
help-text/text: trim/auto any [
if 'howto-view = show-this [ {
HOWTO -- View Data:
- Change between views
Click on Person / Address / Communication, respectively
- Show different Persons data:
Use up / down cursor keys, or click with the mouse
- Show different Address / Communication:
Click in the list
} ]
if 'howto-update = show-this [ {
HOWTO -- Update data:
- Update data:
just change data in the fields as you like
- Delete data:
hit the delete key, if you are on the "Person"
screen, the complete person will be deleted,
in other screens, the data shown at the moment.
- Add new data:
click the last (empty) position in any list, a
new data-set will be added
- Update data on disk:
Currently data on disk will only be updated once
you click the "Save & Exit" Button
} ]
if 'howto-misc = show-this [ {
HOWTO -- Miscallenous:
- Send feedback:
Click on my email address
KNOWN-BUGS
- can't handle " input ; "
- can't handle if "file-as" is changed to a value already present
- You have to click lists, when they are empty
} ]
rejoin [
" " system/script/header/title " help" newline newline
" This is Ver. " System/script/header/version " " System/script/header/version-text{ of "} ; "
system/script/header/title {" the "} system/script/header/long-title {".}
{
This addressbook has features an NQA/WYSIWYG User Interface, that means
NQA:
^-No Questions Asked -> You'll never get asked if you
^-_really_ want to do that
WYSIWYG:
^-Data you see on the screen is in the database
^-(except for an update (and implementation) timelag)
Author: ^-Ingo Hohmann " [send-text/to ingo@2b1.de]
tab button "Help" [show-help] tab tab button "Save & Exit" [leave save-xml unview/all halt]
sensor #"^X" [
show-popup search-layout: layout [
search-string: field last-search
across
button "ok" #"^M" [do-search search-string/text] ; unview/only search-layout]
button "cancel" #"^C" [hide-popup show self]
do [focus search-string]
]
]
sensor #"^S" [
show-search
]
sensor #"^F" [leave set-current-data 1 name-l/sn: 0 name-l/sld/data: 0 show name-l current-view]
sensor #"^L" [
leave
set-current-data (length? names) - 1
name-l/sn: (length? names) - name-l/lc + 1
name-l/sld/data: 1
show name-l
current-view
]
]
set-current-data 1
current-view
view main
]
]
addressbook/load-xml
addressbook/start