Search found 2222 matches

by PB
Mon Mar 30, 2020 11:57 am
Forum: C++ Development
Topic: wxListCtrl: ID vs. Index
Replies: 5
Views: 65

Re: wxListCtrl: ID vs. Index

Thank's for taking the time to think about this. What I'm wondering is an enhanced version of your example: wxListItem info; info.SetId (20); info.SetText ("Blah"); m_listView->InsertItem(info); info.Clear (); info.SetId (20); m_listView->GetItem (info); (Based on my observation on MSW for a list w...
by PB
Mon Mar 30, 2020 9:21 am
Forum: C++ Development
Topic: wxListCtrl: ID vs. Index
Replies: 5
Views: 65

Re: wxListCtrl: ID vs. Index

I think you do not have to be concerned about this. I believe it is generally not possible for the wxListItem id (= 0-based position of the id in the list control) to be different from the actual item list index. Of course, the returned index can still be different than the id when inserting an item...
by PB
Mon Mar 30, 2020 6:06 am
Forum: C++ Development
Topic: Communicate Back to thread
Replies: 8
Views: 344

Re: Communicate Back to thread

Widgets wrote:
Mon Mar 30, 2020 1:20 am
one still would need to use an event to initiate any action in the main thread, with possibly extra information via the queue?
You can pass the extra information to the main thread using wxThreadEvent::SetPayload(), as shown e.g. here
viewtopic.php?f=1&t=46485#p194840
by PB
Sat Mar 28, 2020 9:00 pm
Forum: Compiler / Linking / IDE Related
Topic: Win7: compiled wxWidgets 3.1.3, cannot build "minimal" sample.
Replies: 7
Views: 152

Re: Win7: compiled wxWidgets 3.1.3, cannot build "minimal" sample.

I would guess a corrupt or edited makefile.gcc or config.gcc is the cause of the posters problem. But those are shared between the library and samples, and the library build just fine? I did not see any c:\MinGW in the OP's setup (for some reason, he seems to have it installed in C:\SVILUPPO\MinGWG...
by PB
Sat Mar 28, 2020 6:47 pm
Forum: Compiler / Linking / IDE Related
Topic: Win7: compiled wxWidgets 3.1.3, cannot build "minimal" sample.
Replies: 7
Views: 152

Re: Win7: compiled wxWidgets 3.1.3, cannot build "minimal" sample.

Looks fine to me. The only thing that may be problematic is your GCC is 9.2. Very new MinGW versions are known to have problems with wxWidgets. But they are usually different kind of problems than you have. I doubt Win7 vs Win10 makes any difference here, so the only difference is the build toolchai...
by PB
Fri Mar 27, 2020 5:24 pm
Forum: C++ Development
Topic: Resize a window full width
Replies: 10
Views: 145

Re: Resize a window full width

This post may better explain "invisible borders" in Win10
https://stackoverflow.com/a/34143777/7267315

Not sure if it is of any help to the OP...
by PB
Fri Mar 27, 2020 5:08 pm
Forum: C++ Development
Topic: Resize a window full width
Replies: 10
Views: 145

Re: Resize a window full width

Is not the issue the invisible border around the window, making it seem smaller than it really is, e.g.
https://stackoverflow.com/questions/319 ... ing-border
by PB
Fri Mar 27, 2020 4:34 pm
Forum: Compiler / Linking / IDE Related
Topic: Win7: compiled wxWidgets 3.1.3, cannot build "minimal" sample.
Replies: 7
Views: 152

Re: Win7: compiled wxWidgets 3.1.3, cannot build "minimal" sample.

Did you verify that wxWidgets built successfully? Is file build.cfg in your WXWIN/lib/gcc_libREL_9201/mswu folder? EDIT I have just tried with your exact build parameters and I could build the minimal sample as well. wxWidgets 3.1.3, mingw-64 i686-8.1.0-win32-sjlj-rt_v6-rev0, Win10 BTW, these are th...
by PB
Thu Mar 26, 2020 9:33 pm
Forum: C++ Development
Topic: Resize a window full width
Replies: 10
Views: 145

Re: Resize a window full width

FWIW, I vaguely remember recently using SetSize() on a wxFrame and the resulting size being a couple of pixels off the requested at least in one dimension (Win10).
by PB
Thu Mar 26, 2020 8:37 pm
Forum: C++ Development
Topic: Saving wxImage to wxStringOutputStream fails
Replies: 8
Views: 140

Re: Saving wxImage to wxStringOutputStream fails

Firstly, I can store PNG in a wxString like this (wxWidgets 3.1.3, MSW) #include <wx/wx.h> #include <wx/sstream.h> class MyApp : public wxApp { public: bool OnInit() override { wxInitAllImageHandlers(); wxImage img(128, 128); wxString imgString; wxStringOutputStream sos(&imgString, wxConvISO8859_1);...
by PB
Thu Mar 26, 2020 3:34 pm
Forum: C++ Development
Topic: wxListCtrl::SetItemPtrData: Who owns the memory?
Replies: 2
Views: 51

Re: wxListCtrl::SetItemPtrData: Who owns the memory?

I think wxListCtrl just stores this data and never does anything with them. If the ptrdata contains a pointer to a dynamically allocated memory (it can be just integer as well), the application programmer is responsible for freeing the memory when it makes sense. If the lifetime of the objects store...
by PB
Thu Mar 26, 2020 1:24 pm
Forum: C++ Development
Topic: Saving wxImage to wxStringOutputStream fails
Replies: 8
Views: 140

Re: Saving wxImage to wxStringOutputStream fails

What do you want to accomplish by saving a binary data to a string? If I wanted to get in-memory representation of a PNG, I would use wxMemoryOutputStream. If I wanted a PNG stored as text, I would uuencode it first. EDIT I did some very quick debugging and IMO storing arbitrary binary data in wxStr...
by PB
Wed Mar 25, 2020 8:03 pm
Forum: C++ Development
Topic: Scroll doesn't work after focusing custom control
Replies: 15
Views: 184

Re: Scroll doesn't work after focusing custom control

Tried unbind OnMouseMove handler in the dialog - didn't help. As a user, I expect mouse wheel events going to the focused control supporting scrolling (listctrl, textctrl...), not its top-level parent. I expect the same...seems like wxDataViewListCtrl works in incorrect way. I meant that the scroll...
by PB
Wed Mar 25, 2020 5:58 pm
Forum: C++ Development
Topic: Scroll doesn't work after focusing custom control
Replies: 15
Views: 184

Re: Scroll doesn't work after focusing custom control

The code you posted is way too complex and missing information (e.g., what is m_dialogContent probably coming from the base class?). You do not seem to skip the mouse event in the dialog handler as well, are you sure this is what you want? Did you try to not bind the mouse move event there to see if...
by PB
Wed Mar 25, 2020 4:35 pm
Forum: C++ Development
Topic: Scroll doesn't work after focusing custom control
Replies: 15
Views: 184

Re: Scroll doesn't work after focusing custom control

I would start commenting out the parts of code (including the mouse event handler in the parent dialog) one by one till it start working. I would also doublecheck the parent-child hierarchy, i.e., if all the controls are created with a correct parent (e.g., dialog -> scrolled -> dataview). I am not ...