Đang chuẩn bị liên kết để tải về tài liệu:
Hacking Firefox - part 37

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Các thuộc tính tiêu đề quy định các tiêu đề hộp thoại. Các nút thuộc tính xác định bằng dấu phẩy danh sách các nút đó sẽ xuất hiện trong hộp thoại. Trong trường hợp của chúng tôi, chúng tôi muốn hai nút: OK và Cancel. Chú ý rằng chúng tôi quy định chỉ có các nút muốn và không có để tạo ra các yếu tố nút. | 362 Part VI Creating Extensions and Themes Figure 17-24 shows the dialog we have created. Figure 17-24 A simple dialog Let s look at our dialog code more closely The dialog element specifies that our XUL document is in fact a dialog. The title attribute specifies the dialog title. The buttons attribute specifies the comma-separated list of buttons that will appear in the dialog. In our case we want two buttons OK and Cancel. Notice that we specified only the wanted buttons and didn t have to create the button elements. The buttons are created automatically and their position and appearance are determined by the user s operating system conventions. The ondialogaccept and ondialogcancel attributes define functions that will be called when the user presses OK and Cancel respectively. The script element defines our JavaScript code. Notice that while all our examples until now demonstrated the use of external JavaScript files you can have your scripts embedded directly in the XUL document. A single label element is used to display a line of text. Obviously real dialogs often have more complex user interfaces. Once our dialog implementation is ready we can add it to our chrome package. Let s name our dialog file testDialog.xul and add it to the siteleds package. We can now open it using the window.openDialog method like so window.openDialog chrome siteleds content testDialog.xul _blank chrome The first parameter specifies the URL of the dialog XUL file the second the name of the dialog. The third parameter specifies some optional flags the chrome flag means that the document is a chrome window and doesn t need to be wrapped by a browser component like an HTML document for example. You can specify the modal flag to make the opened dialog modal. Preferences and Persistent Information The preferences mechanism allows the browser to store user modifiable application settings. For example when a user changes the browser s home page in the Options dialog the new value is saved

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.