void GMFilterNameTable::Draw ( JXWindowPainter& p, const JRect& rect ) { JXEditTable::Draw(p, rect); if (itsDNDIsValid) { p.ResetClipRect(); p.SetLineWidth(kDragLineWidth); if (itsCurrentDNDIndex == 0) { JRect crect = GetCellRect(JPoint(1, GetRowCount())); p.Line(0, crect.bottom, GetBoundsWidth(), crect.bottom); } else { JRect crect = GetCellRect(JPoint(1, itsCurrentDNDIndex)); p.Line(0, crect.top, GetBoundsWidth(), crect.top); } } }
void JXTreeListWidget::AdjustColWidths() { if (itsAdjustToTreeTask != NULL) { return; } const JSize colCount = GetColCount(); if (itsMinColWidths->GetElementCount() != colCount) { NeedsAdjustToTree(); return; } for (JIndex i=1; i<=colCount; i++) { SetColWidth(i, itsMinColWidths->GetElement(i)); } if (ColIndexValid(itsElasticColIndex)) { const JCoordinate minReqWidth = itsMinColWidths->GetElement(itsElasticColIndex); if (minReqWidth > 0) { const JCoordinate availWidth = GetApertureWidth() - (GetBoundsWidth() - GetColWidth(itsElasticColIndex)); SetColWidth(itsElasticColIndex, JMax(minReqWidth, availWidth)); } } }
void CMLineIndexTable::AdjustToText() { const JFontManager* fontMgr = GetFontManager(); JFont font = itsText->GetCurrentFont(); const JSize lineCount = itsText->IsEmpty() ? 0 : itsText->GetLineCount(); const JString lineCountStr = GetLongestLineText(lineCount); const JSize lineHeight = font.GetLineHeight(); const JSize lineNumberWidth = font.GetStringWidth(lineCountStr); SetColWidth(kBreakpointColumn, lineHeight); SetColWidth(kExecPointColumn, lineHeight); SetColWidth(kLineNumberColumn, lineNumberWidth + 2*kMarginWidth); SetAllRowHeights(lineHeight); const JSize origRowCount = GetRowCount(); if (origRowCount < lineCount) { AppendRows(lineCount - origRowCount, lineHeight); } else if (origRowCount > lineCount) { RemovePrevRows(origRowCount, origRowCount - lineCount); } const JCoordinate tableWidth = GetBoundsWidth(); const JCoordinate apWidth = GetApertureWidth(); if (tableWidth != apWidth) { AdjustSize(tableWidth-apWidth, 0); itsText->Place(GetFrameWidth(), 0); itsText->AdjustSize(apWidth-tableWidth, 0); } ScrollTo(0, itsVScrollbar->GetValue()); UpdateBreakpoints(); }
void GLFitParameterTable::PrintOnPage ( JPagePrinter& p, JCoordinate* height ) { const JSize origWidth = GetBoundsWidth(); JSize printWidth = JSize(p.GetPageWidth() * 0.9); AdjustSize(printWidth - origWidth, 0); // SetSize(printWidth, GetBoundsHeight()); AdjustColWidth(printWidth); itsColHeaderWidget->PrintOnPage(p); p.ShiftOrigin(0, itsColHeaderWidget->GetBoundsHeight()); TableDraw(p, GetBounds()); AdjustSize(origWidth - printWidth, 0); // SetSize(origWidth, GetBoundsHeight()); *height = GetBoundsHeight() + itsColHeaderWidget->GetBoundsHeight(); }