Beispiel #1
0
    private void OnTabClicked(object sender, object context)
    {
        int  index      = (int)context;
        bool bTabOpened = false;

        for (int ii = 0; ii < m_tabPages.Length; ++ii)
        {
            NvUITabPage page = m_tabPages[ii];
            if (ii == index)
            {
                if (page.isOpened == false && page.isCreatable)
                {
                    //page.open();
                    bTabOpened = true;
                }

                if (m_tabContexts[ii].tabButton is NvUICheckbox)
                {
                    NvUICheckbox chkbox = m_tabContexts[ii].tabButton as NvUICheckbox;
                    chkbox.setChecked(true);
                }

                break;
            }
        }

        for (int ii = 0; ii < m_tabPages.Length; ++ii)
        {
            NvUITabPage page = m_tabPages[ii];
            if (ii != index)
            {
                if (page.isOpened && bTabOpened)
                {
                    mTabsNeedToBeClosed.Add(page);
                }

                if (m_tabContexts[ii].tabButton is NvUICheckbox)
                {
                    NvUICheckbox chkbox = m_tabContexts[ii].tabButton as NvUICheckbox;
                    chkbox.setChecked(false);
                }
            }
        }

        if (index >= 0)
        {
            m_tabPages[index].open();
        }

        //mTutorial.TutorialChkTabButton ( index );
    }
Beispiel #2
0
 public void activeTab(int index)
 {
     if (index >= 0 && index < m_tabPages.Length)
     {
         if (m_tabPages[index].isOpened == false)
         {
             NvUICheckbox chkbox = m_tabContexts[index].tabButton as NvUICheckbox;
             if (chkbox != null)
             {
                 chkbox.setChecked(true);
                 chkbox.SendMessage("OnClickWithoutSoundEffect");
             }
         }
     }
 }