Forum  Commercial Foru...  Commercial Foru...  Theme?
Previous Previous
 
Next Next
New Post 12/9/2010 1:05 PM
  palli
14313 posts
1st Level Poster




Re: Theme? 

Hi Joe and James,

You are pretty much correct on your assumptions here, and the Theme designer is a great tool to verify that you are.

The way this works is that if you create a custom control with some specific XSLT, that is the default  XSLT that would be used for that control, until it's themed, meaning that if you don't change it in your theme, the default control's data will be used.

You can see the default XSLT inside of the Default theme, where you can get a copy of it if needed.

When you do want to change the XSLT of a TextBox for instance, for your custom control, you have to use some property (or other means) of distinguishing between the standard TextBox (or other derivatives) and your own custom control.... more precisely, you want your new XSLT to only apply to your control. The most usual method to do this, is to use CustomStyle property. See more on the Custom controls wiki page.

You can also use the "Skinable Controls" item templates for this. You should find them if you add new item to the solution explorer, and they should be in a folder below the Visual WebGui item templates. The skinable controls provide you with a skeleton to call some predifined XSLT templates with parameters you can adjust, or you can change the XSLT completely. The skinable controls use CustomStyle to distinguish between controls.

Hope this helps,

Palli

 


Páll Björnsson - Visual WebGui support team - Email: support@visualwebgui.com
 
New Post 12/14/2010 11:44 AM
  jharmon@blinfo.com
853 posts
1st Level Poster




Re: Theme? 

Palli,

Do you have any documentation that explains how to create custom controls.  Especially in the naming of your XSL templates, etc.  I am having a hard time looking at the XSL when it points to some template that is not even in the XSLT that I am looking at.  Maybe this is the "Skinable Controls" item templates that you mentioned in the previous post.  I know I can create a CustomStyle to load the appropriate template but am confused as to what gets loaded by default.

This is all very confusing and I really need to customize some of the built-in controls in order to get the functionality we need.  I have made minor changes to controls (added properties, javascript, and XSL changes) and they seem to be working but take the scheduleBox control, I can see VWG is setting the row height by using a style attribute on the tr tag:

<

tr style="height:[Skin.HalfHourHeight]px">

My first question would be why is this in the skin instead of a property of the control itself.  I don't understand how I change the skin property for a specific control that I am inheriting from.  It seems as though you have to create a whole new theme instead of just changing a property.  Doesn't seem very efficient.  I can see properties and colors being defaulted by a theme but why not let the user override through a property sheet? 

Just trying to understand...Any help appreciated...


Thanks, Joe
 
New Post 12/14/2010 12:24 PM
  palli
14313 posts
1st Level Poster




Re: Theme? 

Hi Joe,

At this time, we do not have any documentation on the XSLT template structure, and my guess is that if we did, it would be obsolete by now, as there have been some heavy changes towards the XSLT template structure lately, to support the skinable controls, as well as for standardization and other reasons. The skinable controls are basically custom controls implemented with a custom style and their default XSLT is just calling the standard XSLT templates.

What I find most convenient when viewing the related XSLTs and finding the correct templates, is to create a dummy theme in my project and look at the XSLTs in there. Most of the templates are on the Common node in the theme.

Regarding the HalfHourHeight not being a property on the control itself, I did already open an entry in our task tracker a while back on that request. Please view it here and follow up on our progress.

As for your specific question about how to change the Skin of the ScheduleBox, this is not something you can do runtime, but at design time, you would simply do the following. Create a custom control, which I will call CustScheduleBox. This will create CustScheduleBox class file, as well as CustScheduleBoxSkin skin file. Change the inheritance in the class file and make it inherit from ScheduleBox. Change the inheritance for the CustScheduleBoxSkin and make it inherit from ScheduleBoxSkin. Now build your application and double click CustScheduleBoxSkin to edit the skin in the designer. There you can simply change the HalfHourHeight property on the skin and you're done.

Hope this helps,

Palli

 


Páll Björnsson - Visual WebGui support team - Email: support@visualwebgui.com
 
New Post 12/14/2010 12:44 PM
  jharmon@blinfo.com
853 posts
1st Level Poster




Re: Theme? 

I think I would be better off copying the XSLT from a Theme and pasting it into my custom control's XSLT.  Then modify the HalfHourHeight and have it use my new custom property HalfHourHeight from my custom control.  That way I can change the size on the fly (zoom in/out) and just call ScheduleBoxCustom.Update() to get it to reflect the new size.

Does this make sense? 

I started messing around with it and hard-coded the size to 50.  However, now my events do not line up correctly.  So I adjusted the Top style setting a negative number (-15) in order to align correctly.  I am trying to figure out why I would have to adjust the top property.  I would think it would always be zero but for some reason it doesn't align correctly when at zero.


Thanks, Joe
 
New Post 12/14/2010 1:19 PM
  palli
14313 posts
1st Level Poster




Re: Theme? 

Hi Joe,

The HalfHourHeight property is both used in the resources, as well as in the serverside code. It really was my first thought to just change the HalfHourHeight to a property then change the resources to use that property, but that is not sufficient, as this property is used within the serverside code too. You will need the serverside code to complete the process, and in this case it's not public, so I really don't think you can make this work.

Palli

 


Páll Björnsson - Visual WebGui support team - Email: support@visualwebgui.com
 
Previous Previous
 
Next Next
  Forum  Commercial Foru...  Commercial Foru...  Theme?
.NET HTML5 Web, Cloud and Mobile application delivery | Sitemap | Terms of Use | Privacy Statement | Copyright © 2005-2012 Visual WebGui®       Visual WebGui weblog on ASP.NET Gizmox Blog Visual WebGui Group on LinkedIn Visual WebGui updates on Twitter Visual WebGui Page on Facebook Visual WebGui YouTube Channel Visual WebGui Platform News RSS