亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? duallistmanager.cpp

?? 這是一個經典畢業設計
?? CPP
?? 第 1 頁 / 共 3 頁
字號:
//
//  Return value:
//
//		void 
//
//  Exceptions:		None
//
///////////////////////////////////////////////////////////////////////////////
void CDualListManager::AddItemToChoosenList(LPCTSTR lpszItem, long lItemData)
{
    m_ArrayChoosen.Add(lItemData);
    m_KeyMap.SetAt(lItemData, lpszItem);
}

///////////////////////////////////////////////////////////////////////////////
//
//  Method:			MoveAll
//
//  Purpose:		Moves all of the selected items from one listbox to the
//                  other.
//
//  Inputs:
//
//		CListBox & rLBFrom - listbox moving from
//
//		CArray<long, long> & rArrayFrom - array moving from
//
//		CArray<long, long> & rArrayTo - array moving to
//
//  Outputs:
//
//		None
//
//  Return value:
//
//		void 
//
//  Exceptions:		None
//
///////////////////////////////////////////////////////////////////////////////
void CDualListManager::MoveAll(CListBox & rLBFrom, CListBox & rLBTo, CArray<long, long> & rArrayFrom, CArray<long, long> & rArrayTo) 
{
    CString csName;

    // Move all of the remaining items in the listbox to the opposite array
    int iCount = rLBFrom.GetCount();
    for(int iIndex = 0; iIndex < iCount; ++iIndex)
    {
        long lVal = rLBFrom.GetItemData(iIndex);
        rArrayTo.Add(lVal);
    }

    // Clear the array of items we are clearing out
    rArrayFrom.RemoveAll();

    // Re-fill the listboxes with the contents of the array
    FillListboxes();

    // Select the first item in the to listbox
    SelectLBItem(rLBTo, 0);
}


///////////////////////////////////////////////////////////////////////////////
//
//  Method:			MoveSelected
//
//  Purpose:		Moves the selected items from one listbox and places them
//                  in the other listbox.
//
//  Inputs:
//
//		CListBox & rLBFrom - listbox moving from
//
//		CArray<long, long> & rArrayFrom - array moving from
//
//		CArray<long, long> & rArrayTo - array moving to
//
//		BOOL bRemoving - TRUE if we are removing items 
//                       FALSE if we are adding items
//
//  Outputs:
//
//		None
//
//  Return value:
//
//		void 
//
//  Exceptions:		None
//
///////////////////////////////////////////////////////////////////////////////
void CDualListManager::MoveSelected(CListBox & rLBFrom, CArray<long, long> & rArrayFrom, CArray<long, long> & rArrayTo, BOOL bRemoving)
{
    CArray<long, long>  SelectedArray;

    // Loops through all of the items in the from listbox 
    int iSelFirst = -1;
    int iCount    = rLBFrom.GetCount();
    for(int iIndex = 0; iIndex < iCount; ++iIndex)
    {
        // Check to see if this item is currently selected
        if( 0 < rLBFrom.GetSel( iIndex ) )
        {
            // Hang onto the first selected item in the list so we can keep
            // the item at that position selected.
            if(-1 == iSelFirst)
                iSelFirst = iIndex;

            // Get the item data for this item
            long lItemData = rLBFrom.GetItemData(iIndex);

            // Add the item data value to the list of selected items
            SelectedArray.Add(lItemData);

            // Add this item to the other array of items 
            rArrayTo.Add(lItemData);

            // Find this item in the array we are moving it out of and remove it
            int iCount2 = rArrayFrom.GetSize();
            for(int iIndex2 = 0; iIndex2 < iCount2; ++iIndex2)
            {
                if( lItemData == rArrayFrom[iIndex2] )
                {
                    rArrayFrom.RemoveAt(iIndex2);
                    break;
                }
            }
        }
    }

    // Re-fill the listboxes with the contents of the array
    FillListboxes(&SelectedArray, bRemoving);

    // Select one item in the from listbox at the location of the first 
    // selected item before the items were moved.
    if(-1 != iSelFirst)
    {
        SelectLBItem(rLBFrom, rLBFrom.GetCount() <= iSelFirst 
                              ? rLBFrom.GetCount() - 1 : iSelFirst);
    }
}

