Search found 28 matches
- Wed Dec 02, 2020 3:06 pm
- Forum: C++ Development
- Topic: Attaching a console or writing output to console
- Replies: 5
- Views: 7425
Re: Attaching a console or writing output to console
I know this is a very old thread. But for reference for future readers. If using Code::Blocks it's possible to have the console along the app. Go to : project/properties/Build Targets There is an dropdown option for "type" if you select console application and rebuild, you will have the app run with...
- Tue May 05, 2020 11:51 am
- Forum: The Code Dump
- Topic: wxGrid with MS Excel (copy/paste)
- Replies: 11
- Views: 14077
Re: wxGrid with MS Excel (copy/paste)
This post above Code above does not work anymore. wxOpenClipboard(); copy_data = (char *)wxGetClipboardData(wxDF_TEXT); wxCloseClipboard(); needs to be replaced by if (wxTheClipboard->Open()) { if (wxTheClipboard->IsSupported( wxDF_TEXT )) { wxTextDataObject data; wxTheClipboard->GetData( data ); c...
- Tue Mar 03, 2020 2:21 pm
- Forum: C++ Development
- Topic: program truncated on small screen
- Replies: 2
- Views: 304
program truncated on small screen
Hey guys! I made a program with a wide main panel. When it display on a big screen it's ok. But if I open the program on a small screen, then the right side is just truncated, no scroll bar out of the boxe. And the program window cannot be resized bigger than the screen width (on win7). I tried to a...
- Tue Dec 03, 2019 1:39 pm
- Forum: C++ Development
- Topic: wxString spliting syntax
- Replies: 7
- Views: 729
Re: wxString spliting syntax
Thanks! Working as expected 

- Tue Dec 03, 2019 12:47 pm
- Forum: C++ Development
- Topic: wxString spliting syntax
- Replies: 7
- Views: 729
Re: wxString spliting syntax
While the pattern is so simple that you could solve this with dedicated code, you could also use this as an opportunity to learn about regular expressions :) #include "wx/regex.h" wxRegEx rx("\\((.*?):(.*?)\\)", wxRE_ADVANCED); if (rx.IsValid()) { wxString text = "(abcdef:ghijkl)"; if (rx.Matches(t...
- Mon Dec 02, 2019 4:30 pm
- Forum: C++ Development
- Topic: wxString spliting syntax
- Replies: 7
- Views: 729
Re: wxString spliting syntax
Thanks! '(' is working. Thanks for the reference to wxString::BeforeFirst. However in my case I have in fact recursive structure like ((wxstr1:wxstr2):wxstr3) so just taking the first colon will not work. What about how to get part of a string? This definitly doesn't work : wxString WxString1 = mwxS...
- Mon Dec 02, 2019 3:30 pm
- Forum: C++ Development
- Topic: wxString spliting syntax
- Replies: 7
- Views: 729
wxString spliting syntax
I have a wxString formated as follow : (WxString1:WxString2) And I'm trying to get two wxStrings: WxString1 and WxString2 if(mwxString[0].GetValue() == "("){ int colonIndex=0; for(int i = ;, i<mwxString.size(); i++){ if(mwxString[i].GetValue() == ":"){ colonIndex=i; i=mwxString.size(); } } wxString ...
- Mon Nov 18, 2019 2:32 pm
- Forum: C++ Development
- Topic: pass treectrl item id to menu OnTreeCtrlItemMenu
- Replies: 1
- Views: 315
Re: pass treectrl item id to menu OnTreeCtrlItemMenu
Found the answer in treelist sample. Here no function is called, we just get the id of the menu item that is clicked and process it in the OnItem function. void MyFrame::OnItemContextMenu(wxTreeListEvent& event) { enum { Id_Check_Item, Id_Uncheck_Item, Id_Indet_Item, Id_Check_Recursively, Id_Update_...
- Mon Nov 18, 2019 11:08 am
- Forum: C++ Development
- Topic: pass treectrl item id to menu OnTreeCtrlItemMenu
- Replies: 1
- Views: 315
pass treectrl item id to menu OnTreeCtrlItemMenu
Hi, I am building a treectrl which display some items. When right click on an item I want a menu to show up with some options 'delete item' 'edit item' ... In the treectrl sample (folder wxWidgets-3.1.2\samples\treectrl) it creates the menu, but the menu items are not linked to any functions. My iss...
- Sun Nov 03, 2019 1:40 pm
- Forum: C++ Development
- Topic: wxTextCtrl taking only numbers, wxNumberCtrl?
- Replies: 6
- Views: 882
Re: wxTextCtrl taking only numbers, wxNumberCtrl?
Thanks for your support again 
Also I need to manipulate 64bit values. Is there a way to use spinctrl with longlong? Because I cannot enter max value higher than 32bits

Also I need to manipulate 64bit values. Is there a way to use spinctrl with longlong? Because I cannot enter max value higher than 32bits
- Fri Nov 01, 2019 1:21 pm
- Forum: C++ Development
- Topic: wxTextCtrl taking only numbers, wxNumberCtrl?
- Replies: 6
- Views: 882
Re: wxTextCtrl taking only numbers, wxNumberCtrl?
From a beginner point of vue, this validator concept seems to add a layer of complexity for a feature that should be easy. wxSpinCtrl seem more like the thing. But can we type the value or can we use only the arrows? Because I need to enters 64bit values that can be pretty much random, so the arrows...
- Fri Nov 01, 2019 7:43 am
- Forum: C++ Development
- Topic: wxTextCtrl taking only numbers, wxNumberCtrl?
- Replies: 6
- Views: 882
wxTextCtrl taking only numbers, wxNumberCtrl?
I'm trying to have a wxtextctrl which accept only numbers, with a method getint() to get the number. It seems I found just that: https://forums.wxwidgets.org/viewtopic.php?t=15978 However I tried to add #include "wxNumberCtrl.h" #include "wxNumberCtrl.cpp" And edited my wxTextCtrl to use wxNumberCtr...
- Thu Oct 31, 2019 11:38 am
- Forum: C++ Development
- Topic: wxwidget structure understanding
- Replies: 20
- Views: 2031
Re: wxwidget structure understanding
You can also just initialize m_thread in code inside the constructor: m_thread = &m_thread_status; This bit of code isn't working though. Tried to add it to minimal and it can't build // frame constructor MyFrame::MyFrame(const wxString& title) : wxFrame(NULL, wxID_ANY, title) { m_thread = &m_threa...
- Thu Oct 31, 2019 6:47 am
- Forum: C++ Development
- Topic: wxwidget structure understanding
- Replies: 20
- Views: 2031
Re: wxwidget structure understanding
But you don't have to add methods for all variables, you can also just lock the whole structure with a critical section. How do you apply a critical section to the whole class or structure? Another noob question : I don't understand the syntax of the constructor. What introduce the ":" ? I guess it...
- Thu Oct 31, 2019 5:20 am
- Forum: C++ Development
- Topic: wxwidget structure understanding
- Replies: 20
- Views: 2031
Re: wxwidget structure understanding
Technically you don't need the protection for atomic variables like an integer. Got it thanks! Then what variable would need this protection? How far goes the atomic variables? Would I be fine using a struct with this kind of data directly? typedef struct GlobalMem { std::array<long long, 5> ArrayO...