int EBuffer::HideRow(int Row) { /*FOLD00*/ int V = RToV(Row), GapSize; assert(Row > 0 && Row < RCount); // 0 cannot be hidden if (V == -1) return 1; // already hidden UpdateVisible(Row, -1); if (VGap != V) if (MoveVGap(V) == 0) return 0; GapSize = VAllocated - VCount; VV[VGap + GapSize] = 0; VCount--; GapSize++; if (VAllocated - VAllocated / 2 > VCount) { memmove(VV + VGap + GapSize - VAllocated / 3, VV + VGap + GapSize, sizeof(int) * (VCount - VGap)); if (AllocVis(VAllocated - VAllocated / 3) == 0) return 0; } GapSize = VAllocated - VCount; if (VGap != V) if (MoveVGap(V) == 0) return 0; for (int i = V; i < VCount; i++) VV[i + GapSize]++; // Vis(i, Vis(i) + 1); // if (CP.Row > Row) // if (SetPos(CP.Col, CP.Row - 1) == 0) return 0; Draw(Row, -1); return 1; }
//------------------------------------------------------------------------- void CSlot::SetVisible( bool p_bValue ) { if( p_bValue != m_bIsVisible ) { m_bIsVisible = p_bValue; UpdateVisible( m_bIsVisible ); } }
int EBuffer::ShowRow(int Row) { /*FOLD00*/ int V = RToVN(Row), GapSize; // printf("Showing row %d\n", Row); assert(Row >= 0 && Row < RCount); // 0 cannot be hidden if (V + Vis(V) == Row) return 1; // already visible assert(VCount <= VAllocated); if (VCount == VAllocated) { if (AllocVis(VCount ? (VCount * 2) : 1) == 0) return 0; memmove(VV + VAllocated - (VCount - VGap), VV + VGap, sizeof(int) * (VCount - VGap)); } if (VGap != V + 1) if (MoveVGap(V + 1) == 0) return 0; VV[VGap] = Row - (VGap); VGap++; VCount++; GapSize = VAllocated - VCount; if (VGap != V + 2) if (MoveVGap(V + 2) == 0) return 0; for (int i = V + 2; i < VCount; i++) VV[i + GapSize]--; // Vis(i, Vis(i) - 1); UpdateVisible(Row, 1); // if (CP.Row > Row) // if (SetPos(CP.Col, CP.Row + 1) == 0) return 0; Draw(Row, -1); return 1; }