TAILIEUCHUNG - BeginningMac OS X Tiger Dashboard Widget Development 2006 phần 6

Đến cuối chương này, bạn sẽ biết: ❑ ❑ ❑ các hoạt động bàn nhồi bột trong Bảng điều khiển Làm thế nào để cắt, sao chép, và dán chức năng làm việc thế nào để thêm các hoạt động cắt, sao chép, và dán widget của bạn Sáu sự kiện JavaScript cung cấp hỗ trợ cho các hoạt động bàn nhồi bột có thể được áp dụng | 9 Adding Cut Copy and Paste to Your Widget Cut copy and paste are key components of any Macintosh application and are quintessentially Mac. Just like the Finder s Clipboard Dashboard has a pasteboard that can be used to pass data. When you add the cut copy and paste functions to your widget you give the user an easy way to move data between applications and widgets. By the end of this chapter you will know What the pasteboard operations are in Dashboard How the cut copy and paste functions work How to add cut copy and paste operations to your widget Pasteboard JavaScript in Dashboard supports two constants that are pasteboards for the event object. If you are performing cut copy and paste operations in JavaScript you will use the clipboardData constant. If you are performing drag-and-drop operations in Javascript you will use the dataTranser constant. Pasteboard Events Six JavaScript events provide support for pasteboard operations that can be applied to any element in your widget. Three of the events provide the usual cut copy and paste functionality oncut oncopy and onpaste. The other three allow you to manipulate the data beforehand onbeforecut onbeforecopy and onbeforepaste. Chapter 9 All six of these events can be attached to any HTML element in your widget that supports them. In the case of these events you will register them in the body tag so they are called when the body of the widget finishes loading. To implement the cut copy and paste functions you must write handlers that work with the data. You will also need to pass the information about the event to the handler using the event variable. Pasteboard Handlers While not all widgets support the cut copy and paste functions those that do perform just like their application counterparts. If you perform a calculation on the Calculator widget for instance then press Command-C you can switch to Text Editor and paste in the result of the calculation. Notice in the widget that the number remained in the display

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.