[APP][15 June 2010] XmlGui 0.0.5.2 - Tool for editing HTC Xml layout file

Search This thread

programatix

Senior Member
May 17, 2005
2,275
111
Hi,

The main reason I wrote this small app is to modify the Xml layout files used in more recent HTC applications. HTC however defined different format of Xml layout files.

Currently, this is what it can do:
  • Change objects' location (attributes involved "x", "y", "loc")
  • Change objects' size (attributes involved "w", "h", "width", "height")
  • Perform object transformation using a multiplicand value
  • Handle sub objects declared in parent object's attribute when parent object is tranformed ("IconImgPos", TextPos")
  • Handle "BgImgBlock" attribute by animating the object
  • Handle "BgImgGrid" attribute by drawing the object correctly
  • Draw object with "IconImgMask" and "IconImage" attributes correctly
  • When changing the position of a parent object, the children object (can be seen in the TreeView) will also be moved. It does not however resize the object control when the parent object is resized. This is by design.

I'll be adding more format to this app when I have some free time.

History:
  • 0.0.1
    • This app currently only support Xml layout files which defined the position attributes as "x", "y", "w", "h". This format is used in Album 3 and Connection Setup.
  • 0.0.2
    • Added support for layout which contain attributes "img", "icon", "pic". This layout is used in FullScreenPlayer.
    • You can now drag and drop a xml file onto it to open.
    • If the "icon" contain different states, it will be animated, each will be displayed for 1 second before rotating to another state.
  • 0.0.3b
    • Added support for layout which contain attributes "Pos", "bgimg", and some I can't remember.
    • Fix a bug in 0.0.3 where it handle the "Pos" attribute incorrectly.
    • Quick fix loading EzInput layout *New*
  • 0.0.4f
    • Recoded most of the code.
    • XmlGui now only draws objects which are marked (checked). If the object is selected, a red border will be drawn on the selected object.
    • Text area will be drawn as blue hatched area.
    • Object with sub object will be resized correctly based on the object.
    • Added ability to move all marked objects.
    • Added ability to resize all marked objects. (see attached thumbnails)
    • Correctly interpret "BgImgGrid" attribute. (0.0.4a)
    • When adjusted single object's height and width, children object now do not resize. (0.0.4a)
    • Animate button "BgImgBlock" attribute. (0.0.4a)
    • Fix drawing text position in "Edit" object. (0.0.4b)
    • Fix moving inner object when object is moved (0.0.4b)
    • Fix drawing object with "BgImgGrid" attribute. (0.0.4c)
    • Fix issue resizing object without the "x" and "y" attributes. (0.0.4d)
    • Fix issue with Pos attribute where each point is not seperated by ",". (0.0.4e)
    • Seperate multiplicand for width and height. (0.0.4f)
    • Fix divide by zero bug. (0.0.4f)
  • 0.0.4g (2 Nov 2009)
    • Fixed loading attributes with space in its value crashing XmlGui.
    • Fixed loading Pos and TextPos attributes with no value crashing XmlGui.
  • 0.0.5 (5 Feb 2010)
    • Fixed saving problem when the attribute of the file is marked "read-only" and/or "system".
    • Selection of selected item in TreeView stays after TreeView lost focus.
    • Added new feature to automatic relocate objects.
      • In "Single-Object Properties" section, clicking on the green left arrow will apply the suggested value for that field. Clicking the "Apply" button applies all the suggested values.
      • In "Multi-Object Move" section, clicking the "Auto Relocate" button will apply the above feature to all selected objects.
    • Bug: If clicking "Auto Relocate" mess things up, try highlighting "root" before clicking it.
  • 0.0.5.1 (6 Feb 2010)
    • Added 1 level "Undo" feature. This is a rough implementation, so after pressing undo button, the TreeView would lost its selection.

  • 0.0.5.2 (15 June 2010)
    • Fixed crash caused by negative value.

