181 return False |
181 return False |
182 return True |
182 return True |
183 |
183 |
184 |
184 |
185 class CtxComponent(AppObject): |
185 class CtxComponent(AppObject): |
186 """base class for contextual compontents. The following contexts are |
186 """base class for contextual components. The following contexts are |
187 predefined: |
187 predefined: |
188 |
188 |
189 * boxes: 'left', 'incontext', 'right' |
189 * boxes: 'left', 'incontext', 'right' |
190 * section: 'navcontenttop', 'navcontentbottom', 'navtop', 'navbottom' |
190 * section: 'navcontenttop', 'navcontentbottom', 'navtop', 'navbottom' |
191 * other: 'ctxtoolbar' |
191 * other: 'ctxtoolbar' |
192 |
192 |
193 The 'incontext', 'navcontenttop', 'navcontentbottom' and 'ctxtoolbar' |
193 The 'incontext', 'navcontenttop', 'navcontentbottom' and 'ctxtoolbar' |
194 context are handled by the default primary view, others by the default main |
194 contexts are handled by the default primary view, others by the default main |
195 template. |
195 template. |
196 |
196 |
197 All subclasses may not support all those contexts (for instance if it can't |
197 All subclasses may not support all those contexts (for instance if it can't |
198 be displayed as box, or as a toolbar icon). You may restrict allowed context |
198 be displayed as box, or as a toolbar icon). You may restrict allowed context |
199 as followed: |
199 as follows: |
200 |
200 |
201 .. sourcecode:: python |
201 .. sourcecode:: python |
202 |
202 |
203 class MyComponent(CtxComponent): |
203 class MyComponent(CtxComponent): |
204 cw_property_defs = override_ctx(CtxComponent, |
204 cw_property_defs = override_ctx(CtxComponent, |
205 vocabulary=[list of contexts]) |
205 vocabulary=[list of contexts]) |
206 context = 'my default context' |
206 context = 'my default context' |
207 |
207 |
208 You can configure default component's context by simply giving appropriate |
208 You can configure a component's default context by simply giving an |
209 value to the `context` class attribute, as seen above. |
209 appropriate value to the `context` class attribute, as seen above. |
210 """ |
210 """ |
211 __registry__ = 'ctxcomponents' |
211 __registry__ = 'ctxcomponents' |
212 __select__ = ~no_cnx() |
212 __select__ = ~no_cnx() |
213 |
213 |
214 categories_in_order = () |
214 categories_in_order = () |