r/wxWidgets • • Dec 23 '24

WxWidgets Starting to Support Mordern C++

9 Upvotes

I'm thrilled to notice that wxWidgets is starting to upgrade to modern C++. How are you upgrading your wxWidgets app code base from pre C++-11 to modern C++? Share your experiences.

Bind(wxEVT_MENU, [=](wxCommandEvent&) { wxLogMessage("Hello from a lambda!"); }, ID_Hello);

r/wxWidgets • • Dec 17 '24

A Custom wxWidget Minesweeper

8 Upvotes

wxWidgets has truly impressed me, and I'm glad it came to the rescue for those of us who use C++ as our primary language. Since learning C++, I’ve been excited to build GUI applications, and wxWidgets has become my tool of choice.

To test my mastery of the library, I built a working Minesweeper game that features an intuitive interface and smooth gameplay. You can clone and test the code here. The interface follows the design shown in the figure below. What do you think? Are there any suggestions for making the interface even more user-friendly?

Starting the game:

Game in progress:

When the game ends after losing:


r/wxWidgets • • Mar 19 '23

Thought this was a neat way to have a slider modify a gauge. Also updates value in StatusBar simultaneously. Took a while to figure out.

Post image
7 Upvotes

r/wxWidgets • • 7d ago

The Point of Sale (POS) program of my stores, that the cashiers use, uses wxWidgets! I made it myself

Post image
6 Upvotes

r/wxWidgets • • Dec 11 '24

From Design to wxWidget GUI

6 Upvotes

I am an experienced C++ developer who has been exploring cross-platform frameworks for GUI development. I discovered wxWidgets and found it to be an indispensable tool for creating robust and versatile graphical interfaces. Leveraging my experience with wxWidgets, I designed and developed a sample POS GUI to demonstrate my skills. Below, you can find the design and the corresponding code.

PS: I am open to take a challenge on developing a GUI in wxWidgets - be free to send/tag me some designs.

The POS GUI design & the final look are the same.

main.h

#ifndef __MAIN_H__
#define __MAIN_H__

#include "wx/wx.h"

class MyApp : public wxApp
{
public:
    virtual bool OnInit();
};

wxDECLARE_APP(MyApp);

class MainFrame : public wxFrame
{
public:
    MainFrame();
    MainFrame(wxWindow *, wxWindowID, const wxString &);

    wxMenuBar * createMenu();
    wxSizer * createLeftPane();
    wxSizer * createMiddlePane();
    wxSizer * createRightPane();

    wxComboBox * createComboBox(wxWindow *);
    wxButton *createButton(wxWindow *, const wxString&, bool = false);
};

#endif

main.cpp

#include "wx/wx.h"
#include "wx/spinctrl.h"
#include "wx/listctrl.h"
#include "wx/notebook.h"
#include "main.h"
#include <vector>

MainFrame::MainFrame() {};
MainFrame::MainFrame(wxWindow *parent, wxWindowID id, const wxString &title)
    : wxFrame(parent, id, title)
{
    // ShowFullScreen(!IsFullScreen());
    SetBackgroundColour(wxColor(174, 238, 240));
    Refresh();
    SetMenuBar(createMenu());

    wxBoxSizer *mainLayoutSizer = new wxBoxSizer(wxVERTICAL);

    wxBoxSizer *topSizer = new wxBoxSizer(wxHORIZONTAL);

    topSizer->Add(createLeftPane(), 0, wxEXPAND | wxALL, 5);
    topSizer->Add(createMiddlePane(), 1, wxEXPAND | wxALL, 5);
    topSizer->Add(createRightPane(), 1, wxEXPAND | wxALL, 5);

    wxBoxSizer *bottomSizer = new wxBoxSizer(wxVERTICAL);

    /* Create the notebook */
    wxNotebook *notebook = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxSize(300, 200));
    notebook->SetBackgroundColour(*wxCYAN);
    wxPanel *window1 = new wxPanel(notebook, wxID_ANY);
    wxPanel *window2 = new wxPanel(notebook, wxID_ANY);
    wxPanel *window3 = new wxPanel(notebook, wxID_ANY);
    wxPanel *window4 = new wxPanel(notebook, wxID_ANY);
    wxPanel *window5 = new wxPanel(notebook, wxID_ANY);
    wxPanel *window6 = new wxPanel(notebook, wxID_ANY);
    wxPanel *window7 = new wxPanel(notebook, wxID_ANY);

    notebook->AddPage(window1, wxT("General Notes"));
    notebook->AddPage(window2, wxT("CT News"));
    notebook->AddPage(window3, wxT("Deborah"));
    notebook->AddPage(window4, wxT("Johanna"));
    notebook->AddPage(window5, wxT("Lisa"));
    notebook->AddPage(window6, wxT("Shanah"));
    notebook->AddPage(window7, wxT("Waynette"));

    bottomSizer->Add(notebook, 1, wxEXPAND | wxALL, 2);

    mainLayoutSizer->Add(topSizer, 1, wxEXPAND | wxALL);
    mainLayoutSizer->Add(bottomSizer, 0, wxEXPAND | wxALL);

    // SetSize(wxGetDisplaySize());

    SetSizer(mainLayoutSizer);
    mainLayoutSizer->Fit(this);
    mainLayoutSizer->SetSizeHints(this);
    Maximize();
}

wxSizer *MainFrame::createLeftPane()
{
    wxPanel *panel = new wxPanel(this, wxID_ANY);
    panel->SetBackgroundColour(wxColor(115, 191, 178));

    wxBoxSizer *topLeftSizer = new wxBoxSizer(wxVERTICAL);

    // Create and add combo box
    wxComboBox *combo = createComboBox(panel);
    topLeftSizer->Add(combo, 1, wxALL, 2);

    // Create and add buttons
    const wxString buttonLabels[] = {
        wxT("Consignors"),
        wxT("Suppliers"),
        wxT("Customers"),
        wxT("Add New Item"),
        wxT("Add New Item List"),
        wxT("Add Customer Wish"),
        wxT("Review Inventory"),
        wxT("Account Communic ations"),
        wxT("Customer Credit Adjust"),
        wxT("Sell Gift Car d"),
        wxT("Wish List Search"),
        wxT("Review Orders"),
        wxT("Review Sold Items"),
        wxT("Help Topics")};

    for (const auto &label : buttonLabels)
    {
        topLeftSizer->Add(createButton(panel, label, true), 1, wxALL, 2);
    }

    panel->SetSizer(topLeftSizer);
    topLeftSizer->Fit(panel);
    topLeftSizer->SetSizeHints(panel);

    wxBoxSizer *topLeftMainSizer = new wxBoxSizer(wxVERTICAL);
    topLeftMainSizer->Add(panel, 1, wxEXPAND | wxALL, 1);
    return topLeftMainSizer;
}

wxComboBox *MainFrame::createComboBox(wxWindow *parent)
{
    wxArrayString strings;
    strings.Add(wxT("Apple"));
    strings.Add(wxT("Orange"));
    strings.Add(wxT("Pear"));
    strings.Add(wxT("Grapefruit"));

    return new wxComboBox(parent, wxID_ANY, wxT("Apple"), wxDefaultPosition, wxSize(250, -1),
                          strings, wxCB_READONLY);
}

wxButton *MainFrame::createButton(wxWindow *parent, const wxString &label, bool highlight)
{
    wxButton *button = new wxButton(parent, wxID_ANY, label, wxDefaultPosition, wxSize(250, -1));
    if (highlight)
    {
        button->SetBackgroundColour(wxColor(124, 253, 128));
    }
    return button;
}

