-
June 4th, 2013, 03:47 PM
#1
[RESOLVED] Regarding member function
Hi,
I was reading a c++ code written in embarcadero ide to add vertical colour text in popup menu.
While reading the code, I had seen following instructions.
private:
Code:
void __fastcall ExpandMenuItemWidth(TObject *Sender, TCanvas *ACanvas,int &Width, int &Height);
Code:
void __fastcall DrawNewItem(TObject *Sender, TCanvas *ACanvas, const TRect &ARect, bool Selected);
The above two methods used in the code like below:
Code:
PopupMenu1->Items->Items[i]->OnMeasureItem = ExpandMenuItemWidth;
PopupMenu1->Items->Items[i]->OnDrawItem = DrawNewItem;
What is happening when we are using member function without parameters like above?
I found above code at: http://edn.embarcadero.com/article/26632
Thanks in advance,
-
June 4th, 2013, 04:09 PM
#2
Re: Regarding member function
A function name is a pointer. So all you're doing is assigning the pointer to the function to another variable. Later on, that variable will call the function that it was assigned.
Regards,
Paul McKenzie
-
June 5th, 2013, 04:34 AM
#3
Re: Regarding member function
Originally Posted by Paul McKenzie
A function name is a pointer. So all you're doing is assigning the pointer to the function to another variable. Later on, that variable will call the function that it was assigned.
Regards,
Paul McKenzie
Thanks for your answer.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|