The first text entry autoselects, keeps the cursor in and ignores all input aside from right click. Every time a mouse moves, it selects again, as if I'm holding the Left Mouse Button, but I'm not
I have no idea what caused this
cSettingsFrame.cpp (relevant only):
Code: Select all
#include "cSettingsFrame.h"
wxBEGIN_EVENT_TABLE(cSettingsFrame, wxFrame)
EVT_CLOSE(OnClosed)
wxEND_EVENT_TABLE()
const wxSize minClientSize = wxSize(300, 380);
cSettingsFrame::cSettingsFrame(wxApp* parent) : wxFrame(nullptr, wxID_ANY, "Settings")
{
this->parent = parent;
initializeUI();
}
cSettingsFrame::~cSettingsFrame() = default;
void cSettingsFrame::initializeUI()
{
mPanel = new wxPanel(this);
auto mSizer = new wxGridBagSizer();
wxFont titleFont = wxFont(12, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFontWeight(500));
wxFont normalFont = wxFont(9, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
wxStaticText* titleText = new wxStaticText(mPanel, wxID_ANY, "Settings");
titleText->SetForegroundColour(COL_TITLE);
titleText->SetFont(titleFont);
lanInput = new wxTextCtrl(mPanel, 11000, wxString("192.168.1.1"));
ispInput = new wxTextCtrl(mPanel, 11001, wxString("10.0.0.1"));
dnsInput = new wxTextCtrl(mPanel, 11002, wxString("8.8.8.8"));
hostInput = new wxTextCtrl(mPanel, 11003, wxString("yandex.ru"));
lanInput->SetBackgroundColour(COL_BG_AUX);
...
mSizer->Add(titleText, wxGBPosition(0, 0), wxDefaultSpan, wxALL, 12);
mSizer->Add(lanInput, wxGBPosition(1, 0), wxDefaultSpan, wxALL, 12);
mSizer->Add(ispInput, wxGBPosition(2, 0), wxDefaultSpan, wxALL, 12);
mSizer->Add(dnsInput, wxGBPosition(3, 0), wxDefaultSpan, wxALL, 12);
mSizer->Add(hostInput, wxGBPosition(4, 0), wxDefaultSpan, wxALL, 12);
mPanel->SetSizerAndFit(mSizer);
}
void cSettingsFrame::OnClosed(wxCloseEvent& event)
{
parent->ProcessEvent(event); // destroys frame and nullifies the pointer to that window
}