pans
2016-12-15 87e3ee273b2f84081ac45926be9d8e5be3166eaa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
 /*
 * Copyright(C) 2010,Custom Co., Ltd 
 *    FileName: FramePlayWnd.cpp
 * Description: 
 *     Version: 1.0
 *      Author: panyadong
 * Create Date: 2010-6-24
 * Modification History£º
 */
 
#include <QtGui>
#include "FramePlayWnd.h"
#include "publicfuc.h"
 
/*******************************************************************
*      Function:   QFrame
*   Description:   structure function
*     Parameter:   (IN)   parent   parent object.   
**********************************************************************/
CFramePlayWnd::CFramePlayWnd(QWidget *parent): QFrame(parent)
{
    ui.setupUi(this);
    m_iBorderWidth = 2;
    m_iBorderHeiht = 2;
    m_bSelected = FALSE;
 
    setStyleSheet("border: 2px solid gray;");
 
 
 
    m_pframePlay = ui.framePlayWnd;
    m_pframePlay->move(m_iBorderWidth, m_iBorderHeiht);//ºÍÉÏÃæµÄborder±£³ÖÒ»ÖÂ
    m_pframePlay->setStyleSheet("border: none;");
}
 
/*******************************************************************
*      Function:   CFramePlayWnd::~CFramePlayWnd
*   Description:   Îö¹¹º¯Êý
*     Parameter:   (IN)   ÎÞ²ÎÊý  
**********************************************************************/
CFramePlayWnd::~CFramePlayWnd()
{
}
 
/*******************************************************************
      Function:   CFramePlayWnd::resizeEvent
   Description:   new size
     Parameter:   (IN)   QResizeEvent *event  Size event.
        Return:   none   
**********************************************************************/
void CFramePlayWnd::resizeEvent(QResizeEvent *event)
{
    int iTempWidth;
    int iTempHeight;
    iTempWidth = event->size().width();
    iTempHeight = event->size().height();
 
    m_pframePlay->resize(iTempWidth - 2*2, iTempHeight - 2*2);
}
 
/*******************************************************************
      Function:   CFramePlayWnd::GetPlayWndId
   Description:   Get play HWND in Windows.
     Parameter:   none  
        Return:   Window ID.  
**********************************************************************/
WId CFramePlayWnd::GetPlayWndId()
{
    return m_pframePlay->winId();
}
 
/********************************************************************
*      Function:   CFramePlayWnd::GetPlayRect
*   Description:   Get play rect in Linux.
*     Parameter:   (IN)   CLIENT_PLAY_RECT* pPlayRect  
*        Return:   0--success£¬-1--fail.   
**********************************************************************/
int CFramePlayWnd::GetPlayRect(CLIENT_PLAY_RECT* pPlayRect)
{
    if (NULL == pPlayRect)
    {
        return HPR_ERROR;
    }
    pPlayRect->iX = x() + m_iBorderWidth;
    pPlayRect->iY = y() + m_iBorderHeiht;
 
    //¼ÆËã³ß´ç
    pPlayRect->iWidth = m_pframePlay->width();
    pPlayRect->iHeight = m_pframePlay->height();
    return HPR_OK;
}
 
 
void CFramePlayWnd::mouseReleaseEvent(QMouseEvent * event)
{
    emit SingleClickSig();
}