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; }
void UI::Element::Maximize() { SetLeft(0); SetBottom(0); SetWidth(app->Screen->w); SetHeight(app->Screen->h); }
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 ); } }
void Ide::IdeSetBottom(Ctrl& ctrl) { bottom.Add(ctrl.SizePos()); bottomctrl = &ctrl; BTabs(); SetBottom(BDEBUG); }
void Ide::ToggleBottom(int i) { if(i == btabs.GetCursor() && IsBottomShown()) HideBottom(); else SetBottom(i); }
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(); }
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() ); }
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)); } }
void UI::Element::SetCenter(const ScreenPoint& center) { SetLeft(center[0] - GetWidth() / 2); SetBottom(center[1] - GetHeight() / 2); }
void Ide::IdeActivateBottom() { SetBottom(BDEBUG); }
void Ide::ShowBottom(int i) { if(i == btabs.GetCursor() && IsBottomShown()) return; SetBottom(i); }