Đang chuẩn bị liên kết để tải về tài liệu:
Programming the Be Operating System-Chapter 8: Text
Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Tham khảo tài liệu 'programming the be operating system-chapter 8: text', công nghệ thông tin, hệ điều hành phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | 8 In this chapter Fonts Simple Text Editable Text Scrolling Text The BeOS makes it simple to display text in a view you ve seen several examples of calling the BView functions SetFont and DrawString to specify which font a view should use and then draw a line of text. This approach works fine for small amounts of plain text your application however is more likely to be rich in both graphics and text so you ll want to take advantage of the BFont BStringView BTextView BScrollBar and BScrollView classes. The BFont class creates objects that define the characteristics of fonts. You create a BFont object based on an existing font then alter any of several characteristics. The BeOS is quite adept at manipulating fonts. You can alter basic font features such as size and spacing but you can also easily change other more esoteric font characteristics such as shear and angle of rotation. You can use this new font in subsequent calls to DrawString or as the font in which text is displayed in BStringView BTextView or BScrollView objects. A BStringView object displays a line of text as a call to the BView function DrawString does. Because the text of a BStringView exists as an object this text knows how to update itself something that the text produced by a call to DrawString doesn t know how to do. More powerful than the BStringView class is the BTextView class. A BTextView object is used to display small or large amounts of editable text. The user can perform standard editing techniques such as cut copy and paste on the text of a BTextView object. And the user or the program itself can alter the font or font color of some or all of the text in such an object. If the text of a BTextView object extends beyond the content area of the object a scrollbar simplifies the user s viewing. The BScrollBar class lets you add a scrollbar to a BTextView. Before adding that scrollbar though you should consider 272 Fonts 273 creating a BScrollView object. As its name implies such an object .