Example #1
0
bool wxRegion::DoUnionWithRect(const wxRect& r)
{
    // workaround for a strange GTK/X11 bug: taking union with an empty
    // rectangle results in an empty region which is definitely not what we
    // want
    if ( r.IsEmpty() )
        return true;

    if ( !m_refData )
    {
        InitRect(r.x, r.y, r.width, r.height);
    }
    else
    {
        AllocExclusive();

        GdkRectangle rect;
        rect.x = r.x;
        rect.y = r.y;
        rect.width = r.width;
        rect.height = r.height;

#ifdef __WXGTK3__
        cairo_region_union_rectangle(M_REGIONDATA->m_region, &rect);
#else
        gdk_region_union_with_rect( M_REGIONDATA->m_region, &rect );
#endif
    }

    return true;
}
Example #2
0
bool wxRegion::DoUnionWithRect(const wxRect& r)
{
    // workaround for a strange GTK/X11 bug: taking union with an empty
    // rectangle results in an empty region which is definitely not what we
    // want
    if ( r.IsEmpty() )
        return TRUE;

    if ( !m_refData )
    {
        InitRect(r.x, r.y, r.width, r.height);
    }
    else
    {
        AllocExclusive();

        GdkRectangle rect;
        rect.x = r.x;
        rect.y = r.y;
        rect.width = r.width;
        rect.height = r.height;

        GdkRegion *reg = gdk_region_union_with_rect( M_REGIONDATA->m_region, &rect );
        gdk_region_destroy( M_REGIONDATA->m_region );
        M_REGIONDATA->m_region = reg;
    }

    return TRUE;
}
Example #3
0
BOOL CPlayVedioDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();

	GetClientRect(&m_rect);
	InitLanguage();
	if (g_Language)
	{
		m_font.CreatePointFont(88, "Verdana");
	} 
	else
	{
		m_font.CreatePointFont(90,"宋体");
	}
	SetFont(&m_font); 
	CWnd   *pw   =   GetWindow(GW_CHILD); 
	while(pw   !=   NULL) 
	{ 
		pw-> SetFont(&m_font); 
		pw   =   pw-> GetWindow(GW_HWNDNEXT); 
	}; 
	
	SetDlgItemText(IDC_STATIC1,m_strLanguage[1]);
	SetDlgItemText(IDC_STATIC2,m_strLanguage[2]);
	InitRect();

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
Example #4
0
BOOL CMsgBoxDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	m_bInRect = false;
	m_numbtn = 0;
	GetClientRect(m_rect);
	
	InitRect();
	InitLanguage();
	/****** 字体设置 ***********/
	if (g_Language)
	{
		m_font.CreatePointFont(100, "Verdana");
	} 
	else
	{
		m_font.CreatePointFont(100,"宋体");
	}
	SetFont(&m_font); 
	CWnd   *pw   =   GetWindow(GW_CHILD); 
	while(pw   !=   NULL) 
	{ 
		pw-> SetFont(&m_font); 
		pw   =   pw-> GetWindow(GW_HWNDNEXT); 
	};
	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}
Example #5
0
/////////////////////////////////////////////////////////////////////////////
// CStreamDlg message handlers
BOOL CStreamDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	InitLanguage();
	GetClientRect(m_rect);
	InitRect();
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
Example #6
0
/* Find the smallest rectangle that includes all rectangles in
** branches of a node.
*/
Rect_t NodeCover(Node_t * n)
{
    register int i, flag;
    Rect_t r;
    assert(n);

    InitRect(&r);
    flag = 1;
    for (i = 0; i < NODECARD; i++)
	if (n->branch[i].child) {
	    if (flag) {
		r = n->branch[i].rect;
		flag = 0;
	    } else
		r = CombineRect(&r, &(n->branch[i].rect));
	}
    return r;
}
Example #7
0
/////////////////////////////////////////////////////////////////////////////
// CInfoDlg message handlers
BOOL CInfoDlg::OnInitDialog() 

