示例#1
0
void MSLayout::computeSize(void)
{
  drawBackground();
  placement();
  positionLabel();
  drawShadow();  
}
示例#2
0
void ofxDatGuiComponent::setLabel(string label)
{
    if (mLabel.forceUpperCase) label = ofToUpper(label);
    mLabel.text = label;
    mLabel.rect = mFont->rect(mLabel.text);
    positionLabel();
}
示例#3
0
void MSLayout::updateTitle(void)
{
  undrawShadow();
  label()->freeze();
  label()->foreground(titleForeground());
  int h=label()->height();
  int w=label()->width();

  label()->font(titleFont());
  MSBoolean doPlacement=MSFalse;
  label()->label(title());
  int ml=label()->columns();
  if (ml==0&&label()->mapped()==MSTrue)
   {
     label()->unmap();
     doPlacement=MSTrue;
   }
  else if (ml>0&&label()->mapped()==MSFalse)
   {
     label()->map();
     doPlacement=MSTrue;
   }
  positionLabel();
  label()->unfreeze();
  if (label()->height()!=h||label()->width()!=w||doPlacement==MSTrue) adjustSize();
  else if (label()->mapped()==MSTrue) label()->redraw();
  drawShadow();
}
示例#4
0
void ofxDatGuiComponent::setWidth(int width, float labelWidth)
{
    mStyle.width = width;
    if (labelWidth > 1){
// we received a pixel value //
        mLabel.width = labelWidth;
    }   else{
// we received a percentage //
        mLabel.width = mStyle.width * labelWidth;
    }
    mIcon.x = mStyle.width - (mStyle.width * .05) - 20;
    mLabel.rightAlignedXpos = mLabel.width - mLabel.margin;
    for (int i=0; i<children.size(); i++) children[i]->setWidth(width, labelWidth);
    positionLabel();
}
示例#5
0
void ofxDatGuiComponent::setLabelAlignment(ofxDatGuiAlignment align)
{
    mLabel.alignment = align;
    for (int i=0; i<children.size(); i++) children[i]->setLabelAlignment(align);
    positionLabel();
}
示例#6
0
void KRenameListView::resizeEvent(QResizeEvent* e)
{
    QListView::resizeEvent( e );
    positionLabel();
}
示例#7
0
void MSLayout::configure(void)
{
  if (label()!=0) positionLabel();
}