From 23df83befddfacb19000840e7b70888aa12026da Mon Sep 17 00:00:00 2001 From: kohait Date: Mon, 25 Oct 2010 14:18:48 +0000 Subject: [PATCH] uppsrc: CtrlDesignConcepts$en-us.tpp git-svn-id: svn://ultimatepp.org/upp/trunk@2819 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- .../srcdoc.tpp/AboutChameleon$en-us.tpp | 2 +- .../srcdoc.tpp/CtrlDesignConcepts$en-us.tpp | 139 ++++++++++++++++++ 2 files changed, 140 insertions(+), 1 deletion(-) create mode 100644 uppsrc/CtrlCore/srcdoc.tpp/CtrlDesignConcepts$en-us.tpp diff --git a/uppsrc/CtrlCore/srcdoc.tpp/AboutChameleon$en-us.tpp b/uppsrc/CtrlCore/srcdoc.tpp/AboutChameleon$en-us.tpp index e0e1361e8..2cf8bf68b 100644 --- a/uppsrc/CtrlCore/srcdoc.tpp/AboutChameleon$en-us.tpp +++ b/uppsrc/CtrlCore/srcdoc.tpp/AboutChameleon$en-us.tpp @@ -227,4 +227,4 @@ the uppsrc :)]&] underlying code ][/2 is][2 complicated so it`'s difficult to work out documentation.]&] [s0;2 &] -[s0;2 ] \ No newline at end of file +[s0; ] \ No newline at end of file diff --git a/uppsrc/CtrlCore/srcdoc.tpp/CtrlDesignConcepts$en-us.tpp b/uppsrc/CtrlCore/srcdoc.tpp/CtrlDesignConcepts$en-us.tpp new file mode 100644 index 000000000..cd96bb60d --- /dev/null +++ b/uppsrc/CtrlCore/srcdoc.tpp/CtrlDesignConcepts$en-us.tpp @@ -0,0 +1,139 @@ +topic "Ctrl Design Concepts"; +[ $$0,0#00000000000000000000000000000000:Default] +[{_}%EN-US +[s0; [*R6 Ctrl Design Concepts]&] +[s0; &] +[s0; When developing own Ctrl`'s one often is `'reinventing`' the +wheel, because there are common patterns to do in your Ctrl that +Ultimate`+`+ is probably already providing in Ctrl base class. +Thus, knowing the base class and some of its key design concepts +can make your life easier and the development of your Ctrl faster, +while focusing more on the problem than the methods. As always, +the best reference for Ctrl is its source code, which is quite +large, thats why I try to summarize some of the useful things +you can already use. In any case, look at the [C virtual ]functions +in Ctrl to see what is meant to be implemented or used by you. +I won`'t cover LogPos related things here, it is covered in another +documentation.&] +[s0; &] +[s0; Generally, a Ctrl in U`+`+ is helper to visualize some kind +of data. The data, though, is not static, and can be changed +from GUI (point and click) perspective or from API perspective, +using manipulating functions. The difference is, that GUI interaction +should modify the internal data (or state) of Ctrl AND notify +application somehow about change, but modifying it using API +should NOT generate change notifications. This is a very important +design rule that keeps you away from a lot of head ache from +recursive invocations when modifying Ctrl`'s in API.&] +[s0; &] +[s0; [* Ctrl Tree]&] +[s0; &] +[s0; Ultimate`+`+ uses a linked list for all the child Ctrl`'s that +have been Add()ed to it, partaking of its drawing space. The +Ctrl does NOT own its children, but simply references them (Ptr). +They should be owned by your application, somewhere in a U`+`+ +container, i.e. Array