예제 #1
0
wxInputStream &NassiSwitchBrick::Deserialize(wxInputStream &stream)
{
    wxTextInputStream inp(stream);
    wxUint32 count;
    inp >> count;
    wxString str;
    wxArrayString arstr;
    for (wxUint32 n = 0 ; n < 2*count+2 ; n++ )
    {
        DeserializeString( stream, str );
        //SetTextByNumber(str, n);
        arstr.Add(str);
    }
    for ( wxUint32 n = 0; n < count ; n++ )
    {
        AddChild(n);
        SetChild(NassiBrick::SetData(stream), n);
    }
    for ( wxUint32 n = 0 ; n < arstr.GetCount() ; n++ )
    {
        SetTextByNumber(arstr[n], n);
    }

    SetNext(NassiBrick::SetData(stream));
    return stream;
}
예제 #2
0
XMLTreeNode::XMLTreeNode(XMLTreeNode *prnt, char *typ, char *dta, unsigned int dtaSize, XMLTreeNode *cld, XMLTreeNode *nxt)
{
	attributes=0;
	type=0;

	SetType(typ);
	SetData(dta, dtaSize);
	SetChild(cld);
	SetNext(nxt);
	SetMatchingMode(prnt?prnt->mmode:MATCH_CASE);
	SetParent(prnt);
}
예제 #3
0
/*! \brief Constructor.
 *
 * \param parent wxWindow*				The parent window.
 * \param id 		const wxWindowID	The ID of this window.
 * \param date 	wxDateTime&			The date to display on the button.
 * \param pos 	const wxPoint&			The button's position.
 * \param size 	const wxSize&			The button's size.
 * \param style 	const longint				The button's style.
 *
 */
mmDropMonth::mmDropMonth(wxWindow *parent,
                         const wxWindowID  id,
                         const wxDateTime &date,
                         const wxPoint    &pos,
                         const wxSize     &size,
                         const long int    style)
    : mmDropWindow(parent, id, wxT(" ") + date.FormatISODate() + wxT(" "), wxNullBitmap, pos, wxSize(80, 30), style | wxNO_BORDER | mmMB_DROPDOWN, NULL, size)
{
    mUpdateLabel = mStyle & mmDROPMONTH_UPDATE_LABEL;
    mMonthCtrl = new mmMonthCtrl(this, ID_MONTH_CTRL, date, wxDefaultPosition, size, wxRAISED_BORDER | mmPREV_BTN | mmNEXT_BTN | mmSHOW_ALL | mmRESCALE_FONTS);
    SetChild(mMonthCtrl, size);
} // Constructor
예제 #4
0
void Value::ChildChanged(Value* pvalue, Value* pvalueNew)
{
    if (pvalueNew != NULL) {
        int count = m_pchildren.GetCount();
        for (int index = 0; index < count; index++) {
            if (pvalue == m_pchildren[index]) {
                SetChild(index, pvalueNew);
            }
        }

        // !!! DoFold();
    }

    Changed();
}
예제 #5
0
wxInputStream &NassiIfBrick::Deserialize(wxInputStream &stream)
{
    wxTextInputStream inp(stream);
    wxString str;
    for (wxUint32 n = 0 ; n < 6 ; n++ )
    {
        DeserializeString(stream, str);
        SetTextByNumber(str, n);
    }
    for ( wxUint32 n = 0; n < 2 ; n++ )
        SetChild(NassiBrick::SetData(stream), n);

    SetNext(NassiBrick::SetData(stream));
    return stream;
}
예제 #6
0
NassiSwitchBrick::NassiSwitchBrick(const NassiSwitchBrick &rhs):
    NassiBrick()
{
    nChilds = 0;
    for ( wxUint32 k = 0 ; k < rhs.GetChildCount() ; k++ )
    {
        AddChild(k);
        if ( rhs.GetChild(k) )
            SetChild( rhs.GetChild(k)->Clone()  , k);
    }
    for ( wxUint32 n = 0 ; n < 2 + 2*rhs.GetChildCount() ; n++ )
        SetTextByNumber(*(rhs.GetTextByNumber(n)), n);
    if ( rhs.GetNext() )
        SetNext( rhs.GetNext()->Clone()  );
}
void CXTPMarkupDecorator::SetContentObject(CXTPMarkupBuilder* pBuilder, CXTPMarkupObject* pContent)
{
	if (!pContent->IsKindOf(MARKUP_TYPE(CXTPMarkupUIElement)))
	{
		pBuilder->ThrowBuilderException(CXTPMarkupBuilder::FormatString(_T("'%ls' object cannot be added to '%ls'. Object cannot be converted to type 'CXTPMarkupUIElement'"),
			(LPCTSTR)pContent->GetType()->m_lpszClassName, (LPCTSTR)GetType()->m_lpszClassName));
	}

	if (m_pChild != NULL)
	{
		pBuilder->ThrowBuilderException(CXTPMarkupBuilder::FormatString(_T("'%ls' already has a child and cannot add ")
			_T("'%ls'. '%ls' can accept only one child."),
			(LPCTSTR)GetType()->m_lpszClassName, (LPCTSTR)pContent->GetType()->m_lpszClassName, (LPCTSTR)GetType()->m_lpszClassName));
	}

	SetChild((CXTPMarkupUIElement*)pContent);
}
예제 #8
0
 virtual void SetString(const ZString& str)
 {
     StringPane::SetString(str);
     SetChild(0, new StringValue(str));
 }
