|
About Andrew Choi
MIDI Programs
MIDI File Player (External Device)
MIDI Destination Pop-Up Button
Other Programs Cocoa Sample Programs Syntax Coloring Using Flex Algorithms Jazz Chord Analysis as Optimization
|
A blog where I will write mostly about programming in Cocoa and CoreMIDI, and experiences from my ports of Emacs and XEmacs to the Mac OS.
I wrote some code to handle selection of one of more bars in the chord editor. To select a bar, click anywhere on its notation (the slashes). Clicking on one of the chord names will of course select the chord for editing.
The Cocoa undo manager turns out not to be too difficult to learn. I skimmed its documentation, then the articles whose links I posted yesterday, and then I carefully read its documentation from beginning to end. The problem with articles on the Web is sometimes their authors can be too fixated on their solutions of specialized problems. The quality and generality of these solutions can also be questionable sometimes. [textView shouldChangeTextInRange:... replacementString:...]; [[textView textStorage] replaceCharactersInRange:... withString:...]; [textView didChangeText];for undo and redo to work correctly. Heres a new version of FCBlogEditor that includes this and other small changes I have made since it was last posted. There is also a well-known problem with using NSTextField with the undo manager (see this article, for example). Basically it doesnt work as expected if one simply calls setAllowUndo:YES for its field editor. Ive written some sample code that implements undo/redo for text fields. It assumes that the unit of undo/redo is the combined changes made to a text field between the times it becomes and resigns as first responder.
I implemented an eb7 Cmd-→ dm6 Cmd-→ eb7 Cmd-→ dm6 Cmd-→ eb7 Cmd-→ dm6 Cmd-→ em7b5 Opt-→ a7b5 F5 ↓ Opt-→ dm6 Cmd-→
fmaj7 and dmmaj7 and the formatter will automatically capitalize them correctly for you.My next step is to implement cut, copy, and paste using the mouse. Ill be using a bar as the smallest unit on which the program will operate. This is similar to Finales mass mover and mass edit tools. First I have to learn about the NSUndoManager. Ive found an article on MacEdition and another article on this topic. Ill read them and report back soon.
I wrote some code to allow the user to navigate within a chord chart in the chord editor using the arrow keys. The left and right arrow keys move to the previous and next beats, respectively. So do the tab and shift-tab keys (to be consistent with Cocoas selection of text fields). Option left and right arrow keys move to the next half note. Command left and right arrow keys move to the beginning of the previous and next bar, respectively.
|
Lists
Less-Known Facts About Emacs
Chinese Restaurants in Calgary
Calgary/Banff Tourist Attractions
Top-10 Reason I Stopped Working on Emacs
Misc
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright © 2003, 2004, 2005 Andrew Choi (Contact Information). | Created with FCBlog |