<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Cross-Platform Programming with wxWidgets</title>
	
	<link>http://wxwidgets.info</link>
	<description>Just Make It Cross-Platform</description>
	<lastBuildDate>Fri, 01 Jul 2011 10:18:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/wxWidgets_info" /><feedburner:info uri="wxwidgets_info" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2FwxWidgets_info" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FwxWidgets_info" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://feeds.my.aol.com/add.jsp?url=http%3A%2F%2Ffeeds.feedburner.com%2FwxWidgets_info" src="http://o.aolcdn.com/favorites.my.aol.com/webmaster/ffclient/webroot/locale/en-US/images/myAOLButtonSmall.gif">Subscribe with My AOL</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/wxWidgets_info" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FwxWidgets_info" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FwxWidgets_info" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FwxWidgets_info" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><item>
		<title>Microsoft Kinect Helper Library and Sample for wxWidgets</title>
		<link>http://feedproxy.google.com/~r/wxWidgets_info/~3/2sQlZpzQpwg/</link>
		<comments>http://wxwidgets.info/microsoft-kinect-helper-library-and-sample-for-wxwidgets/#comments</comments>
		<pubDate>Fri, 01 Jul 2011 10:18:26 +0000</pubDate>
		<dc:creator>T-Rex</dc:creator>
				<category><![CDATA[wxWidgets]]></category>
		<category><![CDATA[Kinect]]></category>

		<guid isPermaLink="false">http://wxwidgets.info/?p=593</guid>
		<description><![CDATA[Microsoft released their Kinect SDK several days ago. So, for those wxWidgets developers who are interested in development of Kinect-powered applications, I created a small wxWidgets-based helper library and sample application which will allow to start using Kinect SDK. wxKinectHelper project is hosted at Google Code. For now only basic functionality is available: Retreiving the [...]]]></description>
			<content:encoded><![CDATA[<p>Microsoft released their <a title="Microsoft Research Kinect SDK" href="http://research.microsoft.com/en-us/um/redmond/projects/kinectsdk/" target="_blank">Kinect SDK</a> several days ago.<br />
So, for those wxWidgets developers who are interested in development of Kinect-powered applications, I created a small wxWidgets-based helper library and sample application which will allow to start using Kinect SDK.</p>
<p><a title="wxKinectHelper - wxWidgets Wrapper for Kinect SDK" href="http://code.google.com/p/wxkinecthelper/" target="_blank">wxKinectHelper</a> project is hosted at Google Code.</p>
<p>For now only basic functionality is available:</p>
<ul>
<li>Retreiving the list of installed Kinect devices</li>
<li>Retrieving the IDs of devices</li>
<li>Starting/Stopping of frame grabbing</li>
<li>Grabbing depth images</li>
</ul>
<p>If you are willing to help with implementation of new features then just let me know. I will appreciate any help in improvement of current functionality.</p>
<p><strong>PS:</strong> To test the application and library you need to have Kinect device for sure.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/2Ygoun0K8v8A33eeC_o4IBauseI/0/da"><img src="http://feedads.g.doubleclick.net/~a/2Ygoun0K8v8A33eeC_o4IBauseI/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/2Ygoun0K8v8A33eeC_o4IBauseI/1/da"><img src="http://feedads.g.doubleclick.net/~a/2Ygoun0K8v8A33eeC_o4IBauseI/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/wxWidgets_info?a=2sQlZpzQpwg:OPk9qhO9668:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/wxWidgets_info?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/wxWidgets_info?a=2sQlZpzQpwg:OPk9qhO9668:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/wxWidgets_info?i=2sQlZpzQpwg:OPk9qhO9668:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/wxWidgets_info?a=2sQlZpzQpwg:OPk9qhO9668:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/wxWidgets_info?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/wxWidgets_info?a=2sQlZpzQpwg:OPk9qhO9668:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/wxWidgets_info?i=2sQlZpzQpwg:OPk9qhO9668:V_sGLiPBpWU" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://wxwidgets.info/microsoft-kinect-helper-library-and-sample-for-wxwidgets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://wxwidgets.info/microsoft-kinect-helper-library-and-sample-for-wxwidgets/</feedburner:origLink></item>
		<item>
		<title>wxJSON 1.1.0 Released</title>
		<link>http://feedproxy.google.com/~r/wxWidgets_info/~3/n1ru6yNJ7tU/</link>
		<comments>http://wxwidgets.info/wxjson-1-1-0-released/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 14:07:08 +0000</pubDate>
		<dc:creator>T-Rex</dc:creator>
				<category><![CDATA[Libraries]]></category>
		<category><![CDATA[wxWidgets]]></category>
		<category><![CDATA[wxJSON]]></category>

		<guid isPermaLink="false">http://wxwidgets.info/?p=580</guid>
		<description><![CDATA[JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language, Standard ECMA-262 3rd Edition &#8211; December 1999. JSON is a text format that is completely language independent [...]]]></description>
			<content:encoded><![CDATA[<p>JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language, Standard ECMA-262 3rd Edition &#8211; December 1999. JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, Python, and many others. These properties make JSON an ideal data-interchange language.</p>
<p>The wxJSON library is a complete implementation of the JSON data-interchange format. All JSON specifications are implemented in this library plus some extensions in the writer and in the parser class.</p>
<p>Today <strong>wxJSON 1.1.0</strong> was announced. This release is compatible with both wxWidgets 2.8 and 2.9. It is also compatible with wxWidgets SVN HEAD. N<span>ow JSON reader and writer only process UTF-8 encoded text as a stream.<br />
Also added a new wxJSONValue&#8217;s member function to get values and fixed the bugs in wxJSONValue::IsSameAs()</span></p>
<ul>
<li><a href="http://wxcode.sourceforge.net/docs/wxjson/" target="_blank">Official home page of wxJSON</a></li>
<li><span><a title="wxJSON 1.1 Release Notes" href="http://luccat.users.sourceforge.net/wxjson/docs/wxjson_whatsnew.html" target="_blank">Read complete list of changes in this version</a><br />
</span></li>
</ul>

<p><a href="http://feedads.g.doubleclick.net/~a/7XZOx_77mINnqvfTfjD4j4cwRyc/0/da"><img src="http://feedads.g.doubleclick.net/~a/7XZOx_77mINnqvfTfjD4j4cwRyc/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/7XZOx_77mINnqvfTfjD4j4cwRyc/1/da"><img src="http://feedads.g.doubleclick.net/~a/7XZOx_77mINnqvfTfjD4j4cwRyc/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/wxWidgets_info?a=n1ru6yNJ7tU:C5H2qZX682k:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/wxWidgets_info?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/wxWidgets_info?a=n1ru6yNJ7tU:C5H2qZX682k:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/wxWidgets_info?i=n1ru6yNJ7tU:C5H2qZX682k:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/wxWidgets_info?a=n1ru6yNJ7tU:C5H2qZX682k:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/wxWidgets_info?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/wxWidgets_info?a=n1ru6yNJ7tU:C5H2qZX682k:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/wxWidgets_info?i=n1ru6yNJ7tU:C5H2qZX682k:V_sGLiPBpWU" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://wxwidgets.info/wxjson-1-1-0-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://wxwidgets.info/wxjson-1-1-0-released/</feedburner:origLink></item>
		<item>
		<title>wxRuby. Оно даже работает!</title>
		<link>http://feedproxy.google.com/~r/wxWidgets_info/~3/mrzCXvVMtbQ/</link>
		<comments>http://wxwidgets.info/wxruby-ono-dazhe-rabotaet/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 10:57:56 +0000</pubDate>
		<dc:creator>T-Rex</dc:creator>
				<category><![CDATA[wxWidgets]]></category>
		<category><![CDATA[wxRuby]]></category>

		<guid isPermaLink="false">http://wxwidgets.info/?p=566</guid>
		<description><![CDATA[Вдохновленнный читаемой нынче книгой My Job Went to India: 52 Ways to Save Your Job решил покорять новые горизонты. Наткнулся несколько дней назад на вводную статью о wxRuby и сегодня решил попробовать. Оказывается это не так страшно. Что понравилось: Под Windows ставится просто. После инсталляции не требует никаких настроек. Кодишь, запускаешь &#8211; работает. Документация, как [...]]]></description>
			<content:encoded><![CDATA[<p>Вдохновленнный читаемой нынче книгой <a href="http://www.amazon.com/gp/product/0976694018?ie=UTF8&amp;tag=wxwidginfoart-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0976694018">My Job Went to India: 52 Ways to Save Your Job</a><img class=" asbeyqewjweushpscdfk asbeyqewjweushpscdfk asbeyqewjweushpscdfk asbeyqewjweushpscdfk asbeyqewjweushpscdfk asbeyqewjweushpscdfk asbeyqewjweushpscdfk asbeyqewjweushpscdfk asbeyqewjweushpscdfk asbeyqewjweushpscdfk" style="border:none !important; margin:0px !important;" src="http://www.assoc-amazon.com/e/ir?t=wxwidginfoart-20&amp;l=as2&amp;o=1&amp;a=0976694018" border="0" alt="" width="1" height="1" /> решил покорять новые горизонты. Наткнулся несколько дней назад на <a title="Вводная статья о wxRuby" href="http://ruby-ua.blogspot.com/2009/09/wxruby-welcome-to-wxruby.html" target="_blank">вводную статью о wxRuby</a> и сегодня решил попробовать. Оказывается это не так страшно.<br />
<span id="more-566"></span><br />
Что понравилось:</p>
<ul>
<li>Под Windows ставится просто. После инсталляции не требует никаких настроек. Кодишь, запускаешь &#8211; работает.</li>
<li>Документация, как всегда у wxWidgets, позволяет решить все вопросы.</li>
<li>Синтаксис&#8230; на вид &#8211; вменяемо (учитывая что для меня это новый язык программирования, минимальное приложение получилось создать минут за 15).</li>
<li>Есть бесплатные средства разработки.</li>
</ul>
<p>Что не понравилось:</p>
<ul>
<li>Бесплатные средства разработки немного&#8230;. унылые. Скорее напоминают просто текстовый редактор с подсветкой синтаксиса и возможностью запуска скриптов.</li>
<li>Без интеллисенса тяжело <img src='http://wxwidgets.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li>Хочу документацию в CHM, а есть только в HTML что не очень удобно</li>
</ul>
<p><a href="http://wxwidgets.info//wp-content/uploads/2009/09/freeride.jpg"><img src="http://wxwidgets.info//wp-content/uploads/2009/09/freeride.jpg" alt="FreeRIDE wxRuby IDE" title="FreeRIDE wxRuby IDE" width="556" height="586" class="alignnone size-full wp-image-567" /></a><br />
И вот&#8230; минимальное приложение. Как оно получилось:</p>
<pre class="brush: jscript; title: ; notranslate">
# -*- encoding: utf-8 -*-

require 'wx'

class HelloFrame &amp;lt; Wx::Frame
  def initialize
    super(nil, :title =&amp;gt; 'Hello World!')

    panel = Wx::Panel.new(self)

    sizer = Wx::BoxSizer.new(Wx::VERTICAL)
    panel.set_sizer(sizer)

    button = Wx::Button.new(panel, :label =&amp;gt; 'Press me')
    text = Wx::TextCtrl.new(panel, :value =&amp;gt; 'Sample', :style =&amp;gt; Wx::TE_MULTILINE)

    sizer.add(button, 0, Wx::EXPAND | Wx::ALL, 5)
    sizer.add(text, 1, Wx::EXPAND | Wx::LEFT | Wx::RIGHT | Wx::BOTTOM, 5)

    evt_button(button.get_id, <img src='http://wxwidgets.info/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> n_button_click)
  end

  def on_button_click
    Wx::MessageDialog.new(self, &amp;quot;Hello world!&amp;quot;, &amp;quot;Test&amp;quot;, Wx::OK).show_modal
  end
end

class HelloApp &amp;lt; Wx::App
  def on_init
    frame = HelloFrame.new
    frame.centre
    frame.show
  end
end

app = HelloApp.new
app.main_loop()
</pre>
<p>Немного странно называются классы, без префикса &#8220;wx&#8221;, зато с неймспейсом. Немного странным кажется способ привязки обработчиков событий. Очень понравилась возможность указывать значения только необходимых параметров. По сравнению с wxJavaScript мне wxRuby кажется более приятным т.к. все работает без дополнительной настройки. Сравнения по скорости работы пока не проводил. Есть поддержка wxAUI, wxGCDC/GdiPlus, Document/View, GLCanvas, что очень приятно.</p>
<p>Вместе с wxRuby поставляется довольно большое количество примеров, которые могут помочь разобраться как в синтаксисе так и в особенностях использования API.</p>
<ul>
<li><a href="http://rubyforge.org/frs/?group_id=35" target="_blank">Скачать wxRuby</a></li>
<li><a title="Скачать FreeRIDE" href="http://rubyforge.org/project/showfiles.php?group_id=31" target="_blank">Скачать FreeRIDE</a></li>
</ul>

<p><a href="http://feedads.g.doubleclick.net/~a/etoya72QOgvb-Oq1oIQylN13GgU/0/da"><img src="http://feedads.g.doubleclick.net/~a/etoya72QOgvb-Oq1oIQylN13GgU/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/etoya72QOgvb-Oq1oIQylN13GgU/1/da"><img src="http://feedads.g.doubleclick.net/~a/etoya72QOgvb-Oq1oIQylN13GgU/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/wxWidgets_info?a=mrzCXvVMtbQ:GKGcKWUQiL0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/wxWidgets_info?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/wxWidgets_info?a=mrzCXvVMtbQ:GKGcKWUQiL0:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/wxWidgets_info?i=mrzCXvVMtbQ:GKGcKWUQiL0:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/wxWidgets_info?a=mrzCXvVMtbQ:GKGcKWUQiL0:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/wxWidgets_info?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/wxWidgets_info?a=mrzCXvVMtbQ:GKGcKWUQiL0:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/wxWidgets_info?i=mrzCXvVMtbQ:GKGcKWUQiL0:V_sGLiPBpWU" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://wxwidgets.info/wxruby-ono-dazhe-rabotaet/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://wxwidgets.info/wxruby-ono-dazhe-rabotaet/</feedburner:origLink></item>
		<item>
		<title>Дааа! Ribbon Bar для wxWidgets не за горами!</title>
		<link>http://feedproxy.google.com/~r/wxWidgets_info/~3/BDUa5MkyodU/</link>
		<comments>http://wxwidgets.info/daaa-ribbon-bar-dlya-wxwidgets-ne-za-gorami/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 19:24:17 +0000</pubDate>
		<dc:creator>T-Rex</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[wxWidgets]]></category>

		<guid isPermaLink="false">http://wxwidgets.info/?p=563</guid>
		<description><![CDATA[Надо же,в wxBlog такое рассказывают. Оказывается Google Summer of Code для wxWidgets принес много полезного в этом году. Обещают поддержку нотификаций об изменениях файловой системы &#8211; wxFSWatcher, а также (внимание!) Ribbon для wxWidgets &#8211; wxRibbonBar. А еще&#8230;. апгрейды всевозможные для wxAUI (жду не дождусь collapsible panes и tabbed docking). Все это будет в svn trunk [...]]]></description>
			<content:encoded><![CDATA[<p>Надо же,в wxBlog такое <a href="http://wxwidgets.blogspot.com/2009/09/august-news.html" target="_blank">рассказывают</a>. Оказывается Google Summer of Code для wxWidgets принес много полезного в этом году. Обещают поддержку нотификаций об изменениях файловой системы &#8211; wxFSWatcher, а также (внимание!) Ribbon для wxWidgets &#8211; wxRibbonBar. А еще&#8230;. апгрейды всевозможные для wxAUI (жду не дождусь collapsible panes и tabbed docking).</p>
<p>Все это будет в svn trunk и не факт что появится в ветке 2.8. Так что &#8220;кто куды, а мы к зайцам&#8221; (с), пойду качать svn trunk. Там кстати еще много чего полезного появилось. Если вы пользуетесь стабильной версией 2.8, рекомендую хотя бы попробовать trunk.</p>
<p>Еще вскользь упомянули, что потихоньку развивается wxSymbian и wxQNX. Порт для Symbian мне кажется очень перспективным, да.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/mtWfLSy7OwzqwLOLMR3HrPsKg_M/0/da"><img src="http://feedads.g.doubleclick.net/~a/mtWfLSy7OwzqwLOLMR3HrPsKg_M/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/mtWfLSy7OwzqwLOLMR3HrPsKg_M/1/da"><img src="http://feedads.g.doubleclick.net/~a/mtWfLSy7OwzqwLOLMR3HrPsKg_M/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/wxWidgets_info?a=BDUa5MkyodU:8cGG_naEeks:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/wxWidgets_info?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/wxWidgets_info?a=BDUa5MkyodU:8cGG_naEeks:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/wxWidgets_info?i=BDUa5MkyodU:8cGG_naEeks:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/wxWidgets_info?a=BDUa5MkyodU:8cGG_naEeks:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/wxWidgets_info?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/wxWidgets_info?a=BDUa5MkyodU:8cGG_naEeks:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/wxWidgets_info?i=BDUa5MkyodU:8cGG_naEeks:V_sGLiPBpWU" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://wxwidgets.info/daaa-ribbon-bar-dlya-wxwidgets-ne-za-gorami/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://wxwidgets.info/daaa-ribbon-bar-dlya-wxwidgets-ne-za-gorami/</feedburner:origLink></item>
		<item>
		<title>Cross-Platform Way of Obtaining MAC Address of Your Machine</title>
		<link>http://feedproxy.google.com/~r/wxWidgets_info/~3/5nAZYmB0v0E/</link>
		<comments>http://wxwidgets.info/cross-platform-way-of-obtaining-mac-address-of-your-machine/#comments</comments>
		<pubDate>Sun, 30 Aug 2009 12:04:45 +0000</pubDate>
		<dc:creator>T-Rex</dc:creator>
				<category><![CDATA[Components]]></category>
		<category><![CDATA[Libraries]]></category>
		<category><![CDATA[wxWidgets]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[wxWinCE]]></category>

		<guid isPermaLink="false">http://wxwidgets.info/?p=557</guid>
		<description><![CDATA[In one of my current projects I had to implement client-server communication and protection by MAC address when client machine can&#8217;t connect to server if its MAC address is not allowed, regardless of network or broadband connection. But what was a surprise that wxWidgets does not have API which allows obtaining MAC address in cross-platform [...]]]></description>
			<content:encoded><![CDATA[<p>In one of my current projects I had to implement client-server communication and protection by MAC address when client machine can&#8217;t connect to server if its MAC address is not allowed, regardless of network or broadband connection. But what was a surprise that wxWidgets does not have API which allows obtaining MAC address in cross-platform way. So, I decided to write a small class which allows obtainig MAC address for Windows, Linux, Mac OS and Windows Mobile. Here it is:<br />
<span id="more-557"></span><br />
<strong>MACAddressUtility.h</strong></p>
<pre class="brush: cpp; title: ; notranslate">
#ifndef _MACADDRESS_UTILITY_H
#define _MACADDRESS_UTILITY_H

class MACAddressUtility
{
public:
	static long GetMACAddress(unsigned char * result);
private:
#if defined(WIN32) || defined(UNDER_CE)
	static long GetMACAddressMSW(unsigned char * result);
#elif defined(__APPLE__)
	static long GetMACAddressMAC(unsigned char * result);
#elif defined(LINUX) || defined(linux)
	static long GetMACAddressLinux(unsigned char * result);
#endif
};

#endif
</pre>
<p><strong>MACAddressUtility.cpp</strong></p>
<pre class="brush: cpp; title: ; notranslate">
#include &quot;MACAddressUtility.h&quot;

#include &lt;stdio.h&gt;

#if defined(WIN32) || defined(UNDER_CE)
#	include &lt;windows.h&gt;
#	if defined(UNDER_CE)
#		include &lt;Iphlpapi.h&gt;
#	endif
#elif defined(__APPLE__)
#	include &lt;CoreFoundation/CoreFoundation.h&gt;
#	include &lt;IOKit/IOKitLib.h&gt;
#	include &lt;IOKit/network/IOEthernetInterface.h&gt;
#	include &lt;IOKit/network/IONetworkInterface.h&gt;
#	include &lt;IOKit/network/IOEthernetController.h&gt;
#elif defined(LINUX) || defined(linux)
#	include &lt;string.h&gt;
#	include &lt;net/if.h&gt;
#	include &lt;sys/ioctl.h&gt;
#   include &lt;sys/socket.h&gt;
#   include &lt;arpa/inet.h&gt;
#endif

long MACAddressUtility::GetMACAddress(unsigned char * result)
{
	// Fill result with zeroes
	memset(result, 0, 6);
	// Call appropriate function for each platform
#if defined(WIN32) || defined(UNDER_CE)
	return GetMACAddressMSW(result);
#elif defined(__APPLE__)
	return GetMACAddressMAC(result);
#elif defined(LINUX) || defined(linux)
	return GetMACAddressLinux(result);
#endif
	// If platform is not supported then return error code
	return -1;
}

#if defined(WIN32) || defined(UNDER_CE)

inline long MACAddressUtility::GetMACAddressMSW(unsigned char * result)
{

#if defined(UNDER_CE)
	IP_ADAPTER_INFO AdapterInfo[16]; // Allocate information
	DWORD dwBufLen = sizeof(AdapterInfo); // Save memory size of buffer
	if(GetAdaptersInfo(AdapterInfo, &amp;dwBufLen) == ERROR_SUCCESS)
	{
		memcpy(result, AdapterInfo-&gt;Address, 6);
	}
	else return -1;
#else
	UUID uuid;
	if(UuidCreateSequential(&amp;uuid) == RPC_S_UUID_NO_ADDRESS) return -1;
	memcpy(result, (char*)(uuid.Data4+2), 6);
#endif
	return 0;
}

#elif defined(__APPLE__)

static kern_return_t FindEthernetInterfaces(io_iterator_t *matchingServices)
{
    kern_return_t		kernResult;
    CFMutableDictionaryRef	matchingDict;
    CFMutableDictionaryRef	propertyMatchDict;

    matchingDict = IOServiceMatching(kIOEthernetInterfaceClass);

    if (NULL != matchingDict)
	{
        propertyMatchDict =
			CFDictionaryCreateMutable(kCFAllocatorDefault, 0,
				&amp;kCFTypeDictionaryKeyCallBacks,
				&amp;kCFTypeDictionaryValueCallBacks);

        if (NULL != propertyMatchDict)
		{
            CFDictionarySetValue(propertyMatchDict,
				CFSTR(kIOPrimaryInterface), kCFBooleanTrue);
            CFDictionarySetValue(matchingDict,
				CFSTR(kIOPropertyMatchKey), propertyMatchDict);
            CFRelease(propertyMatchDict);
        }
    }
    kernResult = IOServiceGetMatchingServices(kIOMasterPortDefault,
		matchingDict, matchingServices);
    return kernResult;
}

static kern_return_t GetMACAddress(io_iterator_t intfIterator,
								   UInt8 *MACAddress, UInt8 bufferSize)
{
    io_object_t		intfService;
    io_object_t		controllerService;
    kern_return_t	kernResult = KERN_FAILURE;

	if (bufferSize &lt; kIOEthernetAddressSize) {
		return kernResult;
	}

    bzero(MACAddress, bufferSize);

    while (intfService = IOIteratorNext(intfIterator))
    {
        CFTypeRef	MACAddressAsCFData;        

        // IONetworkControllers can't be found directly by the IOServiceGetMatchingServices call,
        // since they are hardware nubs and do not participate in driver matching. In other words,
        // registerService() is never called on them. So we've found the IONetworkInterface and will
        // get its parent controller by asking for it specifically.

        // IORegistryEntryGetParentEntry retains the returned object,
		// so release it when we're done with it.
        kernResult =
			IORegistryEntryGetParentEntry(intfService,
				kIOServicePlane,
				&amp;controllerService);

        if (KERN_SUCCESS != kernResult) {
            printf(&quot;IORegistryEntryGetParentEntry returned 0x%08x\n&quot;, kernResult);
        }
        else {
            // Retrieve the MAC address property from the I/O Registry in the form of a CFData
            MACAddressAsCFData =
				IORegistryEntryCreateCFProperty(controllerService,
					CFSTR(kIOMACAddress),
					kCFAllocatorDefault,
					0);
            if (MACAddressAsCFData) {
                CFShow(MACAddressAsCFData); // for display purposes only; output goes to stderr

                // Get the raw bytes of the MAC address from the CFData
                CFDataGetBytes((CFDataRef)MACAddressAsCFData,
					CFRangeMake(0, kIOEthernetAddressSize), MACAddress);
                CFRelease(MACAddressAsCFData);
            }

            // Done with the parent Ethernet controller object so we release it.
            (void) IOObjectRelease(controllerService);
        }

        // Done with the Ethernet interface object so we release it.
        (void) IOObjectRelease(intfService);
    }

    return kernResult;
}

long MACAddressUtility::GetMACAddressMAC(unsigned char * result)
{
	io_iterator_t	intfIterator;
	kern_return_t	kernResult = KERN_FAILURE;
	do
	{
		kernResult = ::FindEthernetInterfaces(&amp;intfIterator);
		if (KERN_SUCCESS != kernResult) break;
	    kernResult = ::GetMACAddress(intfIterator, (UInt8*)result, 6);
    }
	while(false);
    (void) IOObjectRelease(intfIterator);
}

#elif defined(LINUX) || defined(linux)

long MACAddressUtility::GetMACAddressLinux(unsigned char * result)
{
	struct ifreq ifr;
    struct ifreq *IFR;
    struct ifconf ifc;
    char buf[1024];
    int s, i;
    int ok = 0;

    s = socket(AF_INET, SOCK_DGRAM, 0);
    if (s == -1)
	{
        return -1;
    }

    ifc.ifc_len = sizeof(buf);
    ifc.ifc_buf = buf;
    ioctl(s, SIOCGIFCONF, &amp;ifc);

    IFR = ifc.ifc_req;
    for (i = ifc.ifc_len / sizeof(struct ifreq); --i &gt;= 0; IFR++)
	{
        strcpy(ifr.ifr_name, IFR-&gt;ifr_name);
        if (ioctl(s, SIOCGIFFLAGS, &amp;ifr) == 0)
		{
            if (! (ifr.ifr_flags &amp; IFF_LOOPBACK))
			{
                if (ioctl(s, SIOCGIFHWADDR, &amp;ifr) == 0)
				{
                    ok = 1;
                    break;
                }
            }
        }
    }

    shutdown(s, SHUT_RDWR);
    if (ok)
	{
        bcopy( ifr.ifr_hwaddr.sa_data, result, 6);
    }
    else
	{
        return -1;
    }
    return 0;
}

#endif
</pre>
<p><strong>wxMACAddressUtility.h</strong></p>
<pre class="brush: cpp; title: ; notranslate">
#ifndef _WX_MACADDRESS_UTILITY_H
#define _WX_MACADDRESS_UTILITY_H

#include &quot;MACAddressUtility.h&quot;
#include &lt;wx/wx.h&gt;

class wxMACAddressUtility
{
public:
	static wxString GetMACAddress()
	{
		unsigned char result[6];
		if(MACAddressUtility::GetMACAddress(result) == 0)
		{
			return wxString::Format(wxT(&quot;%02X:%02X:%02X:%02X:%02X:%02X&quot;),
				(unsigned int)result[0], (unsigned int)result[1], (unsigned int)result[2],
				(unsigned int)result[3], (unsigned int)result[4], (unsigned int)result[5]);
		}
		return wxEmptyString;
	}
};

#endif
</pre>
<p><strong>Sample of usage:</strong></p>
<pre class="brush: cpp; title: ; notranslate">
m_MACAddress = wxMACAddressUtility::GetMACAddress();
</pre>
<p><a href="http://wxwidgets.info//wp-content/uploads/2009/08/macaddr.jpg"><img src="http://wxwidgets.info//wp-content/uploads/2009/08/macaddr.jpg" alt="Get MAC address programmatically" title="Get MAC address programmatically" width="226" height="67" class="alignnone size-full wp-image-558" /></a></p>
<p>As you can see, core class does not depend on wxWidgets and can be used in native applications written without wxWidgets.</p>
<p><a href="http://wxwidgets.info//wp-content/uploads/2009/08/wxMACAddressUtility.7z" title="How to get MAC address in C++: Windows, Linux, Mac OS, Windows Mobile">Download sample application</a></p>

<p><a href="http://feedads.g.doubleclick.net/~a/kuFHE6d_ZRS0PskAAVsK-hFETzg/0/da"><img src="http://feedads.g.doubleclick.net/~a/kuFHE6d_ZRS0PskAAVsK-hFETzg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/kuFHE6d_ZRS0PskAAVsK-hFETzg/1/da"><img src="http://feedads.g.doubleclick.net/~a/kuFHE6d_ZRS0PskAAVsK-hFETzg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/wxWidgets_info?a=5nAZYmB0v0E:KYTqYOGJ6XQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/wxWidgets_info?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/wxWidgets_info?a=5nAZYmB0v0E:KYTqYOGJ6XQ:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/wxWidgets_info?i=5nAZYmB0v0E:KYTqYOGJ6XQ:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/wxWidgets_info?a=5nAZYmB0v0E:KYTqYOGJ6XQ:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/wxWidgets_info?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/wxWidgets_info?a=5nAZYmB0v0E:KYTqYOGJ6XQ:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/wxWidgets_info?i=5nAZYmB0v0E:KYTqYOGJ6XQ:V_sGLiPBpWU" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://wxwidgets.info/cross-platform-way-of-obtaining-mac-address-of-your-machine/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://wxwidgets.info/cross-platform-way-of-obtaining-mac-address-of-your-machine/</feedburner:origLink></item>
		<item>
		<title>Taking Screenshots with wxWidgets under Mac OS is Really Tricky.</title>
		<link>http://feedproxy.google.com/~r/wxWidgets_info/~3/7NUXeUpMZkM/</link>
		<comments>http://wxwidgets.info/taking-screenshots-with-wxwidgets-under-mac-os-is-really-tricky/#comments</comments>
		<pubDate>Thu, 21 May 2009 21:30:00 +0000</pubDate>
		<dc:creator>T-Rex</dc:creator>
				<category><![CDATA[Components]]></category>
		<category><![CDATA[Libraries]]></category>
		<category><![CDATA[Articles]]></category>
		<category><![CDATA[wxWidgets]]></category>

		<guid isPermaLink="false">http://wxwidgets.info/?p=550</guid>
		<description><![CDATA[Taking screenshots is a very common task and it was a must for one of my current projects. What was a surprise when I understood that my favourite toolkit can&#8217;t do that in cross-platform manner. It is official bug that wxScreenDC does not work properly under Mac OS and you can&#8217;t use Blit() message for [...]]]></description>
			<content:encoded><![CDATA[<p>Taking screenshots is a very common task and it was a must for one of my current projects. What was a surprise when I understood that my favourite toolkit can&#8217;t do that in cross-platform manner.</p>
<p>It is <a href="http://trac.wxwidgets.org/ticket/9486">official bug</a> that wxScreenDC does not work properly under Mac OS and you can&#8217;t use Blit() message for copying screen onto wxMemoryDC.</p>
<p>After digging the Internet I found a kind of solution which used OpenGL and created wxWidgets-based class which takes screenshots also under Mac OS. It was really hard task for me because I haven&#8217;t used neither Carbon nor Cocoa before. However everything works now and I&#8217;m happy.</p>
<p>Here it is:<br />
<span id="more-550"></span><br />
<strong>wxScreenshotMaker.h</strong></p>
<pre class="brush: cpp; title: ; notranslate">
#pragma once

#include &lt;wx/wx.h&gt;
#ifdef __WXMAC__
#include &lt;OpenGL/OpenGL.h&gt;
#endif

class wxScreenshotMaker
{
public:
	wxScreenshotMaker();
	~wxScreenshotMaker();
	wxBitmap GetScreenshot();
private:
#ifdef __WXMAC__

	int screenWidth;
	int screenHeight;

	CGLContextObj glContextObj;
	int rowSize;
	unsigned char * glBitmapData;
	unsigned char * glRowData;

	void InitOpenGL();
	void GrabGLScreen();
	void SwizzleBitmap();
	void FinalizeOpenGL();
#endif
};
</pre>
<p><strong>wxScreenshotMaker.cpp</strong></p>
<pre class="brush: cpp; title: ; notranslate">
#include &quot;wxScreenshotMaker.h&quot;
#ifndef __WXMAC__
#include &lt;wx/dcscreen.h&gt;
#else
#include &lt;CoreFoundation/CoreFoundation.h&gt;
#include &lt;ApplicationServices/ApplicationServices.h&gt;
#include &lt;OpenGL/gl.h&gt;
#endif

wxScreenshotMaker::wxScreenshotMaker()
#ifdef __WXMAC__
: screenWidth(0), screenHeight(0), glBitmapData(NULL), glRowData(NULL)
#endif
{
#ifdef __WXMAC__
	wxSize size = wxGetDisplaySize();
	screenWidth = size.GetWidth();
	screenHeight = size.GetHeight();
	InitOpenGL();
#endif
}

wxScreenshotMaker::~wxScreenshotMaker()
{
#ifdef __WXMAC__
	FinalizeOpenGL();
#endif
}

wxBitmap wxScreenshotMaker::GetScreenshot()
{
#ifndef __WXMAC__
	wxScreenDC screenDC;
	wxBitmap bmp(screenDC.GetSize().GetWidth(), screenDC.GetSize().GetHeight());
	wxMemoryDC mdc(bmp);
	mdc.Blit(0, 0, bmp.GetWidth(), bmp.GetHeight(), &amp;screenDC, 0, 0);
	mdc.SelectObject(wxNullBitmap);
	return bmp;
#else
	if(glBitmapData)
	{
		GrabGLScreen();
		wxImage img = wxImage(screenWidth, screenHeight, glBitmapData, true);
		return wxBitmap(img.Copy());
	}
#endif
}

#ifdef __WXMAC__

void wxScreenshotMaker::InitOpenGL()
{
	do
	{
		rowSize = screenWidth * 3;
		rowSize = (rowSize + 2) &amp; ~2;

		glRowData = (unsigned char *)realloc(glRowData, rowSize);
		glBitmapData = (unsigned char *)realloc(glBitmapData, rowSize * screenHeight);

		bzero(glRowData, rowSize);
		bzero(glBitmapData, rowSize * screenHeight);

		CGDirectDisplayID display = CGMainDisplayID();
		CGLPixelFormatObj pixelFormatObj ;
		GLint numPixelFormats;
		CGLPixelFormatAttribute attribs[] =
		{
			kCGLPFAFullScreen,
			kCGLPFADisplayMask,
			(CGLPixelFormatAttribute)0,    /* Display mask bit goes here */
			(CGLPixelFormatAttribute)0
		};

		attribs[2] = (CGLPixelFormatAttribute) CGDisplayIDToOpenGLDisplayMask(display);

		/* Build a full-screen GL context */
		CGLChoosePixelFormat( attribs, &amp;pixelFormatObj, &amp;numPixelFormats );
		if ( pixelFormatObj == NULL ) break;
		CGLCreateContext( pixelFormatObj, NULL, &amp;glContextObj ) ;
		CGLDestroyPixelFormat( pixelFormatObj ) ;
		if ( glContextObj == NULL ) break;
		CGLSetCurrentContext( glContextObj ) ;
		CGLSetFullScreen( glContextObj ) ;
	}
	while(false);
}

void wxScreenshotMaker::FinalizeOpenGL()
{
    CGLSetCurrentContext( NULL );
    CGLClearDrawable( glContextObj );
    CGLDestroyContext( glContextObj );
	free(glRowData);
	free(glBitmapData);
}

void wxScreenshotMaker::GrabGLScreen()
{
	glReadBuffer(GL_FRONT);
    /* Read framebuffer into our bitmap */
    glFinish();
    glPixelStorei(GL_PACK_ALIGNMENT, 3);
    glPixelStorei(GL_PACK_ROW_LENGTH, 0);
    glPixelStorei(GL_PACK_SKIP_ROWS, 0);
    glPixelStorei(GL_PACK_SKIP_PIXELS, 0);
    /*
      * Fetch the data in RGB format, matching the bitmap context.
      */
    glReadPixels((GLint)0, (GLint)0, (GLint)screenWidth, (GLint)screenHeight,
		GL_RGB, GL_BYTE, glBitmapData);

	SwizzleBitmap();
}

void wxScreenshotMaker::SwizzleBitmap()
{
	int top, bottom;
	top = 0;
    bottom = screenHeight - 1;
	void * base = glBitmapData;
	void * topP = NULL;
	void * bottomP = NULL;

	while(top &lt; bottom)
	{
		topP = (void *)((top * rowSize) + (intptr_t)base);
        bottomP = (void *)((bottom * rowSize) + (intptr_t)base);

		bcopy( topP, glRowData, rowSize );
        bcopy( bottomP, topP, rowSize );
        bcopy( glRowData, bottomP, rowSize );

        ++top;
        --bottom;
	}
}

#endif
</pre>
<p><strong>Sample</strong></p>
<pre class="brush: cpp; title: ; notranslate">
wxScreenshotMaker screenshot;
m_Canvas-&gt;SetBitmap(screenshot.GetScreenshot());
m_Canvas-&gt;Refresh();
</pre>
<p><a title="Download source code: Take screenshot with wxWidgets under Mac OS" href="http://wxwidgets.info//wp-content/uploads/2009/05/wxscreenshotmaker.zip">Download wxScreenshotMaker and sample project</a>.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/efHLod_fgOj2-uVdczwc2fEnJ_g/0/da"><img src="http://feedads.g.doubleclick.net/~a/efHLod_fgOj2-uVdczwc2fEnJ_g/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/efHLod_fgOj2-uVdczwc2fEnJ_g/1/da"><img src="http://feedads.g.doubleclick.net/~a/efHLod_fgOj2-uVdczwc2fEnJ_g/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/wxWidgets_info?a=7NUXeUpMZkM:_Q9cGj0ZclM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/wxWidgets_info?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/wxWidgets_info?a=7NUXeUpMZkM:_Q9cGj0ZclM:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/wxWidgets_info?i=7NUXeUpMZkM:_Q9cGj0ZclM:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/wxWidgets_info?a=7NUXeUpMZkM:_Q9cGj0ZclM:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/wxWidgets_info?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/wxWidgets_info?a=7NUXeUpMZkM:_Q9cGj0ZclM:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/wxWidgets_info?i=7NUXeUpMZkM:_Q9cGj0ZclM:V_sGLiPBpWU" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://wxwidgets.info/taking-screenshots-with-wxwidgets-under-mac-os-is-really-tricky/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://wxwidgets.info/taking-screenshots-with-wxwidgets-under-mac-os-is-really-tricky/</feedburner:origLink></item>
		<item>
		<title>AxTk: An Accessibility Toolkit for wxWidgets</title>
		<link>http://feedproxy.google.com/~r/wxWidgets_info/~3/wWKRMn90Cao/</link>
		<comments>http://wxwidgets.info/axtk-an-accessibility-toolkit-for-wxwidgets/#comments</comments>
		<pubDate>Thu, 07 May 2009 16:07:54 +0000</pubDate>
		<dc:creator>T-Rex</dc:creator>
				<category><![CDATA[Components]]></category>
		<category><![CDATA[Libraries]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[wxWidgets]]></category>

		<guid isPermaLink="false">http://wxwidgets.info/?p=546</guid>
		<description><![CDATA[http://code.google.com/p/axtk/ What is AxTk? AxTk (pronounced Ay Ex Tee Kay) is an open source, C++ add-on for wxWidgets that helps developers create highly accessible, talking applications for users with impaired vision. It may also be useful for other impairments that benefit from a simplified user interface. AxTk features a new menu-based system that is easy [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://code.google.com/p/axtk/" target="_blank">http://code.google.com/p/axtk/</a></p>
<h4>What is AxTk?</h4>
<p><strong>AxTk</strong> (pronounced Ay Ex Tee Kay) <strong>is an open source, C++ add-on for wxWidgets that helps developers create highly accessible, talking applications for users with impaired vision</strong>. It may also be useful for other impairments that benefit from a simplified user interface.</p>
<p>AxTk features a new menu-based system that is easy to learn and use, in addition to providing adaptation for some existing GUI controls and dialogs. The developer can choose whether to use the menu system, or to adapt an existing application UI, or use a combination of methods.</p>
<p>AxTk is cross-platform (tested so far on Windows XP, Linux and Mac OS X 10.5), and includes text-to-speech classes with the ability to drive SAPI 5, Apple Speech Synthesis Manager, eSpeak, and Cepstral. Other speech engines can be driven by writing additional handlers.</p>
<p>Note that AxTk is a work in progress and the API is subject to change.<br />
<span id="more-546"></span></p>
<h4>What else is AxTk?</h4>
<p>There is an additional, higher-level layer for building applications that help the user maintain &#8216;resource libraries&#8217; for all kinds of files and services. The motivation is to provided simplified access to many resources and activities that are currently spread amongst many applications and web sites. By making this part of AxTk, we increase the chances of providing a really useful, accessible application platform that can be customised in interesting ways for individuals or government sectors. However, this is currently a less well-developed aspect of AxTk and one which you can ignore fo now. The resource demo shows playing of audio albums and reading Epub books (having converted the XHTML content to plain text first).</p>
<h4>What about Braille output?</h4>
<p>Although nothing is specifically coded yet for Braille devices, they could be supported relatively easily by adding handlers to the wxTextToSpeech system, to output to the device instead of a speech engine.</p>
<h4>Why not just use a screen reader?</h4>
<p>Screen readers don&#8217;t have an in-depth knowledge of the application; in theory, an AxTk application can make use of knowledge of its own structure to make speech more helpful and less verbose. Also, an application&#8217;s custom controls are not accessible to screen readers. In additon, AxTk provides an alternative, menu-based user interface that is not so prone to the problems of accessing conventional layouts via a screen reader. Finally, an AxTk application provides support for application-wide colour and text size changes that are harder to achieve in an ad-hoc way.</p>
<h4>Is this anything to do with MSAA (Microsoft Active Accessibility)?</h4>
<p>No; a different approach is used. Although wxWidgets has some basic MSAA support, other ports have no similar support and it may be hard to create a comprehensive cross-platform solution to accessibility based on OS-level accessibility support. It would still leave applications and users at the mercy of particular screen readers and it would not solve other problems that AxTk sets out to solve: visual adaptation, fine control over speech (such as content voicing), customisable shortcut support, and more.</p>
<p>Having said that, work on integrating MSAA equivalents for other platforms would be very welcome, either as part of AxTk or built into wxWidgets.</p>
<h4>How hard is it to use?</h4>
<p>Apart from some housekeeping that you can pinch from the sample, the amount of extra code can be small if you&#8217;re just adapting existing UIs. For example, to make a dialog self-voicing and responsive to visual appearance changes (assuming the dialog&#8217;s controls are in the set of controls currently handled by AxTk):</p>
<pre class="brush: cpp; title: ; notranslate">
#include &quot;ax/ax_ui_adaptation.h&quot;
...
class MyDialog: public wxDialog
{
    ...
    AxSelfVoicing m_adapter;
};

MyDialog::MyDialog(...)
{
    ...
    m_adapter.Adapt(this);
}
</pre>
<p>If you have controls that are not currently handled by AxTk, you can write adapter classes and also handler classes that detect the appropriate controls and create their adapters.</p>
<p>Using the new menu system is also pretty straightforward as you can see from the sample (mainframe.cpp). There are some new concepts such as AxActivator, which handles menu item activation, but there&#8217;s plenty in common with conventional wxWidgets programming.</p>
<h4>Where and how do I get it?</h4>
<p>AxTk is hosted at Google Code and is available via SVN or as a source tarball or zip file.</p>
<p><a href="http://code.google.com/p/axtk/" target="_blank">http://code.google.com/p/axtk/</a></p>
<p>The discussion group is axtk-dev_at_googlegroups.com.</p>
<p>The documentation is available here:</p>
<p><a href="http://www.anthemion.co.uk/axtk/html/index.html" target="_blank">http://www.anthemion.co.uk/axtk/html/index.html</a></p>
<h4>Are there demos?</h4>
<p>Yes; you can download axsample binaries for Windows, Linux and Mac from:</p>
<p><a href="http://www.anthemion.co.uk/axtk/" target="_blank">http://www.anthemion.co.uk/axtk/</a></p>
<p>You can ignore axresourcesample unless you&#8217;re interested in the higher-level resource library layer mentioned previously.</p>
<h4>Can I contribute?</h4>
<p>Please do! See docs/todo.txt for some of the things left to do. You&#8217;ll probably find things to do yourself. You can supply patches in the AxTk&#8217;s Issue Tracker, or you can ask to be added to the list of project members in order to make changes in SVN.</p>
<h4>What&#8217;s the build system?</h4>
<p>None to speak of. This would make a good contribution. Currently you can use DialogBlocks to generate projects and makefiles for the two samples, which simply include all the AxTk code.</p>
<h4>What is the license?</h4>
<p>The license is the New BSD License, which is very brief, easy to understand, and industry-friendly. Please see license.txt in the source tarball for details.</p>
<p>I hope you find AxTk useful &#8211; or at least, fun to play with.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/wcYautQ4-qYuQ5IE-EW3_ZyzbrQ/0/da"><img src="http://feedads.g.doubleclick.net/~a/wcYautQ4-qYuQ5IE-EW3_ZyzbrQ/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/wcYautQ4-qYuQ5IE-EW3_ZyzbrQ/1/da"><img src="http://feedads.g.doubleclick.net/~a/wcYautQ4-qYuQ5IE-EW3_ZyzbrQ/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/wxWidgets_info?a=wWKRMn90Cao:xJmjEduplgE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/wxWidgets_info?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/wxWidgets_info?a=wWKRMn90Cao:xJmjEduplgE:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/wxWidgets_info?i=wWKRMn90Cao:xJmjEduplgE:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/wxWidgets_info?a=wWKRMn90Cao:xJmjEduplgE:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/wxWidgets_info?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/wxWidgets_info?a=wWKRMn90Cao:xJmjEduplgE:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/wxWidgets_info?i=wWKRMn90Cao:xJmjEduplgE:V_sGLiPBpWU" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://wxwidgets.info/axtk-an-accessibility-toolkit-for-wxwidgets/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://wxwidgets.info/axtk-an-accessibility-toolkit-for-wxwidgets/</feedburner:origLink></item>
		<item>
		<title>Работаем с Cairo в wxWidgets – Часть I – Компиляция CAIRO 1.8.6 на Visual C++ 8</title>
		<link>http://feedproxy.google.com/~r/wxWidgets_info/~3/QiSRW9x_QwM/</link>
		<comments>http://wxwidgets.info/rabotaem-s-cairo-v-wxwidgets-chast-i-kompilyaciya-cairo-186-na-visual-c-8/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 17:57:06 +0000</pubDate>
		<dc:creator>T-Rex</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[wxWidgets]]></category>
		<category><![CDATA[Статьи]]></category>

		<guid isPermaLink="false">http://wxwidgets.info/?p=540</guid>
		<description><![CDATA[Первая статья из цикла, повествующего о том, ка киспользовать библиотеку cairo (и обертку wxCairo) с wxWidgets. В этот раз речь пойдет о том, как собрать библиотеку cairo с помощью Visual C++ в Windows. Для начала определимся, что нам нужно: Mozilla Build 1.3 cairo 1.8.6 libpng 1.2.35 zlib 1.2.3 pixman 0.14.0 Устанавливаем Mozilla Build, распаковываем все [...]]]></description>
			<content:encoded><![CDATA[<p>Первая статья из цикла, повествующего о том, ка киспользовать библиотеку <strong>cairo</strong> (и обертку <strong>wxCairo</strong>) с wxWidgets.</p>
<p>В этот раз речь пойдет о том, как собрать библиотеку <strong>cairo</strong> с помощью Visual C++ в Windows.</p>
<p>Для начала определимся, что нам нужно:</p>
<ul>
<li>Mozilla Build 1.3</li>
<li>cairo 1.8.6</li>
<li>libpng 1.2.35</li>
<li>zlib 1.2.3</li>
<li>pixman 0.14.0</li>
</ul>
<p><span id="more-540"></span><br />
Устанавливаем Mozilla Build, распаковываем все библиотеки.</p>
<p>В переменных окружения прописываем пути к Visual Studio. Для того, чтобы все собралось успешно, необходимо, помимо Visual Studio установить Platform SDK.</p>
<pre class="brush: jscript; title: ; notranslate">
DevEnvDir = C:\Program Files\Microsoft Visual Studio 8\Common7\IDE
FrameworkDir = C:\WINDOWS\Microsoft.NET\Framework
FrameworkSDKDir = C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0
FrameworkVersion = v2.0.50727
INCLUDE = C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE;C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include
LIB = C:\Program Files\Microsoft Visual Studio 8\VC\ATLMFC\LIB;C:\Program Files\Microsoft Visual Studio 8\VC\LIB;C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib;C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\lib
LIBPATH = C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;C:\Program Files\Microsoft Visual Studio 8\VC\ATLMFC\LIB
PATH = C:\Program Files\Microsoft Visual Studio 8\Common7\IDE;C:\Program Files\Microsoft Visual Studio 8\VC\BIN;C:\Program Files\Microsoft Visual Studio 8\Common7\Tools;C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\bin;C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\bin;C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\bin;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;C:\Program Files\Microsoft Visual Studio 8\VC\VCPackages
SDKDIR = C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\
VCINSTALLDIR = C:\Program Files\Microsoft Visual Studio 8\VC
VSINSTALLDIR = C:\Program Files\Microsoft Visual Studio 8
VS80COMNTOOLS = C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\
</pre>
<p><a href="http://wxwidgets.info//wp-content/uploads/2009/04/build-cairo-01.png"><img class="alignnone size-full wp-image-541" title="Переменные окружения для сборки Cairo" src="http://wxwidgets.info//wp-content/uploads/2009/04/build-cairo-01.png" alt="Переменные окружения для сборки Cairo" /></a></p>
<p>Компилируем libpng и zlib</p>
<p>В папке, в которую мы установили Mozilla Build, запускаем скрипт <strong>start-msvc8.bat</strong>. В появившемся окне консоли переходим в папку, куда мы распаковали библиотеку <strong>pixman</strong>, и собираем ее командой</p>
<pre class="brush: cpp; title: ; notranslate">
make -f Makefile.win32 CFG=release
</pre>
<p>После сборки переносим файлы библиотек и заголовочные файлы для <strong>zlib</strong> и <strong>libpng</strong> в папку с <strong>cairo</strong>.</p>
<ul>
<li>zlib.h</li>
<li>zconf.in.h</li>
<li>zconf.h</li>
<li>pngconf.h</li>
<li>png.h</li>
<li>pixman.h</li>
<li>pixman-version.h</li>
<li>libpng.lib</li>
<li>zdll.lib</li>
</ul>
<p>В папке Cairo правим файл <strong>cairo-features.h</strong>:</p>
<pre class="brush: cpp; title: ; notranslate">
/* Generated by configure.  Do not edit. */
 #ifndef CAIRO_FEATURES_H
 #define CAIRO_FEATURES_H
 #define CAIRO_HAS_FT_FONT 0
 #define CAIRO_HAS_IMAGE_SURFACE 1
 #define CAIRO_HAS_PDF_SURFACE 1
 #define CAIRO_HAS_PNG_FUNCTIONS 1
 #define CAIRO_HAS_PS_SURFACE 1
 #define CAIRO_HAS_SVG_SURFACE 1
 #define CAIRO_HAS_USER_FONT 0
 #define CAIRO_HAS_XLIB_SURFACE 0
 #define CAIRO_HAS_XLIB_XRENDER_SURFACE 0
 /*#undef CAIRO_HAS_QUARTZ_FONT */
 /*#undef CAIRO_HAS_QUARTZ_SURFACE */
 #define CAIRO_HAS_WIN32_FONT 1
 #define CAIRO_HAS_WIN32_SURFACE 1
 #endif
</pre>
<p>В консоли MozillaBuild переходим в подкаталог src в папке с Cairo.<br />
<a href="http://wxwidgets.info//wp-content/uploads/2009/04/build-cairo-02.png"><img class="alignnone size-full wp-image-542" title="Собираем Cairo" src="http://wxwidgets.info//wp-content/uploads/2009/04/build-cairo-02.png" alt="Собираем Cairo" /></a></p>
<p>Собираем <strong>cairo</strong> командой</p>
<pre class="brush: cpp; title: ; notranslate">
make -f Makefile.win32 CFG=release
</pre>
<p>Если при сборке будет необходима библиотека <strong>pixman-1.lib</strong>, то копируем ее в эту же папку и повторно запускаем сборку.</p>
<p>После сборки <strong>cairo</strong> нам будут необходимы следующие файлы:</p>
<p>В результате нам для работы понадобятся только файлы:</p>
<ul>
<li>cairo-deprecated.h</li>
<li>cairo-features.h</li>
<li>cairo-pdf.h</li>
<li>cairo-ps.h</li>
<li>cairo-static.lib</li>
<li>cairo-svg.h</li>
<li>cairo-version.h</li>
<li>cairo-win32.h</li>
<li>cairo.dll</li>
<li>cairo.h</li>
<li>cairo.lib</li>
<li>zlib1.dll</li>
</ul>

<p><a href="http://feedads.g.doubleclick.net/~a/jrpks_o6GJXYDH_MDhSnm0k_nGg/0/da"><img src="http://feedads.g.doubleclick.net/~a/jrpks_o6GJXYDH_MDhSnm0k_nGg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/jrpks_o6GJXYDH_MDhSnm0k_nGg/1/da"><img src="http://feedads.g.doubleclick.net/~a/jrpks_o6GJXYDH_MDhSnm0k_nGg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/wxWidgets_info?a=QiSRW9x_QwM:hrJVVo7vTA8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/wxWidgets_info?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/wxWidgets_info?a=QiSRW9x_QwM:hrJVVo7vTA8:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/wxWidgets_info?i=QiSRW9x_QwM:hrJVVo7vTA8:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/wxWidgets_info?a=QiSRW9x_QwM:hrJVVo7vTA8:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/wxWidgets_info?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/wxWidgets_info?a=QiSRW9x_QwM:hrJVVo7vTA8:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/wxWidgets_info?i=QiSRW9x_QwM:hrJVVo7vTA8:V_sGLiPBpWU" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://wxwidgets.info/rabotaem-s-cairo-v-wxwidgets-chast-i-kompilyaciya-cairo-186-na-visual-c-8/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://wxwidgets.info/rabotaem-s-cairo-v-wxwidgets-chast-i-kompilyaciya-cairo-186-na-visual-c-8/</feedburner:origLink></item>
		<item>
		<title>Do You Need Data Access Layer Code Generator Tool?</title>
		<link>http://feedproxy.google.com/~r/wxWidgets_info/~3/WMYwYD5SP1Y/</link>
		<comments>http://wxwidgets.info/what-about-data-access-layer-code-generator-tool/#comments</comments>
		<pubDate>Sat, 11 Apr 2009 15:01:43 +0000</pubDate>
		<dc:creator>T-Rex</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://wxwidgets.info/?p=537</guid>
		<description />
			<content:encoded><![CDATA[<p><!--  POLLIN 1 --></p>

<p><a href="http://feedads.g.doubleclick.net/~a/LmxCq-7QsOttVCaf0TWPwQ42YZ8/0/da"><img src="http://feedads.g.doubleclick.net/~a/LmxCq-7QsOttVCaf0TWPwQ42YZ8/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/LmxCq-7QsOttVCaf0TWPwQ42YZ8/1/da"><img src="http://feedads.g.doubleclick.net/~a/LmxCq-7QsOttVCaf0TWPwQ42YZ8/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/wxWidgets_info?a=WMYwYD5SP1Y:CrGjZURiMnA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/wxWidgets_info?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/wxWidgets_info?a=WMYwYD5SP1Y:CrGjZURiMnA:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/wxWidgets_info?i=WMYwYD5SP1Y:CrGjZURiMnA:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/wxWidgets_info?a=WMYwYD5SP1Y:CrGjZURiMnA:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/wxWidgets_info?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/wxWidgets_info?a=WMYwYD5SP1Y:CrGjZURiMnA:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/wxWidgets_info?i=WMYwYD5SP1Y:CrGjZURiMnA:V_sGLiPBpWU" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://wxwidgets.info/what-about-data-access-layer-code-generator-tool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://wxwidgets.info/what-about-data-access-layer-code-generator-tool/</feedburner:origLink></item>
		<item>
		<title>Работа с базами данных в wxWidgets – DatabaseLayer – Минимальное приложение</title>
		<link>http://feedproxy.google.com/~r/wxWidgets_info/~3/W36S9krn118/</link>
		<comments>http://wxwidgets.info/rabota-s-bazami-dannyx-v-wxwidgets-databaselayer-minimalnoe-prilozhenie/#comments</comments>
		<pubDate>Sat, 11 Apr 2009 14:23:55 +0000</pubDate>
		<dc:creator>T-Rex</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[DatabaseLayer]]></category>

		<guid isPermaLink="false">http://wxwidgets.info/?p=527</guid>
		<description><![CDATA[Вслед за анонсом новой версии DatabaseLayer, кросс-платформенной библиотеки для работы с базами данных, решил выложить небольшой туториал с примером использования DatabaseLayer. В этот раз мы рассмотрим пример создания простейшего консольного приложения, использующего эту библиотеку для работы с базами данных. В качестве среды разработки будем использовать Visual Studio. Это самый простой способ добиться желаемого результата. Бесплатная [...]]]></description>
			<content:encoded><![CDATA[<p>Вслед за <a title="Анонс DatabaseLayer 1.8" href="http://wxwidgets.info/databaselayer-18-released/" target="_blank">анонсом</a> новой версии <strong>DatabaseLayer</strong>, кросс-платформенной библиотеки для работы с базами данных, решил выложить небольшой туториал с примером использования <strong>DatabaseLayer</strong>.</p>
<p>В этот раз мы рассмотрим пример создания простейшего консольного приложения, использующего эту библиотеку для работы с базами данных.</p>
<p><span id="more-527"></span>В качестве среды разработки будем использовать Visual Studio. Это самый простой способ добиться желаемого результата. Бесплатная версия Visual Studio Express Edition тоже вполне подойдет для создания приложений на С++/wxWidgets.</p>
<p>Для начала создадим консольное приложение и назовем его DatabaseLayerMinimal.</p>
<p><img class="alignnone size-full wp-image-528" title="databaselayerminimal_01" src="http://wxwidgets.info//wp-content/uploads/2009/04/databaselayerminimal_01.png" alt="databaselayerminimal_01" /></p>
<p>В настройках проекта указываем тип приложение Console Application и стамим маркер на Empty Project.</p>
<p><img class="alignnone size-full wp-image-529" title="databaselayerminimal_02" src="http://wxwidgets.info//wp-content/uploads/2009/04/databaselayerminimal_02.png" alt="databaselayerminimal_02" /></p>
<p>После того как мы создали проект, распаковываем DatabaseLayer рядом с папкой, в которой находится .sln-файл решения.</p>
<p><img class="alignnone size-full wp-image-530" title="databaselayerminimal_03" src="http://wxwidgets.info//wp-content/uploads/2009/04/databaselayerminimal_03.png" alt="databaselayerminimal_03" /></p>
<p>Затем добавляем в решение проект <strong>databaselayer_databaselayer_sqlite.dsp</strong> &#8211; это проект SqliteDatabaseLayer, который позволяет получить доступ к базам данных SQLite в приложении.</p>
<p>После этого необходимо настроить конфигурации сборки. Открываем Configuration Manager (Build -&gt; Configuration Manager) и устанавливаем для проекта databaselayer_sqlite нужную отладочную и финальную конфигурацию. В нашем примере это <strong>Static Unicode Debug Multilib Static</strong> и <strong>Static Unicode Release Multilib Static</strong>.</p>
<p><img class="alignnone size-full wp-image-531" title="databaselayerminimal_04" src="http://wxwidgets.info//wp-content/uploads/2009/04/databaselayerminimal_04.png" alt="databaselayerminimal_04" width="645" height="404" /></p>
<p>После этого в нашем проекте приложения необходимо настроить пути для поиска заголовочных файлов, файлов библиотек, а также список дополнительных библиотек для сборки проекта.</p>
<p>Для этого в свойствах проекта в разделе <strong>C/C++ -&gt; General </strong>в свойстве Additional Include Directories прописываем:</p>
<pre class="brush: jscript; title: ; notranslate">
$(SolutionDir)..\databaselayer\include
</pre>
<p>В разделе <strong>Linker -&gt; General </strong>в свойстве Additional Library Directories прописываем:</p>
<pre class="brush: jscript; title: ; notranslate">
$(SolutionDir)..\databaselayer\lib\vc_lib
</pre>
<p>В разделе <strong>Linker -&gt; Input </strong>в свойстве Additional Dependencies указываем список необходимых библиоек:</p>
<p><img class="alignnone size-full wp-image-532" title="databaselayerminimal_05" src="http://wxwidgets.info//wp-content/uploads/2009/04/databaselayerminimal_05.png" alt="databaselayerminimal_05" /></p>
<p><img id="kosa-target-image" style="position: absolute; visibility: hidden; z-index: 2147483647; left: 15px; top: 3036px;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAUCAYAAACJfM0wAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAAB90RVh0U29mdHdhcmUATWFjcm9tZWRpYSBGaXJld29ya3MgOLVo0ngAAAAWdEVYdENyZWF0aW9uIFRpbWUAMDQvMDQvMDhrK9wWAAACMElEQVQ4ja3SP2gTcRQH8O8vvUtIGmkqTY3SaMVFz6KDW2ywg4s4dGgXp3SyVLIIthCKQxCCuoZaXaSO/ilKd4sSdXRL0EWtIRYaSkXsJTH33utwSZM01xo0D353v+N+97l33/upQCAwFgwGfehiFYtFUxsYGPCmUqmv3YQTicSwBgCapnXTBQBoSinout5VVCnVDr/44B/OZH0xs6KMThCfR3LRs+aTycjvbwfCmawvduZkn7EwN4TBfheY90fXN6uYuffdyGQRu3apkmyDmzM2K8pYmBvC6kcLK+/KMEsWLCIQMSyLULUIFhH0HsGNycNYnDuO6PRno9lQSsFVh+tDQSEY6MHymzJKFQILgxkgYhALmBnMDLNsIf1sA8cG3VDYYzhFAWWfRBjCAiIbIxYQE1ga17+2GSICKLQYznCtiATEDK6BIrU5MUhgd0+NH+AIt+5jshdqgkpVwEwNkBgs9lyE4XY3nnLMWNf13QEAG1uE2JVe9PUC5JCvCMPrVpifOor1YnW34/pw7NjvVbmZ+3ljcTaMq5EjbRFJ07Gw8QfTd9fg96rc3o7bMh4f9SytvDenLl7/ZADAl5cjWF7dwmy60PaSeiPjo56lv2Ycnzi0Fp9AEgAu39x8+urtT9x5/GP74a2++LlTuumo76kDd4W9ALj9qIDIiOfBhdO+jtB9O279TFcuet77fD7Wn+sU7ajj1+kTSccb/wv/aymloEKh0Fg4HPZ2E87n86Udvs4FoWqwSHUAAAAASUVORK5CYII=" alt="" /></p>
<p>Все, настройку проекта мы закончили, теперь можно заняться написанием кода.</p>
<p>Для каждого сервера баз данных в библиотеке DatabaseLayer существует соответствующий класс соединения. В нашем примере мы будем работать с базой данных SQLite. Для этого будем использовать класс <strong>SqliteDatabaseLayer</strong>.</p>
<p>Для того чтобы открыть базу данных можно использовать два пути:</p>
<ul>
<li>Вызвать конструктор с параметрами и скормить ему путь к базе данных.</li>
<li>Использовать конструктор без параметров и метод <strong>Open</strong>().</li>
</ul>
<p>В нашем примере будет использоваться первый способ.</p>
<p>Для разрыва соединения с базой данных (или для закрытия файла базы данных) используется метод <strong>Close()</strong>.</p>
<p>В библиотеке DatabaseLayer для обработки ошибок используется механизм исключений. Для обработки ошибок необходимо отлавливать исключение <strong>DatabaseLayerException</strong>.</p>
<p>Итак, минимальное приложение, способное открыть базу данных выглядит так:</p>
<pre class="brush: cpp; title: ; notranslate">
#include &lt;wx/wx.h&gt;
#include &lt;DatabaseLayer.h&gt;
#include &lt;SqliteDatabaseLayer.h&gt;
#include &lt;DatabaseLayerException.h&gt;

int main()
{
	int returnCode(0);
	DatabaseLayer * connection(NULL);
	do
	{
		try
		{
			connection = new SqliteDatabaseLayer(wxT(&quot;Minimal.sqlite&quot;), false);
		}
		catch(DatabaseLayerException &amp; e)
		{
			returnCode = 2;
			wxPrintf(wxT(&quot;%d %s&quot;), e.GetErrorCode(), e.GetErrorMessage().GetData());
		}
	}
	while(false);
	wxDELETE(connection);
	getchar();
	return returnCode;
}
</pre>
<p>Необходимо помнить, что все ресурсы нужно освобождать руками.</p>
<p>Для выборки данных из таблицы используется метод RunQueryWithResults(), который возвращает указатель но объект <code>DatabaseResultSet</code>. После работы с результатми запроса, объект <code>DatabaseResultSet</code> необходимо <strong>обязательно закрыть</strong> во избежание утечек памяти. Сделать это можно, вызывав метод <code>DatabaseLayer::CloseResultSet()</code>.</p>
<p>Для обхода записей, возвращенных с помощью метода <code>RunQueryWithResults()</code> используется метод <code>DatabaseResultSet::Next()</code>.</p>
<p>Для получения значения поля в классе <code>DatabaseResultSet</code> существует соответствующий набор методов &#8211; <code>GetResultInt()</code>, <code>GetResultString()</code>, <code>GetResultBool()</code> и т.д. Каждый из этих методов может принимать как имя поля, так и порядковый номер (zero-based).</p>
<p>Для запросов, которые не возвращают список записей (INSERT, DELETE) используется метод <code>RunQuery()</code>.</p>
<p>И вот со всем, описанным выше, мы подошли к рассмотрению более сложного примера &#8211; приложение открывает базу данных SQLite, проверяет ее на наличие таблиц. Если таблицы не найдены, то приложение создает одну таблицу и заполняет ее данными. После этого происходит выборка данных и отображение результатов выборки в консоли.</p>
<pre class="brush: cpp; title: ; notranslate">
#include &lt;wx/wx.h&gt;
#include &lt;DatabaseLayer.h&gt;
#include &lt;SqliteDatabaseLayer.h&gt;
#include &lt;DatabaseLayerException.h&gt;

int main()
{
	int returnCode(0);
	DatabaseLayer * connection(NULL);
	DatabaseResultSet * result(NULL);
	do
	{
		try
		{
			connection = new SqliteDatabaseLayer(wxT(&quot;Minimal.sqlite&quot;), false);
			result = connection-&gt;RunQueryWithResults(
				wxT(&quot;SELECT * FROM sqlite_master WHERE type='table'&quot;));
			if(!result || !result-&gt;Next())
			{
				connection-&gt;RunQuery(
					wxT(&quot;CREATE TABLE SampleTable \
						(ID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, \
						Name VARCHAR(32))&quot;));
				for(int i = 0; i &lt; 5; i++)
				{
					connection-&gt;RunQuery(wxString::Format(
						wxT(&quot;INSERT INTO SampleTable (Name) VALUES ('%i')&quot;), rand()));
				}
			}
			if(result)
			{
				connection-&gt;CloseResultSet(result);
				result = NULL;
			}
			result = connection-&gt;RunQueryWithResults(wxT(&quot;SELECT * FROM SampleTable&quot;));
			if(!result)
			{
				returnCode = 1;
				break;
			}
			while (result-&gt;Next())
			{
				wxPrintf(wxT(&quot;%d - %s\r\n&quot;),
					result-&gt;GetResultInt(wxT(&quot;ID&quot;)),
					result-&gt;GetResultString(wxT(&quot;Name&quot;)).GetData());
			}
		}
		catch(DatabaseLayerException &amp; e)
		{
			returnCode = 2;
			wxPrintf(wxT(&quot;%d %s&quot;), e.GetErrorCode(), e.GetErrorMessage().GetData());
		}
	}
	while(false);
	if(connection)
	{
		if(result) connection-&gt;CloseResultSet(result);
	}
	wxDELETE(connection);
	getchar();
	return returnCode;
}
</pre>
<p><a href="http://wxwidgets.info//wp-content/uploads/2009/04/databaselayerminimal.7z" title="Скачать исходник: Минимальное приложение с DatabaseLayer">Скачать исходный код примера</a>.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/k6eYcdJcoqPHHptK74VjIHyIbLk/0/da"><img src="http://feedads.g.doubleclick.net/~a/k6eYcdJcoqPHHptK74VjIHyIbLk/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/k6eYcdJcoqPHHptK74VjIHyIbLk/1/da"><img src="http://feedads.g.doubleclick.net/~a/k6eYcdJcoqPHHptK74VjIHyIbLk/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/wxWidgets_info?a=W36S9krn118:cobQ569CxYU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/wxWidgets_info?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/wxWidgets_info?a=W36S9krn118:cobQ569CxYU:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/wxWidgets_info?i=W36S9krn118:cobQ569CxYU:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/wxWidgets_info?a=W36S9krn118:cobQ569CxYU:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/wxWidgets_info?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/wxWidgets_info?a=W36S9krn118:cobQ569CxYU:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/wxWidgets_info?i=W36S9krn118:cobQ569CxYU:V_sGLiPBpWU" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://wxwidgets.info/rabota-s-bazami-dannyx-v-wxwidgets-databaselayer-minimalnoe-prilozhenie/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://wxwidgets.info/rabota-s-bazami-dannyx-v-wxwidgets-databaselayer-minimalnoe-prilozhenie/</feedburner:origLink></item>
	</channel>
</rss>

