| User | Post |
|
5:40 pm August 24, 2008
| beta_user
Junior Member
| | | |
|
| posts 5 |
|
|
Hi,
I am trying to place various items in multiple lines within a single view.
Sample code:
<?xml version=”1.0″?> <Window xmlns=”http://www.chi-tai.info/BatteryStatus” imagesrc=”multi”> <Row name=”0″> <View width=”100″ multi=”1″>
<Item class=”space” type=”value”> <label text=”1″ width=”50″ /> </Item>
<Item class=”space” type=”value”> <label text=”2″ width=”50″ /> </Item>
</View> </Row>
</Window>
The above code makes both items appear in one line. Shouldn't it rather result in two lines, with the “2″ written below the “1″ (equalling a carriage return plus line feed?) and the height of the view matching them?
I can only achieve such positioning by further assigning a “top”-value to the second item, thus shifting the item downwards, and a “left”-value to move it to the left. This however could as well be done without setting the attribute “multi” to “1″ and requires for manual adjustments of the height of the view.
Am I getting this wrong?
I am using v.1.06.333 rc1 build 0333.
|
|
|
5:48 pm August 24, 2008
| Chi-Tai
Admin
| | | |
|
| posts 349 |
|
|
By default the positioning of items is relative, that is left-to-right and one-line (similar to xhtml)
if you want an absolute positioning, you must add the attribute absolute=”3″ to the window-tag (or row or view-tag),
e.g.
<?xml version=”1.0″?> <Window xmlns=”http://www.chi-tai.info/BatteryStatus” imagesrc=”multi” absolute=”3″> <Row name=”0″> <View width=”100″ multi=”1″>
<Item class=”space” type=”value”> <label text=”1″ width=”50″ top=”0″ /> </Item>
<Item class=”space” type=”value”> <label text=”2″ width=”50″ top=”20″ /> </Item>
</View> </Row>
</Window>
If you're coming from rlToday or other theme-xml or if you haven't created xhtml-pages, then using absolute=”3″ is probably more what you're used to.
|
|
|
6:02 pm August 24, 2008
| beta_user
Junior Member
| | | |
|
| posts 5 |
|
|
Actually I don't want to use absolute positioning but relative positioning.
With absolute positioning I would manually define the coordinates and heights, as described. But then I wouldn't need the “multi”-attribute.
I thought the attribute was meant to work as carriage return plus line feed for relative positioning, but it doesn't seem to work like that. What does it do, then?
|
|
|
6:09 pm August 24, 2008
| Chi-Tai
Admin
| | | |
|
| posts 349 |
|
|
according to the manual (http://www.chi-tai.info/cs_batterystatus_xda_neo_wm5_ext_cust_im_cs.htm):
multi specifies if the contained items are placed as multiple lines.
0: (default) View shall be handled as 1 line. 1: Contained Items shall be handled as multiple lines
so.. by default a view is considered as a classical BS/HS-View with any items in one-line..
If you want to place the items anywhere or use several “lines” in one View (e.g. place any items you want into only a one-view-theme), then you should specify multi=”1″.
You don't have to specify multi=”1″, but then the “recognizer” thinks that it's one-line and the items (respectively recognizing the bounding-box of an item) is not recognized correctly.
It's just a performance thing and i may set multi=”1″ as default in future, but don't know yet.
Does that help?
If you have a better description for that attribute, then let me know
|
|
|
6:38 pm August 24, 2008
| beta_user
Junior Member
| | | |
|
| posts 5 |
|
|
Thank you.
So is there anything like a carriage return for items? Something like a row within a view (within a row)?
I would like to place various today plugins on multiple lines within a single view. The first plugin would be TodayAgenda, with variable height. It would be followed by plugin 2 on line 2, plugin 3 on line three and so on. If TodayAgenda expands in height, so should its line-height and the follwing lines should move down accordingly (and vice versa if TodayAgenda shrinks in height). Just like rows behave. Due to the variable height of plugin/line 1 absolute positioning would not work, since setting the vertical position of line 2 manually wouldn't take into consideration the changes of height of line 1.
From reading the manual I had the impression, that the attribute “multi” was what I was looking for, but it obviously wasn't. So right now I don't see any way to build this. Or am I missing some way to do it?
I hope it doesn't sound to confusing. 
|
|
|
7:16 pm August 24, 2008
| beta_user
Junior Member
| | | |
|
| posts 5 |
|
|
A similar issue:
<?xml version=”1.0″?> <Window xmlns=”http://www.chi-tai.info/BatteryStatus” imagesrc=”break”> <Row name=”0″> <View width=”100″ multi=”1″>
<Item class=”space” type=”value”> <label text=”12345678901234567890123456789012345678901234567890″ /> </Item>
</View> </Row>
</Window>
The text, if written on a single line, is taking more space than 100px in width. I would expect it to stay within the boundaries of the view-box and to wrap into a second line (and a third, fourth, … if necessary) when reaching the horizontal limits of a surrounding box (I can define the width of the item to no effect as well).
Since no height is given, I would expect the view to expand in height to fit any number of lines that happen to result from the wrapping.
If it worked like this I could just do this:
<?xml version=”1.0″?> <Window xmlns=”http://www.chi-tai.info/BatteryStatus” imagesrc=”multi”> <Row name=”0″> <View width=”100″ multi=”1″>
<Item class=”space” type=”value”> <label text=”1″ width=”100″ /> </Item>
<Item class=”space” type=”value”> <label text=”2″ width=”100″ /> </Item>
</View> </Row>
</Window>
The second item would then drop into a second line below item 1 (since the boundaries of the view-box are reached) and the height of item 1 would define the vertical position of item 2.
|
|
|
7:46 pm August 24, 2008
| Chi-Tai
Admin
| | | |
|
| posts 349 |
|
|
did you tried the class=”tPlug” with a height=”0″?
according to the manual, it does exactly what you want (i guess)…
for your second question. No even if you don't specify a height-attribute, it gets a value (default or depending on the class you derive).
If you want wordwrap, then consider this thread http://www.chi-tai.info/discuss/xml-themes/about-wordbreak/page-1
your suggestion with adding a width-attribute to the View isn't possible. Actually what you want is similar to have a view as an item. A View has always the width of the screen-size.
I considered adding features like several-views in one View, so to say a wrapping View, but believe me.. that would confuse most of the theme-makers a lot and no one would create themes anymore since it gets too difficult and hard to understand..
It's not because i'm not able to implement it, but more a fact of usability even for theme-makers working on xml. If there is a GUI-tool for creating xml-themes, then such features could enrich theming, but there is no and you have to touch the xml.
I can see that you have not understand the current xml-implementation fully and just imagine that it's more complex than it is now –> wouldn't you give up and say that's too difficult??
A View is a View and should be considered a View with max-width. You can have a View spanned over the whole screen or use multiple Views zoned into one Row or several Rows.. i think having understand this let you easily create themes with powerful concepts and much possibilities.
but.. of course.. i'm open minded and if there are a lot of theme-makers telling me that it's not difficult to understand, then i may reconsider this issue hehe
|
|
|
1:30 am August 25, 2008
| beta_user
Junior Member
| | | |
|
| posts 5 |
|
|
Chi-Tai said:
did you tried the class=”tPlug” with a height=”0″?
Yes. I tried that with “TodayAgenda” and the height of the label (and thus the height of the item) appears to be dynamically adapted to the height of the plugin, as expected.
The problem, though, is to place a second item below the first one with respect to the variable height of the first item.
Let's say the second item was “Wireless” and “TodayAgenda” had a height of 100px. If “Wireless” was put in place with absolute positioning and “top='100'”, it would be obscured when “TodayAgenda” expanded to a height of 150px, because with absolute positioning changes to the first item's height would not affect the second item.
What's missing is an option to place an item on a new line without using absolute positioning, so that it would still be linked to the position and dimensions of the preceding item.
|
|
|
12:49 am August 27, 2008
| Chi-Tai
Admin
| | | |
|
| posts 349 |
|
|
hm.. true.. it's working with a dedicated Row for TodayAgenda.
i can't access the code right now, but you could add this to the feature requests and i'll get back and see how much code and cpu-ticks it would “cost”.
|
|