Notepad widget == Description == These markups implement //Notepads// in HOP documents. A //notepad// is a container. It is built using the ++++ constructor. A //notepad// contains a header (++++) and one or several pads (++++). Each //pad// contains a header (++++) which is always visible and a body. The body is only visible when the pad is selected. Only one pad is selected at a time. ~~ Note: ,( :style { font-weight: bold; color: red } [ The markups presented in this page are not yet supported on client side programming. They are only supported on server side.]) == Synopsis == === Server === ( arg ...) ( arg ...) ( arg ...) ( arg ...) === Client === (notepad-select notepad pad [history #t] [callback #f]) (notepad-selection notepad) === Requirements === Client codes using //Notepads// need to load the script ++hop-notepad.js++. They also need to load the ++hop-notepad.css++ style sheet. Hence, documents using //Notepads// must include in their header, the following statement: ( :include "hop-notepad") == Examples == == Server Definitions == === ++++ === ^ attributes ^ type ^ default ^ short description ^ | :id | string | //random// | element identifier. | | :onchange | function | - | a function to invoke on pad selection. | | :history | obj | _ | enables history recording. | | body | element | empty | the body. | This function creates a //notepad//. Its first child can be ++++. Its others children are all ++++. The argument ++:history++ controls whether an history event is associated with selected a tab. When history is enabled, the //back button// of the browser restores previously selected tabs. The history is disabled if ++:history++ is ++#f++. It is enabled if ++:history++ is ++#t++ or if it is not ++#f++ and an ++:id++ value is provided. === ++++ === ^ attributes ^ type ^ default ^ short description ^ | :id | string | //random// | element identifier. | | body | element | empty | the body. | This function creates an optional //notepad// header. === ++++ === ^ attributes ^ type ^ default ^ short description ^ | :id | string | //random// | element identifier. | | :onselect | function | - | a function to invoke on pad selection. | | body | element | empty | the body. | This function creates a //tab//. The first child of //tab// __must__ be a ++++. A //nptab// may be //inlined// or //on-demand//. Inlined nptabs receive their content at creation time. On-demand nptabs ask the server a new content each time they are selected. Tabs body of on-demand //notepad// must use the ++++ markup. === ++++ === ^ attributes ^ type ^ default ^ short description ^ | :id | string | //random// | element identifier. | | body | element | empty | the body. | Creates a tab header. == Client Definitions == === ++(notepad-select notepad tab [history #t] [callback #f])++ === notepad-select ^ arguments ^ type ^ short description ^ | notepad | notepad or string | the notepad. | | tab | tab or string | the tab. | | history | a boolean | enables history. | | callback | #f or a procedure | user callback. | This function selects a //tab// in a //notepad//. * The ++history++ argument, when true, records the selection in the browser history. * The ++callback++ argument can be used to execute a user action after the notepad has been updated. This is useful when some pads are lazy and then update asychronously. === ++(notepad-selection notepad)++ === notepad-selection ^ arguments ^ type ^ short description ^ | notepad | notepad or string | the notepad. | This function returns the currently selected in a //notepad//. == Style == == See also == , notepad-select