Search found 64 matches

by marcusbarnet
Sun Oct 20, 2019 11:20 am
Forum: C++ Development
Topic: Static Text strings in wxwidgets
Replies: 7
Views: 570

Static Text strings in wxwidgets

Hi to all, My applications (wxwidgets 3.1 and C++) usually use lots of static text strings to display messages to users. To do this, I create standard static texts and then I change their values with code and I hide() or show() them depending on user actions. This works but it requires lots of stati...
by marcusbarnet
Sat Oct 19, 2019 5:16 pm
Forum: C++ Development
Topic: Application randomly reset and loads new windows
Replies: 23
Views: 954

Re: Application randomly reset and loads new windows

If I well understood how the wxSimpleBook works, I should have only one frame and multiple panels. Then, I can select them once a time in order to let the user navigate through different pages. I created two panels with wxSmith firstpanel.wxs and secondpanel.wxs and I put inside two static texts. Au...
by marcusbarnet
Sat Oct 19, 2019 11:21 am
Forum: C++ Development
Topic: Application randomly reset and loads new windows
Replies: 23
Views: 954

Re: Application randomly reset and loads new windows

I will need about 20 controls in total, so I think I can follow your suggestion and use the Reset() method for them. The FilterEvent is very cool! I didn't know about it! Thank you! Can I use WxSmith editor to add the controls on the pages? In my previous application, I had three *.wxs files under t...
by marcusbarnet
Fri Oct 18, 2019 5:06 pm
Forum: C++ Development
Topic: Application randomly reset and loads new windows
Replies: 23
Views: 954

Re: Application randomly reset and loads new windows

It seems pretty easy, I used SetSelection() and i was able to display the second page without problems.

How should I handle the reset aspect? Should I use the timer?
If yes, can I use the same procedure I used for my previous application?
Is it possible to reinitialize the frame 0?
by marcusbarnet
Fri Oct 18, 2019 3:16 pm
Forum: C++ Development
Topic: Application randomly reset and loads new windows
Replies: 23
Views: 954

Re: Application randomly reset and loads new windows

I started with a very clean notebook sample which seems to work fine on Codeblocks: #include "WxNotebook1Main.h" #include <wx/panel.h> #include <wx/notebook.h> #include <wx/textctrl.h> #include <wx/sizer.h> WxNotebook1Main::WxNotebook1Main(const wxString& title) : wxFrame(NULL, wxID_ANY, title) { //...
by marcusbarnet
Fri Oct 18, 2019 2:35 pm
Forum: C++ Development
Topic: Application randomly reset and loads new windows
Replies: 23
Views: 954

Re: Application randomly reset and loads new windows

e.g. in thirdpage.cpp you have this line: firstpage = new ProjectFrame(nullptr, 1); You probably have to destroy the old instance first. In general, this code is quite messy (no offense). It's just bad style that the 3 different pages know about each other, call each others methods or even mess wit...
by marcusbarnet
Fri Oct 18, 2019 2:34 pm
Forum: C++ Development
Topic: Application randomly reset and loads new windows
Replies: 23
Views: 954

Re: Application randomly reset and loads new windows

to many code... what this string means? m_clearDataTimer.Bind(wxEVT_TIMER, &ProjectFrame::OnClearData, this); read how to create a timer and define timer events receiver. you must 1. somehow create a timer, for example as member of class, or by new. 2. set its owner using wxTimer::SetOwner(). timer...
by marcusbarnet
Fri Oct 18, 2019 10:19 am
Forum: C++ Development
Topic: Application randomly reset and loads new windows
Replies: 23
Views: 954

Application randomly reset and loads new windows

I'm using WxWidgets 3.1.2 with C++ under Ubuntu to control a device which acts like a Kiosk/ATM. I use a magnetic card reader to take inputs from the users within the first frame (ProjectMain.cpp) and then I have two other frames (SecondPage.cpp and ThirdPage.cpp) where the users can perform some ac...
by marcusbarnet
Mon Oct 07, 2019 5:04 pm
Forum: C++ Development
Topic: Why thread doesn't close in WxWidgets
Replies: 5
Views: 240

Re: Why thread doesn't close in WxWidgets

Yes, I'm sure, but for the moment, I solved by using a fork().

It seems to work!
by marcusbarnet
Mon Oct 07, 2019 4:19 pm
Forum: C++ Development
Topic: Why thread doesn't close in WxWidgets
Replies: 5
Views: 240

Re: Why thread doesn't close in WxWidgets

If I use vlc library directly without thread or fork() the program blocks until the file is not fully played.
by marcusbarnet
Mon Oct 07, 2019 4:10 pm
Forum: C++ Development
Topic: Why thread doesn't close in WxWidgets
Replies: 5
Views: 240

Re: Why thread doesn't close in WxWidgets

so how can I stop the mp3 before going to the next frame?

Shouldn't I use the thread solution?
I do not want to block the program execution while the mp3 is playing.
by marcusbarnet
Mon Oct 07, 2019 2:08 pm
Forum: C++ Development
Topic: Why thread doesn't close in WxWidgets
Replies: 5
Views: 240

Why thread doesn't close in WxWidgets

I'm on Ubuntu and I'm using WxWidgets with C/C++. I need to reproduce some mp3 files without blocking the application flow and so I tried to use threads. I create a new thread to reproduce music with vlc libraries and I want to kill it when the user press a button to load a new frame. Unfortunately,...
by marcusbarnet
Mon Oct 07, 2019 7:44 am
Forum: C++ Development
Topic: Clear a WxTextCtrl after few seconds
Replies: 7
Views: 336

Re: Clear a WxTextCtrl after few seconds

I can't understand why the first frame keeps reloading if the timer is set only in the second frame.
by marcusbarnet
Sat Oct 05, 2019 6:12 pm
Forum: C++ Development
Topic: Clear a WxTextCtrl after few seconds
Replies: 7
Views: 336

Re: Clear a WxTextCtrl after few seconds

Thank you a lot for you tip. I was able to successfully use the wxTimerEvent. I just have a problem because I tried to set a timeout on my second frame in order to reloads the first frame when there is no user action for more than 5 minutes. It seems to work, but when it returns to the first frame, ...
by marcusbarnet
Wed Oct 02, 2019 7:16 pm
Forum: C++ Development
Topic: Clear a WxTextCtrl after few seconds
Replies: 7
Views: 336

Re: Clear a WxTextCtrl after few seconds

Can you please show me a simple example on how to use it?

I'm not an expert so I'm not figuring out how to use it.

Thank you