Beispiel #1
0
void MSTableColumn::clipMode(MSClipMode clipMode_)
{
  if (clipMode()!=clipMode_ && clipMode_!=MSClipIndicator)
   {
     _clipMode=clipMode_;
     redraw();
   }
}
Beispiel #2
0
int MSTableColumn::columnPixelWidth(void)
{
  if (table()!=0)
   {
     unsigned len=columnWidth();
     int cw=(clipMode()==MSNoClipping)?charWidth('W'):charWidth('0');
     return (len*cw+2*table()->columnSpacing());
   }
  else return 0;
}
Beispiel #3
0
void Clipper::splitClip() {
	if (clipMode() && valid()) {
		Vector3 planepts[3];
		AABB bounds(Vector3(0, 0, 0), Vector3(64, 64, 64));
		getPlanePoints(planepts, bounds);

		splitBrushes(planepts[0], planepts[1], planepts[2], eFrontAndBack);

		reset();
		update();
	}
}
Beispiel #4
0
void Clipper::splitSelectedCmd(const cmd::ArgumentList& args) {
	if (clipMode()) {
		UndoableCommand undo("clipperSplit");
		splitClip();
	}
}
Beispiel #5
0
void Clipper::clipSelectionCmd(const cmd::ArgumentList& args) {
	if (clipMode()) {
		UndoableCommand undo("clipperClip");
		clip();
	}
}
Beispiel #6
0
MSAttrValueList& MSTableColumn::get(MSAttrValueList& avList_)
{
  MSStringVector aBoolVector("MSFalse\nMSTrue");
  avList_<<MSAttrValue("tag",tag().symbolName(),MSAttrValue::Control|MSAttrValue::String);
  avList_<<MSAttrValue("heading",MSAttrValue::stringVectorToString(heading()),MSAttrValue::String);
  avList_<<MSAttrValue("headingForeground",server()->colorName(headingForeground()),MSAttrValue::Color);
  avList_<<MSAttrValue("headingFont",server()->fontName(headingFont()),MSAttrValue::Font);
  MSStringVector alignmentVector("MSNone\nMSCenter\nMSTop\nMSBottom\nMSLeft\nMSRight");
  avList_<<MSAttrValue("headingAlignment",MSAttrValue::alignmentToString(headingAlignment()),
                       alignmentVector, MSAttrValue::List);
  avList_<<MSAttrValue("cycleColors",MSAttrValue::colorVectorToString(cycleColors(),server()),
                       MSAttrValue::Color|MSAttrValue::List|MSAttrValue::StringVector);
  const char *value;
  switch (cycleColorMode())
  {
  case MSBackground:   value="MSBackground";   break;
  case MSReverseVideo: value="MSReverseVideo"; break;
  case MSForeground:
  default:             value="MSForeground";   break;
  }
  avList_<<MSAttrValue("cycleColorMode",value, MSStringVector("MSBackground\nMSForeground\nMSReverseVideo"));
  switch (columnAlignment())
   {
   case MSCenter:  value="MSCenter"; break;
   case MSLeft:    value="MSLeft";   break;
   case MSRight:
   default:        value="MSRight";  break;
   }
  avList_<<MSAttrValue("columnAlignment",value,MSStringVector("MSLeft\nMSRight\nMSCenter"));
  MSStringVector clipModeVector("MSNoClipping\nMSClipStars");
  if(clipMode()==MSClipStars) value="MSClipStars";
  else value="MSNoClipping";
  avList_<<MSAttrValue("clipMode",value,clipModeVector);
  avList_<<MSAttrValue("columnWidth",MSString(columnWidth()));
  avList_<<MSAttrValue("editWidth",MSString(editWidth()));
  avList_<<MSAttrValue("resizable",resizable()==MSTrue?"MSTrue":"MSFalse",aBoolVector);
  avList_<<MSAttrValue("format",format().asString(),format().formats(),MSAttrValue::String);

  avList_<<MSAttrValue("breakOn",breakOn()==MSTrue?"MSTrue":"MSFalse",aBoolVector);
  
  MSStringVector modes="MSP::Total\nMSP::Minimum\nMSP::Maximum\nMSP::Average";
  MSUnsignedLongVector modeValues;
  modeValues.append(MSP::Total);
  modeValues.append(MSP::Minimum);
  modeValues.append(MSP::Maximum);
  modeValues.append(MSP::Average);

  MSString result=MSAttrValue::enumToString(breakProcessMode(),modes,modeValues,modes(0),MSTrue);
  
  avList_<<MSAttrValue("breakProcessMode",result,modes);
  avList_<<MSAttrValue("breakProcessOn",breakProcessOn()==MSTrue?"MSTrue":"MSFalse",aBoolVector);
  avList_<<MSAttrValue("breakBg",server()->colorName(breakBgPixel()),MSAttrValue::Color);
  avList_<<MSAttrValue("breakFg",server()->colorName(breakFgPixel()),MSAttrValue::Color);
//  avList_<<MSAttrValue("breakFont",server()->fontName(breakFont()),MSAttrValue::Font);
  avList_<<MSAttrValue("suppressDuplicate",suppressDuplicate()==MSTrue?"MSTrue":"MSFalse",aBoolVector);

  avList_<<MSAttrValue("columnresize","",MSAttrValue::Callback);
  avList_<<MSAttrValue("valueQuoted",valueQuoted()==MSTrue?"MSTrue":"MSFalse",aBoolVector);
  avList_<<MSAttrValue("choices",MSAttrValue::stringVectorToString(choices()),MSAttrValue::StringVector);
  return MSWidget::get(avList_);
}
Beispiel #7
0
void MSTableColumn::set(MSAttrValueList& avList_)
{
  MSWidget::set(avList_);
  MSIndexVector index;
  for (unsigned i=0;i<avList_.length();i++)
   {
     if (avList_[i].attribute()=="breakOn")
      {
       breakOn(avList_[i].value().asBoolean());
       index<<i;
      }
     else if (avList_[i].attribute()=="suppressDuplicate")
      {
       suppressDuplicate(avList_[i].value().asBoolean());
       index<<i;
      }
/*     else if (avList_[i].attribute()=="breakFont")
      {
	breakFont(avList_[i].value());
	index<<i;
      }
      */
     else if (avList_[i].attribute()=="breakFg")
      {
	if(avList_[i].value().length()!=0) breakFg(avList_[i].value());
	index<<i;
      }
     else if (avList_[i].attribute()=="breakBg")
      {
  	if(avList_[i].value().length()!=0) breakBg(avList_[i].value());
	index<<i;
      }
     else if (avList_[i].attribute()=="breakProcessOn")
      {
	breakProcessOn(avList_[i].value().asBoolean());
	index<<i;
      }
     else if (avList_[i].attribute()=="breakProcessMode")
      {
       MSStringVector modes="MSP::Total\nMSP::Minimum\nMSP::Maximum\nMSP::Average";
       MSUnsignedLongVector modeValues;
       modeValues.append(MSP::Total);
       modeValues.append(MSP::Minimum); 
       modeValues.append(MSP::Maximum);
       modeValues.append(MSP::Average);

       unsigned long mode=MSAttrValue::stringToEnum(avList_[i].value(),modes,modeValues,MSP::Total,MSTrue);
       breakProcessMode((MSP::BreakProcessMode)mode);
       index<<i;
      }
     else if (avList_[i].attribute()=="heading")
      {
	heading(MSAttrValue::stringToStringVector(avList_[i].value()));
	index<<i;
      }
     else if (avList_[i].attribute()=="headingForeground")
      {
	headingForeground(avList_[i].value());
	index<<i;
      }
     else if (avList_[i].attribute()=="headingFont")
      {
	headingFont(avList_[i].value());
	index<<i;
      }
     else if (avList_[i].attribute()=="headingAlignment")
      {
	headingAlignment(MSAttrValue::stringToAlignment(avList_[i].value()));
	index<<i;
      }
     else if (avList_[i].attribute()=="cycleColors")
      {
        cycleColors(MSAttrValue::stringToStringVector(avList_[i].value()));
	index<<i;
      }
     else if (avList_[i].attribute()=="cycleColorMode")
      {
	if (avList_[i].value()=="MSBackground") cycleColorMode(MSBackground);
	else if (avList_[i].value()=="MSReverseVideo") cycleColorMode(MSReverseVideo);
	else cycleColorMode(MSForeground);
	index<<i;
      }
     else if (avList_[i].attribute()=="clipMode")
      {
	if (avList_[i].value()=="MSClipStars") clipMode(MSClipStars);
	else clipMode(MSNoClipping);
	index<<i;
      }
     else if (avList_[i].attribute()=="columnAlignment")
      {
	if (avList_[i].value()=="MSRight") columnAlignment(MSRight);
	else if (avList_[i].value()=="MSLeft") columnAlignment(MSLeft);
	else columnAlignment(MSCenter);
	index<<i;
      }
     else if (avList_[i].attribute()=="columnWidth")
      {
	columnWidth(avList_[i].value().asInt());
	index<<i;
      }
     else if (avList_[i].attribute()=="editWidth")
      {
	editWidth(avList_[i].value().asInt());
	index<<i;
      }
     else if (avList_[i].attribute()=="resizable")
      {
	resizable(avList_[i].value().asBoolean());
	index<<i;
      }
     else if (avList_[i].attribute()=="format")
      {
	format(MSFormat(avList_[i].value()));
	index<<i;
      }
     else if(avList_[i].attribute()=="tag")
      {
        if(avList_[i].value().length()==0) tag(MSSymbol::nullSymbol());
        else tag(MSSymbol(avList_[i].value()));
        index<<i;
      }
     else if (avList_[i].attribute()=="valueQuoted")
      {
        valueQuoted(avList_[i].value().asBoolean());
        index<<i;
      }
     else if (avList_[i].attribute()=="choices")
      {
        choices(MSAttrValue::stringToStringVector(avList_[i].value()));
        index<<i;
      }
   }
  avList_.remove(index);
}