wxSizer *MainFrame::createMiddlePane()
{
    struct items
    {
        int sku;
        wxString name;
        double price;
        int qty;
        double subtotal;
    };

    items data[] = {
        items{30059, wxT("Halter jean top"), 14.99, 1, 14.99},
        items{30044, wxT("Short Bik"), 10.99, 1, 10.99},
        items{29591, wxT("Puzzle * dinosaur"), 6.99, 1, 6.99},
        items{29508, wxT("Hair Bow"), 1.99, 1, 1.99},
        items{29493, wxT("Sweat Pant * Aqua"), 10.99, 1, 10.99},
        items{29470, wxT("Jeans * Bootcut"), 6.99, 1, 6.99},
        items{29479, wxT("Aqua Pebbles"), 2.99, 2, 5.98}};
    wxBoxSizer *middleSizer = new wxBoxSizer(wxVERTICAL);

    wxBoxSizer *middleTopSizer = new wxBoxSizer(wxHORIZONTAL);

    wxPanel *panel = new wxPanel(this, wxID_ANY);
    panel->SetBackgroundColour(wxColor(115, 191, 178));

    wxPanel *discountCheckPanel = new wxPanel(panel, wxID_ANY);
    wxCheckBox *discountCheck = new wxCheckBox(discountCheckPanel, -1, wxT("Discount %"), wxDefaultPosition, wxSize(250, 50), wxALIGN_RIGHT);
    wxBoxSizer *checkSizer = new wxBoxSizer(wxHORIZONTAL);
    discountCheckPanel->SetBackgroundColour(wxColor(242, 239, 242));
    checkSizer->Add(discountCheckPanel, 1, wxEXPAND | wxALL, 2);

    wxSpinCtrl *discountCountSpin = new wxSpinCtrl(panel, -1, wxT("0"), wxDefaultPosition, wxSize(-1, 50), wxSP_ARROW_KEYS, 0, 100, 5);
    wxStaticText *qtyText = new wxStaticText(panel, -1, wxT("Qty"), wxDefaultPosition, wxSize(-1, -1), wxALIGN_RIGHT);
    wxSpinCtrl *qtySpin = new wxSpinCtrl(panel, -1, wxT("0"), wxDefaultPosition, wxSize(-1, 50), wxSP_ARROW_KEYS, 0, 100, 5);
    wxStaticText *text = new wxStaticText(panel, -1, wxT(""), wxDefaultPosition, wxSize(-1, 50));
    text->SetBackgroundColour(*wxWHITE);

    middleTopSizer->Add(checkSizer, 1, wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL, 2);
    middleTopSizer->Add(discountCountSpin, 0, wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL, 2);
    middleTopSizer->Add(qtyText, 0, wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL, 8);
    middleTopSizer->Add(qtySpin, 0, wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL, 2);
    middleTopSizer->Add(text, 1, wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL, 2);

    wxListCtrl *itemList = new wxListCtrl(panel, -1, wxDefaultPosition, wxDefaultSize, wxLC_HRULES | wxLC_REPORT | wxLC_SINGLE_SEL);
    itemList->SetForegroundColour(wxColor(82, 56, 224));
    itemList->SetHeaderAttr(wxItemAttr(*wxRED,
                                       *wxCYAN,
                                       wxFont(12, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD)));
    itemList->SetFont(wxFont(12, wxFONTFAMILY_ROMAN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString, wxFONTENCODING_DEFAULT));
    wxListItem itemCol;
    itemCol.SetStateMask(wxLIST_STATE_SELECTED);
    itemCol.SetState(wxLIST_STATE_SELECTED);
    itemCol.SetMask(wxLIST_MASK_STATE | wxLIST_MASK_TEXT);
    itemCol.SetTextColour(*wxRED);
    itemCol.SetBackgroundColour(*wxRED);
    itemCol.SetText(wxT("SKU"));
    itemList->InsertColumn(0, itemCol);
    itemList->SetColumnWidth(0, wxLIST_AUTOSIZE);

    itemCol.SetText(wxT("Name"));
    itemCol.SetAlign(wxLIST_FORMAT_LEFT);
    itemList->InsertColumn(1, itemCol);
    itemList->SetColumnWidth(1, wxLIST_AUTOSIZE);

    itemCol.SetText(wxT("Price"));
    itemCol.SetAlign(wxLIST_FORMAT_LEFT);
    itemList->InsertColumn(2, itemCol);
    itemList->SetColumnWidth(2, wxLIST_AUTOSIZE);

    itemCol.SetText(wxT("Qty"));
    itemCol.SetAlign(wxLIST_FORMAT_LEFT);
    itemList->InsertColumn(2, itemCol);
    itemList->SetColumnWidth(2, wxLIST_AUTOSIZE);

    itemCol.SetText(wxT("Subtotal"));
    itemCol.SetAlign(wxLIST_FORMAT_LEFT);
    itemList->InsertColumn(2, itemCol);
    itemList->SetColumnWidth(2, wxLIST_AUTOSIZE);

    itemList->SetColumnWidth(0, 100);
    itemList->SetColumnWidth(1, 400);
    itemList->SetColumnWidth(2, 100);
    itemList->SetColumnWidth(3, 100);
    itemList->SetColumnWidth(4, 100);
    // Insert ten items
    for (int i = 0; i < 7; i++)
    {
        int imageIndex = 0;
        wxString buf;
        // Insert an item, with a string for column 0,
        // and image index 0
        buf.Printf(wxT("%d"), data[i].sku);
        itemList->InsertItem(i, buf, imageIndex);
        // The item may change position due to e.g. sorting,
        // so store the original index in the item’s data
        itemList->SetItemData(i, i);
        // Set a string for column 1
        buf.Printf(wxT("%s"), data[i].name);
        itemList->SetItem(i, 1, buf);
        // Set a string for column 2
        buf.Printf(wxT("%.2f"), data[i].price);
        itemList->SetItem(i, 2, buf);

        // Set a string for column 3
        buf.Printf(wxT("%d"), data[i].qty);
        itemList->SetItem(i, 3, buf);

        // Set a string for column 3
        buf.Printf(wxT("%.2f"), data[i].subtotal);
        itemList->SetItem(i, 4, buf);
    }

    wxBoxSizer *middleMidSizer = new wxBoxSizer(wxVERTICAL);
    middleMidSizer->Add(itemList, 1, wxEXPAND | wxALL, 2);

    wxBoxSizer *midBottomSizer = new wxBoxSizer(wxHORIZONTAL);
    midBottomSizer->Add(new wxButton(panel, -1, wxT("Clerk Login"), wxDefaultPosition, wxSize(-1, 50)), 1, wxEXPAND | wxALL, 2);
    midBottomSizer->Add(new wxButton(panel, -1, wxT("No Sale"), wxDefaultPosition, wxDefaultSize), 1, wxEXPAND | wxALL, 2);
    midBottomSizer->Add(new wxButton(panel, -1, wxT("Cancel Order"), wxDefaultPosition, wxDefaultSize), 1, wxEXPAND | wxALL, 2);
    midBottomSizer->Add(new wxButton(panel, -1, wxT("Order Notes"), wxDefaultPosition, wxDefaultSize), 1, wxEXPAND | wxALL, 2);
    midBottomSizer->Add(new wxButton(panel, -1, wxT("Funds Entered"), wxDefaultPosition, wxDefaultSize), 1, wxEXPAND | wxALL, 2);

    middleSizer->Add(middleTopSizer, 0, wxEXPAND | wxALL, 2);
    middleSizer->Add(middleMidSizer, 1, wxEXPAND | wxALL, 2);
    middleSizer->Add(midBottomSizer, 0, wxEXPAND | wxALL, 2);

    panel->SetSizer(middleSizer);
    middleSizer->Fit(panel);
    middleSizer->SetSizeHints(panel);

    wxBoxSizer *middleMainSizer = new wxBoxSizer(wxVERTICAL);
    middleMainSizer->Add(panel, 1, wxEXPAND | wxALL, 1);

    return middleMainSizer;
}
wxSizer *MainFrame::createRightPane()
{
    wxBoxSizer *rightSizer = new wxBoxSizer(wxVERTICAL);
    wxPanel *panel = new wxPanel(this, wxID_ANY);
    panel->SetBackgroundColour(wxColor(115, 191, 178));

    wxButton *sellBtn = new wxButton(panel, wxID_ANY, wxT("Sell"), wxDefaultPosition, wxSize(-1, 50));
    sellBtn->SetBackgroundColour(wxColor(150, 234, 146));
    wxButton *refundBtn = new wxButton(panel, wxID_ANY, wxT("Refund"), wxDefaultPosition, wxSize(-1, 50));
    wxButton *lookupBtn = new wxButton(panel, wxID_ANY, wxT("Lookup"), wxDefaultPosition, wxSize(-1, 50));

    wxBoxSizer *rightPaneTopSizer = new wxBoxSizer(wxHORIZONTAL);
    rightPaneTopSizer->Add(sellBtn, 1, wxALL, 2);
    rightPaneTopSizer->Add(refundBtn, 1, wxALL, 2);
    rightPaneTopSizer->Add(lookupBtn, 1, wxALL, 2);

    rightSizer->Add(rightPaneTopSizer, 0, wxEXPAND | wxALL, 2);

    wxStaticText *logCustomer = new wxStaticText(panel, wxID_ANY, wxT("Log Customer"));
    logCustomer->SetForegroundColour(*wxBLUE);
    wxCheckBox *noStateTax = new wxCheckBox(panel, wxID_ANY, wxT("No State Tax"));
    wxCheckBox *noTax2 = new wxCheckBox(panel, wxID_ANY, wxT("No Tax 2"));

    wxBoxSizer *rightPaneTaxSizer = new wxBoxSizer(wxHORIZONTAL);
    rightPaneTaxSizer->Add(logCustomer, 1, wxALL, 2);
    rightPaneTaxSizer->Add(noStateTax, 1, wxALL, 2);
    rightPaneTaxSizer->Add(noTax2, 1, wxALL, 2);

    rightSizer->Add(rightPaneTaxSizer, 0, wxEXPAND | wxALL, 2);

    wxGridSizer *costBoxSizer = new wxGridSizer(5, 2, 0, 0);
    wxStaticText *subTotalLabel = new wxStaticText(panel, wxID_ANY, wxT("Subtotal"));
    costBoxSizer->Add(subTotalLabel, 0, wxEXPAND | wxALL, 2);
    wxStaticText *subTotalValue = new wxStaticText(panel, wxID_ANY, wxT("0"));
    subTotalValue->SetBackgroundColour(wxColor(252, 255, 224));
    costBoxSizer->Add(subTotalValue, 0, wxEXPAND | wxALL, 2);

    wxStaticText *stateTaxLabel = new wxStaticText(panel, wxID_ANY, wxT("State Tax"));
    costBoxSizer->Add(stateTaxLabel, 0, wxEXPAND | wxALL, 2);
    wxStaticText *stateTaxValue = new wxStaticText(panel, wxID_ANY, wxT("0"));
    stateTaxValue->SetBackgroundColour(wxColor(252, 255, 224));
    costBoxSizer->Add(stateTaxValue, 0, wxEXPAND | wxALL, 2);

    wxStaticText *tax2Label = new wxStaticText(panel, wxID_ANY, wxT("Tax2"));
    costBoxSizer->Add(tax2Label, 0, wxEXPAND | wxALL, 2);
    wxStaticText *tax2Value = new wxStaticText(panel, wxID_ANY, wxT("0"));
    tax2Value->SetBackgroundColour(wxColor(252, 255, 224));
    costBoxSizer->Add(tax2Value, 0, wxEXPAND | wxALL, 2);

    wxStaticText *totalLabel = new wxStaticText(panel, wxID_ANY, wxT("Total"));
    costBoxSizer->Add(totalLabel, 0, wxEXPAND | wxALL, 2);
    wxStaticText *totalValue = new wxStaticText(panel, wxID_ANY, wxT("0"));
    totalValue->SetBackgroundColour(wxColor(252, 255, 224));
    costBoxSizer->Add(totalValue, 0, wxEXPAND | wxALL, 2);

    wxStaticText *owingLabel = new wxStaticText(panel, wxID_ANY, wxT("Owing"));
    owingLabel->SetForegroundColour(*wxBLUE);
    costBoxSizer->Add(owingLabel, 0, wxEXPAND | wxALL, 2);
    wxStaticText *owingValue = new wxStaticText(panel, wxID_ANY, wxT("0"));
    owingValue->SetBackgroundColour(wxColor(252, 255, 224));
    costBoxSizer->Add(owingValue, 0, wxEXPAND | wxALL, 2);

    rightSizer->Add(costBoxSizer, 1, wxEXPAND | wxALL, 2);

    wxGridSizer *paymentBoxSizer = new wxGridSizer(4, 2, 0, 0);

    wxButton *debitBtn = new wxButton(panel, wxID_ANY, wxT("Debit"));
    debitBtn->SetBackgroundColour(wxColor(205, 205, 255));
    paymentBoxSizer->Add(debitBtn, 0, wxEXPAND | wxALL, 2);

    wxButton *creditBtn = new wxButton(panel, wxID_ANY, wxT("Credit"));
    creditBtn->SetBackgroundColour(wxColor(255, 204, 201));
    paymentBoxSizer->Add(creditBtn, 0, wxEXPAND | wxALL, 2);

    wxButton *giftCardBtn = new wxButton(panel, wxID_ANY, wxT("Gift Card"));
    giftCardBtn->SetBackgroundColour(wxColor(124, 253, 128));
    paymentBoxSizer->Add(giftCardBtn, 0, wxEXPAND | wxALL, 2);

    wxButton *couponBtn = new wxButton(panel, wxID_ANY, wxT("Coupon"));
    couponBtn->SetBackgroundColour(wxColor(254, 254, 204));
    paymentBoxSizer->Add(couponBtn, 0, wxEXPAND | wxALL, 2);

    wxButton *consignorBtn = new wxButton(panel, wxID_ANY, wxT("Consignor"));
    consignorBtn->SetBackgroundColour(wxColor(255, 225, 204));
    paymentBoxSizer->Add(consignorBtn, 0, wxEXPAND | wxALL, 2);

    wxButton *customerBtn = new wxButton(panel, wxID_ANY, wxT("Customer"));
    customerBtn->SetBackgroundColour(wxColor(253, 223, 189));
    paymentBoxSizer->Add(customerBtn, 0, wxEXPAND | wxALL, 2);

    wxButton *checkBtn = new wxButton(panel, wxID_ANY, wxT("Check"));
    checkBtn->SetBackgroundColour(wxColor(154, 206, 254));
    paymentBoxSizer->Add(checkBtn, 0, wxEXPAND | wxALL, 2);

    wxButton *cashBtn = new wxButton(panel, wxID_ANY, wxT("Cash"));
    cashBtn->SetBackgroundColour(wxColor(255, 205, 255));
    paymentBoxSizer->Add(cashBtn, 0, wxEXPAND | wxALL, 2);

    rightSizer->Add(paymentBoxSizer, 1, wxEXPAND | wxALL, 2);
    panel->SetSizer(rightSizer);
    rightSizer->Fit(panel);
    rightSizer->SetSizeHints(panel);

    wxBoxSizer *rightMainSizer = new wxBoxSizer(wxVERTICAL);
    rightMainSizer->Add(panel, 1, wxEXPAND | wxALL, 1);

    return rightMainSizer;
}
wxMenuBar *MainFrame::createMenu()
{
    wxMenuBar *menuBar = new wxMenuBar(wxMB_DOCKABLE);
    menuBar->SetBackgroundColour(wxColor(174, 238, 240));

    wxMenu *dataEntryMenu = new wxMenu;
    menuBar->Append(dataEntryMenu, wxT("Data Entry"));
    wxMenu *inventoryMenu = new wxMenu;
    menuBar->Append(inventoryMenu, wxT("Inventory"));
    wxMenu *toolsMenu = new wxMenu;
    menuBar->Append(toolsMenu, wxT("Tools"));
    wxMenu *layawayMenu = new wxMenu;
    menuBar->Append(layawayMenu, wxT("Layaway"));
    wxMenu *salesMenu = new wxMenu;
    menuBar->Append(salesMenu, wxT("Sales"));
    wxMenu *adminMenu = new wxMenu;
    menuBar->Append(adminMenu, wxT("Admin"));
    wxMenu *helpMenu = new wxMenu;
    menuBar->Append(helpMenu, wxT("Help"));

    return menuBar;
}
bool MyApp::OnInit()
{
    if (!wxApp::OnInit())
        return false;

    MainFrame *frame = new MainFrame(NULL, -1, wxT("ConsignmentTill"));
    frame->Show();

    return true;
}

