源码:
public class ProductListCanvas extends WorkSpace implements IActionListener {
private int index;
private Container conCenter = new Container();
private AppTabedPane apptab = new AppTabedPane();
private int x,x1;
private int position,numTime;
public ProductListCanvas(int index) {
this.super_workSpace();
this.index = index;
setBackgroundImage(Skin.IMG_BG);
Rect tabArea = calculateTabArea();
int w = m_tabSBg.getWidth();
int w2 = m_tabSBg2.getWidth();
Vector titles = m_tabed.m_titles;
g.setFont(getWidgetFont());
int x = tabArea.x+4;
//for循环和下面的paintTab()方法注释后,好像不影响7.6
for (int i = 0; i < titles.size(); i++) {
boolean isSelected = (i == m_tabed.getSelectedIndex());
if(titles.size() == 4){
paintTab(g, isSelected, (String) titles.elementAt(i), x, tabArea.y,
w2, tabArea.height,true);
x += w2+4;
}
g.drawPicture(tabBgs, x + (w >> 1), y + (h >> 1), Base.HCENTER
| Base.VCENTER);
g.drawString(title, x + (w >> 1), y + (h >> 1), Base.HCENTER
| Base.VCENTER);
// if(isFocuesd() && isSelected){
// g.setStrokeStyle(Base.SOLID);
// g.setColor(getBorderColor());
// g.drawRect(x + 2, y + 5, w - 5, h - 7);
// }
}