Page 2 of 3

CONTEXT MENU

Posted: Thu May 30, 2013 12:03 am
by Pablo César
Wow ! CONTEXT MENU with <cControlName> and [ OF | PARENT <cParentName> ], really ?

You are so good, Dr. Soto !

Thank very very much !

CONTEXT MENU

Posted: Mon Sep 16, 2013 3:57 pm
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 ?

Re: CONTEXT MENU

Posted: Mon Sep 16, 2013 10:21 pm
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.

CONTEXT MENU

Posted: Tue Sep 17, 2013 1:12 am
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:

Re: CONTEXT MENU

Posted: Fri Dec 06, 2013 9:30 am
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.

CONTEXT MENU

Posted: Fri Dec 06, 2013 11:17 am
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.

Re: CONTEXT MENU

Posted: Fri Dec 06, 2013 12:06 pm
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}

CONTEXT MENU

Posted: Fri Dec 06, 2013 12:22 pm
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...

CONTEXT MENU

Posted: Sat Mar 07, 2015 4:17 pm
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 ! :)

Re: CONTEXT MENU

Posted: Sun Mar 08, 2015 8:44 am
by serge_girard
Pablo,

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

Serge