///////////////////////////////////////////////////////////////////////////////
//
//  Method:			MoveUpOrDown
//
//  Purpose:		Moves the hilighted items in the list of choosen items 
//                  either up or down depending on the value of the passed in
//                  flag.
//                  
//                  If more than one item is selected all of the items are
//                  moved as a block. If one or more items have reached the 
//                  top or bottom while other haven't those items stay at their
//                  current location and the other continue to move.
//
//  Inputs:
//
//		BOOL bMovingUp - TRUE if the items should be moved up
//                       FALSE if the items should be moved down
//
//  Outputs:
//
//		None
//
//  Return value:
//
//		void 
//
//  Exceptions:		None
//
///////////////////////////////////////////////////////////////////////////////
void CDualListManager::MoveUpOrDown(BOOL bMovingUp) 
{
    int                 iIndex, iIndex2, iCount, iCount2, iOffset, iInsertAt;
    int                 iIndexSelectedMarker = -1;
    long                lItemData;
    CString             csName;
    CArray<long, long>  SelectedArray;

    // Get the count of items in the list control
    iCount = m_ctrlChoosenList.GetCount();

    // Set the base loop index and the increment/decrement value based on the
    // direction the item are being moved (up or down).
    iIndex  = (TRUE  == bMovingUp) ? 0  : iCount - 1;
    iOffset = (TRUE  == bMovingUp) ? -1 : 1;
    
    // Loop through all of the items in the list.
    while( (TRUE  == bMovingUp && iIndex < iCount) || 
           (FALSE == bMovingUp && iIndex >= 0) )
    {
        // Check if this item is selected.
        if( 0 < m_ctrlChoosenList.GetSel( iIndex ) )
        {
            // Get the item data for this item
            lItemData = m_ctrlChoosenList.GetItemData(iIndex);

            // Build a list of the selected items so we can reselect them
            // later.
            SelectedArray.Add(lItemData);

            // Don't move selected items past other selected items
            if(-1 != iIndexSelectedMarker)
            {
                // Loop through the enabled list looking for the current item
                // which is identified by the item data value.
                iCount2 = m_ArrayChoosen.GetSize();

                for(iIndex2 = 0; iIndex2 < iCount2; ++iIndex2)
                {
                    // Find the index of this item in enabled list
                    if( lItemData == m_ArrayChoosen[iIndex2] )
                    {
                        // Remove the item from its current position
                        m_ArrayChoosen.RemoveAt(iIndex2);

                        // Reinsert the item in the array one space higher 
                        // than its previous position
                        iInsertAt = (iIndex2 + iOffset) < 0 ? 0 : iIndex2 + iOffset;
                        m_ArrayChoosen.InsertAt(iInsertAt, lItemData);
                        break;
                    }
                }
            }
        }
        // If this item wasn't selected save the index so we can check it later
        // so we don't move past the any selected items.
        else if(-1 == iIndexSelectedMarker)
        {
            iIndexSelectedMarker = iIndex;
        }

        iIndex = (TRUE  == bMovingUp) ? iIndex + 1 : iIndex - 1;
    }

    // Re-fill the listboxes with the contents of the array
    FillListboxes(&SelectedArray);
}

