📜 ⬆️ ⬇️

My experience with wxWidgets

Purpose of the article



But first story


So, once, working at one of the industrial enterprises, which had its own equipment for the commercial accounting of oil, with its software solutions under different operating systems, more and more often began to think about cross-platform software development.

I sipped then different libraries. Gtk + and QT were on the list. But really, I got attracted by wxWidgets.

At the same time, I had a private database project for a company that was involved in supporting car purchase transactions, insurance, maintenance. I did it on weekends. At the initial stage of this project, I tried QT, Gtk +, wxWidgets, but in the end I completely re-implemented it with the help of other tools, because:
Patience is an excellent quality, but life is too short to endure for a long time - Abu-l-Faraj.

At that time, the reason for not using these libraries was the time limit, not the complexity of the technical implementation. Business does not like to wait.

In general, during the development of this project for each library I tested, I reached a certain level of completion. The table shows the results in ascending order.
ToolWhat was doneFeedback from the customerRejection reason
QTA couple of forms + binding them with logic.Not submitted to the customer.Spent a lot of time searching for solutions.
Gtk +Whole GUI.For WinXP GUI did not look like a native and familiar.There was a lack of a GUI builder integrated into the IDE.
Not the usual GUI view.
Bulkiness of implementation, long names of functions.
Spent a lot of time searching for solutions.
wxWidgetsEntire GUI + DB.There was no printing of documents with precise positioning of the elements.There was no ready-made document template generator for printing.

There were others, but their results are even more modest than those of QT.
')
To be fair, it must be said that this was the first experience of using all these libraries. If it were not for the generator of document templates for printing in wxWidgets ...

Now what?


As a result, quite recently, I made a minimally viable cross-platform template generator and client library for printing using wxWidgets at the level I would have had then.

Those who want to try can take here: c-help.tk . The site was kindly provided to me by my brother, I asked him to draw up as simply as possible and without frills. I hope we did it.

What we have at the moment:


What does this look like?

Template generator:

image

The simplest client (console application on the left):

image

How it works?

Template generator:

1. A certain template is created in which the graphic elements are precisely located, as in the technical drawing.
2. An enumeration of variable names is created.
3. In the right places of the templates are text boxes.
4. In the text fields, you can enter static text along with the variable names. The variable is specified between the special characters "$ {" and "} $" (for now only manually).
5. The template is saved to a file. There may be many templates in the file. Image files are not attached to the template. The client for printing gives only pictures in the BMP format.
Client + client library:
6. Loads the template file.
7. Selects the template (currently only through the index).
8. Sets data into variables (currently only through an index).
9. Issues to print. Printing may cause an offset due to different printer margin settings.

Conclusion


What was used:


What pleased in wxWidgets:


What is not very pleased with wxWidgets:


I think that without automating many things in Code :: Blocks, using wxWidgets would be more difficult.

That's all for now.

Source: https://habr.com/ru/post/273141/


All Articles