Subject | Bug in IB_Grid - OnExit firing |
---|---|
Author | Paul Hope |
Post date | 2007-03-08T17:17:24Z |
Hi
I am changing the size of a grid OnEnter and reverting back OnExit. If
there is also something causing a layout change and the focused field has an
IBMemoEnh then OnExit fires and the size reverts back although the grid
still appears to have focus.
I have knocked up a test app - here's the unit - needs connecting to
employee.gdb
unit IBOGridTest1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Grids, IB_Grid, IB_Components, Telesis_EditEnh,
Telesis_IB_EditEnh, Telesis_MemoEnh, Telesis_IB_MemoEnh, IB_Controls;
type
TForm1 = class(TForm)
IB_Grid1: TIB_Grid;
Edit1: TEdit;
IB_Connection1: TIB_Connection;
IB_Query1: TIB_Query;
IB_DataSource1: TIB_DataSource;
IB_MemoEnh1: TIB_MemoEnh;
procedure IB_Grid1Enter(Sender: TObject);
procedure IB_Grid1Exit(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.IB_Grid1Enter(Sender: TObject);
begin
IB_Grid1.Top:=0;
IB_Grid1.Width:=420;
IB_Query1.FieldsVisible.Text:='LAST_NAME=FALSE';
end;
procedure TForm1.IB_Grid1Exit(Sender: TObject);
begin
IB_Grid1.top:=64;
IB_Grid1.Width:=320;
IB_Query1.FieldsVisible.Text:='LAST_NAME=TRUE';
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
ib_query1.Open;
end;
end.
and here's the form
object Form1: TForm1
Left = 98
Top = 154
Width = 544
Height = 375
ActiveControl = Edit1
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object IB_Grid1: TIB_Grid
Left = 102
Top = 64
Width = 320
Height = 120
CustomGlyphsSupplied = []
DataSource = IB_DataSource1
TabOrder = 0
OnEnter = IB_Grid1Enter
OnExit = IB_Grid1Exit
object IB_MemoEnh1: TIB_MemoEnh
Left = 40
Top = 48
Width = 185
Height = 89
DataField = 'EMP_NO'
DataSource = IB_DataSource1
Visible = False
TabOrder = 0
end
end
object Edit1: TEdit
Left = 100
Top = 216
Width = 121
Height = 21
TabOrder = 1
Text = 'Edit1'
end
object IB_Connection1: TIB_Connection
PasswordStorage = psNotSecure
SQLDialect = 1
Params.Strings = ()
Left = 32
Top = 8
SavedPassword = ''
end
object IB_Query1: TIB_Query
DatabaseName = 'd:\demos\employee.gdb'
IB_Connection = IB_Connection1
SQL.Strings = (
'select *'
'FROM EMPLOYEE'
'where job_code=''CFO''')
Left = 110
Top = 8
end
object IB_DataSource1: TIB_DataSource
Dataset = IB_Query1
Left = 182
Top = 8
end
end
Regards
Paul
[Non-text portions of this message have been removed]
I am changing the size of a grid OnEnter and reverting back OnExit. If
there is also something causing a layout change and the focused field has an
IBMemoEnh then OnExit fires and the size reverts back although the grid
still appears to have focus.
I have knocked up a test app - here's the unit - needs connecting to
employee.gdb
unit IBOGridTest1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Grids, IB_Grid, IB_Components, Telesis_EditEnh,
Telesis_IB_EditEnh, Telesis_MemoEnh, Telesis_IB_MemoEnh, IB_Controls;
type
TForm1 = class(TForm)
IB_Grid1: TIB_Grid;
Edit1: TEdit;
IB_Connection1: TIB_Connection;
IB_Query1: TIB_Query;
IB_DataSource1: TIB_DataSource;
IB_MemoEnh1: TIB_MemoEnh;
procedure IB_Grid1Enter(Sender: TObject);
procedure IB_Grid1Exit(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.IB_Grid1Enter(Sender: TObject);
begin
IB_Grid1.Top:=0;
IB_Grid1.Width:=420;
IB_Query1.FieldsVisible.Text:='LAST_NAME=FALSE';
end;
procedure TForm1.IB_Grid1Exit(Sender: TObject);
begin
IB_Grid1.top:=64;
IB_Grid1.Width:=320;
IB_Query1.FieldsVisible.Text:='LAST_NAME=TRUE';
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
ib_query1.Open;
end;
end.
and here's the form
object Form1: TForm1
Left = 98
Top = 154
Width = 544
Height = 375
ActiveControl = Edit1
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object IB_Grid1: TIB_Grid
Left = 102
Top = 64
Width = 320
Height = 120
CustomGlyphsSupplied = []
DataSource = IB_DataSource1
TabOrder = 0
OnEnter = IB_Grid1Enter
OnExit = IB_Grid1Exit
object IB_MemoEnh1: TIB_MemoEnh
Left = 40
Top = 48
Width = 185
Height = 89
DataField = 'EMP_NO'
DataSource = IB_DataSource1
Visible = False
TabOrder = 0
end
end
object Edit1: TEdit
Left = 100
Top = 216
Width = 121
Height = 21
TabOrder = 1
Text = 'Edit1'
end
object IB_Connection1: TIB_Connection
PasswordStorage = psNotSecure
SQLDialect = 1
Params.Strings = ()
Left = 32
Top = 8
SavedPassword = ''
end
object IB_Query1: TIB_Query
DatabaseName = 'd:\demos\employee.gdb'
IB_Connection = IB_Connection1
SQL.Strings = (
'select *'
'FROM EMPLOYEE'
'where job_code=''CFO''')
Left = 110
Top = 8
end
object IB_DataSource1: TIB_DataSource
Dataset = IB_Query1
Left = 182
Top = 8
end
end
Regards
Paul
[Non-text portions of this message have been removed]