jndcu...@gmail.com wrote:
> what i would've liked to have done
> would be to have one listpresenter which would be shared by the tabs.
I think that you can do it as follows (I assume this still works in D6, I've
only had to do it in D5 so far):
You use a ListPresenter.'Tab View' (/not/ a Presenter.'Card container') to
display the list of tabs. Set the Presenter to be a normal ListPresenter in
#createComponents, set its model to be (say) a list of String names of the tabs
(or rather, a ListModel on a list of Stings), and then listen for its
#selectionChanged. When the selection is changed, you'll have to swap in the
new contents for your (fixed) EditableListView (remembering to do something
sensible with any on-going edits ;-)
From memory, it's a little tricky to get this looking quite right. What I did
was use FramingLayout for the enclosing container. Added my "contents" view as
the first sub-view, and made it cover all but the top 25 pixels of its parent.
Added a ListPresenter.'Tab view' as the /second/ sub-view of the container, and
made it cover the entirety of the parent. The end result is that the TabView
"thinks" it covers the entire parent, but most of its area is actually obscured
by the "contents" view. That looks OK provided you don't have enough tabs to
"wrap" onto more than one line.
If you do need to wrap, then you have two alternatives that I know of:
One is to study the implementation of CardView and work out how in Hell OA have
managed to make that (compound) View manage its tabs so that they wrap
correctly. I have never managed it, but you might, and I would welcome
suggestions ;-)
The other is to send
... baseStyleMask: TCS_MULTILINE set: false
to the ListPresenter's view (the TabView) in your #onViewAvailable or
#onViewOpened, to turn off wrapping in the strip of tabs. Gross, but that's
the best I could come up with for my application :-(
Good luck...
(And Happy 2013 to everybody)
-- chris