Search found 15808 matches

by doublemax
Sun Apr 11, 2021 9:47 am
Forum: C++ Development
Topic: How to draw only completely visible items in wxScrolledCanvas
Replies: 2
Views: 42

Re: How to draw only completely visible items in wxScrolledCanvas

Try adding the wxFULL_REPAINT_ON_RESIZE window style flag. Despite its name, it sometimes fixed redraw issues in scrolled windows, even when they're happening while scrolling, not resizing.
by doublemax
Sun Apr 11, 2021 9:45 am
Forum: C++ Development
Topic: Stationary background with wxScrolled
Replies: 3
Views: 59

Re: Stationary background with wxScrolled

Try adding the wxFULL_REPAINT_ON_RESIZE window style flag. Despite its name, it sometimes fixed redraw issues in scrolled windows, even when they're happening while scrolling, not resizing.
by doublemax
Sat Apr 10, 2021 8:49 pm
Forum: C++ Development
Topic: Retrieve image indices in wxTreeListCtrl
Replies: 1
Views: 32

Re: Retrieve image indices in wxTreeListCtrl

I looked into the sources, and it seems there is no way to read these values.
by doublemax
Fri Apr 09, 2021 3:57 pm
Forum: C++ Development
Topic: Capture mouse events from childwindows
Replies: 5
Views: 91

Re: Capture mouse events from childwindows

Or do I have to bind to all childwindows? That depends on what you want to do. In most cases you probably want wxWindow::CaptureMouse() https://docs.wxwidgets.org/trunk/classwx_window.html#a5c72c6260a73ef77bb0b1f7ec85fcfef If that's not sufficient for your task, you have to bind to all descendants,...
by doublemax
Fri Apr 09, 2021 3:49 pm
Forum: C++ Development
Topic: Using Matplotlib with wxWidgets C++
Replies: 20
Views: 406

Re: Using Matplotlib with wxWidgets C++

hinet wrote:
Fri Apr 09, 2021 3:45 pm
In python, I am using this code to plot to auinotebook page:
how I could do this using C++?
Does the C++ wrapper have an equivalent to "FigureCanvas"? That that's probably the class you need.
by doublemax
Fri Apr 09, 2021 3:47 pm
Forum: C++ Development
Topic: Using Matplotlib with wxWidgets C++
Replies: 20
Views: 406

Re: Using Matplotlib with wxWidgets C++

This is really Matplotlib question. If you find a way to write the data as some kind of bitmap, you can dispay it in wxwidgets. According to this post , you can do it with "imsave", but it seems using a tempfile is the only way.
by doublemax
Fri Apr 09, 2021 9:07 am
Forum: C++ Development
Topic: Using Matplotlib with wxWidgets C++
Replies: 20
Views: 406

Re: Using Matplotlib with wxWidgets C++

I couldn't find what kind of outputs matplotlib supports, from the sample code i can only see that it can generate a PDF. If it can also create any kind of image/bitmap, you could write a small wrapper class that just takes that image and draws it onto a panel. https://wiki.wxwidgets.org/Drawing_on_...
by doublemax
Wed Apr 07, 2021 2:21 pm
Forum: Platform Related Issues
Topic: Load resources such as images and icons in my .dll project
Replies: 10
Views: 184

Re: Load resources such as images and icons in my .dll project

Code: Select all

button                 ICON        "button1.bmp"

Code: Select all

btnMyButton->SetBitmap(wxICON(button1));
Is this from real code?

Try:

Code: Select all

btnMyButton->SetBitmap(wxICON(button));
by doublemax
Wed Apr 07, 2021 11:23 am
Forum: C++ Development
Topic: How to handle multiple dataview selections?
Replies: 5
Views: 95

Re: How to handle multiple dataview selections?

From the "dataview" sample, code to delete all seletected items: void MyFrame::DeleteSelectedItems() { wxDataViewItemArray items; int len = m_ctrl[Page_Music]->GetSelections( items ); for( int i = 0; i < len; i ++ ) if (items[i].IsOk()) m_music_model->Delete( items[i] ); }
by doublemax
Wed Apr 07, 2021 10:16 am
Forum: C++ Development
Topic: wxLocale equivalent of _configthreadlocale(_ENABLE_PER_THREAD_LOCALE)
Replies: 1
Views: 75

Re: wxLocale equivalent of _configthreadlocale(_ENABLE_PER_THREAD_LOCALE)

Under Windows ::SetThreadLocale() is called to set the locale, so creating another wxLocale instance in the thread should work. But for the other platforms, i don't see any equivalent code in <wxdir>/src/common/intl.cpp If it's only for number conversions, there are a few helper functions in wxStrin...
by doublemax
Wed Apr 07, 2021 10:07 am
Forum: C++ Development
Topic: How to handle multiple dataview selections?
Replies: 5
Views: 95

Re: How to handle multiple dataview selections?

Look in the base class, there is wxDataViewCtrl::GetSelections
https://docs.wxwidgets.org/trunk/classw ... b254c41c86
by doublemax
Mon Apr 05, 2021 7:47 pm
Forum: C++ Development
Topic: Help creating a wxProcess/wxGenericProgressDialog combo!
Replies: 1
Views: 82

Re: Help creating a wxProcess/wxGenericProgressDialog combo!

I can't pinpoint exactly what's wrong, but subclassing wxGenericProgressDialog doesn't sound like a good idea. A progress dialog has a very narrow usage pattern and it can't even be used like a "normal" wxDialog, let alone a wxFrame. { wxGenericProgressDialog dlg(..); dlg.Show(); while (something) {...
by doublemax
Mon Apr 05, 2021 7:38 pm
Forum: General Development
Topic: wxlua build on MacOS 10.15
Replies: 2
Views: 73

Re: wxlua build on MacOS 10.15

I don't know anything about wxLua or wxWidgets under OSX, but i would first focus on the actual error message:

Code: Select all

ld: framework not found -lAVKit
Do you link to AVKit when building wxLua? If not, try adding it. If yes, try to find out why it's not found.
by doublemax
Mon Apr 05, 2021 2:42 pm
Forum: C++ Development
Topic: How to get the frame rate using wxGLCanvas library
Replies: 3
Views: 179

Re: How to get the frame rate using wxGLCanvas library

Supposed you have a paint event handler, do it like this: void SomeClass::OnPaint(wxPaintEvent &event) { static wxLongLong s_lastTime = -1; wxLongLong actTime = ::wxGetLocalTimeMillis(); double fps = 0.0f; if( s_lastTime != -1 ) { fps = 1000.0f / (actTime - s_lastTime).ToDouble(); } s_lastTime = act...