KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

Additions needed for hiding menu items
Goto page 1, 2  Next
 
Post new topic   Reply to topic    KiXforms Forum Index -> Discussion
View previous topic :: View next topic  
Author Message
krabourn
KiXforms Aficionado
KiXforms Aficionado


Joined: 05 Mar 2003
Posts: 273
Location: San Antonio. TX

PostPosted: Thu May 27, 2004 2:29 am    Post subject: Additions needed for hiding menu items Reply with quote

Would it be possible to add .OnPopup() and .Visible to the MenuItem Object? I believe this is what I need to selectively show menu items depending on what is the active object.

Thanks

_________________
Kelly
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Lonkero
KiXforms Devotee
KiXforms Devotee


Joined: 13 Mar 2003
Posts: 1022
Location: Espoo, Finland

PostPosted: Thu May 27, 2004 7:06 am    Post subject: Reply with quote

hmm...
why not take it step back.
everytime control gets focus, change the menu to correspond it.

this way, it will be there when needed.

_________________
Hammer
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
krabourn
KiXforms Aficionado
KiXforms Aficionado


Joined: 05 Mar 2003
Posts: 273
Location: San Antonio. TX

PostPosted: Thu May 27, 2004 11:35 am    Post subject: Reply with quote

Well, even if I did I still need the .Visisble property. But, the .OnPopup() was made to do something in a menu before it is shown.
_________________
Kelly
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Lonkero
KiXforms Devotee
KiXforms Devotee


Joined: 13 Mar 2003
Posts: 1022
Location: Espoo, Finland

PostPosted: Thu May 27, 2004 12:19 pm    Post subject: Reply with quote

but, why would you still need the visible?
_________________
Hammer
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Thu May 27, 2004 12:32 pm    Post subject: Reply with quote

I looked at the popup event quite a while ago ... its going to be tricky to implement because its similar to the OnBeforeExpand event in TreeView, by the time you get the event, the menu is already popped-up ... Kixforms and Kixtart aren't tightly integrated enough for real "OnBeforeXXX" events to work properly ... .so to do this, would probably need to do what we're doing for TreeView, and that is on the popup event, have Kixforms supress the popup, then the Event must complete the popup request.
Back to top
View user's profile Send private message
krabourn
KiXforms Aficionado
KiXforms Aficionado


Joined: 05 Mar 2003
Posts: 273
Location: San Antonio. TX

PostPosted: Thu May 27, 2004 1:34 pm    Post subject: Reply with quote

Lonkero

Unless you want me to write a whole new menu tree, how else do you hide an object?

Shawn

Do you have any suggestions on how do to this now?

_________________
Kelly
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Thu May 27, 2004 2:51 pm    Post subject: Reply with quote

Are you doing Menu menus or ContextMenu menus ?
Back to top
View user's profile Send private message
krabourn
KiXforms Aficionado
KiXforms Aficionado


Joined: 05 Mar 2003
Posts: 273
Location: San Antonio. TX

PostPosted: Thu May 27, 2004 3:31 pm    Post subject: Reply with quote

At the moment menu menus, but ContextMenu menus will be coming at some point.

In my little pet project, I don't want the Edit -- Modify menu item to show if the TreeView has focus. I only want it shown when the ListView has focus.

_________________
Kelly
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Lonkero
KiXforms Devotee
KiXforms Devotee


Joined: 13 Mar 2003
Posts: 1022
Location: Espoo, Finland

PostPosted: Thu May 27, 2004 3:36 pm    Post subject: Reply with quote

hmm...
dunno how hard it's to copy a menu...

$myothermenu = $myfirstmenu

_________________
Hammer
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Bonji
KiXforms Aficionado
KiXforms Aficionado


Joined: 10 Mar 2003
Posts: 393
Location: Virginia

PostPosted: Thu May 27, 2004 3:36 pm    Post subject: Reply with quote

Could you just set ENABLED on the menu item to 0 when you don't want it to work? Then when the TreeView gets focus it could set ENABLED back to 1.

Just a thought.

[EDIT] Well, after looking at the documentation, I don't see the necessay events for the TreeView to make this work. TreeView will need to support the OnGotFocus and OnLostFocus events. Oh well.

[EDIT][EDIT] Maybe this wouldn't work at all anyway, cause wouldn't the TreeView always lose focus when you clicked the Menu item? I think so, which means my post adds a lot of nothing to the pot.

_________________
-Ben
Back to top
View user's profile Send private message
Lonkero
KiXforms Devotee
KiXforms Devotee


Joined: 13 Mar 2003
Posts: 1022
Location: Espoo, Finland

PostPosted: Thu May 27, 2004 3:45 pm    Post subject: Reply with quote

now now, your post was fine.
(I was thinking the same but for some reason decided not to talk about it)

doesn't matter if it lost focus.
the control can be done via gotfocus.

_________________
Hammer
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
krabourn
KiXforms Aficionado
KiXforms Aficionado


Joined: 05 Mar 2003
Posts: 273
Location: San Antonio. TX

PostPosted: Thu May 27, 2004 4:31 pm    Post subject: Reply with quote

Bad wording. How about .ActiveControl instead of focus. I know that works since I use it.
_________________
Kelly
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Thu May 27, 2004 4:46 pm    Post subject: Reply with quote

I would go with Ben's suggestion to just selective enable/disable the menuitem based on "some condition" ...
Back to top
View user's profile Send private message
krabourn
KiXforms Aficionado
KiXforms Aficionado


Joined: 05 Mar 2003
Posts: 273
Location: San Antonio. TX

PostPosted: Thu May 27, 2004 5:32 pm    Post subject: Reply with quote

That would be fine if that was available. Has anyone tried $MenuItem.Enabled = 0? That does not work for me. In fact kix beeps and gives me "ERROR : unexpected command!".
_________________
Kelly
Back to top
View user's profile Send private message Send e-mail MSN Messenger
krabourn
KiXforms Aficionado
KiXforms Aficionado


Joined: 05 Mar 2003
Posts: 273
Location: San Antonio. TX

PostPosted: Thu May 27, 2004 5:39 pm    Post subject: Reply with quote

Sorry. I forget I had to go back a version for testing programs for work. Enabled does work. I really would like to be able to hide a menuitem though.

How come the main menu items at the top don't respond to the .OnClick()?

_________________
Kelly
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> Discussion All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group