Cross-Platform Programming with wxWidgets
Just Make It Cross-Platform
Subscribe to Feed
  • Home
  • Projects
  • Links

Posts Tagged ‘Components’

Taking Screenshots with wxWidgets under Mac OS is Really Tricky.

Components, Libraries 4 Comments » |

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:
(more…)


May 21st, 2009 |

Tags: Articles, Components, wxWidgets




AxTk: An Accessibility Toolkit for wxWidgets

Components, Libraries, News 3 Comments » |

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 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.

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.

Note that AxTk is a work in progress and the API is subject to change.
(more…)


May 7th, 2009 |

Tags: Components, wxWidgets




How to Create Nice About Box in wxWidgets

Components, wxWidgets 2 Comments » |

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.
(more…)


January 25th, 2009 |

Tags: Articles, Components, Tutorilas, wxWidgets, Статьи




Классы редактирования даты и времени в ячейках wxGrid

Components, Controls, wxWidgets No Comments » |

Александр (sandy) Илюшенко любезно предоставил статью о создании редактора ячеек wxGrid:

Данная статья посвящена внедрению в грид ячеек для редактирования дат и времени. Сам котрол для дат существует – wxDatePickerCtrl. Остается вопрос, как прикрутить его к гриду.
(more…)


December 16th, 2008 |

Tags: Components, Controls, wxGrid, wxWidgets, Статьи




Переопределение поведения стандартных компонентов. Делаем свой wxGrid

Components, Controls, wxWidgets No Comments » |

Александр (sandy) Илюшенко любезно предоставил статью о том, как настроить класc wxGrid под свои нужды:

Захотелось мне как-то, чтобы в гриде были не номера строк, а маркер.
К тому же очень хотелось, чтобы незаполненное пространство грида было не белым, а, примерно, как на рисунке ниже.
Делаем собственный wxGrid
Навеяно это было в основном аналогичными и другими классами, предоставляемыми MFC. Тут же и вспомнилось, что подобные классы также прдоставляют очень полезные методы для хранения дополнительных не отображаемых данных, такие как SetData() или GetData().
(more…)


December 16th, 2008 |

Tags: Components, Controls, wxGrid, wxWidgets, Статьи




How to Draw Gradient Buttons (wxWidgets Way)

Books, Components, Controls, wxWidgets No Comments » |

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:
(more…)


August 3rd, 2008 |

Tags: Articles, Components, Controls, wxButton, wxWidgets, wxWinCE, Статьи




Реализация Job Queue на wxWidgets (+исходник)

Components, wxWidgets No Comments » |

При работе с потоками часто приходится делать кучу однотипных задач: создавать класс, производный от wxThread, реализовывать метод Entry() для этого класса, синхронизацию с главным потоком и т.д.

Eran, автор CodeLite IDE поделился кодом класса JobQueue, который реализует пул потоков и позволяет выполнять задачи в фоновом режиме.

class MyJob : public Job {
public:
        MyJob(){}
        ~MyJob(){}

        // Implement your processing code here
        void Process() {
                wxPrintf(wxT("Just doing my work...n"));
        };
};

// define some custom job with progress report
class MyJobWithProgress : public Job {
public:
        MyJobWithProgress(wxEvtHandler *parent) : Job(parent){}
        ~MyJobWithProgress(){}

        // Implement your processing code here
        void Process() {
                // report to parent that we are at stage 0
                Post(0, wxT("Stage Zero"));
                // do the work
                wxPrintf(wxT("Just doing my work...n"));
                // report to parent that we are at stage 1
                Post(1, wxT("Stage Zero Completed!"));
        };
};

// somewhere in your code, start the JobQueue
// for the demo we use pool of size 5
JobQueueSingleton::Instance()->Start(5);

// whenever you want to process MyJob(), just create new instance of MyJob() and add it to the JobQueue
JobQueueSingleton::Instance()->AddJob( new MyJob() );

// at shutdown stop the job queue and release all its resources
JobQueueSingleton::Instance()->Stop();
JobQueueSingleton::Release();

// OR, you can use JobQueue directly without the JobQueueSingleton wrapper class
// so you could have multiple instances of JobQueue

Главный поток получает уведомления таким вот образом:

// in the event table
EVT_COMMAND(wxID_ANY, wxEVT_CMD_JOB_STATUS, MyFrame::OnJobStatus)

void MyFrame::OnJobStatus(wxCommandEvent &e)
{
    wxString msg;
    msg << wxT("Job progress: Stage: ") << e.GetInt() << wxT(" Message: ") << e.GetString();
    wxLogMessage(msg)
}

Скачать исходный код
Читать обсуждение на wxForum


May 10th, 2008 |

Tags: Components, wxThread, wxWidgets, Статьи




Multilingual Applications? It’s Simple!

Uncategorized 2 Comments » |

I was digging wxForum searching for a solution of some of my problems and realized that many people ask questions related to wxLocale and multilingual applications and it seems that setting up the development of multilingual applications is hard enough for junior programmers. So, today I want to tell you about how to start…. start the development of software which supports different languages.
(more…)


May 26th, 2007 |

Tags: Articles, Components, Localization, wxLocale, wxWidgets, Статьи




  • This blog is about…

    Библиотека Книги Статьи Articles Code::Blocks Components Controls Database DatabaseLayer Document/View Eclipse Localization NetBeans Networking News Printing Reports SQLite Tutorilas Video Visual Studio wxAUI wxButton wxDev-CPP wxGrid wxHelpController wxJavaScript wxJSON wxLocale wxLog wxPaintDC wxPropertyGrid wxRuby wxSQLite3 wxThread wxValidator wxWidgets wxWinCE wxZipInputStream wxZipOutputStream XML
  • Showcase

    Visit wxToolBox Homepage

    Buy wxToolBox (with source code)

  • Archives

    • November 2009
    • September 2009
    • August 2009
    • May 2009
    • April 2009
    • March 2009
    • February 2009
    • January 2009
    • December 2008
    • September 2008
    • August 2008
    • July 2008
    • June 2008
    • May 2008
    • April 2008
    • March 2008
    • February 2008
    • January 2008
    • December 2007
    • June 2007
    • May 2007
    • January 2007
  • Recent Comments

    • T-Rex on Сделайте мне красиво – Часть II – wxAUI в Multi-View приложений
    • Vanya on Сделайте мне красиво – Часть II – wxAUI в Multi-View приложений
    • Sash on wxWidgets-2.8 and Code::Blocks (Windows)
    • T-Rex on Быстрый способ упаковки содержимого папки в ZIP-архив
    • Gerald on Быстрый способ упаковки содержимого папки в ZIP-архив
  • Buttons

    Locations of visitors to this page

    Rambler's Top100
    Рейтинг@Mail.ru

Copyright © 2010 Cross-Platform Programming with wxWidgets All Rights Reserved
RSS Log in