Search found 15245 matches

by doublemax
Sun Nov 29, 2020 10:35 pm
Forum: C++ Development
Topic: Redirecting UTF-8 strings to wxTextCtrl
Replies: 11
Views: 125

Re: Redirecting UTF-8 strings to wxTextCtrl

Do you actually have to output to the console? Are you developing a console application?
by doublemax
Sun Nov 29, 2020 9:28 pm
Forum: C++ Development
Topic: Redirecting UTF-8 strings to wxTextCtrl
Replies: 11
Views: 125

Re: Redirecting UTF-8 strings to wxTextCtrl

You need something that converts the 8bit UTF8 byte stream into a stream of (decoded) wide characters. The wxTextCtrl will not do it by itself. Googling found this (very old) post (untested): https://stackoverflow.com/questions/148403/utf8-to-from-wide-char-conversion-in-stl https://en.cppreference....
by doublemax
Sun Nov 29, 2020 1:47 pm
Forum: C++ Development
Topic: How to use wxGridSelectionModes selmode
Replies: 5
Views: 73

Re: How to use wxGridSelectionModes selmode

Sorry, but in this case you can't blame the documentation, you just need to know how to read a C++ method declaration correctly. shortcutGrid->CreateGrid( 10, 2, wxGrid::wxGridSelectRows ); If you had looked into the "grid" sample that comes with wxWidgets, you could have found this: void GridFrame:...
by doublemax
Sat Nov 28, 2020 4:12 pm
Forum: C++ Development
Topic: [Seg fault][wxMSW][3.1.4]: AuiManager and Sizer
Replies: 1
Views: 39

Re: [Seg fault][wxMSW][3.1.4]: AuiManager and Sizer

Panel1->SetSizer(BoxSizer1); SetSizer(BoxSizer1); This can't be correct. A sizer can only be assigned to one window. Remove the second line. BoxSizer1->Add(Button1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); If you run a debug build, this should give an assert, because using wx...
by doublemax
Thu Nov 26, 2020 7:31 pm
Forum: General Development
Topic: Window sizing using "Fit" only works for default font size
Replies: 3
Views: 175

Re: Window sizing using "Fit" only works for default font size

Which wxWidgets version is your wxPython version based on?

The issue seems to be related to this: https://trac.wxwidgets.org/ticket/16088#comment:4
The workaround before the fix was to catch the wxShowEvent of the main frame and re-calculate the layout then
by doublemax
Thu Nov 26, 2020 2:00 pm
Forum: C++ Development
Topic: Focus notion and how to manage it?
Replies: 4
Views: 88

Re: Focus notion and how to manage it?

In other words, what makes a focus pass from one window to another? - the user clicks an a control that doesn't have focus - the user uses keyboard navigation to move focus to another control, e.g. pressing TAB in a text control - it can also happen programmatically, if the application sets focus t...
by doublemax
Thu Nov 26, 2020 12:16 pm
Forum: C++ Development
Topic: Focus notion and how to manage it?
Replies: 4
Views: 88

Re: Focus notion and how to manage it?

The window that has focus receives key events, that's it.

The most common use of focus events is to catch wxEVT_KILL_FOCUS on a wxTextCtrl to get notified when the control loses focus, e.g. to perform validation on the content of the control.
by doublemax
Wed Nov 25, 2020 6:11 am
Forum: C++ Development
Topic: wxSlider SetValue() doesn't reposition the slider
Replies: 21
Views: 452

Re: wxSlider SetValue() doesn't reposition the slider

CallAfter( [this] { slider->GetParent()->Refresh() ; } ;) seems to have fixed the odd slider behavior. Now I'm wondering why. CallAfter ensures two things: 1) The code gets called after all currently pending events have been handled 2) The code is guaranteed to get called in the context of the main...
by doublemax
Mon Nov 23, 2020 6:15 am
Forum: C++ Development
Topic: wxSlider SetValue() doesn't reposition the slider
Replies: 21
Views: 452

Re: wxSlider SetValue() doesn't reposition the slider

Calling SetValue() will also trigger the event handler for the slider. In case there is one, is there anything in it that could interfere? Also, try a delayed Refresh using CallAfter: CallAfter( [this] { slider->Refresh(); // alternative slider->GetParent()->Refresh(); }); If that doesn't work, i'm ...
by doublemax
Sun Nov 22, 2020 6:22 pm
Forum: C++ Development
Topic: Widget to display waveform.
Replies: 1
Views: 145

Re: Widget to display waveform.

wxWidgets itself has no control for it. You could try:

wxFreeChart: https://iwbnwif.github.io/freechart_doc ... index.html
wxMathPlot (pretty old): https://wxmathplot.sourceforge.io/screenshot.shtml

As Audacity is open source, you could check its sources, too.
by doublemax
Sun Nov 22, 2020 4:30 pm
Forum: Compiler / Linking / IDE Related
Topic: wxSmith wxDialog problems when program is run
Replies: 61
Views: 1229

Re: wxSmith wxDialog problems when program is run

Unfortunately all my buttons are not in a panel, and there is no way to copy and paste them into a panel. I will have to move them in one at a time grrrr.
The buttons don't have to be in a panel, just use the parent of the buttons (which is probably the mainframe in your case).
by doublemax
Sat Nov 21, 2020 3:52 pm
Forum: C++ Development
Topic: How to remove transparency from an image
Replies: 8
Views: 212

Re: How to remove transparency from an image

Regarding the actual drawing operation that should work, but it's possible that wxPdfDocument still embeds the image data with alpha. Try calling wxImage::ClearAlpha() https://docs.wxwidgets.org/trunk/classw ... d9065628b1
by doublemax
Fri Nov 20, 2020 11:03 pm
Forum: C++ Development
Topic: handle wxEVT_LEFT_DOWN in wxGrid
Replies: 1
Views: 87

Re: handle wxEVT_LEFT_DOWN in wxGrid

You need to bind the event handler to the window returned by wxGrid::GetGridWindow
https://docs.wxwidgets.org/trunk/classw ... 883c3990f9

I don't know the Python equivalent for this.
by doublemax
Fri Nov 20, 2020 10:17 pm
Forum: C++ Development
Topic: How do you manage non-string objects in a virtual wxListCtrl?
Replies: 1
Views: 107

Re: How do you manage non-string objects in a virtual wxListCtrl?

I don't want to maitain an itermediate std::vector<data_item> because the exteranal store could potentially contain millions of objects I wouldn't use a vector, but a hash, but this is what you'll need. You need a container that maps the row-number of the listctrl to the m_id of the underlying row ...