Search found 1628 matches

by PB
Mon Aug 20, 2018 11:35 am
Forum: Compiler / Linking / IDE Related
Topic: Unable to link after Visual Studio update
Replies: 1
Views: 16

Re: Unable to link after Visual Studio update

You forgot to paste the link errors which should provide a hint what is wrong. Make sure you use the same platform toolset (such as v141) for both the library and application. I would also check if the referenced .props files were not modified... If anything else fails, creating a new MSVC project l...
by PB
Fri Aug 17, 2018 12:04 pm
Forum: C++ Development
Topic: Assertions in release build
Replies: 11
Views: 140

Re: Assertions in release build

As you know, regardless of build tools you use you can test whether NDEBUG is defined with placing this code #ifdef NDEBUG wxMessageBox("NDEBUG is defined."); #else wxMessageBox("NDEBUG is NOT defined."); #endif in a suitable place and running the application. This obviously assu...
by PB
Fri Aug 17, 2018 7:42 am
Forum: C++ Development
Topic: Assertions in release build
Replies: 11
Views: 140

Re: Assertions in release build

catalin, thanks for the information. I believe we are not in disagreement here. Perhaps, I misunderstood the op where he wrote Is this behavior expected? I won't expect any assertions when compiling with NDEBUG but it looks like I've to set the debug level for compiling wxWidgets in release mode man...
by PB
Thu Aug 16, 2018 6:35 pm
Forum: C++ Development
Topic: wxValidator : Display error message when validation fails
Replies: 6
Views: 64

Re: wxValidator : Display error message when validation fails

deepti wrote:Hi PB, There is this function at the end of the page in the link I sent:


The code there has nothing in common with that code of yours I quoted? I.e., it does not have a local instance of wxValidator calling validate with an unassociated control.
by PB
Thu Aug 16, 2018 6:30 pm
Forum: C++ Development
Topic: From int to float (from 1 to 1.0)
Replies: 5
Views: 50

Re: From int to float (from 1 to 1.0)

I hope I understood the question. If you need the result of division of two numbers to be a floating point number, at least one of the operands needs to be floating point number. E.g. (notice the decimal dot in the second assignment which makes the divisor a double) int i = 250; double a, b, c; a = ...
by PB
Thu Aug 16, 2018 6:21 pm
Forum: C++ Development
Topic: wxValidator : Display error message when validation fails
Replies: 6
Views: 64

Re: wxValidator : Display error message when validation fails

Hi PB, I found that from the documentation for wxValidator in this site : http://docs.wxwidgets.org/trunk/classwx_validator.html#abe48368bac7f540f0c20b1436e5c71af I do not see any such code there. Using the if (!textCtrl->Validate() ) is not helping either. I need a message box to be displayed when...
by PB
Thu Aug 16, 2018 5:40 pm
Forum: C++ Development
Topic: wxValidator : Display error message when validation fails
Replies: 6
Views: 64

Re: wxValidator : Display error message when validation fails

if (val.Validate(textCtrl->GetParent()) == false) { wxMessageBox("invalid value"); } This looks a bit suspicious, where did you get your val from? I do not think that you are supposed to validate like this at all. You set a validator to the control and the control does the validation as n...
by PB
Thu Aug 16, 2018 5:33 pm
Forum: C++ Development
Topic: wxSizer in wxPanel in wxStaticBox not work properly [SOLVED]
Replies: 4
Views: 111

Re: wxSizer in wxPanel in wxStaticBox not work properly [SOLVED]

TBH, the code you posted makes little sense to me. Perhaps he main isse there I see is that pPanel is not a part of any sizer - are you sure that is correct? Why do you create a sizer that has just one item - pSizer1? Why don't you use wxStaticBoxSizer instead of doing all you do there? Could the sa...
by PB
Thu Aug 16, 2018 3:31 pm
Forum: C++ Development
Topic: Assertions in release build
Replies: 11
Views: 140

Re: Assertions in release build

(I am talking about MSW here as it is the only desktop OS I ever use) As I wrote above, the documentation explicitly and in many places states that the wxASSERT()s are by default disabled in the release builds (i.e., in builds where NDEBUG is defined) just as the regular C assert()s. Starting with w...
by PB
Wed Aug 15, 2018 8:19 pm
Forum: C++ Development
Topic: Assertions in release build
Replies: 11
Views: 140

Re: Assertions in release build

I believe that plastering the end user with cryptic assert messages is neither expected nor desired. I do not get asserts in the release configuration, where NDEBUG is defined, tested again with this simple code #include <wx/wx.h> class MyFrame : public wxFrame { public: MyFrame() : wxFrame(NULL, wx...
by PB
Wed Aug 15, 2018 10:49 am
Forum: C++ Development
Topic: wxCalendarCtrl - date not getting set correctly
Replies: 4
Views: 86

Re: wxCalendarCtrl - date not getting set correctly

I am not sure but I believe that Today being always marked is a default style of the native control on Windows. Common controls version 4.70 (Vista+) supports MCS_NOTODAYCIRCLE but wxWidgets do not expose this option. Unless you want to mess with the native control then perhahps the only solution wo...
by PB
Wed Aug 15, 2018 10:03 am
Forum: C++ Development
Topic: wxCalendarCtrl - date not getting set correctly
Replies: 4
Views: 86

Re: wxCalendarCtrl - date not getting set correctly

Firstly, you are working with an invalid wxDateTime. If you used the debug version to debug the issue wxWidgets let you know that even without calling its IsValid() method. Secondly, it is true that the calendar does not preserve the selected date when switching months. However, at least on MSW (tes...
by PB
Wed Aug 15, 2018 6:10 am
Forum: Platform Related Issues
Topic: How to prevent erasing the background of a custom control on macOS
Replies: 3
Views: 77

Re: How to prevent erasing the background of a custom control on macOS

Sorry for the stupid question but have you tried to swap the two lines (and/or set the style directly with Create())?
by PB
Tue Aug 14, 2018 5:12 pm
Forum: General Development
Topic: Using Catch2 testing tools with wxWidgets
Replies: 3
Views: 79

Re: Using Catch2 testing tools with wxWidgets

WXWIN is used for the folder where wxWidgets are, e.g., c:\wxwidgets-3.1.1

You can also view the file in the git source tree:
https://github.com/wxWidgets/wxWidgets/blob/master/docs/contributing/how-to-write-unit-tests.md
by PB
Tue Aug 14, 2018 3:54 pm
Forum: General Development
Topic: Using Catch2 testing tools with wxWidgets
Replies: 3
Views: 79

Re: Using Catch2 testing tools with wxWidgets

AFAIK wxWidgets use it also for GUI testing, see "Writing GUI-specific tests" in WXWIN/docs/contributing/how-to-write-unit-tests.md and the tests themselves in the WXWIN/tests folder.

Go to advanced search