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't do that in cross-platform manner.
It is official bug that wxScreenDC does not work properly under Mac OS and you can't use Blit() message for copying screen onto wxMemoryDC.
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't used neither Carbon nor Cocoa before. However everything works now and I'm happy.
Here it is:
After taking a look at wxWidgets samples I noticed that all of them have simple message box instaed of normal about box. However in real applications About dialog is important enough part of GUI.
So, in this post I'm going to tell a bit about creating About boxes for your software.
wxWidgets has builf-in API for creating "standard" dialog boxes. wxAboutBox() function is used for displaying About box and wxAboutDialogInfo object, which contains all necessary information, should be passed to wxAboutBox() function.
Several days ago I found How to draw gradient buttons post at Native Mobile blog. Looks nice but I think that using
GradienFill()
is not very convenient because you need to fill all these TRIVERTEX
structures. wxWidgets provides more convenient way of drawing gradients by using wxDC::GradientFillLinear()
. Here is how it can be done in wxWidgets:In my previous posts here and here I showed how to create a simple application which uses Document/View framework. Now I’m going to show more complex example – image viewer with scrolling and selection rectangle. As far as I can see from wxForum, implementation of selection-related functionality is some kind of complex but very useful task. So, let’s start from simple part. The simplest task here is modification of our wxDocument-related class.
Today we’ll dig a little bit deeper into Document/View framework provided by wxWidgets and will see how to create a simple text editor using this framework.
We’ll take the source code from the previous article of this series and add some modifications. You will see below that modifications are rather simple and take almost no time.
First of all we have to make
wxDocTemplate
to handle desired file extensions (in our case it’s TXT).A few weeks ago, working on TIFF viewer software, I realized that many developers, who use wxWidgets in their work, spend their time on implementing the functionality which already exists in wxWidgets library. Such tasks as loading/saving documents, edit/copy/paste functionality, separating the GUI from application’s logic, all of them can be performed in a far…
Preface
Here is a fourth part of wxJSON tutorial provided by Luciano Cattani, author and maintainer of wxJSON library.- Visit wxJSON homepage
- Read Part I of this tutorial
- Read Part II of this tutorial
- Read Part III of this tutorial
- Read Part IV of this tutorial
Using Comment Lines in wxJSON
Comments are not supported by the JSON syntax specifications but many JSON implementations do recognize and store comment lines in the JSON value objects. Starting by version 0.2, the wxJSON library do recognize and store C/C++ comment lines in the JSON input text and can also write comments to the JSON output text.Preface
Here is a third part of wxJSON tutorial provided by Luciano Cattani, author and maintainer of wxJSON library.- Visit wxJSON homepage
- Read Part I of this tutorial
- Read Part II of this tutorial
- Read Part III of this tutorial
- Read Part IV of this tutorial
Describing a Table with wxJSON
How many times did you use a table in your application? I know the answer: many times. So the best thing would be to write a general-purpose panel window that is capable to show every possible table and table's format.Preface
Here is a second part of wxJSON tutorial provided by Luciano Cattani, author and maintainer of wxJSON library.- Visit wxJSON homepage
- Read Part I of this tutorial
- Read Part II of this tutorial
- Read Part III of this tutorial
- Read Part IV of this tutorial