///////////////////////////////////////////////////////////////////////////////
//
//  Method:			FillListboxes
//
//  Purpose:		Fills both listboxes with the current contents of their
//                  associated arrays. This method also reselects the items
//                  in the passed in array of selected items in appropriate
//                  list.
//
//  Inputs:
//
//		CArray<long
//
//		long> * pSelectedArray
//
//		BOOL bRemoving
//
//  Outputs:
//
//		None
//
//  Return value:
//
//		void 
//
//  Exceptions:		None
//
///////////////////////////////////////////////////////////////////////////////
void CDualListManager::FillListboxes(CArray<long, long> * pSelectedArray, BOOL bRemoving)
{
    int     iIndex, iIndex2, iCount;
    CString csName;

    // Clear and refill the listbox of disabled commands from the disabled
    // command array.
    m_ctrlAvailableList.ResetContent();
    iCount = m_ArrayAvailable.GetSize();
    for(iIndex = 0; iIndex < iCount; ++iIndex)
    {
        m_KeyMap.Lookup(m_ArrayAvailable[iIndex], csName);
        iIndex2 = m_ctrlAvailableList.AddString(csName);
        m_ctrlAvailableList.SetItemData(iIndex2, m_ArrayAvailable[iIndex]);
    }

    // Clear and refill the listbox of enabled commands from the enabled
    // command array.
    m_ctrlChoosenList.ResetContent();
    iCount = m_ArrayChoosen.GetSize();
    for(iIndex = 0; iIndex < iCount; ++iIndex)
    {
		long l=m_ArrayChoosen[iIndex];
        m_KeyMap.Lookup(m_ArrayChoosen[iIndex], csName);
        iIndex2 = m_ctrlChoosenList.AddString(csName);
        m_ctrlChoosenList.SetItemData(iIndex2, m_ArrayChoosen[iIndex]);
    }

    // Now reselect the items that were selected before we moved them.
    if(NULL != pSelectedArray)
    {
        iCount = pSelectedArray->GetSize();
        for(iIndex = 0; iIndex < iCount; ++iIndex)
        {
            m_KeyMap.Lookup(pSelectedArray->GetAt(iIndex), csName);
            if(TRUE == bRemoving)
            {
                iIndex2 = m_ctrlAvailableList.FindStringExact(-1, csName);
                SelectLBItem(m_ctrlAvailableList, iIndex2);
            }
            else
            {
                iIndex2 = m_ctrlChoosenList.FindStringExact(-1, csName);
                SelectLBItem(m_ctrlChoosenList, iIndex2);
            }
        }
    }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品国产77777蜜臀| 国产精品女人毛片| 欧美激情综合五月色丁香| 日韩美女久久久| 五月天精品一区二区三区| 国产精品一区免费视频| 日本精品一区二区三区四区的功能| 欧美另类一区二区三区| 国产欧美日韩在线观看| 亚洲成人1区2区| 国产精品一区久久久久| 欧美性受xxxx黑人xyx性爽| 精品国产一二三区| 亚洲欧美精品午睡沙发| 久久精品国产亚洲高清剧情介绍 | 日韩一区二区三区视频在线观看| 国产丝袜欧美中文另类| 亚洲va韩国va欧美va精品 | 国产精品久久看| 日韩电影一区二区三区四区| 成人av影院在线| 欧美巨大另类极品videosbest | 国产成人在线免费| 欧美久久一区二区| 中文字幕一区二区三区在线播放| 日韩激情一区二区| 99re在线视频这里只有精品| 欧美一级在线视频| 一区二区三区久久久| 国产经典欧美精品| 日韩欧美在线综合网| 一级日本不卡的影视| 成人福利视频在线看| 日韩一级大片在线| 一区二区不卡在线播放 | 亚洲色图.com| 国产黄色91视频| 日韩视频一区二区三区在线播放| 亚洲欧洲综合另类| 国产馆精品极品| 精品国产伦一区二区三区观看方式| 亚洲成人自拍一区| 在线亚洲人成电影网站色www| 亚洲国产精品t66y| 国产精品99久| 欧美精品一区二| 美国精品在线观看| 91精品国产综合久久精品app| 亚洲女爱视频在线| av亚洲精华国产精华精华| 久久午夜色播影院免费高清 | 日韩免费高清av| 五月天激情小说综合| 色美美综合视频| 中文字幕在线不卡一区二区三区| 国产精品亚洲成人| 久久久久国产精品厨房| 久久99精品久久久久| 91精品国产入口| 婷婷国产v国产偷v亚洲高清| 色婷婷av久久久久久久| 亚洲免费观看高清完整版在线观看 | www.欧美日韩| 国产欧美精品区一区二区三区| 激情国产一区二区 | 国产成人精品三级| 国产拍欧美日韩视频二区| 国产在线播精品第三| 精品国产伦一区二区三区免费| 久久精品国产成人一区二区三区| 日韩欧美色电影| 激情五月婷婷综合网| 26uuuu精品一区二区| 国产精品一二一区| 国产精品欧美经典| 色综合久久中文字幕| 一区二区在线看| 欧美三级资源在线| 视频一区二区国产| 精品国产不卡一区二区三区| 久久成人羞羞网站| 国产清纯白嫩初高生在线观看91| 成人免费va视频| 国产精品日产欧美久久久久| 99久久久久久99| 亚洲一区精品在线| 91精品国产全国免费观看| 老司机精品视频线观看86| 久久久久九九视频| 成人国产亚洲欧美成人综合网| 亚洲三级在线免费观看| 欧美视频一区二区三区在线观看| 视频一区二区三区在线| 久久综合成人精品亚洲另类欧美 | 国产精品久久久久久户外露出| 97久久人人超碰| 亚洲动漫第一页| 欧美sm极限捆绑bd| 国产高清精品久久久久| 亚洲欧美电影一区二区| 制服丝袜日韩国产| 国产精品一区二区三区99 | 欧美日韩一区二区三区免费看 | 精品久久久久久无| 成人一区二区三区| 一区二区三区鲁丝不卡| 日韩免费观看2025年上映的电影| 国产91综合网| 亚洲gay无套男同| 久久色在线视频| 一本到高清视频免费精品| 色综合久久天天综合网| 日韩成人一区二区| 久久精品日产第一区二区三区高清版| 91视频精品在这里| 日韩高清一级片| 中文在线一区二区| 欧美午夜精品免费| 国产一区二区免费视频| 亚洲精品国产精华液| 欧美精品一二三区| 不卡大黄网站免费看| 欧美aaaaa成人免费观看视频| 欧美国产精品v| 欧美日韩国产首页| 成人免费三级在线| 理论片日本一区| 一区二区三区在线播| 久久久久久久久久久久久夜| 日本高清不卡在线观看| 狠狠色丁香久久婷婷综合_中| 亚洲欧美日韩一区二区三区在线观看| 日韩一级高清毛片| 在线亚洲一区观看| 成人午夜电影网站| 久久成人免费网| 婷婷一区二区三区| 亚洲欧洲性图库| 国产亚洲视频系列| 91精品麻豆日日躁夜夜躁| av不卡在线观看| 国产在线麻豆精品观看| 亚洲国产视频在线| 亚洲色图在线看| 久久九九国产精品| 欧美xxxxxxxx| 欧美日韩国产一二三| 色就色 综合激情| 成人国产精品免费观看| 国产毛片精品视频| 久久国产夜色精品鲁鲁99| 夜夜爽夜夜爽精品视频| 日韩毛片精品高清免费| 国产嫩草影院久久久久| 精品国产麻豆免费人成网站| 6080午夜不卡| 欧美另类videos死尸| 在线免费观看日本一区| 99久久久免费精品国产一区二区| 国产成人午夜高潮毛片| 久久精品噜噜噜成人av农村| 丝袜a∨在线一区二区三区不卡 | 一本高清dvd不卡在线观看| 粉嫩久久99精品久久久久久夜| 国产一区啦啦啦在线观看| 美女国产一区二区三区| 蜜芽一区二区三区| 日韩av一区二区在线影视| 亚洲444eee在线观看| 亚洲成人免费看| 日韩精品一级中文字幕精品视频免费观看 | 理论电影国产精品| 免费在线观看不卡| 日韩国产精品久久久久久亚洲| 亚洲精品日日夜夜| 一级精品视频在线观看宜春院| 亚洲精品日韩一| 一区二区三区欧美日韩| 一区二区在线观看视频| 亚洲你懂的在线视频| 一区二区三区日韩精品视频| 亚洲精品综合在线| 亚洲综合丝袜美腿| 亚洲成人你懂的| 天天av天天翘天天综合网色鬼国产 | 国产很黄免费观看久久| 国产精品亚洲成人| 成人午夜视频在线| 欧美日韩精品一区二区天天拍小说 | 精品国产乱码久久久久久牛牛| 日韩欧美中文字幕一区| 精品91自产拍在线观看一区| 精品久久久久99| 久久蜜桃av一区二区天堂| 久久久久久久久久久久久女国产乱| 久久久一区二区| 国产精品女同一区二区三区| 亚洲欧洲综合另类| 午夜精品久久久久久久蜜桃app| 男人的j进女人的j一区|