首页 > 代码库 > 使用 IntraWeb (25) - 基本控件之 TIWRegion

使用 IntraWeb (25) - 基本控件之 TIWRegion


这应该是 IW 中最重要的容器了, 和它同父的还有 TIWTabControl

TIWRegion 所在单元及继承链:
IWRegion.TIWRegion < TIWCustomRegion < TIWHTML40Container < TIWHTMLContainer < TIWContainer < TIWBaseContainer < TScrollingWinControl < TWinControl < TControl < TComponent < TPersistent < TObject

主要成员:
property Align: TAlignproperty Anchors: TAnchorsproperty BorderOptions: TIWContainerBorderOptions //设置边框的宽度、颜色、样式property Color: TIWColorproperty ClipRegion: Boolean           //对应 CSS clip, 如果控件大于区域, 是否剪切; 默认 Trueproperty LayoutMgr: TIWContainerLayout //要套用的布局管理器property Splitter: Boolean	       //是否提供分割线; 它出现的位置与 Align 属性有关系property StyleRenderOptions: TIWStyleRenderOptionsproperty Visible: Booleanproperty DoRefreshControl: Booleanproperty InternalTabOrder: TTabOrderproperty ContainerContext: TIWContainerContext property IWComponentsCount: Integerproperty RenderInvisibleControls: Boolean //是否呈现隐藏的控件; 默认 Falseproperty HorzScrollBar: TControlScrollBarproperty VertScrollBar: TControlScrollBarproperty OnCreate: TNotifyEventproperty OnRender: TNotifyEventprocedure SetBounds(ALeft: Integer; ATop: Integer; AWidth: Integer; AHeight: Integer)procedure Invalidatefunction OwnerForm: TIWBaseFormfunction OwnerFrame: TIWHTMLContainerprocedure Freeing(AObject: TObject)procedure ForceAlignprocedure DisableAutoRangeprocedure EnableAutoRangeprocedure ScrollInView(AControl: TControl)


RenderInvisibleControls 属性测试:
procedure TIWForm1.IWAppFormCreate(Sender: TObject);begin  IWRectangle1.Visible := False;             //假如 IWRectangle1 在 IWRegion1 内, 并且已经隐藏了  IWRegion1.RenderInvisibleControls := True; //如果不指定 RenderInvisibleControls := True 那么再从异步事件中设置 IWRectangle1.Visible := True 将无效end;{OnAsyncClick}procedure TIWForm1.IWButton1AsyncClick(Sender: TObject; EventParams: TStringList);begin  IWRectangle1.Visible := not IWRectangle1.Visible;end;


Splitter 属性测试:
{先放三个互不嵌套的 TIWRegion}procedure TIWForm1.IWAppFormCreate(Sender: TObject);begin  IWRegion1.Color := $ff0000;  IWRegion2.Color := $0000ff;  IWRegion3.Color := $00ff00;  IWRegion1.Align := alTop;  IWRegion2.Align := alLeft;  IWRegion3.Align := alClient;  IWRegion1.Splitter := True;  IWRegion2.Splitter := True;end;

效果图: