Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Extending a component (simple work for you guys)

Posted on 2004-04-15
21
Medium Priority
?
404 Views
Last Modified: 2010-04-05
Hello Experts,

I need to extend the TmsnPopup component so that it contains an extra "invisible" label that I can store additional text in and retrieve it later.

If you have never seen/heard of  the TmsnPopup component then all it basically does is create a lil popup window above your taskbar like you find in MSN Messenger when someone logs in and everything works fine except I need to have the additional "invisible" label added on to it and ofcourse ways to add text and retrieve the text back from it later on :)

you can find the source at http://www.torry.net/vcl/forms/appearence/tmsnpopup.zip

TIA,
Blue220
0
Comment
Question by:blue220
  • 6
  • 6
  • 6
  • +1
21 Comments
 
LVL 1

Expert Comment

by:tanghz
ID: 10832763
Hi I modified that component that it has CustomStr property. You put your string data there.
No point to add invisible component. It just take you more resources.

Give me your email I send it over.
0
 
LVL 7

Expert Comment

by:sftweng
ID: 10833532
tanghz, please see "Help" -> "The Big Mistakes":

"The use of private correspondence to resolve a question at Experts Exchange is prohibited as an abuse of the points system."
0
 

Author Comment

by:blue220
ID: 10833716
Hello tanghz ... the point of having the lable was so it was "Invisible" i cannot accept anything other then that. Also all really need to do is post the parts you changed or added and I will do the same to the component I have and if need be ask further questions at that time.

Thanks,
Blue220
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 23

Expert Comment

by:Ferruccio Accalai
ID: 10834122
i'm not understanding one thing: what have to be invisible? the label on the popup or the label property in the cmp?

In the first case you simply need to add a public variable to the cmp so you can set and get it whenever you want....

Please can you explain to me better what do you need?

Do this label have to be showed on the popup?
0
 

Author Comment

by:blue220
ID: 10834242
sorry for any confusion will try to explain better... with the normal component there are 2 lables (1 for title and 1 for text) both of these lables should be left as they are and all I want to do is have one more lable added to the component that will be hidden at runtime so this is what we got..

main component (visible ofcourse)
Title Label (visible)
Text Lable (visible)
New Hidden Label (invisible)

the hidden lable should function the same as the other 2 lables except it's not visible at runtime... anyway thats it and that answers ya questions.
0
 
LVL 23

Accepted Solution

by:
Ferruccio Accalai earned 1000 total points
ID: 10834246
BTW maybe this is what you need:

in MSNPopup.pas

find the lines
TMSNPopUp = Class(TComponent)
  private
    { Private declarations }
    FURL: String;
    FText: String;
   [...]
   add here:
   FHiddenLabel: String; // you can change the name as you prefere....

then find...
published
    { Published declarations }
    Property Text: String read FText write FText;
    Property URL: String read FURL write FURL;
    Property IconBitmap: TBitmap read FIcon write SetIcon stored True;
   [...]
   add in this section:
   HiddenLabel: String read FHiddenLabel write FHiddenLabel;


well, now save and re-compile the dpk.

HiddenLabel will appear in object inspector
0
 
LVL 23

Expert Comment

by:Ferruccio Accalai
ID: 10834304
In fact you don't need really text label, but simply a string variable to store some string values....

for example:

msnpopup1.HiddenLabel := 'This is my hidden text label';
msnpopup1.ShowPopUp;


then in some time

ShowMessage(msnpopup1.HiddenLabel);

Hope it helps
0
 
LVL 7

Assisted Solution

by:sftweng
sftweng earned 100 total points
ID: 10834353
blue220: "and ofcourse ways to add text and retrieve the text back from it later on"

Do you mean that you want to be able to display and change the text at runtime rather than compile time? If so, then perhaps Ferruccio68's HiddenLabel string should be a TEdit.
0
 
LVL 1

Assisted Solution

by:tanghz
tanghz earned 100 total points
ID: 10834422
Sorry, I am new to this forum, just try to help others, no other plans.

save your email safely in case it is exposed by my words.

Ferruccio68: you just gave a very interesting answer. What is the differernce with mine?
blue220 needed a hidden label rather than any other form of string properties.
0
 

Author Comment

by:blue220
ID: 10834467
(Ferruccio68) you got it right... I just wanted an extra label that was hidden at runtime. Ofcourse your string variable suggestion would have worked just as well but this works and i'm happy with it so thx for the help... (told you it was easy for you gurus)


(sftweng) It works exactly the way i need it to... the part about adding and retrieving text later on was because I thought you had to use functions to get the text at runtime but obviously I was mistaken about that part and it works just like I need it to :)
0
 
LVL 23

Expert Comment

by:Ferruccio Accalai
ID: 10834507
--> Ferruccio68: you just gave a very interesting answer. What is the differernce with mine?
The very most important difference here in ex-ex: i never seen your code in this thread, but only your code sharing intent by email. I posted the code!
0
 
LVL 1

Expert Comment

by:tanghz
ID: 10834558
totally faint,
I already made that answer, but ...

That is a string propery added to the component!!!
No Tlabel created or added. it means there is nothing to do labels excep some named as 'FHiddenLabel. I named as 'customstr'.

0
 
LVL 23

Expert Comment

by:Ferruccio Accalai
ID: 10834561
blue220: I'm glad and happy to have helped you.

what about accepting the answer now? ;-)

F68 ;-)
0
 
LVL 7

Expert Comment

by:sftweng
ID: 10834570
tanghz, I meant no offense in pointing out the Ex-Ex policy and I suspected that you were not familiar with it.

Ferrucio68's answer is different from yours in at least one major respect - he posted his code here and you did not. Frequently this will lead to collaboration by many people answering in such a way that the best answer is provided to the questioner, through a process of clarification and refinement; that is one of the reasons why private resolution of a problem may not be as effective as an open discussion.
0
 

Author Comment

by:blue220
ID: 10834584
I upped the points to 300 and spilt the question ... the original 250 to Ferruccio68 for his answer and 25 each to sftweng and tanghz for thier support as well... Thx guys.
0
 
LVL 1

Expert Comment

by:tanghz
ID: 10834591
I agree
0
 
LVL 1

Expert Comment

by:tanghz
ID: 10834623
I mean agree to the policy of the forum
and thanks for blue220's points. however, you really need to get clear what is going on here. This is helpful to your future coding in Delphi.
good lucks,
0
 

Author Comment

by:blue220
ID: 10834632
btw sorry this time around tanghz but by the way I ask for help on here you are sure to get one of them :)
0
 

Author Comment

by:blue220
ID: 10834665
what I asked for was a label and thought that is what F68 provided to me ... just like your new here I am new to delphi so don't really know the diff between alot things ... it's all a learning process and I have a longgggggggg way to go :)

cherrs,
blue220
0
 
LVL 23

Expert Comment

by:Ferruccio Accalai
ID: 10834775
Just to close and clearify this thread:
Sometimes i do some search in Ex-Ex for my needs, and when i find a question answered by email sharing i stay so bad as i was sure to have found my solution but not, just a soap ball....
That's just to say that this is not a game contest (here in Italy we said 'points or not points this evening i'll eat the same') but simply a great place where to increase knowledges, save many time and learn and learn again...
So the best respect to you tanghz, i hope i'll read about you again here in Ex-Ex as i surely have to learn from you also....


0
 
LVL 1

Expert Comment

by:tanghz
ID: 10835108
Hi, you are so gentle and humble, we will learn from each other.
I think I can do the following now:


Application.terminate :)



Good luck to you all.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question