#include "bi_cdt.h"

#include <afxwin.h>

namespace roy {

    namespace ih {

        bi_cdt::bi_cdt(const ref_ptr_Cdt& cdt1, const ref_ptr_Cdt& cdt2)
        {
            if (cdt1 == NULL || cdt2 == NULL) {
                assert(false);
            }

            _cdt[0] = cdt1;
            _cdt[1] = cdt2;
        }

        void bi_cdt::OnEntering(void)
        {
            _cdt[0]->OnEntering();
            _cdt[1]->OnEntering();
        }

        void bi_cdt::OnLeaving(void)
        {
            _cdt[0]->OnLeaving();
            _cdt[1]->OnLeaving();
        }

        bool bi_cdt::OnLButtonDown(UINT nFlags, CPoint point)
        {
            _cdt[0]->OnLButtonDown(nFlags, point);
            _cdt[1]->OnLButtonDown(nFlags, point);

            return false;
        }

        bool bi_cdt::OnLButtonUp(UINT nFlags, CPoint point)
        {
            _cdt[0]->OnLButtonUp(nFlags, point);
            _cdt[1]->OnLButtonUp(nFlags, point);

            return false;
        }

        bool bi_cdt::OnLButtonDblClk(UINT nFlags, CPoint point)
        {
            _cdt[0]->OnLButtonDblClk(nFlags, point);
            _cdt[1]->OnLButtonDblClk(nFlags, point);

            return false;
        }

        bool bi_cdt::OnRButtonDown(UINT nFlags, CPoint point)
        {
            _cdt[0]->OnRButtonDown(nFlags, point);
            _cdt[1]->OnRButtonDown(nFlags, point);

            return false;
        }

        bool bi_cdt::OnRButtonUp(UINT nFlags, CPoint point)
        {
            _cdt[0]->OnRButtonUp(nFlags, point);
            _cdt[1]->OnRButtonUp(nFlags, point);

            return false;
        }
        
        bool bi_cdt::OnRButtonDblClk(UINT nFlags, CPoint point)
        {
            _cdt[0]->OnRButtonDblClk(nFlags, point);
            _cdt[1]->OnRButtonDblClk(nFlags, point);

            return false;
        }

        bool bi_cdt::OnMButtonDown(UINT nFlags, CPoint point)
        {
            _cdt[0]->OnMButtonDown(nFlags, point);
            _cdt[1]->OnMButtonDown(nFlags, point);

            return false;
        }

        bool bi_cdt::OnMButtonUp(UINT nFlags, CPoint point)
        {
            _cdt[0]->OnMButtonUp(nFlags, point);
            _cdt[1]->OnMButtonUp(nFlags, point);

            return false;
        }

        bool bi_cdt::OnMButtonDblClk(UINT nFlags, CPoint point)
        {
            _cdt[0]->OnMButtonDblClk(nFlags, point);
            _cdt[1]->OnMButtonDblClk(nFlags, point);

            return false;
        }

        bool bi_cdt::OnMouseMove(UINT nFlags, CPoint point)
        {
            _cdt[0]->OnMouseMove(nFlags, point);
            _cdt[1]->OnMouseMove(nFlags, point);

            return false;
        }

        bool bi_cdt::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
        {
           _cdt[0]->OnKeyDown(nChar, nRepCnt, nFlags);
            _cdt[1]->OnKeyDown(nChar, nRepCnt, nFlags);

            return false;
        }

        bool bi_cdt::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)
        {
            _cdt[0]->OnKeyUp(nChar, nRepCnt, nFlags);
            _cdt[1]->OnKeyUp(nChar, nRepCnt, nFlags);

            return false;
        }

    }

}