<feed version="0.3" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns="http://purl.org/atom/ns#" xml:lang="en-US"><title>Examples</title><link rel="alternate" type="text/html" href="http://www.softvelocity.net/community/blogs/examples/default.aspx" /><tagline type="text/html" /><id>http://www.softvelocity.net/community/blogs/examples/default.aspx</id><author><url>http://www.softvelocity.net/community/blogs/examples/default.aspx</url></author><generator url="http://communityserver.org" version="1.1.0.51101">Community Server</generator><modified>2007-09-13T13:32:00Z</modified><entry><title>Simple XML Generation without the Report</title><link rel="alternate" type="text/html" href="http://www.softvelocity.net/community/blogs/examples/archive/2008/03/07/2357.aspx" /><id>259bfc0c-c2c9-464c-b5c5-ca3bed41b566:2357</id><created>2008-03-07T20:20:00Z</created><content type="text/html" mode="escaped">&lt;font face="Verdana"&gt;Most of you should be aware of our Advanced Report Generation templates that were introduced in Clarion 6. There is Report to HTML, Report to PDF, Report to Text, and Report to XML.&lt;br&gt;&lt;br&gt;Quite often we receive requests asking for a simple way to create XML documents,  developers looking to programatically create XML docs without using the Report procedure.&lt;br&gt;&lt;br&gt;One of our developers, Diego Borojovich, shows you here how easy this is to do using the XMLGenerator class.&lt;br&gt;&lt;br&gt;&lt;font size="2"&gt; PROGRAM&lt;br&gt;&amp;nbsp;MAP&lt;br&gt;&amp;nbsp;END&lt;br&gt;&lt;br&gt;&amp;nbsp;INCLUDE('ABPRXML.INC'),ONCE&lt;br&gt;&lt;br&gt;XML XMLGenerator   !create an instance of the &lt;/font&gt;&lt;/font&gt;&lt;font face="Verdana" size="2"&gt;XMLGenerator class&lt;/font&gt;&lt;font size="2"&gt;&lt;br&gt;&lt;/font&gt;&lt;font face="Verdana"&gt;&lt;font size="2"&gt;&lt;br&gt;&amp;nbsp;CODE&lt;br&gt;&amp;nbsp;&amp;nbsp;XML.Init('breakfast_menu.XML')&lt;br&gt;&amp;nbsp;&amp;nbsp;XML.OpenDocument()&lt;br&gt;&amp;nbsp;&amp;nbsp;XML.SetEncoding('ISO-8859-1')&lt;br&gt;&amp;nbsp;&amp;nbsp;XML.XMLVersion = '1.0'&lt;br&gt;&amp;nbsp;&amp;nbsp;XML.SetRootTag('breakfast_menu')&lt;br&gt;&amp;nbsp;&amp;nbsp;XML.AddComment('The root tag is the first tag in the doc')&lt;br&gt;&amp;nbsp;&amp;nbsp;XML.AddTag('food','')&lt;br&gt;&amp;nbsp;&amp;nbsp;XML.AddAttribute('recordNumber','1','food')&lt;br&gt;&amp;nbsp;&amp;nbsp;XML.AddTag('name','Belgian Waffles',false,'food')&lt;br&gt;&amp;nbsp;&amp;nbsp;XML.AddTag('price','$5.95',false,'food')&lt;br&gt;&amp;nbsp;&amp;nbsp;XML.AddTag('description','two of our famous Belgian Waffles with plenty of real maple syrup',false,'food')&lt;br&gt;&amp;nbsp;&amp;nbsp;XML.AddTag('calories','650',false,'food')&lt;br&gt;&amp;nbsp;&amp;nbsp;XML.AddTag('food','')&lt;br&gt;&amp;nbsp;&amp;nbsp;XML.AddAttribute('recordNumber','2','food')&lt;br&gt;&amp;nbsp;&amp;nbsp;XML.AddTag('name','Strawberry Belgian Waffles',false,'food')&lt;br&gt;&amp;nbsp;&amp;nbsp;XML.AddTag('price','$7.95',false,'food')&lt;br&gt;&amp;nbsp;&amp;nbsp;XML.AddTag('description','light Belgian waffles covered with strawberries and whipped cream',false,'food')&lt;br&gt;&amp;nbsp;&amp;nbsp;XML.AddTag('calories','900',false,'food')&lt;br&gt;&amp;nbsp;&amp;nbsp;XML.CloseDocument()&lt;br&gt;&lt;br&gt;&lt;/font&gt;*****************************&lt;br&gt;Here are the xml elements created by the program:&lt;br&gt;&lt;br&gt; &amp;lt;breakfast_menu&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;food recordNumber="1"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;name&gt;gt;Belgian Waffles&amp;lt;/name&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;price&amp;gt;$5.95&amp;lt;/price&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;description&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;two of our famous Belgian Waffles with plenty of real maple syrup&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/description&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;calories&amp;gt;650&amp;lt;/calories&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/food&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;food recordNumber="2"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;name&amp;gt;Strawberry Belgian Waffles&amp;lt;/name&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;price&amp;gt;$7.95&amp;lt;/price&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;description&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;light Belgian waffles covered with strawberries and whipped cream&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/description&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;calories&amp;gt;900&amp;lt;/calories&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/food&amp;gt;&lt;br&gt; &amp;lt;/breakfast_menu&amp;gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/font&gt;&lt;font face="Verdana"&gt;That's all there is to it. We're working on adding
some additional documentation for this class, but in the mean time if
you examine the parameter names of each of the methods, the class is
nearly self-documenting. &lt;br&gt;&lt;/font&gt;&lt;br&gt;&lt;font face="Verdana"&gt;We have a new XML reader class for C7 that will read any sized XML file very quickly and is super easy to use -- and is pure Clarion code. Stay tuned for more info, and now I'm going bowling!&lt;br&gt;&lt;br&gt;&lt;/font&gt;&lt;img src="http://www.softvelocity.net/community/aggbug.aspx?PostID=2357" width="1" height="1"&gt;</content><slash:comments>0</slash:comments><wfw:commentRss>http://www.softvelocity.net/community/blogs/examples/commentrss.aspx?PostID=2357</wfw:commentRss></entry><entry><title>Styled Menus - Update</title><link rel="alternate" type="text/html" href="http://www.softvelocity.net/community/blogs/examples/archive/2007/09/15/1938.aspx" /><id>259bfc0c-c2c9-464c-b5c5-ca3bed41b566:1938</id><created>2007-09-15T14:52:00Z</created><content type="text/html" mode="escaped">&lt;br&gt;&lt;font size="3"&gt;&lt;font face="Tahoma"&gt;We had some feedback in the Beta news group for where some developers were requesting some new functionality for the MenuStyles class.&lt;br&gt;&lt;br&gt;Basically they wanted the ability to have their application detect the users current OS theme (or more aptly the color scheme in use), and then have the class be able to switch the colors used on the menu to match the users colors.&amp;nbsp; We thought it was a pretty reasoable request so we have implemented it, and it'll be available in the next build.&lt;br&gt;&lt;br&gt;Here's the code, its very simple, you just make a call to the new SetThemeColors method:&lt;br&gt;&lt;br&gt;&amp;nbsp;OF ?MenuStylesAutomatic&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; COMPILE ('**CW7**',_CWVER_=7000)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MenuStyleMgr.Init(?MenuBar)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MenuStyleMgr.SetThemeColors()&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AppFrame{PROP:Text} = 'Menu Styles Demo - Automatic'&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; !**CW7**&lt;br&gt;&amp;nbsp; END&lt;br&gt;&lt;br&gt;A few things to consider, the end user can customize any OS theme, for example they can choose the Energy Blue theme and then change to green colors, and they also can purchase new themes, or download free 3rd party themes. So you can't count on knowing every theme, and you can't rely on a known theme using default colors.&lt;br&gt;&lt;br&gt;So the SetThemeColors method does its best to determine the actual color in use and tries to match it.&amp;nbsp; That should make it work no matter the theme, or the user customizations.&lt;br&gt;&lt;br&gt;We also realize that some applications are designed with their own color "theme", background colors on windows, tab, button colors etc., and thats why we made the class flexible enough to let users choose from pre-determined styles that match &lt;br&gt;'known' OS themes, but we also support you designing your own menu color scheme.&amp;nbsp; And now you have the option to let your application decide at runtime the colors to use on the menu based on the users current theme.&lt;br&gt;&lt;br&gt;You can download a local link exe that has the new code to auto detect the theme color, and give it a test drive before we release it.&lt;br&gt;&lt;br&gt;&lt;/font&gt;&lt;/font&gt;&lt;a href="http://www.softvelocity.net/code/menus/menuStyles2.zip"&gt;&lt;font face="Tahoma"&gt;&lt;font size="3"&gt;Download a local link executable - 670kb&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;br&gt;&lt;font size="3"&gt;&lt;font face="Tahoma"&gt;&lt;a href="http://www.softvelocity.net/code/menus/MenuStyles2.zip"&gt;&lt;/a&gt;&lt;br&gt;After you load it up just go to the Menu Styles menu option and choose the 'Automatic' menu item.&lt;br&gt;&lt;br&gt;&lt;/font&gt;&lt;/font&gt;&lt;img src="http://www.softvelocity.net/community/aggbug.aspx?PostID=1938" width="1" height="1"&gt;</content><slash:comments>0</slash:comments><wfw:commentRss>http://www.softvelocity.net/community/blogs/examples/commentrss.aspx?PostID=1938</wfw:commentRss></entry><entry><title>Styled Menus in C7</title><link rel="alternate" type="text/html" href="http://www.softvelocity.net/community/blogs/examples/archive/2007/09/13/1927.aspx" /><id>259bfc0c-c2c9-464c-b5c5-ca3bed41b566:1927</id><created>2007-09-13T15:32:00Z</created><content type="text/html" mode="escaped">
&lt;font face="Tahoma"&gt;&lt;font size="3"&gt;&lt;br&gt;This is a simple example that shows how easy it is to change the style of your menu's at runtime.&amp;nbsp; You can use pure template code to setup a menu style at design time, but if you want to change the style based on user preference, or on target OS, or any other variable, you only need a few lines of code. The example also shows how to create styled popup menus.&lt;br&gt;&lt;br&gt;

