[futurebasic] Re: [FB] ActivateControl and/or HiliteControl usage

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : June 2007 : Group Archive : Group : All Groups

From: Brian Stevens <bstevens33@...>
Date: Sun, 3 Jun 2007 18:22:17 -0700
I've quickly hacked together an example of this behavior. Any clues  
welcome.

Thanks...Brian S.

http://members.cox.net/ccnx/ActivateControlIssue.zip



On Jun 3, 2007, at 3:49 PM, Brian Stevens wrote:

> Simple scenario:  When a check box is selected with a check, a push  
> button is activated (previously visible but dim). Window is nib- 
> based and all controls are nib-based. Check box has a control hit  
> handler assigned and control does reach the handler and the code  
> verifying _kControlCheckBoxCheckedValue returns true (verified with  
> simple prints and all values are as they should be).
>
> Once a the checkbox is confirmed as checked, it does an FN  
> ActivateControl(c):
>
> fn ActivateControl( fn GetControlByIDWnd (_WeeklyWindow,  
> _DelChecked) )  where GetControlByIDWnd returns a controlRef for  
> the this window and this button (which has a corresponding ID  
> defined in the nib). This should activate the push button but does  
> not. If I immediately follow the ActivateControl with HiliteControl 
> ( fn GetControlByIDWnd (_WeeklyWindow, _DelChecked), 0 ), the push  
> button is activated and works as expected.
>
> Everything I've read says do NOT use HiliteControl and  
> ActivateControl is better for embedded controls, but this is  
> mysterious. These are the 2 FNs getting the WindowRef and the  
> ControlRef. They have been solid.  I don't want to use  
> HiliteControl but I suspect I'm missing something regarding the  
> basic reason for using it.
>
> TIA---Brian S.
>
> P.S. I know I need to work on FBtoC but I needed a break. Please  
> excuse me.
>
> local mode
> local fn WindowFindByID( id as SInt32 )
> '~'1
> dim as WindowRef @ w
>
> w = fn GetWindowList()
> while ( w )
> if ( fn WindowGetID( w ) == id ) then exit fn
> w = fn GetNextWindow( w )
> wend
> end fn = w
>
>
> local fn GetControlByIDWnd (wNum as SInt16, id as SInt16)
> dim as ControlID     cID
> dim as ControlRef  @ c
> dim as WindowRef     w
>
> w = fn WindowFindByID( wNum )
> cID.signature = 0
> cID.id = id
> call GetControlByID( w, cID, @c )
> end fn = c
>
> --
> To unsubscribe, send ANY message to: futurebasic- 
> unsubscribe@...
>