PPDConfigView::PPDConfigView(BRect bounds, const char *name, uint32 resizeMask, uint32 flags) : BView(bounds, name, resizeMask, flags) , fPPD(NULL) { // add category outline list view bounds.OffsetTo(0, 0); BRect listBounds(bounds.left + kLeftMargin, bounds.top + kTopMargin, bounds.right - kHorizontalSpace, bounds.bottom - kBottomMargin); listBounds.right -= B_V_SCROLL_BAR_WIDTH; listBounds.bottom -= B_H_SCROLL_BAR_HEIGHT; BStringView* label = new BStringView(listBounds, "printer-settings", "Printer Settings:"); AddChild(label); label->ResizeToPreferred(); listBounds.top += label->Bounds().bottom + 5; // add details view fDetails = new BView(listBounds, "details", B_FOLLOW_ALL_SIDES, B_WILL_DRAW); fDetails->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); BScrollView* scrollView = new BScrollView("details-scroll-view", fDetails, B_FOLLOW_ALL_SIDES, 0, true, true); AddChild(scrollView); }
void DigitView::selectItemsReplace(Q3CanvasItemList* list) { unselect(); selectionList = *list; ASSERT_ENGAUGE(m_doc != 0); m_doc->selectionListChanged(); removeHandles(); if (selectionList.count() > 0) addHandles(listBounds(&selectionList)); }
PrinterSelectionView::PrinterSelectionView(BRect bounds, const char *name, uint32 resizeMask, uint32 flags) : BView(bounds, name, resizeMask, flags) { // add vendor list view bounds.OffsetTo(0, 0); BRect listBounds(bounds.left + kLeftMargin, bounds.top + kTopMargin, bounds.right / 3.0 - kHorizontalSpace / 2, bounds.bottom - kBottomMargin); listBounds.right -= B_V_SCROLL_BAR_WIDTH; listBounds.bottom -= B_H_SCROLL_BAR_HEIGHT; BStringView* label = new BStringView(listBounds, "vendors-label", "Vendors:"); AddChild(label); label->ResizeToPreferred(); listBounds.top += label->Bounds().bottom + 5; fVendors = new BListView(listBounds, "vendors", B_SINGLE_SELECTION_LIST, B_FOLLOW_ALL); FillVendors(); BScrollView* scrollView = new BScrollView("vendors-scroll-view", fVendors, B_FOLLOW_LEFT | B_FOLLOW_TOP_BOTTOM, 0, true, true); AddChild(scrollView); // add details view BRect printerBounds(listBounds); printerBounds.left = B_V_SCROLL_BAR_WIDTH + printerBounds.right + kHorizontalSpace; printerBounds.right = bounds.right - kRightMargin - B_V_SCROLL_BAR_WIDTH; printerBounds.top = bounds.top + kTopMargin; label = new BStringView(printerBounds, "printers-label", "Printers:"); AddChild(label); label->ResizeToPreferred(); BRect detailBounds(listBounds); detailBounds.left = B_V_SCROLL_BAR_WIDTH + detailBounds.right + kHorizontalSpace; detailBounds.right = bounds.right - kRightMargin - B_V_SCROLL_BAR_WIDTH; fPrinters = new BListView(detailBounds, "printers", B_SINGLE_SELECTION_LIST, B_FOLLOW_ALL); scrollView = new BScrollView("printers-scroll-view", fPrinters, B_FOLLOW_LEFT | B_FOLLOW_TOP_BOTTOM, 0, true, true); AddChild(scrollView); }
void DigitView::selectItemsToggle(Q3CanvasItemList* list) { Q3CanvasItemList::iterator itr; ASSERT_ENGAUGE(list != 0); for (itr = list->begin(); itr != list->end(); ++itr) { Q3CanvasItemList::iterator itrS = selectionList.find(*itr); if (itrS == selectionList.end()) selectionList.append(*itr); else selectionList.remove(itrS); } ASSERT_ENGAUGE(m_doc != 0); m_doc->selectionListChanged(); removeHandles(); if (selectionList.count() > 0) addHandles(listBounds(&selectionList)); }