Welcome, Guest
Please Login or Register.    Lost Password?

Test for urgent category selection in Todolist.xml
(1 viewing) (1) Guest
Go to bottomPage: 12
TOPIC: Test for urgent category selection in Todolist.xml
#19677
Test for urgent category selection in Todolist.xml 1 Year ago  
Hi,

I have nearly completed desired changes to my skins but am stumped on how to test for whether Urgent category has been selected for a ToDo task in Black_Chromophore.r2skin

The code for the various priorities in todolist.xml is very similar (example below)

<highpriorityitem>
<appearance priority="1" padding="19,0,4,0" element="font.bold10" color="230,225,0,255" effect="NORMAL" align="TOP-LEFT" />
<image element="bitmap.todo.item" origin="TOP-LEFT" x="4" y="0" />
</highpriorityitem


The todo item is a small white ball offset to the left of the todo text.

What I wish to do is test
IF the Urgent category has been selected display icon-small-urgent.png instead of todo-item.png (and place it in the same position)
ELSE show the white ball as normal.

and insert that into each priority code.

I did try to do that in the Elements.xml within the Urgent category. I was able to change the text colour this way BUT (BIG BUT) by using something like
<appearance target="30" layer="0" priority="1" element="bitmap.icon.small.urgent"

showalways="1" />

and changing target to 4 and layers and priority numbers. I was successful in displaying the desired icon.small.png in the todo list BUT it did not replace (or overwrite) the white ball but inserted itself to the right of it as the first item in the todo task summary text.

Rightly or wrongly I enter all my details in the Todo Summary field which can spread over several lines so I ma careful with spacing which is important (as it seems impossible to execute a carriage return in that text field ).

Of course (undesirably) when the small urgent triangle icon is inserted it "pushes" the text slightly to the right and the text wraps incorrectly both in
todo and also my alarm window if there is several lines of todo Summary text.

It seems to me the Urgent categories in elements.xml only recognize the todo items Text margins and inserts its icons within it, Instead of where the actual todo list places its white ball icon.

I did experiment changing the ball icon with the icon.small.urgent in the Todolist.xml High Priority and it replaced the ball ball in the same place but of course I do not wan tan urgent icon next to a High priority todo item UNLESS I have also selected Urgent as well in its category list.

After hours of trial and error I am asking for help on this issue please.

Thanks
Muttley
Fresh Boarder
Posts: 15
graphgraph
User Offline Click here to see the profile of this user
Last Edit: 2013/07/24 03:11 By Muttley.
The administrator has disabled public write access.
 
#19678
Re:Test for urgent category selection in Todolist.xml 1 Year ago  
Rightly or wrongly I enter all my details in the Todo Summary field which can spread over several lines so I ma careful with spacing which is important (as it seems impossible to execute a carriage return in that text field ).
If you want to execute a carriage return in text field, you can use "\n" to do that. Eg: Text1\nText2\nText3 .

It seems to me the Urgent categories in elements.xml only recognize the todo items Text margins and inserts its icons within it, Instead of where the actual todo list places its white ball icon. Yes. In ToDoList, a item is displayed as "White ball (it's a button)" + "Icon (category)" + "Text (summary)", and the categories in elements.xml can only effect (change) the Icon + Text. But, we can use offset="x, y" to repositioning the Icon to overwrite "White ball". Eg:
<appearance target="4" layer="0" priority="100" element="bitmap.icon.small.urgent" showalways="1" offset="-13, 0" />
anoob
Platinum Boarder
Posts: 496
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Location: TaiChung, Taiwan, R.O.C. Birthday: 02/12
The administrator has disabled public write access.
I couldn't speak English! This skin released to Customize.org(Do you want it? Click Picture) Please contact me if interested: jhg5702@gmail.com
 
#19679
Re:Test for urgent category selection in Todolist.xml 1 Year ago  
Hi anoob,

Thanks ever so much for you help.