{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here

	GetClientRect(m_rect);
	InitRect();
	InitLanguage();
	CenterWindow();  //显示居中
	SetTimer(1,500,NULL);


	m_bInRect = false;

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
Example #8
0
//extern bool g_Language;
/////////////////////////////////////////////////////////////////////////////
// CSetDlg message handlers
BOOL CSetDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	GetClientRect(m_rect);
	InitLanguage();
	InitRect();
	// TODO: Add extra initialization here
	/**********绑定对话框**************/
	CRect rect;
	user=new CUserDlg();
	user->Create(IDD_LOGIN,this); 
	GetDlgItem(IDC_STATIC_RECT)->GetWindowRect(&rect);
	ScreenToClient(&rect);
	user->MoveWindow(rect);
	user->ShowWindow(SW_SHOW);

	vedio=new CVedioDlg();
	vedio->Create(IDD_VEDIO,this);
	vedio->MoveWindow(rect);
	
	voice=new CVoiceDlg();
	voice->Create(IDD_VOICE,this);
	voice->MoveWindow(rect);

	stream=new CStreamDlg();
	stream->Create(IDD_STREAM,this);
	stream->MoveWindow(rect);


	/*******设置列表风格*****/
	DWORD dwStyle;   
	dwStyle = m_ListCtrl.GetExtendedStyle();      
	dwStyle = dwStyle|LVS_EX_FULLROWSELECT|LVS_EX_SUBITEMIMAGES ;  
	m_ListCtrl.SetExtendedStyle(dwStyle);  

    m_ListCtrl.InsertColumn(0,_T("1111"),LVCFMT_CENTER,100); 

	/**********绑定SmallIcon和LargeIcon到CListCtrl上******/
	m_LargeIcon.Create(24,24, ILC_COLORDDB | ILC_MASK, 0, 4);
    //为子项加载图标
	m_LargeIcon.Add(AfxGetApp()->LoadIcon(IDI_ICON1));
	m_LargeIcon.Add(AfxGetApp()->LoadIcon(IDI_ICON2));
	m_LargeIcon.Add(AfxGetApp()->LoadIcon(IDI_ICON3));
	m_LargeIcon.Add(AfxGetApp()->LoadIcon(IDI_ICON4));

	m_ListCtrl.SetImageList(&m_LargeIcon,LVSIL_SMALL );  

	char *str[5]={0};

	for (int i=0;i<3;i++)
	{  
	  //名称
		str[i] = m_strLanguage[i+1].GetBuffer(m_strLanguage[i+1].GetLength()); //把CString 转换成char*
		m_strLanguage[i].ReleaseBuffer();
		LV_ITEM lvitem;//LV_ITEM结构体填充
		memset ((char *) &lvitem, '\0', sizeof (LV_ITEM));//结构体初始化
		lvitem.mask = LVIF_TEXT | LVIF_IMAGE  | LVIF_STATE;
		lvitem.iItem = i;
		lvitem.iSubItem = 0;
		lvitem.stateMask = 0;
		lvitem.iImage = i;          //显示不同的图标时,可以把一个int 变量赋给这个属性值
		lvitem.pszText = str[i];    //项名标题
		m_ListCtrl.InsertItem (&lvitem);
	}
	if (g_Language)
	{
		m_font.CreatePointFont(90, "Verdana");
	} 
	else
	{
		m_font.CreatePointFont(100,"宋体");
	}
	SetFont(&m_font); 
	CWnd   *pw   =   GetWindow(GW_CHILD); 
	while(pw   !=   NULL) 
	{ 
		pw-> SetFont(&m_font); 
		pw   =   pw-> GetWindow(GW_HWNDNEXT); 
	};
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
Example #9
0
/* Initialize one branch cell in a node.
*/
void InitBranch(Branch_t * b)
{
    InitRect(&(b->rect));
    b->child = NULL;
}