CONTEXT MENU

Creative ideas/suggestions for HMG

Moderator: Rathinagiri

User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

CONTEXT MENU

Post by Pablo César »

Wow ! CONTEXT MENU with <cControlName> and [ OF | PARENT <cParentName> ], really ?

You are so good, Dr. Soto !

Thank very very much !
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

CONTEXT MENU

Post by Pablo César »

srvet_claudio wrote:Hi guys,
I implemented:

Code: Select all

      - DEFINE CONTROL CONTEXT MENU <cControlName> [ OF | PARENT <cParentName> ]
      - DEFINE CONTROL CONTEXTMENU  <cControlName> [ OF | PARENT <cParentName> ]
 
      - RELEASE CONTROL CONTEXT MENU <cControlName>   OF | PARENT <cParentName>
      - RELEASE CONTROL CONTEXTMENU <cControlName>    OF | PARENT<cParentName>

      - ReleaseControlContextMenu ( cControl, cParentForm )
      - IsControlContextMenuDefined ( cControl, cParentForm ) --> Return lBoolean
   
      - SET CONTROL CONTEXTMENU  [ ON | OFF ]
      - SET CONTROL CONTEXT MENU [ ON | OFF ]
Best Regards,
Claudio.
Hi Claudio, is it posible to make exceptions at same control in ContextMenu ? I.E. I means is it posible to have different ITEMS of contectmenu for each column of one GRID ? Also is posible to work according to the contents of a cell GRID ?
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: CONTEXT MENU

Post by srvet_claudio »

Pablo César wrote:
srvet_claudio wrote:Hi guys,
I implemented:

Code: Select all

      - DEFINE CONTROL CONTEXT MENU <cControlName> [ OF | PARENT <cParentName> ]
      - DEFINE CONTROL CONTEXTMENU  <cControlName> [ OF | PARENT <cParentName> ]
 
      - RELEASE CONTROL CONTEXT MENU <cControlName>   OF | PARENT <cParentName>
      - RELEASE CONTROL CONTEXTMENU <cControlName>    OF | PARENT<cParentName>

      - ReleaseControlContextMenu ( cControl, cParentForm )
      - IsControlContextMenuDefined ( cControl, cParentForm ) --> Return lBoolean
   
      - SET CONTROL CONTEXTMENU  [ ON | OFF ]
      - SET CONTROL CONTEXT MENU [ ON | OFF ]
Best Regards,
Claudio.
Hi Claudio, is it posible to make exceptions at same control in ContextMenu ? I.E. I means is it posible to have different ITEMS of contectmenu for each column of one GRID ? Also is posible to work according to the contents of a cell GRID ?
Hi Pablo,
with the code of DEFINE CONTROL CONTEXT MENU I think is not posible.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

CONTEXT MENU

Post by Pablo César »

srvet_claudio wrote:with the code of DEFINE CONTROL CONTEXT MENU I think is not posible.
Thank you Claudio to answer.

It's frustrating the domain ContextMenu...

I guess I'll have to do something like I did View_Build_Log with a ComboBox... is not very ethical but should solve... :cry:
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: CONTEXT MENU

Post by mol »

Hi!
I want to refresh this topic.
Essentially, everything works OK, but, one thing looks poor - when you press context menu button on the keyboard, menu appears in bottom right corner always:
Image

It would be great to position context menu aligned to its parent control.

And second problem - when you call context menu, it should close with ESCAPE key.
But, when I set sction of ESCAPE key to close window, ESCAPE closes whole window, not context menu only.
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

CONTEXT MENU

Post by Pablo César »

Hi Marek !
mol wrote:when you press context menu button on the keyboard, menu appears in bottom right corner always
IMHO this is normal behaviour, because ContextMenu is actioned not by pointer of mouse then "ContextMenu" key is pressed has not any referance about coordinates where the mouse's pointer is. So, always will start on bottom of screen.
It would be great to position context menu aligned to its parent control.
Yes, I think would be very good to set coordinates positions to open ContextMenu by previous parameters.
And second problem - when you call context menu, it should close with ESCAPE key. But, when I set sction of ESCAPE key to close window, ESCAPE closes whole window, not context menu only.
This is also normal behaviour when in your code is ESCAPE already defined, like as:

ON KEY ESCAPE ACTION ThisWindow.Release()

Then all the times will works when escape is actioned... but if you remove this definition for that form, then it going to work normally.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: CONTEXT MENU

Post by mol »

Pablo César wrote:Hi Marek !
mol wrote:when you press context menu button on the keyboard, menu appears in bottom right corner always
IMHO this is normal behaviour, because ContextMenu is actioned not by pointer of mouse then "ContextMenu" key is pressed has not any referance about coordinates where the mouse's pointer is. So, always will start on bottom of screen.
I don't agree with you - simply press Context Menu key on keyboard in your browser...
When I do it, my context menu appears at text cursor position, not in the right bottom corner.

It would be great to position context menu aligned to its parent control.
Yes, I think would be very good to set coordinates positions to open ContextMenu by previous parameters.
And second problem - when you call context menu, it should close with ESCAPE key. But, when I set sction of ESCAPE key to close window, ESCAPE closes whole window, not context menu only.
This is also normal behaviour when in your code is ESCAPE already defined, like as:

ON KEY ESCAPE ACTION ThisWindow.Release()

Then all the times will works when escape is actioned... but if you remove this definition for that form, then it going to work normally.
So, It should be any possibility to detect if my focus is in Context Menu, not in any other form.
So, then I could write something like this:

Code: Select all

ON KEY ESCAPE ACTION {|| if(IsContextMenuActive, ReleaseContextMenu(), ThisWindow.Release}
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

CONTEXT MENU

Post by Pablo César »

mol wrote:simply press Context Menu key on keyboard in your browser...
When I do it, my context menu appears at text cursor position, not in the right bottom corner
Yes, you are right, my friend. Seems at internet browser and other softwares it is working properly when press ContextMenu key.
So, It should be any possibility to detect if my focus is in Context Menu, not in any other form.
So, then I could write something like this:

Code: Select all

ON KEY ESCAPE ACTION {|| if(IsContextMenuActive, ReleaseContextMenu(), ThisWindow.Release}
Yes understand now. Would it be good idea !

Now we have to wait for Claudio pronounce...
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

CONTEXT MENU

Post by Pablo César »

mol wrote:...It should be any possibility to detect if my focus is in Context Menu, not in any other form.
I think it could be handled as in this example:

Image
viewtopic.php?p=40268#p40268

This gives an idea how to make personalized ContextMenus.

I hope be helpful ! :)
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
serge_girard
Posts: 3161
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: CONTEXT MENU

Post by serge_girard »

Pablo,

This works great except for one thing: how to determine which ROW is being clicked?

Serge
There's nothing you can do that can't be done...
Post Reply