コード例 #1
0
void CSkeletonActionExpDlg::OnBnClickedActionAdd()
{
    // TODO: Add your control notification handler code here
    sActionInfo_t action;
    UpdateData();
    action.m_ActionType  = GetActionType();
    action.m_iFirstFrame = m_iStartFrame;
    action.m_iLastFrame  = m_EndFrame;
    action.m_lTime       = m_iDurationTime;
    if(m_iDurationTime == 0)
    {
        int tickt_per_frame = GetTicksPerFrame();
        int iMaxTime = (m_EndFrame - m_iStartFrame + 1 ) * tickt_per_frame;
        float vTime = CMaxEnv::singleton().TicksToSeconds(iMaxTime);
        action.m_lTime       =  vTime * 1000;
        m_iDurationTime = action.m_lTime;
    }
	WGetWndText(&m_ctrlActionName , action.m_Name,32);

    if(wcslen(action.m_Name) == 0)
    {
        ::MessageBoxA(::GetActiveWindow(),"请填写动作名字","错误",MB_OK);
        return ;
    }
    if(m_iDurationTime <= 0)
    {
        ::MessageBoxA(::GetActiveWindow(),"动作时间不能为0","错误",MB_OK);
        return ;
    }
    InsertAction(action, true); 
    
}
コード例 #2
0
void
nsMathMLmactionFrame::Init(nsIContent*      aContent,
                           nsIFrame*        aParent,
                           nsIFrame*        aPrevInFlow)
{
  // Init our local attributes

  mChildCount = -1; // these will be updated in GetSelectedFrame()
  mActionType = GetActionType(aContent);

  // Let the base class do the rest
  return nsMathMLSelectedFrame::Init(aContent, aParent, aPrevInFlow);
}
コード例 #3
0
NS_IMETHODIMP
nsMathMLmactionFrame::AttributeChanged(int32_t  aNameSpaceID,
                                       nsIAtom* aAttribute,
                                       int32_t  aModType)
{
  bool needsReflow = false;

  if (aAttribute == nsGkAtoms::actiontype_) {
    // updating mActionType ...
    int32_t oldActionType = mActionType;
    mActionType = GetActionType(mContent);

    // Initiate a reflow when actiontype classes are different.
    if ((oldActionType & NS_MATHML_ACTION_TYPE_CLASS_BITMASK) !=
          (mActionType & NS_MATHML_ACTION_TYPE_CLASS_BITMASK)) {
      needsReflow = true;
    }
  } else if (aAttribute == nsGkAtoms::selection_) {
    if ((mActionType & NS_MATHML_ACTION_TYPE_CLASS_BITMASK) == 
         NS_MATHML_ACTION_TYPE_CLASS_USE_SELECTION) {
      needsReflow = true;
    }
  } else {
    // let the base class handle other attribute changes
    return 
      nsMathMLContainerFrame::AttributeChanged(aNameSpaceID, 
                                               aAttribute, aModType);
  }

  if (needsReflow) {
    PresContext()->PresShell()->
      FrameNeedsReflow(this, nsIPresShell::eTreeChange, NS_FRAME_IS_DIRTY);
  }

  return NS_OK;
}
コード例 #4
0
void CSkeletonActionExpDlg::LoadActionList(const wchar_t* fileName , bool FilterByFile)
{
    xXmlDocument doc;
    if(doc.load( fileName , true ) == false)
        return ;

    m_ActionXmlList.clear();
    xXmlNode* pNode = doc.root();
    if(pNode == NULL)
        return ;

    CStr MaxFile = CMaxEnv::singleton().m_pInterace->GetCurFileName();
    wchar_t wcsMaxFileName [1024] = {0};
    XEvol_LocaleToUnicode(MaxFile.data() , wcsMaxFileName , 1024);
    std::wstring maxFileName = xFileSystem::singleton()->getFileName(wcsMaxFileName).c_str();


    xXmlNode::XmlNodes nodes;
    pNode->findNode(L"动作" , nodes);
    size_t nAction = nodes.size();
    for(size_t i = 0 ; i < nAction ; i ++)
    {
        xXmlNode* pActNode = nodes[i];
        if(pActNode->value(L"MaxFile") == NULL || pActNode->value(L"MaxFile") == maxFileName || FilterByFile == false )
        {
            sActionInfo_t action;
            action.m_ActionType  = GetActionType();
            action.m_iFirstFrame = pActNode->int_value(L"StartFrame");
            action.m_iLastFrame  = pActNode->int_value(L"EndFrame");
            if(action.m_iFirstFrame > action.m_iLastFrame )
            {
                int _v = action.m_iFirstFrame;
                action.m_iFirstFrame = action.m_iLastFrame;
                action.m_iLastFrame = _v;
            }
            action.m_lTime       = pActNode->int_value(L"DurTime");
            wcsncpy(action.m_Name  , pActNode->value(L"ActionName") , 32);
            action.m_nFrame      = action.m_iLastFrame - action.m_iFirstFrame + 1;
            if(action.m_lTime == 0)
            {
                int tickt_per_frame = GetTicksPerFrame();
                int iMaxTime = (action.m_iLastFrame - action.m_iFirstFrame + 1 ) * tickt_per_frame;
                float vTime = CMaxEnv::singleton().TicksToSeconds(iMaxTime);
                action.m_lTime       =  vTime * 1000;
            }
            InsertAction(action , true); 

            xActionXMLInfo _info;
            _info.m_MaxFile = pActNode->value(L"MaxFile") ? pActNode->value(L"MaxFile") : maxFileName.c_str();
            _info.m_Name    = action.m_Name;
            _info.m_nFirst  = pActNode->int_value(L"StartFrame");
            _info.m_nLast   = pActNode->int_value(L"EndFrame");
            _info.m_DurTime = 0;
            if(pActNode->value(L"DurTime") )
            {
                _info.m_DurTime = pActNode->int_value(L"DurTime");
            }
            m_ActionXmlList.push_back(_info);
        }
    }
    return ;
}