joe_pool_is Posted March 6, 2008 Posted March 6, 2008 Whenever an application is given a MenuBar and the "Standard Items" are included, there is an Edit section that includes "Redo," "Undo," "Cut," "Copy," "Paste," and "Select All." Generally, this would be applicable to text editing controls, but I've heard a little about people using them with objects. I generally do very basic coding (VB or C#), and I've never dealt with any of this. Related to this ability is the ability to accept "Drag-n-Drop," or it seems like it fits into the same voodoo category to me. Where could I find something simple on how to (redo, undo, cut, copy, paste, select all, dragNdrop) with objects? Are events typically set up that enable and disable these menu items? For example, if nothing is selected, the Cut and Copy menu items are disabled. If there is data on the clipboard, the Paste menu item is enabled. I understand for the case where someone selects something, the programmer writes code to count how much was selected, then enables an item, but this seems like Geiko Caveman code. The activation of these menu items should respond to events. Could anyone point me to something like that? Quote Avoid Sears Home Improvement
Machaira Posted March 6, 2008 Posted March 6, 2008 The problem is, the menu items don't know what events will trigger them being enabled or disabled. It depends on the application. You'll have to handle catching the events for enabling/disabling the items in whatever control you're using with that functionality. Quote Here's what I'm up to.
joe_pool_is Posted March 6, 2008 Author Posted March 6, 2008 The problem is, the menu items don't know what events will trigger them being enabled or disabled. It depends on the application. You'll have to handle catching the events for enabling/disabling the items in whatever control you're using with that functionality. Thanks for your response. All I'm looking for are "best practice" guidelines, website tutorials, etc. I've done very little event handling other than what comes with controls and this never seems to be covered in any of the books I look into. If anyone else has any input, suggestions, or ideas, please respond. Thanks! Quote Avoid Sears Home Improvement
Machaira Posted March 6, 2008 Posted March 6, 2008 You can't really have any "best practice" guidelines because there's not one set way to do those things. The Standard Items in the menubar and toolbar don't know anything about how data will be input. How you disable/enable those controls depends on how you're inputting data. It could be the keyboard, it could be an on-screen keyboard with a mouse or other controller, it could be voice recognition software, etc. Quote Here's what I'm up to.
mskeel Posted March 7, 2008 Posted March 7, 2008 For starters, check out the Command and Memento patterns from the GoF's Design Patterns. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.