Exemplo n.º 1
0
bool wxSheetBlock::UpdateRows( size_t row_, int numRows )
{
    int row = row_;
    if ((numRows == 0) || (GetBottom() < row)) return false;
    bool remove = numRows < 0;

    // this starts above the deleted rows
    if (m_row < row)
    {
        // this ends within deleted rows, trim to row
        if (remove && (GetBottom() < row - numRows))
            SetBottom(row-1);
        // this straddles the inserted/deleted rows - resize
        else 
            m_height += numRows;
    }
    // This is fully below it or an insert - shift coord
    else if (!remove || (m_row > row + labs(numRows)))
    {
        m_row += numRows;
    }
    // a remove and this's row is in deleted rows
    else 
    {
        m_height += m_row - (row - numRows);
        m_row = row;
    }

    return true;
}        
Exemplo n.º 2
0
void UI::Element::Maximize()
{
	SetLeft(0);
	SetBottom(0);
	SetWidth(app->Screen->w);
	SetHeight(app->Screen->h);
}
Exemplo n.º 3
0
void wxRect2DDouble::Union( const wxPoint2DDouble &pt )
{
    wxDouble x = pt.m_x;
    wxDouble y = pt.m_y;

    if ( x < m_x )
    {
        SetLeft( x );
    }
    else if ( x < m_x + m_width )
    {
        // contained
    }
    else
    {
        SetRight( x );
    }

    if ( y < m_y )
    {
        SetTop( y );
    }
    else if ( y < m_y + m_height )
    {
        // contained
    }
    else
    {
        SetBottom( y );
    }
}
Exemplo n.º 4
0
void Ide::IdeSetBottom(Ctrl& ctrl)
{
	bottom.Add(ctrl.SizePos());
	bottomctrl = &ctrl;
	BTabs();
	SetBottom(BDEBUG);
}
Exemplo n.º 5
0
void Ide::ToggleBottom(int i)
{
	if(i == btabs.GetCursor() && IsBottomShown())
		HideBottom();
	else
		SetBottom(i);
}
Exemplo n.º 6
0
void CDiagramEntity::SetRect( double left, double top, double right, double bottom )
/* ============================================================
	Function :		CDiagramEntity::SetRect
	Description :	Sets the object rect.
					
	Return :		void
	Parameters :	double left		-	Left edge
					double top		-	Top edge
					double right	-	Right edge
					double bottom	-	Bottom edge
					
	Usage :			Call to place the object.

   ============================================================*/
{

	SetLeft( left );
	SetTop( top );
	SetRight( right );
	SetBottom( bottom );

	if( GetMinimumSize().cx != -1 )
		if( GetRect().Width() < GetMinimumSize().cx )
			SetRight( GetLeft() + GetMinimumSize().cx );

	if( GetMinimumSize().cy != -1 )
		if( GetRect().Height() < GetMinimumSize().cy )
			SetBottom( GetTop() + GetMinimumSize().cy );

	if( GetMaximumSize().cx != -1 )
		if( GetRect().Width() > GetMaximumSize().cx )
			SetRight( GetLeft() + GetMaximumSize().cx );

	if( GetMaximumSize().cy != -1 )
		if( GetRect().Height() > GetMaximumSize().cy )
			SetBottom( GetTop() + GetMaximumSize().cy );

  if( GetPropertySheet() )
		GetPropertySheet()->SetValues();

}
Exemplo n.º 7
0
void wxRect2DInt::ConstrainTo( const wxRect2DInt &rect )
{
    if ( GetLeft() < rect.GetLeft() )
        SetLeft( rect.GetLeft() );

    if ( GetRight() > rect.GetRight() )
        SetRight( rect.GetRight() );

    if ( GetBottom() > rect.GetBottom() )
        SetBottom( rect.GetBottom() );

    if ( GetTop() < rect.GetTop() )
        SetTop( rect.GetTop() );
}
Exemplo n.º 8
0
void Scrollbar::Thumb::Arrange()
{
  if (auto sb = _scrollbar.lock())
  {
    auto scrollDelegate = sb->GetScrollDelegate();

    auto p = GetParent();
    SetLeft(p->GetLeft());
    SetRight(p->GetRight());
    auto trackHeight = p->GetHeight();
    auto height      = scrollDelegate->GetThumbSizePercent() * trackHeight;
    auto top         = p->GetTop() + (scrollDelegate->GetCurrentOffsetPercent() * trackHeight);
    SetTop(std::round(top));
    SetBottom(std::round(top + height));
  }
}
Exemplo n.º 9
0
void UI::Element::SetCenter(const ScreenPoint& center)
{
	SetLeft(center[0] - GetWidth() / 2);
	SetBottom(center[1] - GetHeight() / 2);
}
Exemplo n.º 10
0
void Ide::IdeActivateBottom()
{
	SetBottom(BDEBUG);
}
Exemplo n.º 11
0
void Ide::ShowBottom(int i)
{
	if(i == btabs.GetCursor() && IsBottomShown())
		return;
	SetBottom(i);
}