Search found 2569 matches

by PB
Mon Sep 14, 2020 9:03 am
Forum: General Development
Topic: licence de wxWidgets et ses obligations
Replies: 23
Views: 849

Re: licence de wxWidgets et ses obligations

AFAIK, wxWidgets uses its own licence, which is basically modified LGPL. In other words, you do not have to pay, regardless if your application is free or commercial. You also do not have to publish the source of your application. See http://wxwidgets.org/docs/faq/general/#licence I strongly recomme...
by PB
Thu Sep 10, 2020 7:06 pm
Forum: C++ Development
Topic: wxWidgets and a USB HID device
Replies: 2
Views: 227

Re: wxWidgets and a USB HID device

How do you access the GUI elements (wxFrame, wxTextCtrl, etc.) from the worker thread? Just to make sure you know this: anything GUI-related must be accessed only from the main thread aka the GUI thread (i.e., the thread in which wxWidgets were initialized). If you need to set the GUI from the worke...
by PB
Thu Sep 10, 2020 7:02 pm
Forum: Compiler / Linking / IDE Related
Topic: cmake MT compiler option instead of the MD [SOLVED]
Replies: 3
Views: 241

Re: cmake MT compiler option instead of the MD

Did you try setting option wxBUILD_USE_STATIC_RUNTIME to ON?
by PB
Wed Sep 09, 2020 8:56 am
Forum: C++ Development
Topic: How to specify format for wxAutomationObject date property
Replies: 2
Views: 139

Re: How to specify format for wxAutomationObject date property

Do you really receive the property as wxVariant with type "string" and not "datetime"? If the Outlook property type is Date, should it not be returned as OLEVARIANT with VT_DATE? If so, wxConvertOleToVariant() should convert it correctly (the function does not handle VT_FILETIME), you could debug wh...
by PB
Mon Sep 07, 2020 7:27 am
Forum: C++ Development
Topic: Getting user data from wxListCtrl item
Replies: 5
Views: 253

Re: Getting user data from wxListCtrl item

This needs to be a pointer to HEAP, not pointer to stack.

And obviously, you must delete it yourself. How do you expect the control would do that for an opaque pointer (e.g., how would a dtor be called)?
by PB
Mon Sep 07, 2020 5:23 am
Forum: C++ Development
Topic: Getting user data from wxListCtrl item
Replies: 5
Views: 253

Re: Getting user data from wxListCtrl item

In addition to what doublemax wrote, I think there is another bug in your code. You are using the address of dataPtr ( & dataPtr ) instead of dataPtr itself. wxUIntPtr dataPtr = m_list->GetItemData( position ); MyData *data = reinterpret_cast<MyData *>( &dataPtr ); BTW, why create a new topic discus...
by PB
Sun Aug 30, 2020 7:40 pm
Forum: C++ Development
Topic: Retrieve data from wxUIntPtr
Replies: 3
Views: 173

Re: Retrieve data from wxUIntPtr

I do not think that dynamic_cast is a good fit here, the proper C++ cast would probably be reinterpret_cast. This crude example works just fine for me on MSW #include <wx/wx.h> #include <wx/listctrl.h> #include <vector> struct Name { Name(const wxString& first, const wxString& last) : m_first(first)...
by PB
Sat Aug 29, 2020 12:56 pm
Forum: C++ Development
Topic: Multiple ticks in wxSlider?
Replies: 1
Views: 117

Re: Multiple ticks in wxSlider?

I think you do not mean ticks but a slider (the thumb). wxSlider can have only one, at least on MSW, the native control does not support having e.g. two to adjust a range. wxSL_SELRANGE only visually indicates the range the slider can move within.
by PB
Sat Aug 29, 2020 8:26 am
Forum: C++ Development
Topic: Reading large files on Windows
Replies: 2
Views: 147

Re: Reading large files on Windows

wxFile is just a wrapper around CRT file functions and on MSW, unlike size_t , int is 32-bit even in 64-bit builds. wxFile uses wxRead() which I think with MSVC translates to _read() and the assert comes from there. FWIW, wxFFile uses fread() which may not have the problem. TBH, I find attempting to...
by PB
Mon Aug 24, 2020 1:16 pm
Forum: C++ Development
Topic: wxAutomationObject CoInitialize has not been called error in wxThread
Replies: 5
Views: 196

Re: wxAutomationObject CoInitialize has not been called error in wxThread

Sorry, I have no idea about this, I have long forgotten the little I knew about COM. This naive approach seems to work, but I am sure I am missing some gotchas so I would be wary to use it #include <wx/wx.h> #include <wx/msw/ole/automtn.h> #include <wx/msw/ole/oleutils.h> #include <wx/thread.h> clas...
by PB
Mon Aug 24, 2020 10:41 am
Forum: C++ Development
Topic: wxAutomationObject CoInitialize has not been called error in wxThread
Replies: 5
Views: 196

Re: wxAutomationObject CoInitialize has not been called error in wxThread

Well, I have no experience with this but the error message seems to be pretty clear. wxWidgets initialize the COM in the main thread (using wxOleInitialize()) but you need to do that for the threads you create (and probably call wxOleUninitialize() on the thread deletion). See https://docs.microsoft...
by PB
Fri Aug 21, 2020 6:29 pm
Forum: Platform Related Issues
Topic: Processing ENTER key with wxSpinCtrlDouble
Replies: 6
Views: 305

Re: Processing ENTER key with wxSpinCtrlDouble

Unfortunately, I have tried using wxTE_PROCESS_ENTER on both Windows and Linux, but it does not seem to be supported for the spin control double This "works" for me both on GTK and MSW for both types of spin controls in the widgets sample: but as I wrote above, this generates wxEVT_TEXT_ENTER and n...
by PB
Fri Aug 21, 2020 3:38 pm
Forum: Platform Related Issues
Topic: Processing ENTER key with wxSpinCtrlDouble
Replies: 6
Views: 305

Re: Processing ENTER key with wxSpinCtrlDouble

I am not really using Linux, but I tested this with widgets sample using wxWidgets 3.1.4 on Linux Mint 20 with GTK 3.24 under VirtualBox and was not able to generate wxSpinCtrDoubleEvent by hitting <Enter> there either?! Both MSW and GTK seem to handle <Enter> only when the spin control has wxTE_PRO...
by PB
Thu Aug 20, 2020 7:15 pm
Forum: Platform Related Issues
Topic: Processing ENTER key with wxSpinCtrlDouble
Replies: 6
Views: 305

Re: Processing ENTER key with wxSpinCtrlDouble

Controls normally do not trigger events on <Enter>, do they? Not sure if this is any help, but here is a somewhat similar thread, using wxEVT_TEXT_ENTER https://forums.wxwidgets.org/viewtopic.php?f=1&t=46747&p=196346#p196332 EDIT My bad, wxSpinCtrlDouble documentation states that the event is sent o...
by PB
Thu Aug 20, 2020 3:15 pm
Forum: Compiler / Linking / IDE Related
Topic: Linking step: Lib directories missing and other questions
Replies: 5
Views: 193

Re: Linking step: Lib directories missing and other questions

The jpeg and tiff libraries are not needed in the shared build used in my guide, only in the static build.

The need for wxregex is also explained there: it was introduced in 3.1.4 and is again not needed in 3.1.5.