Xojo Conferences
XDCMay2019MiamiUSA

Re: Control Focus (Real Studio Plugins Mailinglist archive)

Back to the thread list
Previous thread: new plugin format
Next thread: weird crash


Plugin Control Changes with Composite On   -   Seth Willits
  Re: Control Focus   -   Seth Willits
    Control Focus   -   Seth Willits
    Re: Control Focus   -   Jonathan Johnson
    Re: Control Focus   -   Seth Willits
    Re: Control Focus   -   Seth Willits
    Re: Control Focus   -   Jonathan Johnson
    Re: Control Focus   -   Seth Willits
    Re: Control Focus   -   Seth Willits

Re: Control Focus
Date: 03.06.04 19:48 (Thu, 3 Jun 2004 11:48:07 -0700)
From: Seth Willits
On May 20, 2004, at 11:28 PM, Seth Willits wrote:

>>>> No. I hadn't seen this. But even after I did, it didn't work.
>>>
>>> I'm not sure then -- I can tell you that my plugin's focus does work
>>> (tabbing, clicking, etc), and it's an HIView. You're using 5.5,
>>> right? What all flags are you specifying in your REALcontrol?
>>
>> Yes: REALcontrolAcceptFocus | REALcontrolIsHIViewCompatible |
>> REALenabledControl | REALdontTryHIViewize
>>
>> I just noticed that tabbing _out_ of the field works, but tabbing in
>> (from the EditField) doesn't.
>
> I believe this also has something to do with the window being
> composite. In a non-composite window, I can tab to the search field
> from another control and the gainedFocus function is called, but the
> control itself doesn't accept the focus. In a composite window, the
> gainedFocus event never fires, like the control doesn't even exist.

I never did figure this out. You wouldn't happen to have any more
ideas, would you?


Seth Willits
------------------------------------------------------------------------
---
President and Head Developer of Freak Software - http://www.freaksw.com
REALbasic Guru at ResExcellence - http://www.resexcellence.com/realbasic

"The problem of defense is how far you can go without destroying from
within what you are trying to defend from without."
-- Dwight D. Eisenhower
------------------------------------------------------------------------
---

_______________________________________________
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Control Focus
Date: 21.05.04 00:33 (Thu, 20 May 2004 16:33:10 -0700)
From: Seth Willits
On May 20, 2004, at 3:57 PM, Seth Willits wrote:

> Now all I have to do is figure out how to handle tabbing from the
> plugin control (a search field) to any other control in the window. I
> see that I'd need to trap the key press (presumably with a RawKeyDown
> handler attached to the control and it looks like I would use
> kEventParamKeyMacCharCodes against Ascii 9), but I don't see what
> you're supposed to do to pass the focus to the next control.

It occurred to me that AdvanceKeyboardFocus might do the trick, however
I noticed two things. 1) it doens't work, and 2) if the focus is in an
editfield (the only other control in the window) pressing tab inside it
does not switch the focus to the plugin control. I setup the gained
focus event, put in a SysBeep(1) and I never here a thing. The control
does have the AcceptsFocus flag, so I don't know why it's not working.
I can post the code if desired. This will be open source anyway.


Seth Willits
------------------------------------------------------------------------
---
President and Head Developer of Freak Software - http://www.freaksw.com
REALbasic Guru at ResExcellence - http://www.resexcellence.com/realbasic

"Relations are simply a tedious pack of people, who haven't got the
remotest knowledge of how to live, nor the smallest instinct about when
to die."
-- Algernon, The Importance of Being Earnest
------------------------------------------------------------------------
---

_______________________________________________
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Control Focus
Date: 21.05.04 00:55 (Thu, 20 May 2004 18:55:53 -0500)
From: Jonathan Johnson

On May 20, 2004, at 6:33 PM, Seth Willits wrote:

> On May 20, 2004, at 3:57 PM, Seth Willits wrote:
>
>> Now all I have to do is figure out how to handle tabbing from the
>> plugin control (a search field) to any other control in the window. I
>> see that I'd need to trap the key press (presumably with a RawKeyDown
>> handler attached to the control and it looks like I would use
>> kEventParamKeyMacCharCodes against Ascii 9), but I don't see what
>> you're supposed to do to pass the focus to the next control.
>
> It occurred to me that AdvanceKeyboardFocus might do the trick,
> however I noticed two things. 1) it doens't work, and 2) if the focus
> is in an editfield (the only other control in the window) pressing tab
> inside it does not switch the focus to the plugin control. I setup the
> gained focus event, put in a SysBeep(1) and I never here a thing. The
> control does have the AcceptsFocus flag, so I don't know why it's not
> working. I can post the code if desired. This will be open source
> anyway.

Are you implementing the ControlHandle function and returning your
HIViewRef? I thought this was taken care of if you did this. Also, are
you specifying REALcontrolAcceptFocus?

-Jon

Re: Control Focus
Date: 21.05.04 01:12 (Thu, 20 May 2004 17:12:35 -0700)
From: Seth Willits
On May 20, 2004, at 4:55 PM, Jonathan Johnson wrote:

> Also, are you specifying REALcontrolAcceptFocus?

Yes.


> Are you implementing the ControlHandle function and returning your
> HIViewRef? I thought this was taken care of if you did this.

No. I hadn't seen this. But even after I did, it didn't work.



Seth Willits
------------------------------------------------------------------------
---
President and Head Developer of Freak Software - http://www.freaksw.com
REALbasic Guru at ResExcellence - http://www.resexcellence.com/realbasic

"More praise of peace is easy but ineffective. What is needed is active
participation in the fight against war and everything that leads to it."
-- Albert Einstein
------------------------------------------------------------------------
---

_______________________________________________
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Control Focus
Date: 21.05.04 01:17 (Thu, 20 May 2004 17:17:24 -0700)
From: Seth Willits
On May 20, 2004, at 5:12 PM, Seth Willits wrote:

>> Are you implementing the ControlHandle function and returning your
>> HIViewRef? I thought this was taken care of if you did this.
>
> No. I hadn't seen this. But even after I did, it didn't work.

I forgot that this:

static unsigned long searchFieldControlHandle(REALcontrolInstance
instance)
{
// Get Control Data
ControlData(searchFieldControl, instance, searchFieldData, data);

return (unsigned long)(data->viewRef);
}

viewRef is an HIViewRef.

Seth Willits
------------------------------------------------------------------------
---
President and Head Developer of Freak Software - http://www.freaksw.com
REALbasic Guru at ResExcellence - http://www.resexcellence.com/realbasic

"One day you'll be wandering through the darkness looking for guidance,
inspiration, and your purpose in life, and the next you'll turn around
and realize they've been standing right next to you the whole time."
------------------------------------------------------------------------
---

_______________________________________________
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Control Focus
Date: 21.05.04 01:21 (Thu, 20 May 2004 19:21:46 -0500)
From: Jonathan Johnson

On May 20, 2004, at 7:12 PM, Seth Willits wrote:

> No. I hadn't seen this. But even after I did, it didn't work.

I'm not sure then -- I can tell you that my plugin's focus does work
(tabbing, clicking, etc), and it's an HIView. You're using 5.5, right?
What all flags are you specifying in your REALcontrol?

-Jon

Re: Control Focus
Date: 21.05.04 01:25 (Thu, 20 May 2004 17:25:59 -0700)
From: Seth Willits
On May 20, 2004, at 5:21 PM, Jonathan Johnson wrote:

>> No. I hadn't seen this. But even after I did, it didn't work.
>
> I'm not sure then -- I can tell you that my plugin's focus does work
> (tabbing, clicking, etc), and it's an HIView. You're using 5.5, right?
> What all flags are you specifying in your REALcontrol?

Yes: REALcontrolAcceptFocus | REALcontrolIsHIViewCompatible |
REALenabledControl | REALdontTryHIViewize

I just noticed that tabbing _out_ of the field works, but tabbing in
(from the EditField) doesn't.



Seth Willits
------------------------------------------------------------------------
---
President and Head Developer of Freak Software - http://www.freaksw.com
REALbasic Guru at ResExcellence - http://www.resexcellence.com/realbasic

"Black holes are where God divided by zero."
-- Steven Wright
------------------------------------------------------------------------
---

_______________________________________________
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Control Focus
Date: 21.05.04 07:28 (Thu, 20 May 2004 23:28:28 -0700)
From: Seth Willits
On May 20, 2004, at 5:25 PM, Seth Willits wrote:

>>> No. I hadn't seen this. But even after I did, it didn't work.
>>
>> I'm not sure then -- I can tell you that my plugin's focus does work
>> (tabbing, clicking, etc), and it's an HIView. You're using 5.5,
>> right? What all flags are you specifying in your REALcontrol?
>
> Yes: REALcontrolAcceptFocus | REALcontrolIsHIViewCompatible |
> REALenabledControl | REALdontTryHIViewize
>
> I just noticed that tabbing _out_ of the field works, but tabbing in
> (from the EditField) doesn't.

I believe this also has something to do with the window being
composite. In a non-composite window, I can tab to the search field
from another control and the gainedFocus function is called, but the
control itself doesn't accept the focus. In a composite window, the
gainedFocus event never fires, like the control doesn't even exist.


Seth Willits
------------------------------------------------------------------------
---
President and Head Developer of Freak Software - http://www.freaksw.com
REALbasic Guru at ResExcellence - http://www.resexcellence.com/realbasic

"Few are those who see with their own eyes and feel with their own
hearts."
-- Albert Einstein
------------------------------------------------------------------------
---

_______________________________________________
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>