wxIMPLEMENT_APP(MyApp);

r/wxWidgets • • Apr 28 '20

New Stable wxWidgets 3.0.5 Released

6 Upvotes

r/wxWidgets • • Jul 06 '25

Windows Darkmode

5 Upvotes

I have updated WxWidgets in UV-Remap to version 3.3 and think the new support for dark mode looks great. I've been waiting a long time for this and the customers even more so.


r/wxWidgets • • Dec 29 '24

Cpp and wxwidgets

5 Upvotes

Can anyone suggest me some projects ideas that i can use these function in cpp. Like some "system" type ,better if something unique.


r/wxWidgets • • Apr 15 '22

Custom widgets

5 Upvotes

Any tips for custom widgets? Specially custom MenuBar, Button and StaticBoxSizer. In wxPython, i used to use a class called wxGenButton to create custom buttons. I could do the same in C++ with a wxWindow/Control, the problem is, for some reason, this type of widget has a limit amount of times it can be clicked per second and it is fairly low. For the MenuBar, the docs say it inherits from wxWindow, but digging the source I found out it inherits from wxMenuBarBase. I could dig the source and see what I can find, but it would help a lot if someone knows a bit about the subject.


r/wxWidgets • • Nov 04 '21

Roundup of the Recent Changes in wx API

Thumbnail wxwidgets.org
5 Upvotes

r/wxWidgets • • May 15 '26

WxRuby3 v1.70 Released

Thumbnail
github.com
4 Upvotes

r/wxWidgets • • Mar 10 '24

Anyone here making serious money using wxWidgets?

4 Upvotes

Anyone making a real living using wxWidgets or is everyone just using it for hobby projects?


r/wxWidgets • • Oct 28 '23

wxsocket Windows to Linux migration

4 Upvotes

I've coded an application about 15 years ago with wxwidgets 2.8 It was running on xp for years and now we got a new pc with linux. Compilation went fine.

However, after several hours a wxsocket object turns dead. All reads time out.

Is there perhaps some reasonable explanation?


r/wxWidgets • • Aug 11 '22

I cannot compile wxWidgets with Mingw32-make

4 Upvotes

I keep getting this error whenever I try to compile:

..\..\include/wx/msw/ole/oleutils.h: In function 'bool wxOleInitialize()':
..\..\include/wx/msw/ole/oleutils.h:49:16: error: 'RPC_E_CHANGED_MODE' was not declared in this scope
     if ( hr != RPC_E_CHANGED_MODE && FAILED(hr) )
                ^~~~~~~~~~~~~~~~~~
..\..\include/wx/msw/ole/oleutils.h:49:47: error: 'FAILED' was not declared in this scope
     if ( hr != RPC_E_CHANGED_MODE && FAILED(hr) )
                                               ^
..\..\include/wx/msw/ole/oleutils.h: At global scope:
..\..\include/wx/msw/ole/oleutils.h:146:42: error: 'S_OK' was not declared in this scope
     wxVariantDataErrorCode(SCODE value = S_OK) { m_value = value; }
                                          ^~~~
../../src/common/filename.cpp: In member function 'bool wxFileName::GetShortcutTarget(const wxString&, wxString&, wxString*) const':
../../src/common/filename.cpp:1660:23: error: 'SUCCEEDED' was not declared in this scope
     if (SUCCEEDED(hres))
                       ^
../../src/common/filename.cpp: In member function 'wxString wxFileName::GetLongPath() const':
../../src/common/filename.cpp:2250:21: error: 'ERROR_FILE_NOT_FOUND' was not declared in this scope
         if ( err == ERROR_FILE_NOT_FOUND || err == ERROR_BAD_NETPATH )
                     ^~~~~~~~~~~~~~~~~~~~
../../src/common/filename.cpp:2250:52: error: 'ERROR_BAD_NETPATH' was not declared in this scope
         if ( err == ERROR_FILE_NOT_FOUND || err == ERROR_BAD_NETPATH )
                                                    ^~~~~~~~~~~~~~~~~
../../src/common/filename.cpp: In static member function 'static wxULongLong wxFileName::GetSize(const wxString&)':
../../src/common/filename.cpp:2902:58: error: 'NO_ERROR' was not declared in this scope
     if ( ret == INVALID_FILE_SIZE && ::GetLastError() != NO_ERROR )
                                                          ^~~~~~~~
makefile.gcc:12191: recipe for target 'gcc_mswudll\basedll_filename.o' failed
mingw32-make: *** [gcc_mswudll\basedll_filename.o] Error 1

r/wxWidgets • • Jun 15 '22

Reducing the size of the wxWidgets library file

4 Upvotes

Hi, I make programs that only use a small number of widgets. So I want to only pack the widgets that I use with my program. Currently there isn't an easy way to build a wxWidgets library file that only contains the needed widgets. This is why I ask that we come up with a solution to this problem.


r/wxWidgets • • Jan 18 '22

Updated docs: High DPI Support in wxWidgets

Thumbnail docs.wxwidgets.org
4 Upvotes

r/wxWidgets • • Dec 03 '21

Bind x Event Table

4 Upvotes

What is the difference between those? I couldn't understand by just reading the docs, but it seems the event table (i guess) gives the class what are its specific event it should handle, and bind just bind a method to an id, but i still dont get it the difference between those and why/where using one or another.


r/wxWidgets • • Oct 08 '21

is it possible to create a dialog from a set of parameters?

4 Upvotes

Let me start by saying that I have never used wxWidgets before, so I'm not familiar with what it's capable of doing. Someone mentioned to me that they use this library for their project though, so I wanted to learn more about it.

I am reverse engineering a 1997 game that basically stores the design of their dialogs in a file as parameters (background art, font metrics, colors, controls types and positions, etc.), and then they read that from the file and draw their dialogs using that information.

