Search found 15806 matches

by doublemax
Sat Apr 10, 2021 8:49 pm
Forum: C++ Development
Topic: Retrieve image indices in wxTreeListCtrl
Replies: 1
Views: 29

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: 89

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: 393

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: 393

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: 393

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: 178

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: 74

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: 71

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: 175

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...
by doublemax
Mon Apr 05, 2021 1:57 pm
Forum: C++ Development
Topic: wxWidgets theming.
Replies: 1
Views: 66

Re: wxWidgets theming.

Is is possible to add theming options to a application, like giving user option to change color of controls, something like CSS or maybe a simple config file No. You can only modify the color from individual controls, but even that is limited depending on the underlying native control and platform ...
by doublemax
Mon Apr 05, 2021 1:51 pm
Forum: C++ Development
Topic: Passing data from Parent to Child
Replies: 1
Views: 54

Re: Passing data from Parent to Child

The "child frame" you're creating should be a modal dialog. Here's some sample code for a dialog for entering one string: class DataEntryDialog : public wxDialog { public: DataEntryDialog(wxWindow *parent, const wxString &title) : wxDialog(parent, wxID_ANY, title) { wxBoxSizer *mainSizer = new wxBox...