Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

by Unknown user

Read Part 3

First, some housecleaning. Mike Hanson pointed out that I needed a couple of additional lines of code (5 and 6) in my TakeAccepted handler:

...

But there's another problem with the original method - I'd neglected to return a value, yet the Register function docs specifically say you must return one of three values from the function:

Level:Benign

Calls any other handlers and the ACCEPT loop, if available.

Level:Notify

Doesn't call other handlers or the ACCEPT loop. This is like executing CYCLE when processing the event in an ACCEPT loop.

Level:Fatal

Doesn't call other handlers or the ACCEPT loop. This is like executing BREAK when processing the event in an ACCEPT loop.

I always want processing to continue normally, so I'm returning Level:Benign.

...

And finally I added something that may only be practically in practical in its current form for simple list boxes (and not ABC browses): the ability to press the space bar to toggle an entry and then advance to the next item. 

...

As I've said before, my usual approach with non-UI code is to start with a unit test, but in this case I think applying this class to an ABC browse will help to illustrate some of the potential issues I need to consider.

ABCTest.app

I've created a simple app with a single ABC browse (included in the source zip). 

...

in the last embed so the unchecked icons display be by default. 

With the modification the browse works as expected, with one proviso.

...

And that sets the stage for persisting data... 

Download the source

CheckboxUI2.zip