02-14-2023, 10:10 AM
Hello!
Discovered another strange ting in IntraWeb 15.2.69.
Try the following:
Create a new IW application and put a TIWTabControl on it.
Add a couple of pages to the TabControl.
Create an event for the forms OnAsynchResize.
When running the application the OnAsynchResize is fired once as it should and you can switch between the pages on the TabControl and no more OnAsynchResize is fired.
Now add an event to the TabControls OnChange event, it can be an empty event doing nothing.
Now when you run the program the OnAsynchResize event is fired on program startup as it should, but it's also fired every time you change page in the page control!
This is a big issue for me as I use the OnAsynchResize event for rescaling every component on the form.
Am i missing soething here? Is this normal behaviour?
Best regards, Mikael
object IWForm2: TIWForm2
Left = 0
Top = 0
Width = 555
Height = 400
RenderInvisibleControls = True
AllowPageAccess = True
ConnectionMode = cmAny
OnAsyncResize = IWAppFormAsyncResize
Background.Fixed = False
HandleTabs = False
LeftToRight = True
LockUntilLoaded = True
LockOnSubmit = True
ShowHint = True
DesignLeft = 3
DesignTop = 3
object IWTabControl1: TIWTabControl
Left = 96
Top = 72
Width = 305
Height = 225
RenderInvisibleControls = True
OnChange = IWTabControl1Change
ActiveTabFont.Color = clWebWHITE
ActiveTabFont.FontFamily = 'Arial, Sans-Serif, Verdana'
ActiveTabFont.Size = 10
ActiveTabFont.Style = [fsBold]
ActiveTabFont.PxSize = 13
InactiveTabFont.Color = clWebBLACK
InactiveTabFont.FontFamily = 'Arial, Sans-Serif, Verdana'
InactiveTabFont.Size = 10
InactiveTabFont.Style = []
InactiveTabFont.PxSize = 13
ActiveTabColor = clWebDARKGRAY
InactiveTabColor = clWebLIGHTGRAY
ActivePage = 0
BorderOptions.NumericWidth = 0
BorderOptions.Style = cbsNone
Color = clWebSILVER
ClipRegion = False
TabPadding = 0
ActiveTabBorder.Color = clWebBLACK
ActiveTabBorder.Width = 0
InactiveTabBorder.Color = clWebBLACK
InactiveTabBorder.Width = 0
DesignSize = (
305
225)
object IWTabControl1Page0: TIWTabPage
Left = 0
Top = 20
Width = 305
Height = 205
RenderInvisibleControls = True
Title = 'Page0'
BorderOptions.NumericWidth = 0
BorderOptions.Style = cbsNone
Color = clWebWHITE
end
object IWTabControl1Page1: TIWTabPage
Left = 0
Top = 20
Width = 305
Height = 205
RenderInvisibleControls = True
TabOrder = 1
Title = 'Page1'
BorderOptions.NumericWidth = 0
BorderOptions.Style = cbsNone
Color = clWebWHITE
end
end
end
unit Unit2;
interface
uses
Classes, SysUtils, IWAppForm, IWApplication, IWColor, IWTypes,
IWCompTabControl, Vcl.Controls, Vcl.Forms, IWVCLBaseContainer, IWContainer,
IWHTMLContainer, IWHTML40Container, IWRegion;
type
TIWForm2 = class(TIWAppForm)
IWTabControl1: TIWTabControl;
IWTabControl1Page0: TIWTabPage;
IWTabControl1Page1: TIWTabPage;
procedure IWAppFormAsyncResize(Sender: TObject; EventParams: TStringList);
procedure IWTabControl1Change(Sender: TObject);
public
end;
implementation
{$R *.dfm}
procedure TIWForm2.IWAppFormAsyncResize(Sender: TObject; EventParams: TStringList);
begin
// Put breakpoint here if you want to see when it's fired
end;
// If this function is removed everything works fine!
procedure TIWForm2.IWTabControl1Change(Sender: TObject);
begin
//
end;
initialization
TIWForm2.SetAsMainForm;
end.
Discovered another strange ting in IntraWeb 15.2.69.
Try the following:
Create a new IW application and put a TIWTabControl on it.
Add a couple of pages to the TabControl.
Create an event for the forms OnAsynchResize.
When running the application the OnAsynchResize is fired once as it should and you can switch between the pages on the TabControl and no more OnAsynchResize is fired.
Now add an event to the TabControls OnChange event, it can be an empty event doing nothing.
Now when you run the program the OnAsynchResize event is fired on program startup as it should, but it's also fired every time you change page in the page control!
This is a big issue for me as I use the OnAsynchResize event for rescaling every component on the form.
Am i missing soething here? Is this normal behaviour?
Best regards, Mikael
object IWForm2: TIWForm2
Left = 0
Top = 0
Width = 555
Height = 400
RenderInvisibleControls = True
AllowPageAccess = True
ConnectionMode = cmAny
OnAsyncResize = IWAppFormAsyncResize
Background.Fixed = False
HandleTabs = False
LeftToRight = True
LockUntilLoaded = True
LockOnSubmit = True
ShowHint = True
DesignLeft = 3
DesignTop = 3
object IWTabControl1: TIWTabControl
Left = 96
Top = 72
Width = 305
Height = 225
RenderInvisibleControls = True
OnChange = IWTabControl1Change
ActiveTabFont.Color = clWebWHITE
ActiveTabFont.FontFamily = 'Arial, Sans-Serif, Verdana'
ActiveTabFont.Size = 10
ActiveTabFont.Style = [fsBold]
ActiveTabFont.PxSize = 13
InactiveTabFont.Color = clWebBLACK
InactiveTabFont.FontFamily = 'Arial, Sans-Serif, Verdana'
InactiveTabFont.Size = 10
InactiveTabFont.Style = []
InactiveTabFont.PxSize = 13
ActiveTabColor = clWebDARKGRAY
InactiveTabColor = clWebLIGHTGRAY
ActivePage = 0
BorderOptions.NumericWidth = 0
BorderOptions.Style = cbsNone
Color = clWebSILVER
ClipRegion = False
TabPadding = 0
ActiveTabBorder.Color = clWebBLACK
ActiveTabBorder.Width = 0
InactiveTabBorder.Color = clWebBLACK
InactiveTabBorder.Width = 0
DesignSize = (
305
225)
object IWTabControl1Page0: TIWTabPage
Left = 0
Top = 20
Width = 305
Height = 205
RenderInvisibleControls = True
Title = 'Page0'
BorderOptions.NumericWidth = 0
BorderOptions.Style = cbsNone
Color = clWebWHITE
end
object IWTabControl1Page1: TIWTabPage
Left = 0
Top = 20
Width = 305
Height = 205
RenderInvisibleControls = True
TabOrder = 1
Title = 'Page1'
BorderOptions.NumericWidth = 0
BorderOptions.Style = cbsNone
Color = clWebWHITE
end
end
end
unit Unit2;
interface
uses
Classes, SysUtils, IWAppForm, IWApplication, IWColor, IWTypes,
IWCompTabControl, Vcl.Controls, Vcl.Forms, IWVCLBaseContainer, IWContainer,
IWHTMLContainer, IWHTML40Container, IWRegion;
type
TIWForm2 = class(TIWAppForm)
IWTabControl1: TIWTabControl;
IWTabControl1Page0: TIWTabPage;
IWTabControl1Page1: TIWTabPage;
procedure IWAppFormAsyncResize(Sender: TObject; EventParams: TStringList);
procedure IWTabControl1Change(Sender: TObject);
public
end;
implementation
{$R *.dfm}
procedure TIWForm2.IWAppFormAsyncResize(Sender: TObject; EventParams: TStringList);
begin
// Put breakpoint here if you want to see when it's fired
end;
// If this function is removed everything works fine!
procedure TIWForm2.IWTabControl1Change(Sender: TObject);
begin
//
end;
initialization
TIWForm2.SetAsMainForm;
end.