Search found 1937 matches

by PB
Thu Mar 21, 2019 12:25 pm
Forum: Compiler / Linking / IDE Related
Topic: adding release build to project
Replies: 10
Views: 207

Re: adding release build to project

Yes, having multiple build targets in a single project is the standard way.

TBH, I do not understand how you want to do it, as one does:
1. need both debug and release targets
2. not want to maintain two projects for one application..
by PB
Thu Mar 21, 2019 10:41 am
Forum: Compiler / Linking / IDE Related
Topic: adding release build to project
Replies: 10
Views: 207

Re: adding release build to project

Sorry, I forgot to mention that you also need to change the paths for the Release target. Mixing builds in the same folder can lead to bad things happening. In "Build targets" tab of "Project/targets options" dialog select the "Release" build target and replace "Debug" with "Release" in "Output file...
by PB
Wed Mar 20, 2019 7:31 pm
Forum: Compiler / Linking / IDE Related
Topic: How to compile wxWidgets samples under windows?
Replies: 15
Views: 328

Re: How to compile wxWidgets samples under windows?

wxWidgets by default build the libraries as static and those reside (for GCC) in "WXWIN/lib/gcc_lib". If your folder with libraries is named "gcc_dll", it means you also used "SHARED=1" when building wxWidgets building them as .DLLs and you need to use the same command line switch for the samples. A...
by PB
Wed Mar 20, 2019 7:27 pm
Forum: Compiler / Linking / IDE Related
Topic: adding release build to project
Replies: 10
Views: 207

Re: adding release build to project

Firstly, you need to have wxWidgets built in the release mode too, which I assume you have. If not, build them (adding "BUILD=release" to the command line). I also assume your Debug build target is fully functional and you can build and run the application as expected. I am not really using Code::Bl...
by PB
Wed Mar 20, 2019 5:59 pm
Forum: Compiler / Linking / IDE Related
Topic: How to compile wxWidgets samples under windows?
Replies: 15
Views: 328

Re: How to compile wxWidgets samples under windows?

Additionally, your folder structure looks unexpected (to the makefile): do you have the whole library (include, src, lib, build etc. folders there)? I.e., is wxWwidgets root dir really c:\0 instead of more common one like c:\wxWidgets?
by PB
Tue Mar 19, 2019 6:56 pm
Forum: C++ Development
Topic: reading very old binary file
Replies: 3
Views: 108

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: 130

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: 15
Views: 313

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: 15
Views: 313

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: 477

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: 477

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: 477

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: 477

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: 533

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: 533

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