1) The \n works perfectly wish I had worked that out long ago. Things will be so much easier in future

2) The offset works but has a side effect. It does overwrite the ball (in my case using -18 BUT the text on the same line as the urgent icon still gets displaced a little to the right.

Here are 2 screen shots of 2 dummy records.

1)The first screen shot is with an urgent category and icon.small.urgent and offset-19. The second record is high priority but NO category allocated

2) The second screen shot is with an urgent category BUT WITHOUT icon.small.urgent and offset-19. The second record is high priority but NO category allocated

Any suggestions on how to pull Record 1's first line text back and lined up with lines below it. (and record 2 text)

Kind regards
Muttley
Fresh Boarder
Posts: 15
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#19680
Re:Test for urgent category selection in Todolist.xml 1 Year ago  
Hi anoob,

Thanks ever so much for you help.

1) The \n works perfectly wish I had worked that out long ago. Things will be so much easier in future

2) The offset works but has a side effect. It does overwrite the ball (in my case using -18 BUT the text on the same line as the urgent icon still gets displaced a little to the right.

Here are 2 screen shots of 2 dummy records.

1)The first screen shot is with an urgent category and icon.small.urgent and offset-19. The second record is high priority but NO category allocated

2) The second screen shot is with an urgent category BUT WITHOUT icon.small.urgent and offset-19. The second record is high priority but NO category allocated

Any suggestions on how to pull Record 1's first line text back and lined up with lines below it. (and record 2 text)

Kind regards
Muttley
Fresh Boarder
Posts: 15
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#19681
Re:Test for urgent category selection in Todolist.xml 1 Year ago  
Change the padding tag.
The default padding in target="4" for the urgent category is "10,0,0,3" (left, top, right, bottom). Change the 10 value to a lower or negative value. I think this will also affect the icon's location. Try changing this, then the offset and then both.

From help: "padding - This defines the space that is added around the item. The padding is defined with four (left, top, right, bottom) comma separated values which define the space in pixels for each edge."
Jorge_Luis
Platinum Boarder
Posts: 791
graphgraph
User Offline Click here to see the profile of this user
Gender: Male My Rainlendar Skins Location: Argentina Birthday: 03/15
Last Edit: 2013/07/25 10:30 By Jorge_Luis.Reason: Added help info
The administrator has disabled public write access.
 
#19682
Re:Test for urgent category selection in Todolist.xml 1 Year ago  
OK, I have found the way to do that.
Originally I did not have idea about how to accomplish your needs, because the "offset" parameter only can affect Icon, can not to move text.
But when I back to re-view the Help-File later, I found a parameter indent = "number".
indent - Indents the first line right by the given number of pixels. If the value is negative all the other lines are indented instead.
So, To accomplish your needs, you can modify (below is my all work) :
In todolist.xml :
<item>
<appearance padding="15,0,0,3" element="font.normal" color="255,255,255,255" effect="NORMAL" align="TOP-LEFT" />
<button element="bitmap.todo.item" origin="TOP-LEFT" x="2" y="0" action="Global_ToggleTaskStatus('#GUID#')" tooltip="Mark as completed" />
</item>


In elements.xml :
<appearance target="4" layer="0" priority="100" element="font.bold" color="color.urgent" effect="BORDER" align="TOP-LEFT" padding="2,0,0,3" indent="-12" />
<appearance target="4" layer="0" priority="100" element="bitmap.icon.small.urgent" showalways="1" offset="-2,0" />


Note: If you had not modify the all items of status that in todolist.xml, it still can not work, when the status is overdue, completed or cancelled.
anoob
Platinum Boarder
Posts: 496
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Location: TaiChung, Taiwan, R.O.C. Birthday: 02/12
The administrator has disabled public write access.
I couldn't speak English! This skin released to Customize.org(Do you want it? Click Picture) Please contact me if interested: jhg5702@gmail.com
 
Go to topPage: 12
get the latest posts directly to your desktop