Calling base.MdiChildActivate from my event

Posted by Darren Parr on 19-Nov-2012 12:17

Hi

I can't find any reference to this so I'm going to assume its not possible but I thought it best to ask. I need to call the base class event from within my event handler. I'm not sure if its possible.

I really need an AfterMdiChildActivate but there isn't one.

My C# example does something like this from within the event handler.

base.MdiChildActivate(e);

Any ideas?

Thanks

Darren

All Replies

Posted by Admin on 19-Nov-2012 12:23

Looks like you didn't care too much about the "On". Override the OnMdiChildActivate method in the Form and do something before or after the

SUPER:OnMdiChildActivate ( e ) .

Same as in C#, when you replace "base" with SUPER and the period with a colon.

http://msdn.microsoft.com/en-us/library/system.windows.forms.form.onmdichildactivate.aspx

Posted by Peter Judge on 19-Nov-2012 12:23

The directly equivalent code/syntax is

SUPER:MdiChildActivate(e).

That may work.

-- peter

Posted by Darren Parr on 20-Nov-2012 05:08

Hi

Thanks. You were correct. However it crashes progress.

I changed my call to SUPER:OnMdiChildActivate(e). and it dies.

I can confirm that as soon as this is called Progress crashes.

Basically I'm trying to automatically select a recently created contextual tab in a child window. The code I've looked at seems to make sense and is confirmed to work.

I did find it quite bizarre that all of the events on progress.windows.form dont specify the real event but instead specify the event without the "on" when subscribing. I guess this is by design.

IN the toolbar etc. this is not the case.

This is what threw me as I'me quite new to all this.

Any ideas on where to try next?

Here is my code.

METHOD PRIVATE VOID DotNetParent_MdiChildActivate( INPUT sender AS System.Object, INPUT e AS System.EventArgs ):

DEFINE VARIABLE oChild AS UltraToolbarsManager NO-UNDO.

DEFINE VARIABLE oTab   AS RibbonTab            NO-UNDO.

DEFINE VARIABLE iCount AS INTEGER              NO-UNDO.

SUPER:OnMdiChildActivate(e).

/* oChild = THIS-OBJECT:oToolbar:ActiveMdiChildManager.                                              */

/*                                                                                                    */

/*        IF VALID-OBJECT(oChild) THEN                                                                */

/*        DO iCount = 0 TO oChild:Ribbon:Tabs:Count:                                                  */

/*           IF VALID-OBJECT(oChild:Ribbon:Tabs[iCount]:AttachedParentTab) THEN                       */

/*           DO:                                                                                      */

/*             THIS-OBJECT:oToolbar:Ribbon:SelectedTab = oChild:Ribbon:Tabs[iCount]:AttachedParentTab.*/

/*             LEAVE.                                                                                 */

/*           END.                                                                                     */

/*        END.                                                                                        */

       

RETURN.


END METHOD.

-Darren

Posted by Admin on 20-Nov-2012 06:18

Code looks o.k..

Typically, when overriding something on the .NET side you need to recompile a bunch and restart the session.

The AVM does not support re-emitting ABL inherited classes when they have changed.

What version of Progress are you on (incl. SP)?

Posted by Darren Parr on 20-Nov-2012 06:26

Hi

Re-compiled everything clean and the problem still exists. Looks like a bug. I wonder if I need a hotfix...

I'm on 11.1 (unpatched).

HTH

Darren

Posted by Darren Parr on 20-Nov-2012 06:29

Mike

Is there anywhere else I could do this. I need my code to happen after the toolbars have been merged etc. Originally I had been doing this in my mdi child which obviously was far too early.

-Darren

Posted by Admin on 20-Nov-2012 06:33

>I wonder if I need a hotfix...

I'm on 11.1 (unpatched).

 

If you ask me, you urgently need one. Look at

http://blog.consultingwerk.de/consultingwerkblog/2012/07/serious-issues-with-gui-for-net-type-management-in-openedge-11-1/

I'm on 11.1.0.005 and that's fine!!!

Posted by jmls on 20-Nov-2012 06:48

of course, you have to be someone special* to

a) be in the know of these hotfixes

b) have them available for download

  • we're obviously not ...

On 20 November 2012 12:33, Mike Fechner

Posted by Admin on 20-Nov-2012 06:53

of course, you have to be someone special* to

 

Like that one who logged the issues and pays attention to PANS?

But I agree, that Hotfixes should be available to everyone.

Posted by jmls on 20-Nov-2012 06:58

again, you have to be someone special** to get PANS

    • yes, I've subscribed to it. loads of times. Apparently Tom Bascom

gets my edition (he gets 5 or so ...)

On 20 November 2012 12:53, Mike Fechner

Posted by Peter Judge on 20-Nov-2012 08:07

darrenp wrote:

Hi

Thanks. You were correct. However it crashes progress.

I changed my call to SUPER:OnMdiChildActivate(e). and it dies.

I can confirm that as soon as this is called Progress crashes.

Darren,

You should always report crashes to Tech Support. They never fall into the "you're doing it wrong" category .

-- peter

Posted by jmls on 20-Nov-2012 08:15

oh. Right. Better be prepared for a flood then

Posted by Darren Parr on 20-Nov-2012 08:41

Hi

As always theres workarounds. I got it working in the end and I'm going to blame myself. In the early prototype days I had the mdiparent creating a new instance of the mdiform and then setting its mdiparent property directly before show(). I now realise that this was messing with the merging etc as it wasnt an mdichild until the very last second.

Ive since moved this into the contructor of my mdichild and I was able to catch the event nicely and set the selectedtab to the contextual tab I have created.

Works a treat. I do agree however that there looks to be some serious issues in 11.1. I guess I'll wait and see if they patch it for all.

-Darren

Posted by Peter Judge on 20-Nov-2012 08:52

Works a treat. I do agree however that there looks to be some serious

issues in 11.1. I guess I'll wait and see if they patch it for all.

I'm glad you worked around the problem.

We can only patch stuff that's been reported - and the more people, especially customers, that report an issue, the more likely it is to get quick attention.

-- peter

Posted by Admin on 20-Nov-2012 09:02

We can only patch stuff that's been reported - and the more people, especially customers, that report an issue, the more likely it is to get quick attention.

 

Hi Peter, that's not the point here. 11.1 is out since a while. Some VERY serious and general (not too difficult to run into) issue have been been fixed.

I logged those issue and requested the hotfix. Hence I have received access to them.

Others may have the same issues. But getting (available) hotfixes from tech support is a night mare - and a formal service pack is not yet there.

Some of my customers are affected with the same issues, I cave them the hot fit version number and the bug numbers, but it'S not that easy to get the hot fix delivered to your ESD account.

Posted by Peter Judge on 20-Nov-2012 09:07

I logged those issue and requested the hotfix. Hence I have received

access to them.

Others may have the same issues. But getting (available) hotfixes from

tech support is a night mare - and a formal service pack is not yet there.

I misunderstood Darren's point - which was whether everyone could get access to the patch/hotfix. I read his message as "hopefully someone else has already logged the issue I'm seeing", hence my reply.

Apologies for any confusion,

-- peter

Posted by Admin on 20-Nov-2012 09:16

I misunderstood Darren's point - which was whether everyone could get access to the patch/hotfix. I read his message as "hopefully someone else has already logged the issue I'm seeing", hence my reply.

 

Fact is, that in order to know the hotfix is there you need to either know someone who knows it or report an already fixed issue. Very time consuming for both sides.

This thread is closed