I have reversed it enough that I can get all of that information from their file, and I was wondering if I would be able to dynamically create a dialog with controls using this information in wxWidgets?

I don't expect it to look identical to what they made, and I probably wouldn't use more than the position initially just to test it out as a proof of concept.


r/wxWidgets • • Mar 02 '21

Wxwidgets and SQL SERVER database

4 Upvotes

Hey, anyone knows how to connect SQL server database to wxwidgets I basically want to write a wxwidgets code in c++ to update data in the database


r/wxWidgets • • Jan 13 '21

How to build for snapstore

4 Upvotes

Hi guys am looking for a way to build my wxWidgets app for snapstore. Apparently I am able to build it on codeblocks. Writing the snap.yaml seems more of a challenge and am running short of tutorials to use for this course.


r/wxWidgets • • Dec 16 '20

Use wxWidgets without building

4 Upvotes

I am working on a project that uses wxWidgets and I want to use it directly in the project without building it. Any idea how can I do that? I have a clone of the repo and I am using CMake as build system.


r/wxWidgets • • Dec 08 '19

wxWidgets builds under Windows on ARM

Thumbnail
andregarzia.com
4 Upvotes

r/wxWidgets • • May 31 '26

WxAndroid

3 Upvotes

How's WxAndroid? It's working? Any working examples?

In the negative case, is there any way to develop with wxwidgets for Android?


r/wxWidgets • • Dec 25 '25

wxEVT_ENTER_WINDOW and wxEVT_LEAVE_WINDOW on macOS

3 Upvotes

I was debugging an issue on Bambu Studio (https://github.com/bambulab/BambuStudio) on macOS, and my impression is that these ENTER and LEAVE events do not fire as expected.

For a given window, I'm getting enter and leave as the mouse goes into the child windows of the given windows, but I'm not getting leave and enter as the mouse moves away from the window to other (its parent) window, nor am I seeing those events when the mouse completely leaves the app's window... It's really quite sporadic.

My general question is this (admittedly having zero experience with wxWidgets): Is it possible the framework is misbehaving at that level on macOS? Or is this more likely an app issue of some sort? How tested and refined is this on macOS?


r/wxWidgets • • May 12 '25

Save Dialog Box (MAC)

3 Upvotes

While working on a project using wxWidgets, I recently ran into an issue with the Dialog Boxes. Below is a segment of code that I used to create and show a dialog box, for purposes of saving an XML file. **WITHOUT changing any code, my program now fails to display the dialog box each time. When ShowModal() is called, it simply returns the wxID_CANCEL code. I have determined that this issue is most likely caused by some sort of issue between MAC OS and wxWidgets, but I cannot deterime why. Any Help on how to fix this would be greatly appreciated!