使用 IntraWeb (38) - TIWAppForm、TIWForm、TIWBaseHTMLForm、TIWBaseForm


窗體 < TIWAppForm < TIWForm < TIWBaseHTMLForm < TIWBaseForm.

TIWAppForm 所在單元及繼承鏈:
IWAppForm.TIWAppForm < TIWForm < TIWBaseHTMLForm < TIWBaseForm < TIWModuleDsn < TIWContainer < TIWBaseContainer < TScrollingWinControl < TWinControl < TControl < TComponent < TPersistent < TObject

主要成員:
property OnURLRequest: TOnURLRequest //響應下面的 DoURLRequest 方法

procedure DoURLRequest(aRequest: THttpRequest) //執行 OnURLRequest 事件; 如: DoURLRequest(WebApplication.Request);
function MessageForm: TIWMessageFormClass  //函數獲取個類而不是對象; 它是個虛函數, 或許是爲了在繼承時美化彈出窗口
class procedure SetAsMainForm              //設置爲主窗口; 須用在 initialization 區
class procedure SetURL(const aPath: string; const aDocument: string) //設置虛擬地址
class function RequestAuth(aRequest: THttpRequest; var rGroup: string): Boolean	//安全判斷; 它是虛函數, 能夠繼承並增長安全條件 



TIWForm 所在單元及繼承鏈:
IWForm.TIWForm < TIWBaseHTMLForm < TIWBaseForm < TIWModuleDsn < TIWContainer < TIWBaseContainer < TScrollingWinControl < TWinControl < TControl < TComponent < TPersistent < TObject

{TIWForm = class(TIWBaseHTMLForm, IIWHTML40Container, IIWHTML40Form) //它同時實現了兩個接口} 主要成員:
property ActiveControl: TIWCustomControl //當前被激活的控件
property Background: TIWBackground	 //背景圖像設置
property LayoutMgr: TIWContainerLayout   //指定佈局管理器
property HandleTabs: Boolean //暫未使用
property LeftToRight: Boolean		 //文字方向
property LockUntilLoaded: Boolean	 //在加載完畢前是否禁止操做, 默認 True
property LockOnSubmit: Boolean		 //是否禁止重複提交, 默認 True
property StyleSheet: TIWFileReference	 //要使用的 CSS 文件; 文件須在 wwwroot 下(或嵌套)
property ShowHint //
property ServerOnResize: Boolean         //暫未使用; only write
property ProgressIndicator: TIWProgressIndicator //指定進度提示器
property Theme: string    //暫未使用
property XPTheme: Boolean //
property JavaScript: TStringList //js 代碼
property DocType: string    //如今默認 ; 譬如能夠指定爲:   
property KeepAlive: Boolean //保持激活, 以保證 Session 不過時; 應該是用在異步事件用時較長時, 但要慎用, 它會把 SessionTimeout 弄成四百多天; 默認 False;

property OnDefaultAction: TNotifyEvent //默認事件; 譬如在 TIWEdit 編輯後回車, 若是沒有給它寫 OnSubmit 事件, 將執行默認事件
property OnResize; //在 ServerOnResize 暫時棄用的狀況下, 它只執行一次

constructor Create(aOwner: TComponent); override;
procedure AddToInitProc(const ACode: string); //添加用於初始化的 js 代碼
procedure DoDefaultAction; //執行一次 OnDefaultAction

procedure SetIWAJAXNotifier(aIWAJAXNotifier: TIWBaseHTML40Component); //TIWAJAXNotifier 就是調用它和下面的 SendAJAXNotification, 感受直接調用它們應該比 TIWAJAXNotifier 控件更靈活.
function SendAJAXNotification: Boolean;       //
function GetIWAJAXNotificationJSCode: string; //
function GetIsStrictMode: Boolean; //好像是判斷是否是 IE 兼容模式
class function FindParentForm(Control: TControl): TIWForm;
property PageContext: TIWPageContext40;        //該對象有更多頁面相關的操做; only read
property ContainerContext: TIWContainerContext //該對象有更多容器相關的操做
property JavaScriptOnce: string //只執行一次的 js 代碼
property CacheFiles: TStrings   //緩存文件列表; only read



TIWBaseHTMLForm 所在單元及繼承鏈:
IWBaseHTMLForm.TIWBaseHTMLForm < TIWBaseForm < TIWModuleDsn < TIWContainer < TIWBaseContainer < TScrollingWinControl < TWinControl < TControl < TComponent < TPersistent < TObject

主要成員:
property BGColor: TIWColor    //背景色        
property LinkColor: TIWColor  //連接色        
property TextColor: TIWColor  //普通文本色    
property VLinkColor: TIWColor //訪問過的連接色



TIWBaseForm 所在單元及繼承鏈:
IWBaseForm.TIWBaseForm < TIWModuleDsn < TIWContainer < TIWBaseContainer < TScrollingWinControl < TWinControl < TControl < TComponent < TPersistent < TObject

主要成員:
property FormAction: string  //對應 Html Form 的 action 屬性
property Params: TStringList //參數列表, 有點相似 WebApplication.Request.ContentFields, 但後者更全; only read
property Released: Boolean              //是否執行過 Release, 但執行事後很快就 Free 了, 這個屬性沒多少意義; only read
property WebApplication: TIWApplication //only read
property FormState: TIWFormState        //當前狀態: fsUndefined, fsRendering, fsExecuting, fsCreating, fsCreated; only read
property ExecCount: Cardinal            //命令執行次數; only read
property AllowPageAccess: Boolean //好像也未使用
property ConnectionMode: TIWConnectionMode //讀取鏈接模式: cmAny, cmSecure, cmNonSecure
property PreHeader: TStringList	    //插入到 Head 靠前的內容
property ExtraHeader: TStringList   //插入到 Head 靠後的內容
property ContentFiles: TStringList  //包含 js、css 
property HiddenFields: TStringList  //隱藏字段
property Title: string		    //網頁標題
property PreventBackButton: Boolean //是否禁用後退按鈕; 默認 False

property OnAfterRender: TNotifyEvent //呈現後, 發生在 OnCreate > OnRender 以後
property OnCreate: TNotifyEvent
property OnDestroy: TNotifyEvent

procedure Hide //
procedure Show //
procedure Release //釋放; 它會先把窗體添加到 WebApplicaiton 內部的列表(FReleasedForms)中, 同時 Hide 掉; 等新的 ActiveForm 就緒後再 Free
procedure ReleaseAndRedirect(const aUrl: string) //釋放並轉向
class function TextToHTMLStringLiteral(const AText: string): string; //在 Html 中有些字符須要轉碼, 用這個函數很方便


示例:
//待續...
相關文章
相關標籤/搜索