void JXTextMenuTable::Draw ( JXWindowPainter& p, const JRect& rect ) { JXMenuTable::Draw(p, rect); const JCoordinate w = GetApertureWidth(); const JSize rowCount = GetRowCount(); for (JIndex i=1; i<rowCount; i++) // ignore separator after last item { if (itsTextMenuData->HasSeparator(i)) { JRect r = GetCellRect(JPoint(1,i)); r.top = r.bottom - kSeparatorHeight; r.right = r.left + w; // JXDrawDownFrame(p, r, kSeparatorHeight/2); r.top = r.ycenter() - 1; r.bottom = r.top + 2; JXDrawDownFrame(p, r, 1); } } if (itsHilightRow != 0) { const JRect r = GetCellRect(JPoint(1, itsHilightRow)); JRect r1 = AdjustRectForSeparator(itsHilightRow, r); r1.right = r1.left + w; JXDrawUpFrame(p, r1, kHilightBorderWidth); } }
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)); } } }
THXVarTable::THXVarTable ( THXVarList* varList, JXTextMenu* fontMenu, JXScrollbarSet* scrollbarSet, JXContainer* enclosure, const HSizingOption hSizing, const VSizingOption vSizing, const JCoordinate x, const JCoordinate y, const JCoordinate w, const JCoordinate h ) : JXEditTable(1,1, scrollbarSet, enclosure, hSizing,vSizing, x,y, w,h) { const JSize rowHeight = 2*kVMarginWidth + (GetFontManager())->GetLineHeight(JGetDefaultFontName(), kJDefaultFontSize, JFontStyle()); SetDefaultRowHeight(rowHeight); itsVarList = varList; itsTextInput = NULL; itsFontMenu = fontMenu; AppendCols(2); // name, function const JSize count = itsVarList->GetElementCount() - THXVarList::kUserFnOffset; AppendRows(count); FitToEnclosure(); // make sure SetColWidth() won't fail ListenTo(this); // adjust fn col width SetColWidth(kNameColumn, GetApertureWidth()/3); // kFnColumn width set automatically }
void JXRowHeaderWidget::ApertureResized ( const JCoordinate dw, const JCoordinate dh ) { JXEditTable::ApertureResized(dw,dh); SetColWidth(1, GetApertureWidth()); }
void CBMacroSetTable::ApertureResized ( const JCoordinate dw, const JCoordinate dh ) { JXStringTable::ApertureResized(dw,dh); SetColWidth(1, GetApertureWidth()); }
JXWidgetSet* JXVertPartition::CreateCompartment ( const JIndex index, const JCoordinate position, const JCoordinate size ) { JXWidgetSet* compartment = new JXWidgetSet(this, kHElastic, kFixedTop, 0,position, GetApertureWidth(), size); assert( compartment != NULL ); return compartment; }
JXRowHeaderWidget::JXRowHeaderWidget ( JXTable* table, JXScrollbarSet* scrollbarSet, JXContainer* enclosure, const HSizingOption hSizing, const VSizingOption vSizing, const JCoordinate x, const JCoordinate y, const JCoordinate w, const JCoordinate h ) : JXEditTable(1,w, NULL, enclosure, hSizing,vSizing, x,y, w,h) { assert( table != NULL && scrollbarSet != NULL ); itsTable = table; itsTable->SetRowHeader(this); ListenTo(itsTable); itsVScrollbar = scrollbarSet->GetVScrollbar(); ListenTo(itsVScrollbar); itsTitles = NULL; itsAllowRowResizingFlag = kJFalse; itsMinRowHeight = 1; itsHMarginWidth = 2*kCellFrameWidth; itsMaxBcastWidth = 0; itsDragType = kInvalidDrag; itsDragLineCursor = JXGetDragHorizLineCursor(GetDisplay()); itsDragAllLineCursor = JXGetDragAllHorizLineCursor(GetDisplay()); SetColBorderInfo(0, (GetColormap())->GetBlackColor()); // override JXEditTable WantInput(kJFalse); SetBackColor((GetColormap())->GetDefaultBackColor()); AppendCols(1, GetApertureWidth()); AdjustToTable(); }
void JXVertPartition::SetCompartmentSizes() { const JCoordinate w = GetApertureWidth(); const JSize compartmentCount = GetCompartmentCount(); JCoordinate y = 0; for (JIndex i=1; i<=compartmentCount; i++) { const JCoordinate h = GetCompartmentSize(i); assert( h >= JPartition::GetMinCompartmentSize(i) ); JXContainer* compartment = GetCompartment(i); compartment->Place(0,y); compartment->SetSize(w,h); y += h + kDragRegionSize; } }
void JXFSBindingTable::UpdateColWidths() { JCoordinate borderWidth; JColorIndex color; GetColBorderInfo(&borderWidth, &color); JCoordinate w = GetApertureWidth(); for (JIndex i=1; i<=kColCount; i++) { if (i != kCommandColumn) { w -= GetColWidth(i) + borderWidth; } } w = JMax(w, kInitColWidth[ kCommandColumn-1 ]); SetColWidth(kCommandColumn, w); }
void GMFilterMBoxTable::AdjustColWidths() { const JSize apWidth = GetApertureWidth(); JCoordinate lineWidth; JColorIndex color; GetColBorderInfo(&lineWidth, &color); const JSize usedWidth = GetColWidth(kCopyColumn) + lineWidth; if (apWidth > usedWidth) { SetColWidth(kMBoxColumn, apWidth - usedWidth); } else { // I'll really need to adjust this relative to the size of the patterns. } }
void THXVarTable::AdjustColWidths() { const JSize apWidth = GetApertureWidth(); JCoordinate lineWidth; JColorIndex color; GetColBorderInfo(&lineWidth, &color); const JSize usedWidth = GetColWidth(kNameColumn) + lineWidth; if (apWidth > usedWidth) { SetColWidth(kFnColumn, apWidth - usedWidth); } else { const JSize nameWidth = apWidth/3; SetColWidth(kNameColumn, nameWidth); SetColWidth(kFnColumn, apWidth - nameWidth - lineWidth); } }
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(); }
JCoordinate JXTable::TableGetApertureWidth() const { return GetApertureWidth(); }
void GLFitParameterTable::AdjustColWidth() { AdjustColWidth(GetApertureWidth()); }
void CBSymbolTable::AdjustColWidths() { const JCoordinate minWidth = kIconWidth + itsMaxStringWidth + kTextPadding; SetColWidth(1, JMax(minWidth, GetApertureWidth())); }
void JX2DCurveNameList::AdjustColWidth() { SetColWidth(1, JMax(itsMinColWidth, GetApertureWidth())); }
JCoordinate JXHorizPartition::GetTotalSize() const { return GetApertureWidth(); }
void GMFilterNameTable::AdjustColWidths() { SetColWidth(1, GetApertureWidth()); }
void GLFitDescriptionList::AdjustColWidth() { SetColWidth(1, JMax(itsMinColWidth, GetApertureWidth())); }