예제 #9
0
 void   SetImage(Image* pimage) { SetChild(0, pimage); }
예제 #10
0
void ScaleTransform2::SetScale(PointValue* ppoint)
{
    SetChild(0, ppoint);
}
예제 #11
0
void TranslateTransform2::SetTranslate(PointValue* ppoint)
{
    SetChild(0, ppoint);
}
U2SpatialPtr U2ConvexRegionMgr::AttachOutsideScene(U2Spatial* pOutside)
{
	return SetChild(1, pOutside);
}
예제 #13
0
U2SpatialPtr U2BspNode::AttachBackChild(U2Spatial* pChild)
{
	return SetChild(2, pChild);
}
예제 #14
0
U2SpatialPtr U2BspNode::AttachCoplanarChild(U2Spatial* pChild)
{
	return SetChild(1, pChild);
}
예제 #15
0
U2SpatialPtr U2BspNode::AttachFrontChild(U2Spatial *pChild)
{
	return SetChild(0, pChild);
}
예제 #16
0
파일: Test.c 프로젝트: mustafabar/CS291
int main()
{
  printf("\nRunning Parition of Unity Test 2\n");
  Forest *F = malloc(sizeof(Forest)) ;
  if(F == NULL)
    {
      fprintf(stderr,"Forest not allocated\n") ;
    }

  Initialize(18,F) ;

  SetChild(3,6,F) ;
  SetChild(0,3,F) ;
  SetChild(8,6,F) ;
  SetChild(7,8,F) ;
  SetChild(2,8,F) ;
  SetChild(4,8,F) ;
  SetChild(1,7,F) ;
  SetChild(5,7,F) ;
  
  SetChild(9,11,F) ;
  SetChild(10,9,F) ;
  SetChild(14,9,F) ;
  SetChild(12,14,F) ;
  SetChild(13,14,F) ;

  int i ;
  for(i=0;i<18;i++)
    {
      fprintf(stderr,"%d ",F->Nodes[i]) ;
    }
  fprintf(stderr,"\n") ;

  for(i=0;i<18;i++)
    {
      if(F->Nodes[i] != -2)
	{
	  fprintf(stderr,"Size of subtree %d = %d\n",i,GetSizeTree(i,F)) ;
	}
    }

  int r,flag ;
  for(i=0;i<18;i++)
    {
      flag=GetRoot(i,&r,F) ;
      if(flag)
	{
	  fprintf(stderr,"Root of subtree %d = %d\n",i,r) ;
	}
      else
	{
	  fprintf(stderr,"%d is not a node\n",i) ;
	}
    }
	
	return 0;
}
예제 #17
0
void RotateTransform2::SetAngle(Number* pangle)
{
    SetChild(0, pangle);
}
CXTPMarkupDecorator::~CXTPMarkupDecorator()
{
	SetChild(NULL);
}