FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Problem with MENU's
Posts: 246
Joined: Sat Mar 03, 2007 08:42 PM
Problem with MENU's
Posted: Mon Sep 08, 2008 12:03 PM
Hello,

In METHOD Command() in CLASS TMenu there is a function ::GetMenuItem( nCommand ) to retreive oMenuItem.

Now, somethimes, when a user works for a while with my application, the menu's don't fire anything anymore. The menu's SHOW, I can see them, but the ACTION is not executed anymore.

I have found out this is because after some time, ::GetMenuItem( nCommand ) starts returning NIL. And when omenuItem = NIL, nothing is executed.

Any ideas on how to fix this?
Thanks!

Patrick
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Problem with MENU's
Posted: Mon Sep 08, 2008 03:13 PM
Patrick,

I have noticed a similar problem.

In my application, the user is able to change his own menu.

After the menu has been changed by the user, this code is executed :
oWnd:SetMenu(oMenu)

If this is executed several times (somewhat between 15 and 20 times), the menus don't react anymore. Indeed the menu can be opened but the action is not executed.

The application has to be restarted and then everything is normal again.

Maybe it has something to do with SetMenu() ?

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Problem with MENU's
Posted: Mon Sep 08, 2008 03:31 PM

Patrick,

Please modify Method GetMenuItem() this way, so we can check what nItemId value fails:

METHOD GetMenuItem( nItemId ) BLOCK { | o | o := SearchItem( ::aItems, nItemId ), If( o == nil, MsgAlert( "MENUITEM " + Str( nItemId ) + " fails" ), ), o }

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 246
Joined: Sat Mar 03, 2007 08:42 PM
Problem with MENU's
Posted: Mon Sep 08, 2008 03:52 PM
Antonio Linares wrote:Please modify Method GetMenuItem() this way, so we can check what nItemId value fails:

METHOD GetMenuItem( nItemId ) BLOCK { | o | o := SearchItem( ::aItems, nItemId ), If( o == nil, MsgAlert( "MENUITEM " + Str( nItemId ) + " fails" ), ), o }

Ok, done.

What do we know when we know what nItenID fails?

Patrick
Posts: 246
Joined: Sat Mar 03, 2007 08:42 PM
Problem with MENU's
Posted: Mon Sep 08, 2008 03:55 PM
Antonio Linares wrote:Please modify Method GetMenuItem() this way, so we can check what nItemId value fails:

METHOD GetMenuItem( nItemId ) BLOCK { | o | o := SearchItem( ::aItems, nItemId ), If( o == nil, MsgAlert( "MENUITEM " + Str( nItemId ) + " fails" ), ), o }

Hmm, we can't do it that way. Now cklicking on a menu always shows the MsgAlert().

Patrick
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Problem with MENU's
Posted: Mon Sep 08, 2008 06:21 PM

Patrick,

> What do we know when we know what nItenID fails ?

We need some info about that situation, as a start we will know what nItemId value is searched for.

> Now cklicking on a menu always shows the MsgAlert()

The MsgAlert() should be shown only if the menuitem is nil (not found).

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion