文件是一個包含關於示例及其所屬歸類的信息的XML文件,基本格式如下:
複製內容到剪貼板
代碼:
<solutions vendor="供應商名稱" name="解決方案集合名稱">
<category key="分類鍵值">
<text>分類名稱</text>
<image>PaneCache圖像文件名稱</image>
<solution key="示例程序鍵值" parent="示例所屬分類鍵值">
<text>示例程序名稱</text>
<type>示例程序類型</type>
<file>不帶路徑的文件名稱</file>
<description><![CDATA[示例描述文本]]></description>
</solution>
</category>
</solutions>
將該文件保存到\Samples\Solution\Toledo\文件夾中,文件內容如下所示:
複製內容到剪貼板
代碼:
<?xml version='1.0' encoding='gb2312' standalone='no'?>
<solutions vendor="VFPTOP" name=" VFPTOP_Samples">
<category key=" VFPTOP_Samples">
<text>Visual FoxPro編程園地程序示例</text>
<image>frm</image>
<solution key=" Systray_Sample" parent="VFPTOP_Samples">
<text>系統托盤示例</text>
<type>F</type>
<file>systray_sample</file>
<method></method>
<description><![CDATA[要瞭解更多Visual FoxPro編程資源,歡迎
<a href="vfps:linkto?url=http://www.vfptop.com">訪問</a>
Microsoft Visual FoxPro編程園地!]]>
</description>
</solution>
</category>
</solutions>
為了示例,建立一個叫做Static.htm的簡單HTML文件。注意其中的「vfps:linkto?url=」語法,其屬於任務窗格管理器的內置處理器功能,不是標準的HTML語言,對於處理器功能在後面將有介紹。
複製內容到剪貼板
代碼:
<html>
<head>
<title>歡迎訪問Visual FoxPro編程園地</title>
</head>
<body>
<h3>Visual FoxPro編程園地</h3>
<p>Visual FoxPro編程園地擁有豐富的編程技術資源和最新的Visual FoxPro產品信息,歡迎訪問!</p>
<p><a href="vfps:linkto?url=http://www.vfptop.com">http://www.vfptop.com</a> </p>
</body>
</html>
可以傳遞一個字符串參數到任務窗格管理器自動打開一個指定窗格,該參數是窗格的唯一ID,如:
複製內容到剪貼板
代碼:
DO (_TASKPANE) WITH "MICROSOFT.FILER" &&打開Filer任務窗格
也可以傳遞一個「-s」 選項來直接打開Pane Customization窗口,如:
複製內容到剪貼板
代碼:
DO (_TASKPANE) WITH "-s"
建立一個多格式內容窗格,首先建立一個RichContent.prg文件,內容如下:
複製內容到剪貼板
代碼:
PUBLIC oRichContent
oRichContent=NEWOBJECT("RichContents")
DEFINE CLASS RichContents AS PaneContainer OF FoxPane
Showwindow=2 && 頂層表單
ADD OBJECT lblWelcome AS Label WITH Caption="多格式內容窗格示例",Height=50,Left=1,Width=1024
ADD OBJECT lblPaneContentTable AS Label WITH Height=50,Left=1,Width=1024
ADD OBJECT lblContentTile AS Label WITH Height=50,Left=1,Width=1024
PROCEDURE Init
This.ResizeHeader()
ENDPROC
PROCEDURE OnRender(oPane,oContent)
This.lblWelcome.FontSize=oContent.GetOption("txtFontSize",1) &&指定字號
This.lblPaneContentTable.Caption="任務窗格工作目錄:"+oPane.CacheDir
This.lblContentTile.Caption="窗格唯一ID:"+oContent.UniqueID
ENDPROC
PROCEDURE OnResize() &&窗格調整大小時相應調整其中控件對象的位置
This.ResizeHeader()
ENDPROC
PROCEDURE ResizeHeader()
This.lblWelcome.Top=INT(This.Height/2)-30
This.lblPaneContentTable.Top=INT(This.Height/2)+30
This.lblContentTile.Top=INT(This.Height/2)+60
ENDPROC
ENDDEFINE