Search found 26 matches

by p_lu
Fri Mar 15, 2019 1:25 pm
Forum: C++ Development
Topic: C++ function ptr with class
Replies: 11
Views: 358

Re: C++ function ptr with class

>>> You could not replace "&ControlFrame::OnButton3Click" with "&this->OnButton3Click" and it would still work. Well, the compiler wouldn't accept "&this->OnButton3Click" anyway. I'm not clear that what you claim, that "this" is polymorphic (inherited class, virtual class, etc.) makes it "unusable."...
by p_lu
Thu Mar 14, 2019 5:22 pm
Forum: C++ Development
Topic: C++ function ptr with class
Replies: 11
Views: 358

Re: C++ function ptr with class

>>> But in your example, you could not replace "ControlFrame::" with "this->". Not sure what you're thinking with the above statement. The difference between dispatcher() and dispatcher1() is simply that in the latter case, the explicit qualifiers "ControlFrame::" and "this->" were removed. This sho...
by p_lu
Thu Mar 14, 2019 12:50 pm
Forum: C++ Development
Topic: C++ function ptr with class
Replies: 11
Views: 358

Re: C++ function ptr with class

Sorry, but I don't know how to set up the code below in a code-display scroll section (<code>, <code/> ???), so am just including the code in-line. I've rearranged the code a little, so the dispatcher is part of the ControlFrame class. The code in dispatcher() compiles and runs fine. One would think...
by p_lu
Wed Mar 13, 2019 12:05 pm
Forum: C++ Development
Topic: C++ function ptr with class
Replies: 11
Views: 358

Re: C++ function ptr with class

I realized this after doing some additional Web-searching and compiling the program under g++, which gave a more "meaningful" error message. funcptr.cpp: In member function ‘void clx::f()’: funcptr.cpp:38:30: error: must use ‘.*’ or ‘->*’ to call pointer-to-member function in ‘((clx*)this)->clx::fun...
by p_lu
Tue Mar 12, 2019 10:49 pm
Forum: C++ Development
Topic: C++ function ptr with class
Replies: 11
Views: 358

C++ function ptr with class

Hi, This is a generic C++ programming issue, not anything wxWidgets specific. I just don't know where to ask for C++ help. The following sample program fails to compile under VS2017, with the following errors (for the noted line)... E0109 expression preceding parentheses of apparent call must have (...
by p_lu
Thu Feb 14, 2019 4:34 pm
Forum: C++ Development
Topic: wxTextCtrl EVT_TEXT_ENTER
Replies: 8
Views: 354

Re: wxTextCtrl EVT_TEXT_ENTER

Yah, it would be nice if we had the luxury of learning basic toolkits from scratch. But, the reality is that we have very limited time to get software working, so have to count on "add-on" builders like Codeblocks/wxsmith to get an infrastructure going quickly, and to (reverse) learn the basics thro...
by p_lu
Tue Feb 12, 2019 7:13 pm
Forum: C++ Development
Topic: wxTextCtrl EVT_TEXT_ENTER
Replies: 8
Views: 354

Re: wxTextCtrl EVT_TEXT_ENTER

Found the problem. In the Connect(), I should use wxEVT_COMMAND_TEXT_ENTER instead of the default wxEVT_COMMAND_TEXT_UPDATED. This should correspond to your use of EVT_TEXT_ENTER(). Not sure how to tell wxsmith to do this, though, at this point, but at least I know what's needed. Thank you so much.
by p_lu
Tue Feb 12, 2019 6:56 pm
Forum: C++ Development
Topic: wxTextCtrl EVT_TEXT_ENTER
Replies: 8
Views: 354

Re: wxTextCtrl EVT_TEXT_ENTER

I tried out your MyFrame1 program and it works great as expected. However, since I'm using the Codeblocks+wxsmith infrastructure to build my project, I tried a standalone test of the wxTextCtrl widget and am still seeing the handler invoked on _any_ change to the text line. By eyeballing your (worki...
by p_lu
Mon Feb 11, 2019 9:11 pm
Forum: C++ Development
Topic: wxTextCtrl EVT_TEXT_ENTER
Replies: 8
Views: 354

wxTextCtrl EVT_TEXT_ENTER

I'm trying to use a wxTextCtrl widget with EVT_TEXT_ENTER mode (wxTE_PROCESS_ENTER style set under wxsmith in Codeblocks). Codeblocks, by default, sets up a handler, OnTextCtrl1Text(...) which gets invoked on _any_ change of text in the widget. I want the handler invoked when the ENTER key is presse...
by p_lu
Mon Jan 07, 2019 8:36 pm
Forum: Platform Related Issues
Topic: wxExecute invoking window in Windows, not so in Linux
Replies: 2
Views: 207

Re: wxExecute invoking window in Windows, not so in Linux

Looks like

#define SH "/usr/bin/lxterm -geometry 100x30 -e /bin/sh -c \'"

works fine.

Thanks.
by p_lu
Mon Jan 07, 2019 8:19 pm
Forum: Platform Related Issues
Topic: wxExecute invoking window in Windows, not so in Linux
Replies: 2
Views: 207

Re: wxExecute invoking window in Windows, not so in Linux

I think one option might be xterm (or Terminal). Any better or more fitting
method, more parallel to the Windows case?

Thanks.
by p_lu
Mon Jan 07, 2019 8:17 pm
Forum: Platform Related Issues
Topic: wxExecute invoking window in Windows, not so in Linux
Replies: 2
Views: 207

wxExecute invoking window in Windows, not so in Linux

Hi, From Windows (10), when I invoke wxExecute from a (Codeblocks) wxFrame app, specifying a shell program (in this case Cygwin Bash), the framework opens a shell window and executes the script within it. In (Debian/Raspian) Linux, however, the framework processes the shell program within the window...
by p_lu
Sat Dec 08, 2018 3:12 am
Forum: C++ Development
Topic: wxStaticText clear label before SetLabel
Replies: 3
Views: 209

Re: wxStaticText clear label before SetLabel

Thanks for the replies. I was thinking it's a known wxWidgets issue that users know well, but it's a bug in my code. I wrote a small test program that demonstrated the SetLabel() works as expected. It was in my code, where "char *s1 = "xyz";" wasn't quite right (and that simple). Found it by walking...
by p_lu
Fri Dec 07, 2018 2:44 pm
Forum: C++ Development
Topic: wxSpinCtrl larger buttons
Replies: 4
Views: 263

Re: wxSpinCtrl larger buttons

I'm using a 3.5" touchscreen on a Raspberry Pi. The goal is to have buttons big enough for a finger to activate. Yes. native controls are meant to use the screen as a "computer display," with buttons that are controllable via a cursor (mouse, touchpad, stylus, etc.), so the relative dimensions of co...
by p_lu
Fri Dec 07, 2018 2:35 pm
Forum: C++ Development
Topic: wxStaticText clear label before SetLabel
Replies: 3
Views: 209

wxStaticText clear label before SetLabel

I'm using wxStaticText SetLabel() and would like the field(s) after the new label to be cleared (spaces). Instead, I see the old data in those spaces. My code is: char *s = "abcdef"; wxString str; str << s; StaticText1->SetLabel(str); // text shows "abcdef" char *s1 = "xyz"; wxString str1; str1 << s...