1. Miguel Leeuwe
  2. PowerBuilder
  3. Thursday, 11 June 2020 16:24 PM UTC

Hi all,

I'm trying to prevent a user from changing the position of a menu toolbar. What I'd really like is to get rid of the handle that allows you to change it in the first place, but that seems to be difficult.

So I thought, let me restore the menu to it's original position after they move it:

pbm_tbnmoved should do the trick I thought?

But, I've added the event to my main menu and added a messagebox to it: never executes as it seems.

Anyone any info about this? When does the pbm_tbnmoved event fire?

TIA,

Miguel

 

 

Accepted Answer
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 11 June 2020 19:11 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi Miguel;

   It's easier than that ... just disable toolbar control in your Application Object.

For example:

  • Application   lo_app
    lo_app    =    GetApplication ( )
    lo_app.toolbarusercontrol = FALSE

HTH

Regards ... Chris

Comment
  1. Miguel Leeuwe
  2. Friday, 12 June 2020 08:29 AM UTC
Hi Chris,

That's a great solution for what we want to do!

Thank you very much,

regards
  1. Helpful
  1. Chris Pollach @Appeon
  2. Friday, 12 June 2020 14:46 PM UTC
Hi Miguel ... Yes, I had to post that as soon as I saw the thread as you guys were taking the "long & hard route" to solving this simple question. I thought it kind to give you the easy way. ;-)
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Thursday, 11 June 2020 18:59 PM UTC
  2. PowerBuilder
  3. # 1

Hi, Miguel -

I think the pbm_tbnmoved might fire when the position of a Toolbar ButtoN is changed. There are several TBN_xxxxx notifications defined in the Windows API and they seem to all relate to toolbar buttons. Interestingly, there does not appear to be a TBN_MOVED notification message, so that is probably an event created and managed by PB.

Regards, John

Comment
  1. John Fauss
  2. Thursday, 11 June 2020 19:05 PM UTC
My above response is not correct.

Look at the PB Help topic named "ToolbarMoved (PowerScript event).
  1. Helpful
  1. John Fauss
  2. Thursday, 11 June 2020 19:11 PM UTC
PB issues the pbm_tbnmoved event to the MDI frame window.



Also look at the GetToolbar and GetToolbarPos PowerScript functions.
  1. Helpful
  1. Miguel Leeuwe
  2. Friday, 12 June 2020 08:23 AM UTC
Hi John, thanks for your information on this. It makes the event pretty useless:

- not triggered for sheet windows

- only triggered when you use SetToolbarPos(), so you already know it's being moved, since you're the one doing it and not the user.

It would be nice if triggered when a user drags a toolbar around with the mouse, but it doesn't.



Thanks!

  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.