&lt;p&gt;&lt;img src="/images/menus.png"&gt;&lt;/p&gt;

This code was generated by the templates and then copied into an embed point:&lt;br&gt;&lt;br&gt;&lt;pre&gt;COMPILE ('**CW7**',_CWVER_=7000)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MenuStyleMgr.Init(?MenuBar)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MenuStyleMgr.SetFlatMode(True)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MenuStyleMgr.SetColor(MenuBrushes:ImageBkgnd,16706781,14854529)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MenuStyleMgr.SetColor(MenuBrushes:SelectedBkgnd,16706781,14854529,False)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MenuStyleMgr.SetColor(MenuBrushes:SelectedBarBkgnd,16706781,14854529,True)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MenuStyleMgr.SetColor(MenuBrushes:HotBkgnd,16706781,14854529,True)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MenuStyleMgr.SetColor(MenuBrushes:FrameBrush,8388608, 8388608,True)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AppFrame{PROP:Text} = 'Menu Styles Demo - Luna Blue Menu Style Active'&lt;br&gt;    &amp;nbsp;DISPLAY()&lt;br&gt;!**CW7**&lt;br&gt;&lt;br&gt;&lt;/pre&gt;

You can drop this code into an appropriate embed point and change the menu style at runtime to any of the pre-built styles and any user-defined style (like this example does). Of course with the use of the COMPILE directive this code has no effect in your Clarion6 app.&lt;br&gt;&lt;br&gt;&lt;a href="http://www.softvelocity.net/code/menus/menustylesSrc.zip"&gt;Download demo App and project source - 69kb&lt;/a&gt;&lt;br&gt;&lt;a href="http://www.softvelocity.net/code/menus/menuStyles.zip"&gt;Download a local link executable - 589kb&lt;/a&gt;&lt;br&gt;&lt;/font&gt;&lt;/font&gt;&lt;img src="http://www.softvelocity.net/community/aggbug.aspx?PostID=1927" width="1" height="1"&gt;</content><slash:comments>3</slash:comments><wfw:commentRss>http://www.softvelocity.net/community/blogs/examples/commentrss.aspx?PostID=1927</wfw:commentRss></entry></feed>