ILXStatusBar::ILXStatusBar(int argc, char* argv[]) : Application(&argc, &argv, (AppOptions) (OptDaleAuto)) { setBackgroundImage(ILIXI_DATADIR"car/statusbar/statusbar_bg.png"); setMargins(0, 0, 0, 0); HBoxLayout* mainLayout = new HBoxLayout(); mainLayout->setVerticalAlignment(Alignment::Middle); mainLayout->setSpacing(0); setLayout(mainLayout); _home = new StatusbarButton(); _home->addImage(new Image(ILIXI_DATADIR"car/statusbar/home.png", Size(48, 48))); _home->addImage(new Image(ILIXI_DATADIR"car/statusbar/homeG.png", Size(48, 48))); _home->setActive(1); _home->sigClicked.connect(sigc::mem_fun(this, &ILXStatusBar::clickedHome)); addWidget(_home); _switch = new StatusbarButton(); _switch->addImage(new Image(ILIXI_DATADIR"car/statusbar/switch.png", Size(48, 48))); _switch->addImage(new Image(ILIXI_DATADIR"car/statusbar/switchG.png", Size(48, 48))); _switch->sigClicked.connect(sigc::mem_fun(this, &ILXStatusBar::clickedSwitcher)); addWidget(_switch); _dash = new StatusbarButton(); _dash->addImage(new Image(ILIXI_DATADIR"car/statusbar/dash.png", Size(48, 48))); _dash->addImage(new Image(ILIXI_DATADIR"car/statusbar/dashG.png", Size(48, 48))); _dash->sigClicked.connect(sigc::mem_fun(this, &ILXStatusBar::clickedDash)); addWidget(_dash); _sound = new StatusbarButton(); _sound->addImage(new Image(ILIXI_DATADIR"car/statusbar/vol0.png", Size(48, 48))); _sound->addImage(new Image(ILIXI_DATADIR"car/statusbar/vol0G.png", Size(48, 48))); _sound->addImage(new Image(ILIXI_DATADIR"car/statusbar/vol1.png", Size(48, 48))); _sound->addImage(new Image(ILIXI_DATADIR"car/statusbar/vol1G.png", Size(48, 48))); _sound->addImage(new Image(ILIXI_DATADIR"car/statusbar/vol2.png", Size(48, 48))); _sound->addImage(new Image(ILIXI_DATADIR"car/statusbar/vol2G.png", Size(48, 48))); _sound->addImage(new Image(ILIXI_DATADIR"car/statusbar/vol3.png", Size(48, 48))); _sound->addImage(new Image(ILIXI_DATADIR"car/statusbar/vol3G.png", Size(48, 48))); _sound->sigClicked.connect(sigc::mem_fun(this, &ILXStatusBar::clickedSound)); _sound->setButtonState(6); addWidget(_sound); _back = new StatusbarButton(); _back->setVisible(false); _back->addImage(new Image(ILIXI_DATADIR"car/statusbar/back0.png", Size(48, 48))); _back->sigClicked.connect(sigc::mem_fun(this, &ILXStatusBar::clickedBack)); addWidget(_back); addWidget(new Clock()); _rca = new RemoteContentArea(); addWidget(_rca); sigVisible.connect(sigc::mem_fun(this, &ILXStatusBar::onShow)); sigHidden.connect(sigc::mem_fun(this, &ILXStatusBar::onHide)); _statComp = new StatusbarComponent(this); }
void PanelRadar::paintEvent(QPaintEvent* event) { const qreal scale0 = 0.14644660940672623779957781894758; const qreal scale1 = (1.0 - scale0); PanelWidget::paintEvent(event); QPainter p; p.begin(this); setMargins(&p); p.setRenderHint(QPainter::Antialiasing, true); p.setRenderHint(QPainter::TextAntialiasing, true); QPen pen = p.pen(); pen.setWidth(1); p.setPen(QColor("black")); QPainterPath path; qreal rx = p.device()->width(); qreal ry = p.device()->height(); QPointF point(0.5 * rx, 0.5 * ry); path.addEllipse(point, 0.50 * rx, 0.50 * ry); p.fillPath(path, QColor("white")); path.addEllipse(point, 0.25 * rx, 0.25 * ry); p.drawPath(path); p.drawLine(0, 0.5 * ry, rx, 0.5 * ry); p.drawLine(0.5 * rx, 0, 0.5 * rx, ry); p.drawLine(rx * scale0 + 1, ry * scale0 + 1, rx * scale1 - 1, ry * scale1 - 1); p.drawLine(rx * scale0 + 1, ry * scale1 - 1, rx * scale1 - 1, ry * scale0 + 1); drawItems(&p); p.end(); }
TracingScaleEngine::TracingScaleEngine(TracingEngine *engine) : QwtLinearScaleEngine() { my.engine = engine; my.minSpanID = 0.0; my.maxSpanID = 1.0; setMargins(0.5, 0.5); }
void DesktopWindow::updateFromSettings(Settings& settings, bool changeSlide) { setDesktopFolder(); setWallpaperFile(settings.wallpaper()); setWallpaperMode(settings.wallpaperMode()); setLastSlide(settings.lastSlide()); QString wallpaperDir = settings.wallpaperDir(); if(wallpaperDir_ != wallpaperDir) { changeSlide = true; // another wallpapaer directory; change slide! } setWallpaperDir(wallpaperDir); int interval = settings.slideShowInterval(); if(interval > 0 && (interval < MIN_SLIDE_INTERVAL || interval > MAX_SLIDE_INTERVAL)) { interval = qBound(MIN_SLIDE_INTERVAL, interval, MAX_SLIDE_INTERVAL); settings.setSlideShowInterval(interval); } setSlideShowInterval(interval); setWallpaperRandomize(settings.wallpaperRandomize()); setFont(settings.desktopFont()); setIconSize(Fm::FolderView::IconMode, QSize(settings.desktopIconSize(), settings.desktopIconSize())); setMargins(settings.desktopCellMargins()); // setIconSize and setMargins may trigger relayout of items by QListView, so we need to do the layout again. queueRelayout(); setForeground(settings.desktopFgColor()); setBackground(settings.desktopBgColor()); setShadow(settings.desktopShadowColor()); showWmMenu_ = settings.showWmMenu(); if(slideShowInterval_ > 0 && QFileInfo(wallpaperDir_).isDir()) { if(!wallpaperTimer_) { changeSlide = true; // slideshow activated; change slide! wallpaperTimer_ = new QTimer(); connect(wallpaperTimer_, &QTimer::timeout, this, &DesktopWindow::nextWallpaper); } else { wallpaperTimer_->stop(); // restart the timer after updating wallpaper } if(changeSlide) { pickWallpaper(); } else if(QFile::exists(lastSlide_)) { /* show the last slide if it still exists, otherwise show the wallpaper until timeout */ wallpaperFile_ = lastSlide_; } } else if(wallpaperTimer_) { wallpaperTimer_->stop(); delete wallpaperTimer_; wallpaperTimer_ = nullptr; } updateWallpaper(); update(); if(wallpaperTimer_) { wallpaperTimer_->start(slideShowInterval_); } }
void DesktopWindow::removeBottomGap() { /************************************************************ NOTE: Desktop is an area bounded from below while icons snap to its grid srarting from above. Therefore, we try to adjust the vertical cell margin to prevent relatively large gaps from taking shape at the desktop bottom. ************************************************************/ auto delegate = static_cast<Fm::FolderItemDelegate*>(listView_->itemDelegateForColumn(0)); auto itemSize = delegate->itemSize(); qDebug() << "delegate:" << delegate->itemSize(); QSize cellMargins = getMargins(); int workAreaHeight = qApp->desktop()->availableGeometry(screenNum_).height() - 24; // a 12-pix margin will be considered everywhere int cellHeight = itemSize.height() + listView_->spacing(); int iconNumber = workAreaHeight / cellHeight; int bottomGap = workAreaHeight % cellHeight; /******************************************* First try to make room for an extra icon... *******************************************/ // If one pixel is subtracted from the vertical margin, cellHeight // will decrease by 2 while bottomGap will increase by 2*iconNumber. // So, we can add an icon to the bottom once this inequality holds: // bottomGap + 2*n*iconNumber >= cellHeight - 2*n // From here, we get our "subtrahend": qreal exactNumber = ((qreal)cellHeight - (qreal)bottomGap) / (2.0 * (qreal)iconNumber + 2.0); int subtrahend = (int)exactNumber + ((int)exactNumber == exactNumber ? 0 : 1); Settings& settings = static_cast<Application*>(qApp)->settings(); int minCellHeight = settings.desktopCellMargins().height(); if(subtrahend > 0 && cellMargins.height() - subtrahend >= minCellHeight) { cellMargins -= QSize(0, subtrahend); } /*************************************************** ... but if that can't be done, try to spread icons! ***************************************************/ else { cellMargins += QSize(0, (bottomGap / iconNumber) / 2); } // set the new margins (if they're changed) delegate->setMargins(cellMargins); setMargins(cellMargins); // in case the text shadow is reset to (0,0,0,0) setShadow(settings.desktopShadowColor()); }
void HGLayout::setWidget(HGWidget* widget) { //qDebug("HGLayout::setWidget"); mWidget = widget; //todo create layout object setLayoutType(mLayoutType); setMargins(mMargins); setSpacing(mSpacing); }
MessageBoxContainer::MessageBoxContainer( Frame* frame, MessageBox* msg ) : m_frame(frame),m_msg(msg) { add(m_frame); setMargins(0,0,0,0); m_frame->setResizable(false); m_frame->setMovable(false); setVisibility(false); setFocusable(false); }
Button::Button() : isDoingKeyAction(false),mouseIsDown(false),mouseIsInside(false), isButtonToggleButton(false),toggled(false), buttonState(DEFAULT), mouseLeaveState(HOVERED), autoUntoggle(true) { setFocusable(true); setTabable(true); setTextAlignment(ALIGN_MIDDLE_CENTER); setBackColor(Color(115,183,226)); setMargins(1,1,2,2); }
void View::updateFromSettings(Settings& settings) { setIconSize(Fm::FolderView::IconMode, QSize(settings.bigIconSize(), settings.bigIconSize())); setIconSize(Fm::FolderView::CompactMode, QSize(settings.smallIconSize(), settings.smallIconSize())); setIconSize(Fm::FolderView::ThumbnailMode, QSize(settings.thumbnailIconSize(), settings.thumbnailIconSize())); setIconSize(Fm::FolderView::DetailedListMode, QSize(settings.smallIconSize(), settings.smallIconSize())); setMargins(settings.folderViewCellMargins()); setAutoSelectionDelay(settings.autoSelectionDelay()); Fm::ProxyFolderModel* proxyModel = model(); if(proxyModel) { proxyModel->setShowThumbnails(settings.showThumbnails()); } }
void QFormulatorRenderer::init() { FBtnToolbarSet *toolbarSet = ::getCurrentToolBarSet(); if( toolbarSet == 0 || toolbarSet->getToolBarCount() == 0 ) { ::setCurrentFormulatorContentMathML_TranslateTimes( ::Formulib_GetTimes2Times() ); ::setCurrentFormulatorStyle_TranslatePref( ::Formulib_GetTranslator() ); ::setCurrentFormulatorOptionsValue( ::Formulib_GetOptionsValue() ); QFormulatorWidget::initFormulatorCore(); } m_engine = new QFormulatorWidget(); m_engine->initialUpdate(); setMargins(0, 0, 0, 0); m_isValid = false; }
void DesktopWindow::updateFromSettings(Settings& settings) { setDesktopFolder(); setWallpaperFile(settings.wallpaper()); setWallpaperMode(settings.wallpaperMode()); setFont(settings.desktopFont()); setIconSize(Fm::FolderView::IconMode, QSize(settings.desktopIconSize(), settings.desktopIconSize())); setMargins(settings.desktopCellMargins()); // setIconSize and setMargins may trigger relayout of items by QListView, so we need to do the layout again. queueRelayout(); setForeground(settings.desktopFgColor()); setBackground(settings.desktopBgColor()); setShadow(settings.desktopShadowColor()); showWmMenu_ = settings.showWmMenu(); updateWallpaper(); update(); }
void ScaleEngine::clone(const ScaleEngine *engine) { d_type = engine->type(); d_break_left = engine->axisBreakLeft(); d_break_right = engine->axisBreakRight(); d_break_pos = engine->breakPosition(); d_step_before = engine->stepBeforeBreak(); d_step_after = engine->stepAfterBreak(); d_minor_ticks_before = engine->minTicksBeforeBreak(); d_minor_ticks_after = engine->minTicksAfterBreak(); d_log10_scale_after = engine->log10ScaleAfterBreak(); d_break_width = engine->breakWidth(); d_break_decoration = engine->hasBreakDecoration(); setAttributes(engine->attributes()); setMargins(engine->loMargin(), engine->hiMargin()); }
// Initialization of parameters from R void PBC::parametersInit(SEXP m_binMat, SEXP m_theta, SEXP m_x, SEXP m_root, SEXP m_f, SEXP m_nIteration, SEXP m_dxf, SEXP m_dxdyf, SEXP m_graf, SEXP m_gradxf, SEXP m_gradxdyf, SEXP m_type, SEXP m_g, SEXP m_dxg, SEXP m_out) { setType(m_type); setNIteration(m_nIteration); setFunction(m_f); setDxf(m_dxf); setDxdyf(m_dxdyf); setGraf(m_graf); setGradxf(m_gradxf); setGradxdyf(m_gradxdyf); setVector(m_x); setTheta(m_theta); setRoot(m_root); setBinMat(m_binMat, m_x); setMargins(m_g); setDxg(m_dxg); setOut(m_out); }
RadioButton::RadioButton() : sidePadding(6), radioButtonState(DEFAULT), mouseIsInside(false), mouseIsDown(false), isDoingKeyAction(false) { setMargins(1,1,1,1); setBackColor(Color(240,240,240)); setFocusable(true); setTabable(true); setRadioButtonAlignment(ALIGN_TOP_LEFT); setTextAlignment(ALIGN_MIDDLE_LEFT); positionRadioButton(); resizeCaption(); setChecked(false); setAutosizing(false); setRadioButtonRadius(6); }
void CWidget::initialize(CWidget *parent, bool dummy) { DEBUG_ui("CWidget::initialize, 0"); _parent = parent; DEBUG_ui("CWidget::initialize, 1"); // If we haven't initialized curses yet, don't create a new curses window and panel if(!dummy) { _window = newwin(1, 1, 0, 0); _panel = new_panel(_window); } else { _window = 0; _panel = 0; } DEBUG_ui("CWidget::initialize, 2"); setMargins(1, 1, 1, 1); DEBUG_ui("CWidget::initialize, 3"); _bgcolor = Black; _fgcolor = White; _layout = 0; _fwdDataSelect = 0; _customID = 0; _listenKeys = false; _changed = false; _visible = true; _bold = false; // Set default name. _name = "Widget"; DEBUG_ui("CWidget::initialize, 4"); hide(); }
void MultiLayer::copy(ApplicationWindow *parent, MultiLayer *ml) { hide(); // FIXME: find a better way to avoid a resize event resize(ml->size()); setSpacing(ml->rowsSpacing(), ml->colsSpacing()); setAlignement(ml->horizontalAlignement(), ml->verticalAlignement()); setMargins(ml->leftMargin(), ml->rightMargin(), ml->topMargin(), ml->bottomMargin()); QWidgetList graphsList = ml->graphPtrs(); for (int i = 0; i < graphsList.count(); i++) { Graph *g = (Graph *)graphsList.at(i); Graph *g2 = addLayer(g->pos().x(), g->pos().y(), g->width(), g->height()); g2->copy(parent, g); g2->setIgnoreResizeEvents(g->ignoresResizeEvents()); g2->setAutoscaleFonts(g->autoscaleFonts()); } show(); }
Graphics::Graphics(QWidget *parent) : QWidget(parent) { QList<QColor> colors; QColor color; color.setRgb(0,180,0); colors << color; color.setRgb(0,0,180); colors << color; color.setRgb(100,100,100); colors << color; color.setRgb(0,255,0); colors << color; color.setRgb(255,255,0); colors << color; color.setRgb(255,0,255); colors << color; color.setRgb(255,150,0); colors << color; setColors(colors); setMargins(50,150,30,60); QList<float> data; data << 100 << 300 << 200 << 300 << 900; setData(data); QList<QString> legenda; legenda << "Cor 1" << "Cor 2" << "Cor 3" << "Cor 4" << "Cor 5"; setLegend(legenda); setType(Graphics::Sectors); maxLine = 0; }
xQGanttListView::xQGanttListView(KGanttItem* toplevelitem, QWidget* parent, const char * name, WFlags f) : QScrollView(parent,name,f) ///////////////////////////////////////////////////////// { _toplevelitem = toplevelitem; setFrameStyle(QFrame::Sunken); setLineWidth(1); _headerBackBrush = QBrush(QColor(230,230,230)); setMargins( 1, TOPMARGIN , 1, 1 ); setVScrollBarMode( AlwaysOff ); _viewport = new xQGanttListViewPort(toplevelitem,viewport()); addChild(_viewport); viewport()->setBackgroundColor(QColor(white)); }
CSeparatorWidget::CSeparatorWidget(const string &name, int id, Color fgcolor, Color bgcolor, bool bold) : CLabel(name, id, fgcolor, bgcolor, bold) { setMargins(0, 0, 0, 0); }
void KPrinter::setMargins(QSize m) { setMargins( m.height(), m.width(), m.height(), m.width() ); }
// ------------------------------------------------------------------------- void GraphMapping::setRectFull( const QRectF& rect ) { m_rectFull = rect; setMargins( m_fMarginPercent, m_fMarginMax ); }
void KWidget::setLayout(QGraphicsLayout *layout) { QGraphicsWidget::setLayout(layout); setMargins(QMargins(0, 0, 0, 0)); setSpacing(0); }
EmptyWidget::EmptyWidget(void) { setMargins(0,0,0,0); setBackColor(Color(0,0,0,0)); }
void LayerTreeSidebar::createForms() { QVBoxLayout *mainLayout = new QVBoxLayout(); mainLayout->setSpacing(0); mainLayout->setContentsMargins(0, 0, 0, 0); { auto view = new QTreeView(); if (d->uiController) view->setItemDelegate(new LayerModelViewDelegate(d->uiController, this)); view->setHeaderHidden(true); view->setSelectionMode(QAbstractItemView::ExtendedSelection); view->setDragDropMode(QAbstractItemView::DragDrop); view->setDefaultDropAction(Qt::MoveAction); view->setDropIndicatorShown(true); if (d->document) { view->setModel(d->document->layerScene()->itemModel()); view->setSelectionModel(d->document->layerScene()->itemSelectionModel()); connect(d->document->layerScene(), SIGNAL(thumbnailsUpdated(QPointSet)), view, SLOT(update())); } view->setContextMenuPolicy(Qt::CustomContextMenu); connect(view, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showViewContextMenu(QPoint))); view->installEventFilter(this); d->view = view; mainLayout->addWidget(view); } { auto lowerLayout = new QVBoxLayout(); lowerLayout->setSpacing(6); lowerLayout->setContentsMargins(6,6,6,6); { auto editor = new LayerPropertyEditor(d->document ? d->document->layerScene() : 0); lowerLayout->addWidget(editor); } // buttons { auto layout = new QHBoxLayout(); layout->setSpacing(0); auto addButton = new SimpleButton(":/icons/16x16/add.svg", QSize(16,16)); addButton->setMargins(4, 0, 4, 0); auto removeButton = new SimpleButton(":/icons/16x16/subtract.svg", QSize(16,16)); removeButton->setMargins(4, 0, 4, 0); auto miscButton = new SimpleButton(":/icons/16x16/menuDown.svg", QSize(16,16)); miscButton->setMargins(4, 0, 4, 0); if (d->uiController) { auto addMenu = new QMenu(this); addMenu->addAction(d->uiController->action(LayerUIController::ActionNewRaster)); addMenu->addAction(d->uiController->action(LayerUIController::ActionNewGroup)); addMenu->addAction(d->uiController->action(LayerUIController::ActionImport)); addButton->setMenu(addMenu); connect(removeButton, SIGNAL(pressed()), d->uiController, SLOT(removeLayers())); QMenu *miscMenu = new QMenu(this); miscMenu->addAction(d->uiController->action(LayerUIController::ActionMerge)); miscButton->setMenu(miscMenu); } layout->addWidget(addButton); layout->addWidget(removeButton); layout->addWidget(miscButton); layout->addStretch(1); lowerLayout->addLayout(layout); } mainLayout->addLayout(lowerLayout); } setLayout(mainLayout); }
CSeparatorWidget::CSeparatorWidget(CWidget *parent) : CLabel(parent) { setMargins(0, 0, 0, 0); }
//------------------------------------------------------------------------------------------------- // Main application //------------------------------------------------------------------------------------------------- App::App(int argc, char* argv[]) : Application(&argc, &argv, OptDaleAuto), _sipComponent(NULL), _pid(0) { setLayout(new HBoxLayout()); setMargins(5, 5, 5, 5); //------------------------------------------------------------------------------------------------- // Create toolbar //------------------------------------------------------------------------------------------------- ToolBar* bar = new ToolBar(); setToolbar(bar); _baresip = new ToolButton("Offline"); _baresip->setIcon(StyleHint::Network); _baresip->setInputMethod(NoInput); _baresip->setDrawFrame(false); bar->addWidget(_baresip); bar->addWidget(new Spacer(Horizontal)); _contactsButton = new ToolBarButton("Contacts"); _contactsButton->setIcon(StyleHint::Contacts2); _contactsButton->sigClicked.connect(sigc::bind<int>(sigc::mem_fun(this, &App::showScreen), 0)); bar->addWidget(_contactsButton); _historyButton = new ToolBarButton("Call Log"); _historyButton->setIcon(StyleHint::Contacts1); _historyButton->sigClicked.connect(sigc::bind<int>(sigc::mem_fun(this, &App::showScreen), 1)); bar->addWidget(_historyButton); _settingsButton = new ToolBarButton("Settings"); _settingsButton->setIcon(StyleHint::Settings); _settingsButton->sigClicked.connect(sigc::bind<int>(sigc::mem_fun(this, &App::showScreen), 2)); bar->addWidget(_settingsButton); _holdButton = new ToolBarButton("Hold"); _holdButton->setVisible(false); _holdButton->setIcon(StyleHint::Pause); _holdButton->sigClicked.connect(sigc::mem_fun(this, &App::holdCall)); bar->addWidget(_holdButton); _muteButton = new ToolBarButton("Mute"); _muteButton->setVisible(false); _muteButton->setIcon(StyleHint::VolumeMuted); _muteButton->sigClicked.connect(sigc::mem_fun(this, &App::muteCall)); bar->addWidget(_muteButton); _hangupButton = new ToolBarButton("Hang Up"); _hangupButton->setVisible(false); _hangupButton->setIcon(StyleHint::Hangup); _hangupButton->sigClicked.connect(sigc::mem_fun(this, &App::hangupCall)); bar->addWidget(_hangupButton); //------------------------------------------------------------------------------------------------- // Create views //------------------------------------------------------------------------------------------------- _manager = new ContactManager(); _contacts = new Contacts(_manager); _contacts->sigCall.connect(sigc::mem_fun(this, &App::callContact)); addWidget(_contacts); _history = new History(); _history->sigCall.connect(sigc::mem_fun(this, &App::callContact)); _history->setVisible(false); addWidget(_history); _settings = new Settings(); _settings->setVisible(false); addWidget(_settings); _call = new Call(); _call->setVisible(false); _call->sigHangup.connect(sigc::mem_fun(this, &App::hangupCall)); addWidget(_call); _rightPanel = new VBoxLayout(); addWidget(_rightPanel); _dialer = new Dialer(); _rightPanel->addWidget(_dialer); _status = new Status(); _rightPanel->addWidget(_status); //------------------------------------------------------------------------------------------------- // Incoming call dialog //------------------------------------------------------------------------------------------------- _incomingCall = new Dialog("Incoming Call", Dialog::YesNoButtonOption); _incomingCall->setLayout(new VBoxLayout()); _caller = new Label(""); Size s = _caller->preferredSize(); _caller->setMinimumSize(PlatformManager::instance().getLayerSize().width() - 200, s.height()); _incomingCall->addWidget(_caller); _incomingCall->addWidget(new Label("Do you wish to accept?")); _incomingCall->sigAccepted.connect(sigc::mem_fun(this, &App::acceptCall)); _incomingCall->sigRejected.connect(sigc::mem_fun(this, &App::hangupCall)); sigVisible.connect(sigc::mem_fun(this, &App::runBaresip)); }
HScrollBar::HScrollBar( Widget *thumb /*= NULL*/, Widget *leftArrow /*= NULL*/, Widget *rightArrow /*= NULL*/ ) : lastArrowTick(0.0),largeAmount(10), minValue(0), maxValue(100), currentValue(0), downThumbPos(0), downMousePos(0), leftArrowDown(false),rightArrowDown(false), autoScrollStartInterval(0.35f),minThumbSize(10) { if(thumb) { isMaintainingThumb = false; pChildThumb = thumb; } else { isMaintainingThumb = true; pChildThumb = new Button(); ((Button*)pChildThumb)->setMouseLeaveState(Button::CLICKED); } if(leftArrow) { isMaintainingLeftArrow = false; pChildLeftArrow = leftArrow; ((Button*)pChildLeftArrow)->setMouseLeaveState(Button::CLICKED); } else { isMaintainingLeftArrow = true; pChildLeftArrow = new Button(); } if(rightArrow) { isMaintainingRightArrow = false; pChildRightArrow = rightArrow; } else { isMaintainingRightArrow = true; pChildRightArrow = new Button(); ((Button*)pChildRightArrow)->setMouseLeaveState(Button::CLICKED); } pChildThumb->setFocusable(false); pChildLeftArrow->setFocusable(false); pChildRightArrow->setFocusable(false); pChildThumb->addMouseListener(this); pChildLeftArrow->addMouseListener(this); pChildRightArrow->addMouseListener(this); pChildRightArrow->setBackColor(Color(80,160,200)); pChildLeftArrow->setBackColor(Color(80,160,200)); pChildThumb->setBackColor(Color(60,140,180)); pChildLeftArrow->setCausesLocationChange(true); pChildThumb->setCausesLocationChange(true); pChildRightArrow->setCausesLocationChange(true); addPrivateChild(pChildThumb); addPrivateChild(pChildLeftArrow); addPrivateChild(pChildRightArrow); setLeftArrowAmount(5); setRightArrowAmount(5); setArrowWidth(16); setSize(400,16); setMargins(0,0,0,0); setCausesLocationChange(true); setBackColor(Color(200,200,201)); }