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 » U++ Library support » U++ Core » Extend StaticText with method possible?
Extend StaticText with method possible? [message #34405] Sun, 20 November 2011 20:22 Go to next message
Wolfgang is currently offline  Wolfgang
Messages: 146
Registered: November 2011
Location: Germany
Experienced Member
Hi,

is it possible to extend the methods of a StaticText widget to have additional to the "SetText(const char *text)" a method that ADDS text instead of resetting it?

AddText for example.... "AddText(cont char *text)", can you tell me how to extend it, if possible? (I'm really sure it is possible)

Thank you!
Re: Extend StaticText with method possible? [message #34409 is a reply to message #34405] Mon, 21 November 2011 02:01 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Wolfgang wrote on Sun, 20 November 2011 14:22

Hi,

is it possible to extend the methods of a StaticText widget to have additional to the "SetText(const char *text)" a method that ADDS text instead of resetting it?

AddText for example.... "AddText(cont char *text)", can you tell me how to extend it, if possible? (I'm really sure it is possible)

Thank you!



Why not just use

lbl.SetText(lbl.GetText() + add);

?

Mirek
Re: Extend StaticText with method possible? [message #34411 is a reply to message #34405] Mon, 21 November 2011 07:29 Go to previous messageGo to next message
Wolfgang is currently offline  Wolfgang
Messages: 146
Registered: November 2011
Location: Germany
Experienced Member
I use this but I ask myself HOW such a task could be done. It's just to learn / see the technics behind the whole thing.

This thread is just an example to get a (possible) background.
Re: Extend StaticText with method possible? [message #34414 is a reply to message #34411] Mon, 21 November 2011 09:18 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Wolfgang wrote on Mon, 21 November 2011 01:29

I use this but I ask myself HOW such a task could be done. It's just to learn / see the technics behind the whole thing.

This thread is just an example to get a (possible) background.


At your level, I mean without changing U++ code, you cannot add this to StaticText.

You would have to create something like StaticText2, derived from StaticText, with your new method.

Mirek
Re: Extend StaticText with method possible? [message #34416 is a reply to message #34414] Mon, 21 November 2011 10:03 Go to previous messageGo to next message
Wolfgang is currently offline  Wolfgang
Messages: 146
Registered: November 2011
Location: Germany
Experienced Member
I see what u mean. Just thought I can extend the existing StaticText Class of u++.
Re: Extend StaticText with method possible? [message #34417 is a reply to message #34416] Mon, 21 November 2011 10:37 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Wolfgang wrote on Mon, 21 November 2011 04:03

I see what u mean. Just thought I can extend the existing StaticText Class of u++.


Well, in C++, you cannot extend class without changing its header code....
Previous Topic: assection failed error while opening /dev/rtp0 on ubuntu
Next Topic: Complex numbers..How to use in upp??
Goto Forum:
  


Current Time: Fri Apr 19 01:49:54 CEST 2024

Total time taken to generate the page: 0.03670 seconds