跳轉到內容

Futurebasic/語言/參考/游標

來自華夏公益教科書,開放的書籍,為了開放的世界

CURSOR 語句

[編輯 | 編輯原始碼]

✔ χ 外觀 ✔ χ 標準 ✔ χ 控制檯

語法(標準 BASIC)
CURSOR [=] intExpr

語法(外觀執行時)

[編輯 | 編輯原始碼]

CURSOR cursorID[,cursorType]

修訂
2002 年 2 月(6.0 版)

如果 intExpr 為正數,則解釋為 'crsr'(首選)或 'CURS' 資源(備選)的資源 ID,此語句將當前游標更改為指定的游標。以下游標資源可在系統檔案中找到,並且始終可用

對於外觀管理器呼叫,cursorType 必須為 _themeCursorStatic_themeCursorAnimate

標準 BASIC

資源 ID

游標

_arrowCursor(0)

<img src="c/cursor01.gif" alt="IMAGE imgs/CURSOR_statement02.gif" height="16" width="16">
_iBeamCursor(1) <img src="c/cursor02.gif" alt="IMAGE imgs/CURSOR_statement02.gif" height="16" width="16">
_crossCursor(2) <img src="c/cursor03.gif" alt="IMAGE imgs/CURSOR_statement02.gif" height="16" width="16">
_plusCursor(3) <img src="c/cursor04.gif" alt="IMAGE imgs/CURSOR_statement02.gif" height="16" width="16">
_watchcursor(4) <img src="c/cursor05.gif" alt="IMAGE imgs/CURSOR_statement02.gif" height="16" width="16">

外觀管理器游標
帶星號 (*) 的專案可能為動畫。

資源 ID

游標

_kThemeArrowCursor (0)

<img src="c/cursor01.gif" alt="IMAGE imgs/CURSOR_statement02.gif" height="16" width="16">
_kThemeCopyArrowCursor (1) <img src="c/cursor01a.gif" alt="IMAGE imgs/CURSOR_statement02.gif" height="16" width="16">
_kThemeAliasArrowCursor (2) <img src="c/cursor02a.gif" alt="IMAGE imgs/CURSOR_statement02.gif" height="16" width="16">
_kThemeContextualMenuArrowCursor (3) <img src="c/cursor03a.gif" alt="IMAGE imgs/CURSOR_statement02.gif" height="16" width="16">
_kThemeIBeamCursor (4) <img src="c/cursor02.gif" alt="IMAGE imgs/CURSOR_statement02.gif" height="16" width="16">
_kThemeCrossCursor (5) <img src="c/cursor03.gif" alt="IMAGE imgs/CURSOR_statement02.gif" height="16" width="16">
_kThemePlusCursor (6) <img src="c/cursor04.gif" alt="IMAGE imgs/CURSOR_statement02.gif" height="16" width="16">
_kThemeWatchCursor (7)* <img src="c/cursor05.gif" alt="IMAGE imgs/CURSOR_statement02.gif" height="16" width="16">
_kThemeClosedHandCursor (8) <img src="c/cursor08a.gif" alt="IMAGE imgs/CURSOR_statement02.gif" height="16" width="16">
_kThemeOpenHandCursor (9) <img src="c/cursor09a.gif" alt="IMAGE imgs/CURSOR_statement02.gif" height="16" width="16">
_kThemePointingHandCursor (10) <img src="c/cursor10a.gif" alt="IMAGE imgs/CURSOR_statement02.gif" height="16" width="16">
_kThemeCountingUpHandCursor (11)* <img src="c/cursor11a.gif" alt="IMAGE imgs/CURSOR_statement02.gif" height="16" width="16">
_kThemeCountingDownHandCursor (12)* <img src="c/cursor09a.gif" alt="IMAGE imgs/CURSOR_statement02.gif" height="16" width="16">
_kThemeCountingUpAndDownHandCursor (13)* <img src="c/cursor11a.gif" alt="IMAGE imgs/CURSOR_statement02.gif" height="16" width="16">
_kThemeSpinningCursor (14)* <img src="c/cursor14a.gif" alt="IMAGE imgs/CURSOR_statement02.gif" height="16" width="16">
_kThemeResizeLeftCursor(15) <img src="c/cursor15a.gif" alt="IMAGE imgs/CURSOR_statement02.gif" height="16" width="16">
_kThemeResizeRightCursor(16) <img src="c/cursor16a.gif" alt="IMAGE imgs/CURSOR_statement02.gif" height="16" width="16">
_kThemeResizeLeftRightCursor(17) <img src="c/cursor17a.gif" alt="IMAGE imgs/CURSOR_statement02.gif" height="16" width="16">

錯誤資訊(外觀管理器)
如果您嘗試在游標語句中使用非法值,您將看到以下對話方塊

<img src="c/CURSOR_statement07.gif" alt="" height="132" width="375" border="0">

此型別的對話方塊只會在您從命令選單中選擇執行時出現。如果您在選擇構建後在程式中使用非法值,它將不會出現。這可以防止錯誤訊息出現在您的終端使用者螢幕上,但仍然可以在編碼過程中使用它。

強制游標事件:
如果 intExpr 為負數(例如:CURSOR=-_watchCursor), 則游標將更改為 ID 為 ABS(intExpr) 的游標,並且會生成游標事件,可以使用 DIALOG 函式透過檢查 _cursEvent 型別的事件來捕獲。當切換到 _arrowCursor 時,您不能生成 _cursEvent(因為它的資源 ID 號沒有負數!)

注意
如果您已經設計了自己的 csrsCURS 資源,並且希望在程式中使用它,請執行以下操作

  1. 為資源分配一個正資源 ID 號(不要使用上面表格中的任何數字。您應該使用 128 或更高的 ID 號。)
  2. 將資源複製到程式的 RESOURCES 語句中引用的資原始檔。

然後,您可以在程式中使用 CURSOR 語句啟用您的游標。

DIALOG
DEF CYCLE

華夏公益教科書