Note:
  • XmlGui requires .NET Framework 3.5.
  • If XmlGui can't open the xml file, edit it with any text editor and remove the first line. Save and reopen in XmlGui.
  • Please be aware that HTC does not resize all images according to the size stated in the xml file. Take for example the HTCFramework package. The htccalendar_bg_green.png is resized in the calendar, but is not resize when you select a day. The background and the buttons (Set and Cancel) are also not resized. So, the only way around this is also to resize (or crop) the images yourself.

Contribution:
I'm very grateful for the donation given. Thank you very much. It would encourage me to add more new automate features to it too.
  • Noonski
  • francarl
 

Attachments

  • XmlPreview1.jpg
    XmlPreview1.jpg
    91.2 KB · Views: 3,754
  • XmlPreview2.jpg
    XmlPreview2.jpg
    85.4 KB · Views: 2,289
  • XmlGui0.0.4f.zip
    66.8 KB · Views: 525
  • XmlGui0.0.4g.zip
    66.9 KB · Views: 454
  • XmlGui0.0.5.zip
    70.6 KB · Views: 101
  • XmlGui0.0.5.1.zip
    72.4 KB · Views: 622
  • XmlGui0.0.5.2.zip
    91.1 KB · Views: 834
Last edited:

programatix

Senior Member
May 17, 2005
2,275
111
Ported Packages using XmlGui

VGA

QVGA

Goodies

XML-GUI Shared Folder
  • Folder - Everybody can upload and download files here.
 
Last edited:

12aon

Retired Senior Moderator
Mar 24, 2008
2,437
483
So if I would want to port a newer version of connection setup or album this tool would be all I need?

Any other apps you that use xml for layout?

Nice one, 12
 

programatix

Senior Member
May 17, 2005
2,275
111
So if I would want to port a newer version of connection setup or album this tool would be all I need?

Any other apps you that use xml for layout?

Nice one, 12

Yes. Just modify the .xml files in the packages and the apps are resized correctly. Of course if you want to maintain the aspect ratio of the background (if used), you'll need to crop it first (by cutting some part away) using any imaging software you prefer. Btw, I've already ported Connection Setup layout to VGA here (http://xdaforums.com/showpost.php?p=4385330&postcount=1926)

To see what other HTC apps that uses xml, just search for the xml files in your packages. If they are there, then it uses the xml files as layout. The hard part is, there are different format available. I'm thinking of finding all the different format used and put them in the XmlGui.
 
Last edited:
C

conflipper

Guest
Tested on Leo New Contact Card, and it couldnt read any of the values.

Great tool, will come in handy, keep up the good work.
 

l3v5y

Retired Senior Moderator
Sep 13, 2007
7,485
44
32
Bristol
Great idea for a tool! :)

Will be very useful with more WVGA stuff coming out...
 

c_shekhar

Inactive Recognized Developer
Jun 7, 2005
1,979
40
Great idea.
One day it shall become a big tool for porting the utility from one device to another.
Keep going bro!!
 

l3v5y

Retired Senior Moderator
Sep 13, 2007
7,485
44
32
Bristol
Attached is a file it has trouble with from HTCMagnifier package from the Leo (I've also included the images from that package).

Hope this is useful somehow...

Thanks!
 

Attachments

  • Files.zip
    30.8 KB · Views: 62

programatix

Senior Member
May 17, 2005
2,275
111
Tested on Leo New Contact Card, and it couldnt read any of the values.

Great tool, will come in handy, keep up the good work.

Wow, nice to know that Leo New Contact Card uses xml for its layout. Can you post the package for it? I have slow connection, so prefer not to download the whole Leo packages.

Thanks in advance.
 

programatix

Senior Member
May 17, 2005
2,275
111
Attached is a file it has trouble with from HTCMagnifier package from the Leo (I've also included the images from that package).

Hope this is useful somehow...

Thanks!

XmlGui 0.0.3 should be able to handle it now. Since you didn't post the whole package, I can't test whether it loaded all the images correctly... but it should.
 

programatix

Senior Member
May 17, 2005
2,275
111

Thanks.

Attached is the resized xml to VGA for it.

I've downloaded Leo packages and tried the New Contact Card. Ported it to VGA but so sad that Leo packages seems to support only portrait. No landscape. Further more, it uses the HTCFramework for GUI and it is damn slow.
 
Last edited:

kane159

Senior Member
Jun 16, 2008
871
118
I got an error here....any help??
23-4.jpg

here is all the message
如需叫用 Just-In-Time (JIT) 偵錯的詳細資料,
請參閱本訊息結尾處 (而非這個對話方塊) 的資訊。

************** 例外狀況文字 **************
System.FormatException: 輸入字串格式不正確。
於 System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
於 System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
於 System.Convert.ToInt32(String value)
於 XmlGui.Main.DrawElement(XElement element, PaintEventArgs e)
於 XmlGui.Main.EnumerateElement(XElement element, PaintEventArgs e, Boolean direction)
於 XmlGui.Main.EnumerateElement(XElement element, PaintEventArgs e, Boolean direction)
於 XmlGui.Main.EnumerateElement(XElement element, PaintEventArgs e, Boolean direction)
於 XmlGui.Main.pb_Paint(Object sender, PaintEventArgs e)
於 System.Windows.Forms.Control.OnPaint(PaintEventArgs e)
於 System.Windows.Forms.PictureBox.OnPaint(PaintEventArgs pe)
於 System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
於 System.Windows.Forms.Control.WmPaint(Message& m)
於 System.Windows.Forms.Control.WndProc(Message& m)
於 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
於 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
於 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** 已載入的組件 **************
mscorlib
組件版本: 2.0.0.0
Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)
程式碼基底: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
XmlGui
組件版本: 0.0.3.0
Win32 版本: 0.0.3.0
程式碼基底: file:///C:/VIVA/XmlGui.exe
----------------------------------------
System.Windows.Forms
組件版本: 2.0.0.0
Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)
程式碼基底: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
組件版本: 2.0.0.0
Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)
程式碼基底: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
組件版本: 2.0.0.0
Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)
程式碼基底: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Windows.Forms.resources
組件版本: 2.0.0.0
Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)
程式碼基底: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_zh-CHT_b77a5c561934e089/System.Windows.Forms.resources.dll
----------------------------------------
System.Xml.Linq
組件版本: 3.5.0.0
Win32 版本: 3.5.30729.1 built by: SP
程式碼基底: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml.Linq/3.5.0.0__b77a5c561934e089/System.Xml.Linq.dll
----------------------------------------
System.Core
組件版本: 3.5.0.0
Win32 版本: 3.5.30729.1 built by: SP
程式碼基底: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Xml
組件版本: 2.0.0.0
Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)
程式碼基底: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
mscorlib.resources
組件版本: 2.0.0.0
Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)
程式碼基底: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------

************** JIT 偵錯 **************
若要啟用 Just-In-Time (JIT) 偵錯功能,則必須在
此應用程式或電腦的 .config 檔案中,設定
system.windows.forms 區段內的 jitDebugging 值。
且該應用程式也必須在啟用偵錯的狀態下進行
編譯。

例如:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
 
Last edited:
C

conflipper

Guest
very handy because in newer leo and Qilin roms, HTC has converted everything to XML, so all resizing is done that way, so that will be very nice.

something that might be very handy in a program like this, is a VGA button, where it will take the vales and multiply by 0.8, and then it would be an automatic, maybe even do check boxes, to pick the number of boxes you wanted, so say you wanted just 2 or 3, and convert those 2 by 0.8, this would really speed everything up has well

keep up the good work with everything, this has a lot of potential here.
 
Last edited:

programatix

Senior Member
May 17, 2005
2,275
111
I got an error here....any help??

Would be best if you could upload the xml file, or the whole package.

very handy because in newer leo and Qilin roms, HTC has converted everything to XML, so all resizing is done that way, so that will be very nice.

something that might be very handy in a program like this, is a VGA button, where it will take the vales and multiply by 0.8, and then it would be an automatic, maybe even do check boxes, to pick the number of boxes you wanted, so say you wanted just 2 or 3, and convert those 2 by 0.8, this would really speed everything up has well

keep up the good work with everything, this has a lot of potential here.
Will do that when I get all the base thing up first. Newer layout seems has so many attributes for each item. Just need some time to study them.