Forum  General Visual ...  How do I...?  Problem in understanding skinnable control behavior
Previous Previous
 
Next Next
New Post 2/22/2012 11:59 PM
Resolved
  MWeinert
18 posts
www.tds.de
No Ranking


Problem in understanding skinnable control behavior 
Modified By MWeinert  on 2/23/2012 7:52:14 AM)

Hi,

I created a VWG application with a simple form from SCRATCH (so private versions should not affect the outcome).

Then I created a skinnable control (in Visual Studio 2008 with 6.4.0c) in a separate control library, created a skinnable control, compiled, override the dropdown button and changed it to a different GIF file.

Then I added a reference to the control library, created a "TestTheme" derived from the "Theme" class or "Office2010" class in the VWG applicaiton project. I recompiled, registered the theme and the control. I dragged the new control on an empty form.

After starting the project, the standard image is still displayed. IE debug mode shows me the following URL:

http://localhost:49251/Route/2.78.1/ie/de-DE/TestTheme/1/Resources.Gizmox.WebGUI.Forms.Skins.ButtonSkin.ArrowDown.gif.wgx

 

What is the reason that my control does not refer to the overriden DropDown Arrow?

 

 
New Post 2/23/2012 2:00 PM
  palli
11824 posts
1st Level Poster




Re: Problem in understanding skinnable control behavior 

Hi,

What I can think of for starters is that you either missed some property setting in your CSS or your Theme.

Hard for me to tell, when I don't have any code to view and don't even know what controls you are talking about.

Please email your project to support email address (see my signature), or a minimal reproducing sample that includes your library and a form to test it on. Please include in that email message the full Http reference to this thread and also please post here when you have sent the email.

We will be happy to look it over and try to spot what you are missing.

Palli

 


Páll Björnsson - Visual WebGui support team - Email: support@visualwebgui.com
 
New Post 2/23/2012 11:16 PM
  MWeinert
18 posts
www.tds.de
No Ranking


Re: Problem in understanding skinnable control behavior 
Modified By MWeinert  on 2/24/2012 3:21:25 AM)

Thank you so much for your fast answer.

I've sent you the project. It is quite straightforward. Just a skinnable control, a related empty theme, a form and a custom drawn image.

Is there any documentation about internals of the VWG base framework (css/javascript/xslt or JQT) and how they relate to skinning/resx contents?

E.g. I can see embedded font settings and border styling in the Gizmox VWG forms sources, but I am not sure how to apply them in my own themes without directly manipulating the resx or breaking naming conventions

regards

Manuel

 
New Post 2/24/2012 8:35 AM
  palli
11824 posts
1st Level Poster




Re: Problem in understanding skinnable control behavior 

Hi Manuel,

Sorry to say, we don't as yet have a comprehensive documentation on how this all comes together, but hopefully that will change in the near future. The best we have today is the related pages in our KB or Wiki, where we try to add links to relevant discussions when they do occur. You can find pages for Themes and Custom Controls. You may also find this article useful, as it's relevant for the update I made to your project.

Let's concentrate on your immediate concern, the problem with the custom image not showing. The change you made, overriding the image, is the first step as then you have the correct resource inside of your custom control's skin. The next step is making sure that your overridden resource is actually used, instead of the standard one. For many overridden resources, this would indeed be possible by doing exactly what you started on, creating a new theme and customizing the theme property that references the resource you were overriding. To understand this option, open your new TestTheme, navigate to the ButtonTest node and look at the PropertyGrid down right. Explode the nodes for some style and you will see.

In your case (and for the moment you will simply have to find this out in each case), the ArrowDown.gif is not controlled by any such Theme property, so you can't force your ButtonTest to use it by (re)setting a theme property. Instead, you will have to dig a little deeper. For this purpose, what I usually do is to take a look at the .XSLT created for your skinnable control, the ButtonTestSkin.Button.xslt. You will need to follow the calls to the templates to see where your property (the ArrowDown image) is actually being used, and in this case it's within the tplDrawButtonContentAPI template (you find this by educative browsing the standard xslt). This template is best to view within the TestTheme, navigating to the Button node and you will find it within the ButtonSkin.Button.xslt file (within the call to tplDrawButtonContent tempate, the prmDropDownImage parameter).

In this case, I simply made a copy of this template and pasted within the xslt for your ButtonTest control, gave it a new name (tplDrawButtonContentAPItest) and then modified you custom control's call to this template to call this new template.

The modifications required within this new xslt tempate is simply changing the resource for this parameter as you can see in the modified project I uploaded here.

After these modifications, you have an overridden image inside the skin and you also have made sure to modify/override the resources that use this image so they will use your overridden image instead of the standard one. Works like a charm.

For the record, as I chose to do the modifications within the custom control itself, the TestTheme you created is unnecessary for this customization to work. As explained above, this is not always true, and especially for the font question you asked, take a look at what properties you can set by modifying properties within the theme, without doing any custom coding. Experimenting is a good virtue in this case :-)

Hope this explains enough to get you started.

Good luck,

Palli

 


Páll Björnsson - Visual WebGui support team - Email: support@visualwebgui.com
 
New Post 2/25/2012 3:58 AM
  MWeinert
18 posts
www.tds.de
No Ranking


Re: Problem in understanding skinnable control behavior 

Hi Palli,

thank you very much for your explanations. This gives me a perfect starting point for this issue. I will dig deeper into the theme engine to better understand the mechanics behind it.

with best regards

Manuel

 
Previous Previous
 
Next Next
  Forum  General Visual ...  How do I...?  Problem in understanding skinnable control behavior
Azure banner
.NET Web, Cloud and Mobile application delivery platform | Sitemap | Terms of Use | Privacy Statement | Copyright © 2005-2011 Visual WebGui®       Visual WebGui weblog on ASP.NET Visual WebGui Group on LinkedIn Visual WebGui updates on Twitter Visual WebGui Page on Facebook Visual WebGui YouTube Channel Visual WebGui Platform News RSS