[open-beos-printing] Re: Further PDF Writer Progress

4/3/02 5:31:12 PM, "Simon Gauvin" <gauvins@xxxxxxxxx> wrote:

>
>> I have tried this already, but the problem is that the when the 
>> BTextView 
>> has the focus hitting the tabulator key does not change the focus 
>> but instead inserts a tabulator into the text of the BTextView.
>> 
>> BTextView::DisallowChar('\t') is also not helpful.
> 
>Michael,
>
>You need to override the KeyDown() method and check for the tab key and 
>do the call to MakeFocus() manually, here is a code bit that will get 
>you started:
>
>void DocInfoText::KeyDown(const char *bytes, int32 numBytes)
>{
>    // test for tab
>    if (bytes[0] =3D=3D '\t') {
>        // get parent and get next child
>        BView *child =3D NextSibling();
>        if (child) {
>            child->MakeFocus(true);
>        } else {
>            child =3D Parent()->ChildAt(0); 
>            if (child) child->MakeFocus(true);
>                  // *** Call the view here and send Tab Message or change 
>scroll location. **//
>        }
>    } else {
>        BTextView::KeyDown(bytes, numBytes);
>    }
>}
> 
>This is not totally safe since we should check the call to Parent(), 
>and you would also need to do the 'Shift-Tab' check to go the other way 
>too.

Thanks.

What if DocInfoText does not handle tab, shift tab, ctrl tab, ... itself
but calls KeyDown of the parent class BView instead?

Michael





Other related posts: