summaryrefslogtreecommitdiff
path: root/documentation/treeview.mdwn
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2017-02-04 09:41:13 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2017-02-04 09:41:13 +0000
commite7366bf41f68cfe07e9ea03fc4a398baecbae651 (patch)
tree5bb9c3cbe7eab7e70ff1ebd65d9de59a694762df /documentation/treeview.mdwn
downloadnetsurf-wiki-e7366bf41f68cfe07e9ea03fc4a398baecbae651.tar.gz
netsurf-wiki-e7366bf41f68cfe07e9ea03fc4a398baecbae651.tar.bz2
Initial conversion from MediaWiki, 20170204
Diffstat (limited to 'documentation/treeview.mdwn')
-rw-r--r--documentation/treeview.mdwn88
1 files changed, 88 insertions, 0 deletions
diff --git a/documentation/treeview.mdwn b/documentation/treeview.mdwn
new file mode 100644
index 0000000..3f6ecc9
--- /dev/null
+++ b/documentation/treeview.mdwn
@@ -0,0 +1,88 @@
+[[!meta title="Documentation/Treeview"]]
+[[!meta author="James Bursa"]]
+[[!meta date="2010-03-01T02:57:03Z"]]
+
+
+[[!toc]] Using the treeview gadget
+(together with core hotlist/history/cookies/sslcert)
+
+Providing front end specific bits
+---------------------------------
+
+Most of the treeview logic is located in core code but there still are
+some functions that need implementing on the front end side. These
+include:
+
+- Functions marked as front end specific ones and listed at the end of
+
+` tree_url_node.h.`
+
+- Functions in treeview\_table located in tree.h
+
+Additionally the option\_tree\_icons\_dir option should be set. It
+should be pointing at the directory containing the frontend specific
+icon set for the treeview.
+
+During GUI initialisation the following functions should be called:
+
+- cookies\_initialise
+- history\_global\_initialise
+- hotlist\_initialise
+- sslcert\_init
+
+On GUI closure:
+
+- cookies\_cleanup
+- history\_global\_cleanup
+- hotlist\_cleanup
+- no function for sslcert here!
+
+The sslcert tree is created and deleted each time the dialog gets
+invoked. This is done with sslcert\_create\_tree and sslcert\_cleanup.
+Make sure that closing the window with any other method will also
+perform the cleanup.
+
+The remaining functions in the header files of
+hotlist/history/cookies/sslcert have to be connected to the front end
+specific buttons and menu or tool bars.
+
+The front end is responsible for creating the windows and toolbars as
+well as empty core trees passed to the cookies/history/hotlist/sslcert
+initialisation functions. Use the \*\_get\_tree\_flags functions to
+obtain the flags with which the particular tree should be created.
+
+Using the treeview
+------------------
+
+### Creating and modifying the tree structure
+
+- Create an empty tree with tree\_create.
+- Create the necessary folder/leave nodes.
+- Fill the leave nodes with tree\_create\_node\_element and assign
+ content to the elements with tree\_update\_node\_element.
+- Use tree\_link\_node to connect the created nodes in the required
+ structure.
+- With tree\_set\_redraw set the redraw flag on the tree to true, any
+ further changes will result in tree redraws. The flag can be
+ set/unset multiple times.
+- Call tree\_draw to draw the tree for the first time.
+
+### Client -\> Tree communication
+
+To make the tree respond to mouse action, all such has to be passed to
+tree\_mouse\_action and tree\_drag\_end. The mouse coordinates have to
+be given with respect to the tree origin.
+
+### Tree -\> Client communication
+
+Use tree\_set\_node\_user\_callback to provide a callback for any node
+related events. At the moment it can be used for(default behavior for a
+not handled event in brackets):
+
+- handling a node launch (no action)
+- custom node element deletion (free text/bitmap)
+- accepting/rejecting edited text (any text accepted)
+- informing about edit end (no action)
+
+[[!inline raw=yes pages="Documentation"]]
+