Beispiel #1
0
void GridViewColumn::OnHeaderGripperResize(suic::Element* sender, suic::MouseEventArg& e)
{
    int iWid = _prevWidth + e.MousePoint().x - _point.x;

    if (iWid < 10)
    {
        iWid = 10;
    }

    if (iWid != GetColumnWidth())
    {
        int iDelta = iWid - GetColumnWidth();

        SetColumnWidth(iWid);

        suic::Size size = ColumnHeader()->GetDesiredSize();

        size.cx = GetColumnWidth();
        ColumnHeader()->SetDesiredSize(size);

        if (DragDelta)
        {
            DragDeltaEventArg edd(iDelta, 0);

            DragDelta(this, edd);
        }

        if (GetColumnWidth() != iWid)
        {
            //_prevWidth = GetColumnWidth();
        }
    }
}
Beispiel #2
0
/*
==============
NewBrushDrag
==============
*/
void NewBrushDrag (int x, int y)
{
	vec3_t	mins, maxs, junk;
	int		i;
	float	temp;
	brush_t	*n;

	if (!DragDelta (x,y, junk))
		return;
	// delete the current selection
	if (selected_brushes.next != &selected_brushes)
		Brush_Free (selected_brushes.next);
	XY_ToGridPoint (pressx, pressy, mins);
	mins[2] = g_qeglobals.d_gridsize * ((int)(g_qeglobals.d_new_brush_bottom_z/g_qeglobals.d_gridsize));
	XY_ToGridPoint (x, y, maxs);
	maxs[2] = g_qeglobals.d_gridsize * ((int)(g_qeglobals.d_new_brush_top_z/g_qeglobals.d_gridsize));
	if (maxs[2] <= mins[2])
		maxs[2] = mins[2] + g_qeglobals.d_gridsize;

	for (i=0 ; i<3 ; i++)
	{
		if (mins[i] == maxs[i])
			return;	// don't create a degenerate brush
		if (mins[i] > maxs[i])
		{
			temp = mins[i];
			mins[i] = maxs[i];
			maxs[i] = temp;
		}
	}

	n = Brush_Create (mins, maxs, &g_qeglobals.d_texturewin.texdef);
	if (!n)
		return;

	Brush_AddToList (n, &selected_brushes);

	Entity_LinkBrush (world_entity, n);

	Brush_Build( n );

//	Sys_UpdateWindows (W_ALL);
	Sys_UpdateWindows (W_XY| W_CAMERA);
}