Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Get the Parent on Tab control.

434 views
Skip to first unread message

Ken

unread,
Mar 22, 1999, 3:00:00 AM3/22/99
to
I have a tabpage on a tab control, in a click event of a command button, on
the tabpage, I want to fire off
an event on the window that the tabcontrol is on.

How can reference the window generically i.e

What I want to do....

{Event Clicked for CB_1}
...
...

lpw_parentwindow = Tabcontrol.GetParent()

lpw_parentwindow.Trigger Event ue_process()

This don't work!!

Thanks
Ken


Philip Salgannik

unread,
Mar 22, 1999, 3:00:00 AM3/22/99
to
Check the free stuff that comes with Powerbuilder - PFC:
See how they implement of_GetParentWindow(...) on most of their controls...

Ken wrote in message ...

Stephanie Giovannini

unread,
Mar 22, 1999, 3:00:00 AM3/22/99
to
lpw_parentwindow.Trigger Dynamic Event ue_process()

You don't mention the data type of lpw_parentwindow, but I assume it is type
Window. The window datatype does not have the event ue_process. So, the
compiler can't let you call an event that does not exist in type Window.
However, you know that at runtime the lpw_parentwindow variable will contain
a reference to a descendant of Window that does have the ue_process event.
The dynamic keyword tells the compiler not to check the event or function
call. At run-time, PB finds the event in the actual object referenced by
lpw_parentwindow. If the event does not exist, PB ignores the event call and
moves on in the code. If you call a function in this way and the function
does not exist, PB will raise a run-time error.

Another approach to your problem:

w_desc lpw_parentwindow // substitute the window class that contains the
ue_process event

lpw_parentwindow = Tabcontrol.GetParent()

lpw_parentwindow.Trigger Event ue_process()

You can take this approach if you are absolutely certain that the parent of
Tabcontrol will always be of class w_desc or a descendant of w_desc. If it
isn't, then the GetParent assignment will cause a type mismatch runtime
error.


Ken

unread,
Mar 29, 1999, 3:00:00 AM3/29/99
to
Thanks for all that!
It is of window type so what you sa will work for me, thanks!

Regards
Ken


Stephanie Giovannini wrote in message ...

0 new messages