SkOSMenu changes to use the new SkEvents, cleaned up the helper functions
Looks pretty great so far. http://codereview.appspot.com/4809075/diff/1/include/views/SkOSMenu.h File include/views/SkOSMenu.h (right): http://codereview.appspot.com/4809075/diff/1/include/views/SkOSMenu.h#newcode91 include/views/SkOSMenu.h:91: const Item* getItem(int index) const { return fItems[index]; } Lets use /** * This format for documenting methods. */ http://codereview.appspot.com/4809075/diff/1/src/views/SkOSMenu.cpp File src/views/SkOSMenu.cpp (right): http://codereview.appspot.com/4809075/diff/1/src/views/SkOSMenu.cpp#newcode38 src/views/SkOSMenu.cpp:38: Item* item = fItems[i]; nit: a little safer looking comparison is if (item->getKeyEquivalent() == key) { so we can't accidentally use '=' instead of '==' http://codereview.appspot.com/4809075/diff/1/src/views/SkOSMenu.cpp#newcode59 src/views/SkOSMenu.cpp:59: break; Is it sensible to post events for slider/text on a key-equivalent? Maybe, but if so lets document that behavior. http://codereview.appspot.com/4809075/diff/1/src/views/SkOSMenu.cpp#newcode62 src/views/SkOSMenu.cpp:62: case kAction_Type: What is default handling? http://codereview.appspot.com/4809075/diff/1/src/views/SkOSMenu.cpp#newcode195 src/views/SkOSMenu.cpp:195: Do we document this syntax in the header?
http://codereview.appspot.com/4809075/diff/1/include/views/SkOSMenu.h File include/views/SkOSMenu.h (right): http://codereview.appspot.com/4809075/diff/1/include/views/SkOSMenu.h#newcode91 include/views/SkOSMenu.h:91: const Item* getItem(int index) const { return fItems[index]; } On 2011/08/05 15:00:33, reed1 wrote: > Lets use > > /** > * This format for documenting methods. > */ Done. http://codereview.appspot.com/4809075/diff/1/src/views/SkOSMenu.cpp File src/views/SkOSMenu.cpp (right): http://codereview.appspot.com/4809075/diff/1/src/views/SkOSMenu.cpp#newcode38 src/views/SkOSMenu.cpp:38: Item* item = fItems[i]; On 2011/08/05 15:00:33, reed1 wrote: > nit: a little safer looking comparison is > > if (item->getKeyEquivalent() == key) { > > so we can't accidentally use '=' instead of '==' Done. http://codereview.appspot.com/4809075/diff/1/src/views/SkOSMenu.cpp#newcode59 src/views/SkOSMenu.cpp:59: break; On 2011/08/05 15:00:33, reed1 wrote: > Is it sensible to post events for slider/text on a key-equivalent? Maybe, but if > so lets document that behavior. Done. http://codereview.appspot.com/4809075/diff/1/src/views/SkOSMenu.cpp#newcode195 src/views/SkOSMenu.cpp:195: On 2011/08/05 15:00:33, reed1 wrote: > Do we document this syntax in the header? Done.