Search found 27 matches

by paddle
Tue May 05, 2020 11:51 am
Forum: The Code Dump
Topic: wxGrid with MS Excel (copy/paste)
Replies: 11
Views: 13366

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...
by paddle
Tue Mar 03, 2020 2:21 pm
Forum: C++ Development
Topic: program truncated on small screen
Replies: 2
Views: 214

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...
by paddle
Tue Dec 03, 2019 1:39 pm
Forum: C++ Development
Topic: wxString spliting syntax
Replies: 7
Views: 486

Re: wxString spliting syntax

Thanks! Working as expected :)
by paddle
Tue Dec 03, 2019 12:47 pm
Forum: C++ Development
Topic: wxString spliting syntax
Replies: 7
Views: 486

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...
by paddle
Mon Dec 02, 2019 4:30 pm
Forum: C++ Development
Topic: wxString spliting syntax
Replies: 7
Views: 486

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...
by paddle
Mon Dec 02, 2019 3:30 pm
Forum: C++ Development
Topic: wxString spliting syntax
Replies: 7
Views: 486

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 ...
by paddle
Mon Nov 18, 2019 2:32 pm
Forum: C++ Development
Topic: pass treectrl item id to menu OnTreeCtrlItemMenu
Replies: 1
Views: 235

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_...
by paddle
Mon Nov 18, 2019 11:08 am
Forum: C++ Development
Topic: pass treectrl item id to menu OnTreeCtrlItemMenu
Replies: 1
Views: 235

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...
by paddle
Sun Nov 03, 2019 1:40 pm
Forum: C++ Development
Topic: wxTextCtrl taking only numbers, wxNumberCtrl?
Replies: 6
Views: 705

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
by paddle
Fri Nov 01, 2019 1:21 pm
Forum: C++ Development
Topic: wxTextCtrl taking only numbers, wxNumberCtrl?
Replies: 6
Views: 705

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...
by paddle
Fri Nov 01, 2019 7:43 am
Forum: C++ Development
Topic: wxTextCtrl taking only numbers, wxNumberCtrl?
Replies: 6
Views: 705

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...
by paddle
Thu Oct 31, 2019 11:38 am
Forum: C++ Development
Topic: wxwidget structure understanding
Replies: 20
Views: 1611

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...
by paddle
Thu Oct 31, 2019 6:47 am
Forum: C++ Development
Topic: wxwidget structure understanding
Replies: 20
Views: 1611

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...
by paddle
Thu Oct 31, 2019 5:20 am
Forum: C++ Development
Topic: wxwidget structure understanding
Replies: 20
Views: 1611

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...
by paddle
Wed Oct 30, 2019 4:47 pm
Forum: C++ Development
Topic: wxwidget structure understanding
Replies: 20
Views: 1611

Re: wxwidget structure understanding

Solved, the class is defined in the XxxMain.h.