CONTEXT MENU
Moderator: Rathinagiri
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
CONTEXT MENU
Wow ! CONTEXT MENU with <cControlName> and [ OF | PARENT <cParentName> ], really ?
You are so good, Dr. Soto !
Thank very very much !
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
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
CONTEXT MENU
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 ?srvet_claudio wrote:Hi guys,
I implemented:
Best Regards,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 ]
Claudio.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- srvet_claudio
- Posts: 2193
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: CONTEXT MENU
Hi Pablo,Pablo César wrote: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 ?srvet_claudio wrote:Hi guys,
I implemented:
Best Regards,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 ]
Claudio.
with the code of DEFINE CONTROL CONTEXT MENU I think is not posible.
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
CONTEXT MENU
Thank you Claudio to answer.srvet_claudio wrote:with the code of DEFINE CONTROL CONTEXT MENU I think is not posible.
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...
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Re: CONTEXT MENU
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:
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.
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:
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.
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
CONTEXT MENU
Hi Marek !
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.
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.mol wrote:when you press context menu button on the keyboard, menu appears in bottom right corner always
Yes, I think would be very good to set coordinates positions to open ContextMenu by previous parameters.It would be great to position context menu aligned to its parent control.
This is also normal behaviour when in your code is ESCAPE already defined, like as: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.
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
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Re: CONTEXT MENU
I don't agree with you - simply press Context Menu key on keyboard in your browser...Pablo César wrote:Hi Marek !
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.mol wrote:when you press context menu button on the keyboard, menu appears in bottom right corner always
When I do it, my context menu appears at text cursor position, not in the right bottom corner.
Yes, I think would be very good to set coordinates positions to open ContextMenu by previous parameters.It would be great to position context menu aligned to its parent control.
So, It should be any possibility to detect if my focus is in Context Menu, not in any other form.This is also normal behaviour when in your code is ESCAPE already defined, like as: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.
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, then I could write something like this:
Code: Select all
ON KEY ESCAPE ACTION {|| if(IsContextMenuActive, ReleaseContextMenu(), ThisWindow.Release}
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
CONTEXT MENU
Yes, you are right, my friend. Seems at internet browser and other softwares it is working properly when press ContextMenu key.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 understand now. Would it be good idea !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}
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
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
CONTEXT MENU
I think it could be handled as in this example:mol wrote:...It should be any possibility to detect if my focus is in Context Menu, not in any other form.
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
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- 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
Pablo,
This works great except for one thing: how to determine which ROW is being clicked?
Serge
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...