Search found 1872 matches

by PB
Tue Mar 19, 2019 6:56 pm
Forum: C++ Development
Topic: reading very old binary file
Replies: 3
Views: 51

Re: reading very old binary file

And I suppose, generally you could read fixed-width strings with wxDataInputStream like this (untested) #include <wx/strconv.h> #include <wx/buffer.h> wxString ReadFixedWidthAnsiStringFromDataInputStream(wxDataInputStream& input, size_t width, const wxMBConv& conv = wxConvLocal) { wxCHECK(width > 0,...
by PB
Tue Mar 19, 2019 5:12 pm
Forum: C++ Development
Topic: Writing to binary file crashes application
Replies: 6
Views: 62

Re: Writing to binary file crashes application

In addition to what doublemax said. You can avoid the conversion to std::string when checking for the extension, using wxString's methods. Additionally, your check may be unintentionally case-sensitive, which is usually not desirable in such scenarios. C++ streams may not be the best suited for such...
by PB
Tue Mar 19, 2019 12:48 pm
Forum: C++ Development
Topic: How to manually validate wxTextCtrl value
Replies: 7
Views: 71

Re: How to manually validate wxTextCtrl value

BTW, numeric validators with their on-the-fly validation can be annoying enough in general (IMO), but on top of it, wxNumValidator has an annoying bug that can manifest if its allowed range does not include 0.
https://trac.wxwidgets.org/ticket/12968
by PB
Tue Mar 19, 2019 10:29 am
Forum: C++ Development
Topic: How to manually validate wxTextCtrl value
Replies: 7
Views: 71

Re: How to manually validate wxTextCtrl value

I may be missing something but this seems to work on MSW with GIT master wxValidator* validator = m_textCtrl->GetValidator(); if ( validator ) validator->Validate(m_textCtrl); } SSCCE #include <wx/wx.h> class MyDialog : public wxDialog { public: MyDialog() : wxDialog(NULL, wxID_ANY, "Test") { m_text...
by PB
Mon Mar 18, 2019 9:17 pm
Forum: C++ Development
Topic: How to create such a layout?
Replies: 23
Views: 326

Re: How to create such a layout?

I only looked at the UI in Access (current Office 365 on monthly channel) now and noticed that the grid there also has frozen rows and only the rows starting with Criteria scroll. So I guess you are out of luck with current wxGrid implementation.... Otherwise, basically the code I posted in my previ...
by PB
Mon Mar 18, 2019 8:01 pm
Forum: C++ Development
Topic: How to create such a layout?
Replies: 23
Views: 326

Re: How to create such a layout?

Yes - the grid is vertically scrollable. And thats the other reason I want to skip label renderer override - I don't want to keep re-assigning those labels on every single vertical scroll. Is that necessary, I thought if you use actual row headers they will always match the rows regardless of scrol...
by PB
Mon Mar 18, 2019 6:39 pm
Forum: C++ Development
Topic: How to create such a layout?
Replies: 23
Views: 326

Re: How to create such a layout?

I will try to play with just labels and spacers in a vertical sizer. This may not be easy, assuming the grid is vertically scrollable and one has to deal with it. Sizers and absolute positioning are not a good match.... FWIW, here is what I briefly played with (the labels align with rows only once ...
by PB
Mon Mar 18, 2019 1:37 pm
Forum: C++ Development
Topic: How to create such a layout?
Replies: 23
Views: 326

Re: How to create such a layout?

This supersimple implementation seems to work as expected on MSW with current(ish) GIT master: grid.png #include <wx/wx.h> #include <wx/grid.h> class MyGridHeaderLabelsRenderer : public wxGridRowHeaderRenderer { void DrawBorder(const wxGrid& grid, wxDC& dc, wxRect& rect) const wxOVERRIDE { const wxC...
by PB
Fri Mar 15, 2019 12:47 pm
Forum: C++ Development
Topic: using wxWidgets in library
Replies: 26
Views: 367

Re: using wxWidgets in library

In your wx-users post, you may have not provided enough information, particularly about non-standard wxWidgets use. FWIW, I tried on MSW "locally" run wxWidgets dialog, seemed to work with this, see GetPin() code. The separate scope for the dialog was required, so that the dialog is destroyed before...
by PB
Fri Mar 15, 2019 11:16 am
Forum: C++ Development
Topic: using wxWidgets in library
Replies: 26
Views: 367

Re: using wxWidgets in library

[I implemented it and it works perfectly on windows, but then I found at macOS GUI is allowed only in main thread. In cross-platform applications is best practice use GUI from main thread I guess. And I don't want have GUI in main thread and everything else in second, that would be pretty wierd. I ...
by PB
Fri Mar 15, 2019 9:34 am
Forum: C++ Development
Topic: using wxWidgets in library
Replies: 26
Views: 367

Re: using wxWidgets in library

I know nothing about OSX and I haven't done anything like you describe but that is not enough to stop me from giving my two cents. ;) Are you sure the approach you use is robust enough to use? If I had to do something like this I would try something like 1. When initializing my library (this approac...
by PB
Wed Mar 13, 2019 8:39 pm
Forum: Platform Related Issues
Topic: wxStaticBox appearance on Windows 10
Replies: 5
Views: 91

Re: wxStaticBox appearance on Windows 10

I can confirm that (a) there is an issue if the approach in the OP is used (b) the simple workaround suggested by doublemax works This SSCCE #include <wx/wx.h> #include <wx/notebook.h> class MyFrame: public wxFrame { public: MyFrame() : wxFrame (NULL, wxID_ANY, "Test") { wxNotebook* notebook = new w...
by PB
Wed Mar 13, 2019 1:03 pm
Forum: C++ Development
Topic: wxBitmap from wxBITMAP_PNG_FROM_DATA is not Ok()
Replies: 2
Views: 39

Re: wxBitmap from wxBITMAP_PNG_FROM_DATA is not Ok()

(Assuming the character array is correct.)

Did you initialize the PNG image handler?

The easiest way to see what went wrong would be to step into the wxWidgets code, which is both easy and quick.

TBH, I am not even sure if the macro you use is documented and intended for public consumption.
by PB
Wed Mar 13, 2019 11:51 am
Forum: C++ Development
Topic: show "Table like" with wxMessageBox
Replies: 3
Views: 45

Re: show "Table like" with wxMessageBox

I meant to create one, basically mimicking wxMessageDialog but with having a grid-like control. Which one (e.g., wxListCtrl in report mode, wxGrid, grid of wxStaticTexts, ...) depends on the amount of information you need to present to the useer. Or, if you feel adventurous, you could use read-only ...
by PB
Wed Mar 13, 2019 10:13 am
Forum: C++ Development
Topic: show "Table like" with wxMessageBox
Replies: 3
Views: 45

Re: show "Table like" with wxMessageBox

I do not think this would possible and the only solution would be to use a custom dialog instead of wxMessageDialog / wxMessageBox().