Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Changing EditFields from header files
Re: Changing EditFields from header files [message #38079 is a reply to message #38063] Thu, 29 November 2012 19:45 Go to previous messageGo to previous message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
Thanks navi for the response
Quote:

you need to read up on C++ scope of variables and specially class scope.


Yes I do. I have C++ Language Tutorial from cplusplus.com
If you know something better let me know.

Quote:

its nothing to do with U++

How U++ handles EditFields may be different from M$VC, which I don't know very well either.

My post apparently was not as clear as it should have been but this may relate to it:
Quote:

if data need to be set from outside the class you have to implement a interface for that. usually through a public function like
void Set_t1(int a){ t1<=a; }

With this in H1.h if it can be called from H2.h it may work.

In java with H1 h1 = new H1(String);
then in H2 it would just be h1.t1<<= "2 OK";

I tried to make t1 global but that did not work.

How you modified the code:
in H1.h
void Set_t1(int a){ t1<<=a; }
in H2.h instead of
return AsString("2 OK");

maybe have
H1.h
void Set_t1(String a){ t1<<=a; }
H2.h
if ( a > b ) Set_t1("2 OK");

but get this error
H2.h(16) : error C3861: 'Set_t1': identifier not found
but in H1.h it is under public:

To clarify this is in GPS receiver code in a separate thread so there will be no 'return' but up to five EditFields will be changed but it needs to be done in that thread.

I cleaned up the code.
The t1 or the Set_t1(...) needs to be accessed in H2.h

  • Attachment: Test2.zip
    (Size: 1.44KB, Downloaded 230 times)
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: hiding the vertical scrollbar of LineEdit Ctrl
Next Topic: Buttons in Array using ArrayCtrl
Goto Forum:
  


Current Time: Sat May 03 14:41:35 CEST 2025

Total time taken to generate the page: 0.01104 seconds