PagePanel and dynamic menu problem - Windows 7

Hello,

I have several dynamic menus on a page panel in a window.

When that window is instantiated I do not get the menus displayed unless I first click somewhere on the PagePanel.

How can I fix that?

The same code works perfectly in Mac.

The code in the Dynamic menus is like this one…

// Make the base item, this is what will be doing the popping up
dim base as new MenuItem

// Add some items
base.Append(new MenuItem(“unassessed”))

'// Add a Separator
base.Append( new MenuItem( MenuItem.TextSeparator))

'Add some more hard-coded items
base.Append(new MenuItem(“regular”))
base.Append(new MenuItem(“irregular”))

// Now display the menu
dim hitItem as MenuItem
If App.InTheDynamicMenuTF(X,Y, me) = True then // method to indicate that Mouse-Down is within the boundaries of the TextField
hitItem = base.PopUp
if hitItem <> nil then
me.Text = hitItem.Text
me.BackColor = Module2.setcolor(me, me.text)

  TextHasChanged = true
  Self.Refresh(False)
  
else
  'msgbox "No item has been selected"
  Return True
end if

else
Return True

end if

Lennox.

Not sure what you mean by “dynamic menu”. A control? Your code looks like a typical contextual type menu, but you seem to be expecting some visible indicator on the page panel. Can you explain a little more?

OK Tim, thanks for your reply,

This is a better description of the problem…

I have a window with a pagePanel.

On that PagePanel there are several TextFields with the code mentioned in my last post - I am using the TextFields somewhat like BevelButtons.

When that window is instantiated if the user clicks on one of those Textfields the menu is not displayed.
If the user clicks again and again the menu is still not displayed… continue clicking makes no difference.

However, if the user clicks somewhere else on the PagePanel where there is not one of those textFields and then clicks on one of those text fields the menu is displayed - looks like clicking outside of a textField activates them (all of them are now “activated”, the user does not have to click directly on the PagePanel again).

That only happens on Windows, there is no problem on Mac.

Any suggestions/workarounds? I do not want to use BevelButtons.

Thanks.

Lennox

OK Tim,

You can put it on hold for now.

I made the window with only one textfield and it works so there must be something else in that window that is causing it to behave like that.

I will try to find out what exactly is the problem.

Thanks.

Lennox

Hi Tim and anyone else who might be interested,

I was instantiating that window with ShowModal, when I use Show everything is OK, of course I hid the calling window first.

Lennox