Subject Re: Cannot focus a disabled or invisible windows with TIB_Checkbox
Author mmusetti70
Jason, I resolved the problem.

In fact the mistake was in a TIB_Edit control.

In the OnClick Event of the CheckBox control I have a code:
IF ckCAST.CHECKED = TRUE THEN BEGIN
edDTCAS.ENABLED := TRUE;

IF (dmSISGADO.dsANI.STATE = dssINSERT) OR
(dmSISGADO.dsANI.STATE = dssEDIT) THEN

// Here is the problem
edDTCAS.SETFOCUS;

END ELSE BEGIN
edDTCAS.ENABLED := FALSE;
edDTCAS.TEXT := '';
dmSISGADO.qrANI.FieldByName('DATE').ISNULL;
END;

When the Cancel of the Query is fired the OnClick Event of the Checkbox is fired too (I DON'T KNOW WHY), but the tabsheet is not more visible.
Then the mistake was happening.

Even after to fire the method CANCEL of the TIB_Query, the state of the dataset continues in way of insertion (dmSISGADO.dsANI.STATE = dssINSERT). Why ?

To resolve the problem I did:

IF pgcANIMAL.ACTIVEPAGEINDEX = 2 THEN BEGIN
// Code above...
END;

Here we go !

Thanks Jason.


--- In IBObjects@yahoogroups.com, "Jason Wharton" <supportlist@...> wrote:
>
> Marcos,
>
> > First, I'm using IBO 4.8.7 with Delphi 2007 and Firebird 2.1.3.
> >
> > In my form I have a TIB_Checkbox control linked to a datasource and the
> > linked
> > field is BOOLEAN. And "ColumnAttributes => Field - Boolean, True Text =
> > 'Y',
> > False Text = 'N'".
> > This control is in a tabsheet (2) of a pagecontrol.
> > When TIB_Query.Cancel is fired the following message appears:
> >
> > "Cannot focus a disabled or invisible windows".
> >
> > But this happen only when the cursor is over a register where the field
> > BOOLEAN is True (Y).
> >
> > What is wrong ?
>
> I'd really need to see more details to figure it out.
>
> The callstack would help.
>
> Probably the best thing to do is to send me a sample app of the problem.
>
> Jason Wharton
>