Search found 2439 matches

by PB
Wed Jun 24, 2020 6:02 am
Forum: C++ Development
Topic: Using wxExecute to call itself
Replies: 8
Views: 250

Re: Using wxExecute to call itself

Not sure why it's happening on my code, it does work if I make a simple sample. I thought it had to do with the wxSingleInstanceChecker , but I commented out this part of the code and the problem still happens. The worst is that it doesn't even get to OnInit() and that it works if I change the name...
by PB
Tue Jun 23, 2020 8:55 pm
Forum: C++ Development
Topic: Using wxExecute to call itself
Replies: 8
Views: 250

Re: Using wxExecute to call itself

wxWidgets version, platform? This simple example works for me as I expect it to on Windows with the current wxWidgets master #include <wx/wx.h> #include <wx/utils.h> class MyDialog : public wxDialog { public: MyDialog() : wxDialog(nullptr, wxID_ANY, "Test", wxDefaultPosition, wxSize(800, 600)) { wxB...
by PB
Mon Jun 22, 2020 3:55 pm
Forum: Compiler / Linking / IDE Related
Topic: Non-Unicode/MBCS wxWidgets build for Visual Studio [How we solved it]
Replies: 9
Views: 360

Re: Non-Unicode/MBCS wxWidgets build for Visual Studio [How we solved it]

I finally see what you meant by defining _UNICODE manually. This may be an artifact of how wxWidgets MSVS projects are generated. I still think that using nmake or CMake(GUI) to change UNICODE-related build settings is much easier, and I am certainly no command line guru. Well, good luck with your p...
by PB
Sun Jun 21, 2020 2:45 pm
Forum: Compiler / Linking / IDE Related
Topic: Non-Unicode/MBCS wxWidgets build for Visual Studio [How we solved it]
Replies: 9
Views: 360

Re: Non-Unicode/MBCS wxWidgets build for Visual Studio [How we solved it]

For my purposes, I think of MBCS as the option I choose to compile for single-byte TCHARs, as opposed to UNICODE which is used for double-byte TCHARs. My old code unfortunately uses mostly char rather than TCHAR, strcpy() rather than _tcscpy() etc, so it's not easy to convert (and man why did they ...
by PB
Sun Jun 21, 2020 10:37 am
Forum: Compiler / Linking / IDE Related
Topic: Non-Unicode/MBCS wxWidgets build for Visual Studio [How we solved it]
Replies: 9
Views: 360

Re: Non-Unicode/MBCS wxWidgets build for Visual Studio [How we solved it]

I think it is all very simple but I also think you are confusing several things. I don't understand why wxWidgets is trying to force UNICODE upon us. When you in MSVS select "Use Unicode character set" for "Character set", MSVS automaticaly adds both _UNICODE and UNICODE preprocessor defintions, you...
by PB
Fri Jun 19, 2020 5:02 pm
Forum: C++ Development
Topic: Disable wxSlider
Replies: 3
Views: 138

Re: Disable wxSlider

You always need to look also at the inherited methods, it's right there. Obviously, this method is common for all wxWindows and as such, declared in wxWindow.
by PB
Fri Jun 19, 2020 3:58 pm
Forum: C++ Development
Topic: Disable wxSlider
Replies: 3
Views: 138

Re: Disable wxSlider

Calling its Enable(false) does not work for you? Which platform and wxWidgets version are you using? Works as expected for me (MSW, master): disabled slider.png #include <wx/wx.h> class MyDialog : public wxDialog { public: MyDialog() : wxDialog(nullptr, wxID_ANY, "Test") { wxBoxSizer* mainSizer = ne...
by PB
Wed Jun 17, 2020 7:22 pm
Forum: C++ Development
Topic: Serializeand deserialize wxImage
Replies: 9
Views: 304

Re: Serializeand deserialize wxImage

I have no idea what are you trying to say here? I assume you mean to use the Clipboard to store some data there instead of using a file system? The clipboard is not for the programmer to decide what it put there when he wants, what is put there is strictly the user's choice. I would be very upset if...
by PB
Wed Jun 17, 2020 7:15 pm
Forum: C++ Development
Topic: Copy/Pasting using wxClientDC wxMemoryDC produces black box in ms paint
Replies: 3
Views: 184

Re: Copy/Pasting using wxClientDC wxMemoryDC produces black box in ms paint

I am not familiar with that video, so I do not know why (-1,-1) was used. As far as I can tell, using -1 there does not have any special meaning and is considered an actual coordinate.
by PB
Tue Jun 16, 2020 4:15 pm
Forum: C++ Development
Topic: Copy/Pasting using wxClientDC wxMemoryDC produces black box in ms paint
Replies: 3
Views: 184

Re: Copy/Pasting using wxClientDC wxMemoryDC produces black box in ms paint

I took a look only at OnCopyClick(). I think you always need to unselect the bitmap from the memory DC once you are done drawing onto it, before doing anything else with it. E.g.: wxBitmap my_bitmap_tmp(Panel1->GetSize(), wxBITMAP_SCREEN_DEPTH); my_wxmemorydc->SelectObject(my_bitmap_tmp); my_wxmemor...
by PB
Sun Jun 14, 2020 5:32 pm
Forum: C++ Development
Topic: Serializeand deserialize wxImage
Replies: 9
Views: 304

Re: Serializeand deserialize wxImage

BTW, this could be how to get any data from a file (assuming the file fits into the memory at once) to a SQLite database as a blob using wxSQLite #include <wx/buffer.h> #include <wx/wfstream.h> bool GetFileAsBlob(const wxString& fileName, wxMemoryBuffer& blob) { wxFFileInputStream file(fileName); if...
by PB
Sun Jun 14, 2020 5:17 pm
Forum: C++ Development
Topic: Serializeand deserialize wxImage
Replies: 9
Views: 304

Re: Serializeand deserialize wxImage

Not sure if those are any useful for blob in SQLite but I have recently shown you two pieces of working code that convert wxImage to (1) void pointer and (2) wxString. You did not respond but it seems that the code in the OP is very similar to the code I referred you to, except you replaced a concre...
by PB
Sat Jun 13, 2020 5:02 pm
Forum: Compiler / Linking / IDE Related
Topic: \wxWidgets-3.1.3\src\xrc\xmlres.cpp(2844,5): error C2065: 'wxID_RESET': undeclared identifier
Replies: 14
Views: 466

Re: \wxWidgets-3.1.3\src\xrc\xmlres.cpp(2844,5): error C2065: 'wxID_RESET': undeclared identifier

As stated above: The symbol wxID_RESET is only defined in file interface\wx\defs.h Dave, you can easily verify this it not true, see e.g. here https://github.com/wxWidgets/wxWidgets/blob/v3.1.3/include/wx/defs.h#L1822 Unless your wxWidgets installation is corrupted it must be there on your computer...
by PB
Sat Jun 13, 2020 5:50 am
Forum: Compiler / Linking / IDE Related
Topic: \wxWidgets-3.1.3\src\xrc\xmlres.cpp(2844,5): error C2065: 'wxID_RESET': undeclared identifier
Replies: 14
Views: 466

Re: \wxWidgets-3.1.3\src\xrc\xmlres.cpp(2844,5): error C2065: 'wxID_RESET': undeclared identifier

I have just successfully built 3.1.3 with MSVS Community 2019 v16.6.2 in Debug Win32 and x64 configurations, both in default C++14 as well as yours C++17 language standards. If cleaning the build did not help, I would delete vc_* folders in WXWIN\build\msw (and perhaps also .vs folder there) and WXW...