|
|
||||||||||||||||
Class UIColumnHeaderpublic class UIColumnHeader extends UIScrollThumb { // Constructors public UIColumnHeader(); public UIColumnHeader(String text); public UIColumnHeader(IUIComponent comp); // Methods public int getRoleCode(); public boolean isMoving(); public boolean isSizing(); public boolean isSizingLeft(); public boolean isSizingRight(); public boolean mouseDown(Event e, int x, int y); } This class manages column headers. UIColumnHeader objects are used with UIColumnViewer objects and UIScrollViewer objects to display sizeable headings for columns of data. You can construct a UIColumnHeader with textual or graphical content using a String or a component (such as a UIText or UIGraphic object). The following example demonstrates different ways to construct a UIColumnHeader object. // Construct a UIColumnHeader object that displays // the "Expenses" text string. By default, the // text is left-aligned and hot-tracked. UIColumnHeader ch1 = new UIColumnHeader("Expenses"); // Construct a UIColumnHeader object that displays // the "Revenue" string, centered in the control. UIColumnHeader ch2 = new UIColumnHeader(new UIText("Revenue", UIStatic.CENTERED)); // Construct a UIColumnHeader object that uses an // appropriate, right-aligned .gif file image (for example, // a "$" sign for "Profit"). URL docBase = getDocumentBase(); Image myDollarSign = getImage(docBase, "Profit.gif"); UIColumnHeader ch3 = new UIColumnHeader(new UIGraphic(myDollarSign, UIStatic.RIGHT)); When you use a UIGraphic object or an image in a UIColumnHeader, the header is sized to fit the image. // Create an array of UIColumnHeader objects // to pass to a UIColumnViewer object. UIColumnHeader financialReportHeadings [] = {ch1, ch2, ch3}; // Create the UIColumnViewer object that uses // the headings. UIColumnViewer cv1 = new UIColumnViewer(financialReportHeadings, listOfData); Note The hot-track color is the same color as the button text color. As a result, hot-tracking does not appear to be functional. UIComponent | +--UIContainer | +--UIStateContainer | +--UISingleContainer | +--UIThumb | +--UIScrollThumb | +--UIColumnHeader ConstructorsUIColumnHeaderpublic UIColumnHeader(); UIColumnHeaderpublic UIColumnHeader(String text); UIColumnHeaderpublic UIColumnHeader(IUIComponent comp); MethodsgetRoleCodepublic int getRoleCode(); isMovingpublic boolean isMoving(); isSizingpublic boolean isSizing(); isSizingLeftpublic boolean isSizingLeft(); isSizingRightpublic boolean isSizingRight(); mouseDownpublic boolean mouseDown(Event e, int x, int y);
|
© 1998 Microsoft Corporation. All rights reserved. Terms of use. |