Search found 71 matches

by marcusbarnet
Sun Oct 20, 2019 5:58 pm
Forum: C++ Development
Topic: Application randomly reset and loads new windows
Replies: 23
Views: 1280

Re: Application randomly reset and loads new windows

Thank you a lot, doublemax! Now, it works very well! I did in this way as you suggested: Isola02App.cpp wxIMPLEMENT_APP(Isola02App); bool Isola02App::OnInit() { Isola02Frame* frame = new Isola02Frame(L"Isola02Frame"); pointer = frame; frame->Show(true); m_timer.Bind(wxEVT_TIMER, &Isola02App::reset, ...
by marcusbarnet
Sun Oct 20, 2019 4:58 pm
Forum: C++ Development
Topic: Application randomly reset and loads new windows
Replies: 23
Views: 1280

Re: Application randomly reset and loads new windows

Thank you again for your efforts! I'm writing down all the advices so I can use them also in future! I made the variables protected, the program compiles correctly and runs fine. As last task, I was trying the filter function to catch the last user action and trigger the timer, but it seems that it ...
by marcusbarnet
Sun Oct 20, 2019 4:45 pm
Forum: C++ Development
Topic: Application randomly reset and loads new windows
Replies: 23
Views: 1280

Re: Application randomly reset and loads new windows

Thank you a lot for all your support and suggestions! Now, it can swap from one panel to another without problems! I modified all the parameters and now it works! I also followed your advice and I added the ShowPage() function, here is the code. class Isola02Frame : public wxFrame { public: Isola02F...
by marcusbarnet
Sun Oct 20, 2019 4:21 pm
Forum: C++ Development
Topic: Static Text strings in wxwidgets
Replies: 7
Views: 759

Re: Static Text strings in wxwidgets

yes, unfortunately, it's only one page; since there were lots of user interactions in my previous application, I wanted to avoid to create too many pages and so I tried to insert all the texts in a single page; the result was really a mess because it is hard to handle all the strings. However, if it...
by marcusbarnet
Sun Oct 20, 2019 4:12 pm
Forum: C++ Development
Topic: Application randomly reset and loads new windows
Replies: 23
Views: 1280

Re: Application randomly reset and loads new windows

I'm sorry if my question is too stupid, but what means this line of code? pointer = mainFrame; I can understand that the error is caused by the pointer which is NULL and not initialized, but what should mainFrame be? Are you suggesting to use ShowPage() as a function which accepts as parameter the n...
by marcusbarnet
Sun Oct 20, 2019 3:25 pm
Forum: C++ Development
Topic: Application randomly reset and loads new windows
Replies: 23
Views: 1280

Re: Application randomly reset and loads new windows

Thank you for your support. I'm having problems when trying to switch from the current page to the next page. To do a test, I simply added a button to the first panel to change the page selection when pressed, but I receive segmentation fault error. In the button pressed event, in firstpanel.cpp, I ...
by marcusbarnet
Sun Oct 20, 2019 2:54 pm
Forum: C++ Development
Topic: Static Text strings in wxwidgets
Replies: 7
Views: 759

Re: Static Text strings in wxwidgets

This is an example of the mess I have in each frame caused by the multiple text strings. Most of them are set as hidden and then I show() them depending on the user input. Other strings have default values and then I change them with values generated by the user. I can't use the same string because ...
by marcusbarnet
Sun Oct 20, 2019 11:20 am
Forum: C++ Development
Topic: Static Text strings in wxwidgets
Replies: 7
Views: 759

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

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

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

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

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

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

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

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...