您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ theme函数代码示例

51自学网 2021-06-03 08:47:55
  C++
这篇教程C++ theme函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中theme函数的典型用法代码示例。如果您正苦于以下问题:C++ theme函数的具体用法?C++ theme怎么用?C++ theme使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了theme函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: setPressedPart

void Scrollbar::mouseDown(const PlatformMouseEvent& evt){    // Early exit for right click    if (evt.button() == RightButton)        return;    setPressedPart(theme()->hitTest(this, evt.position()));    int pressedPos = orientation() == HorizontalScrollbar ? convertFromContainingWindow(evt.position()).x() : convertFromContainingWindow(evt.position()).y();    if ((m_pressedPart == BackTrackPart || m_pressedPart == ForwardTrackPart) && theme()->shouldCenterOnThumb(this, evt)) {        setHoveredPart(ThumbPart);        setPressedPart(ThumbPart);        m_dragOrigin = m_currentPos;        int thumbLen = theme()->thumbLength(this);        int desiredPos = pressedPos;        // Set the pressed position to the middle of the thumb so that when we do the move, the delta        // will be from the current pixel position of the thumb to the new desired position for the thumb.        m_pressedPos = theme()->trackPosition(this) + theme()->thumbPosition(this) + thumbLen / 2;        moveThumb(desiredPos);        return;    } else if (m_pressedPart == ThumbPart)        m_dragOrigin = m_currentPos;    m_pressedPos = pressedPos;    autoscrollPressedPart(theme()->initialAutoscrollTimerDelay());}
开发者ID:kjthegod,项目名称:WebKit,代码行数:27,


示例2: theme

void Scrollbar::moveThumb(int pos, bool draggingDocument){    if (!m_scrollableArea)        return;    int delta = pos - m_pressedPos;    if (draggingDocument) {        if (m_draggingDocument)            delta = pos - m_documentDragPos;        m_draggingDocument = true;        FloatPoint currentPosition = m_scrollableArea->scrollAnimator()->currentPosition();        float destinationPosition = (m_orientation == HorizontalScrollbar ? currentPosition.x() : currentPosition.y()) + delta;        destinationPosition = m_scrollableArea->clampScrollPosition(m_orientation, destinationPosition);        m_scrollableArea->scrollToOffsetWithoutAnimation(m_orientation, destinationPosition);        m_documentDragPos = pos;        return;    }    if (m_draggingDocument) {        delta += m_pressedPos - m_documentDragPos;        m_draggingDocument = false;    }    // Drag the thumb.    int thumbPos = theme()->thumbPosition(this);    int thumbLen = theme()->thumbLength(this);    int trackLen = theme()->trackLength(this);    if (delta > 0)        delta = std::min(trackLen - thumbLen - thumbPos, delta);    else if (delta < 0)        delta = std::max(-thumbPos, delta);    float minPos = m_scrollableArea->minimumScrollPosition(m_orientation);    float maxPos = m_scrollableArea->maximumScrollPosition(m_orientation);    if (delta) {        float newPosition = static_cast<float>(thumbPos + delta) * (maxPos - minPos) / (trackLen - thumbLen) + minPos;        m_scrollableArea->scrollToOffsetWithoutAnimation(m_orientation, newPosition);    }}
开发者ID:kjthegod,项目名称:WebKit,代码行数:40,


示例3: main

int main(int argc, char ** argv){    LTHEME::LoadCustomEnvSettings();    QApplication a(argc, argv);    LUtils::LoadTranslation(&a, "lumina-fileinfo");    LuminaThemeEngine theme(&a);    //Read the input variables    QString path = "";    QString flag = "";    if (argc==2) {        path = QString::fromLocal8Bit(argv[1]);    } else if (argc==3) {        flag = QString::fromLocal8Bit(argv[1]);        path = QString::fromLocal8Bit(argv[2]);    }    //Check the input variables    // - path    if(!path.isEmpty()) {        path = LUtils::PathToAbsolute(path);    }    // - flag    if(!flag.isEmpty()) {        if(flag=="-application") {            flag = "APP"; //for internal use        } else if(flag=="-link") {            flag = "LINK"; //for internal use        } else {            //Invalid flag - clear the path as well            path.clear();        }    }    if(!path.isEmpty()) {        //if(!QFile::exists(path)){ LUtils::writeFile(path,QStringList()); } //create an empty file        MainUI w;        QObject::connect(&theme, SIGNAL(updateIcons()), &w, SLOT(UpdateIcons()) );        w.LoadFile(path, flag);        w.show();        int retCode = a.exec();        return retCode;    } else {        //Show an error text and exit        QStringList msg;        msg << "ERROR: Invalid input arguments";        msg << "Usage: /"lumina-fileinfo [-application | -link] <file>";        qDebug() << msg.join("/n");        return 1;    }}
开发者ID:abishai,项目名称:lumina,代码行数:52,


示例4: moveThumb

void Scrollbar::mouseMoved(const PlatformMouseEvent& evt){    if (m_pressedPart == ThumbPart) {        if (theme()->shouldSnapBackToDragOrigin(this, evt)) {            if (m_scrollableArea) {                m_scrollableArea->setScrollPositionSingleAxis(m_orientation, m_dragOrigin + m_scrollableArea->minimumScrollPosition(m_orientation), UserScroll);            }        } else {            moveThumb(m_orientation == HorizontalScrollbar ?                      convertFromContainingWindow(evt.position()).x() :                      convertFromContainingWindow(evt.position()).y(), theme()->shouldDragDocumentInsteadOfThumb(this, evt));        }        return;    }    if (m_pressedPart != NoPart)        m_pressedPos = orientation() == HorizontalScrollbar ? convertFromContainingWindow(evt.position()).x() : convertFromContainingWindow(evt.position()).y();    ScrollbarPart part = theme()->hitTest(this, evt.position());    if (part != m_hoveredPart) {        if (m_pressedPart != NoPart) {            if (part == m_pressedPart) {                // The mouse is moving back over the pressed part.  We                // need to start up the timer action again.                startTimerIfNeeded(theme()->autoscrollTimerDelay());                setNeedsPaintInvalidation();            } else if (m_hoveredPart == m_pressedPart) {                // The mouse is leaving the pressed part.  Kill our timer                // if needed.                stopTimerIfNeeded();                setNeedsPaintInvalidation();            }        }        setHoveredPart(part);    }    return;}
开发者ID:azureplus,项目名称:chromium,代码行数:39,


示例5: ASSERT

void RenderSlider::layout(){    ASSERT(needsLayout());    SliderThumbElement* thumbElement = shadowSliderThumb();    RenderBox* thumb = thumbElement ? toRenderBox(thumbElement->renderer()) : 0;    IntSize baseSize(borderAndPaddingWidth(), borderAndPaddingHeight());    if (thumb) {        // Allow the theme to set the size of the thumb.        if (thumb->style()->hasAppearance()) {            // FIXME: This should pass the style, not the renderer, to the theme.            theme()->adjustSliderThumbSize(thumb);        }        baseSize.expand(thumb->style()->width().calcMinValue(0), thumb->style()->height().calcMinValue(0));    }    LayoutRepainter repainter(*this, checkForRepaintDuringLayout());    IntSize oldSize = size();    setSize(baseSize);    computeLogicalWidth();    computeLogicalHeight();    updateLayerTransform();    if (thumb) {        if (oldSize != size())            thumb->setChildNeedsLayout(true, false);        LayoutStateMaintainer statePusher(view(), this, IntSize(x(), y()), style()->isFlippedBlocksWritingMode());        IntRect oldThumbRect = thumb->frameRect();        thumb->layoutIfNeeded();        IntRect rect = thumbRect();        thumb->setFrameRect(rect);        if (thumb->checkForRepaintDuringLayout())            thumb->repaintDuringLayoutIfMoved(oldThumbRect);        statePusher.pop();        addOverflowFromChild(thumb);    }    repainter.repaintAfterLayout();        setNeedsLayout(false);}
开发者ID:sanyaade-mobiledev,项目名称:Webkit-Projects,代码行数:51,


示例6: draw

    /////////////////////////////////////////////////////////////////////////////////////////    // ThemedSkin::draw const    //! Draws a standard button control    //!     //! /param[in,out] &btn - Button to be drawn    //! /param[in,out] &dc - Output device context    //! /param[in] const &rc - Drawing rectangle    /////////////////////////////////////////////////////////////////////////////////////////    void draw(Button<ENC>& btn, DeviceContext& dc, const RectL& rc) const override    {      Theme theme(btn.handle(), L"Button");      // Determine state      ::PUSHBUTTONSTATES state = PBS_NORMAL;      if (!btn.Enabled)        state = PBS_DISABLED;      else if (btn.State == ButtonState::Pushed) //else if (args.State && OwnerDrawState::Selected)        state = PBS_PRESSED;      else if (btn.isMouseOver())        state = PBS_HOT;            // Draw background       theme.fill(dc, BP_PUSHBUTTON, state, rc);      // Query content rect      RectL rcContent = theme.content(dc, BP_CHECKBOX, state, rc);      // Pressed: Offset drawing rect      if (state == PBS_PRESSED)        rcContent += PointL(1,1);      // Draw icon      if (btn.Icon.exists())       {        RectL rcIcon = rcContent.arrange(Metrics::WindowIcon, {RectL::FromLeft,Metrics::WindowEdge.Width}, RectL::Centre);        dc.draw(btn.Icon, rcIcon);      }            // Calculate text rectangle      RectL rcText = rcContent;      if (btn.Icon.exists())         rcText.Left += Metrics::WindowIcon.Width + Metrics::WindowEdge.Width;      // Draw text      if (state != PBS_DISABLED)        theme.write(dc, BP_PUSHBUTTON, state, btn.Text(), rcText, DrawTextFlags::Centre|DrawTextFlags::VCentre|DrawTextFlags::SingleLine);      else      {        const auto grayString = choose<ENC>(::GrayStringA,::GrayStringW);        grayString(dc.handle(), StockBrush::AppWorkspace, nullptr, (LPARAM)btn.Text().c_str(), btn.Text().size(), rcText.Left, rcText.Top, rcText.width(), rcText.height());      }            // [FOCUS] Draw focus rectangle      if (btn.Focus)         {        RectL rcFocus = rcContent.inflate(-Metrics::WindowEdge);        dc.focus(rcFocus);      }    }
开发者ID:nick-crowley,项目名称:Win32-Template-Library,代码行数:59,


示例7: prepareSearchLine

 void prepareSearchLine() {     ui->searchLine->setDelayedSignals(true);     QToolButton *left = new QToolButton(q);     left->setIcon(theme()->icon(Core::Constants::ICONSEARCH));     ui->searchLine->setLeftButton(left);     QToolButton *right = new QToolButton(q);     right->addAction(aSearchMolsAndClass);     right->addAction(aSearchClassOnly);     right->addAction(aSearchMolsOnly);     right->setDefaultAction(aSearchMolsAndClass);     ui->searchLine->setRightButton(right);     QObject::connect(right, SIGNAL(triggered(QAction*)), q, SLOT(toggleClassMolsFilter(QAction*))); }
开发者ID:Dinesh-Ramakrishnan,项目名称:freemedforms,代码行数:14,


示例8: theme

void ThemeManager::newTheme(){	Theme theme(QString(), false);	ThemeDialog dialog(theme, this);	dialog.setWindowTitle(ThemeDialog::tr("New Theme"));	if (dialog.exec() == QDialog::Rejected) {		return;	}	QListWidgetItem* item = addItem(theme.id(), false, theme.name());	m_themes->setCurrentItem(item);	m_tabs->setCurrentIndex(1);}
开发者ID:wkoomson,项目名称:focuswriter,代码行数:14,


示例9: loadDefaults

	void IconManager::readSettings(QSettings *settings)	{		settings->beginGroup(appGroup);		QString iconTheme = settings->value(iconThemeKey).toString();		if(iconTheme.isEmpty()) {			loadDefaults();		} else {			IconTheme theme(qApp->applicationDirPath() + "/themes/icons/" + iconTheme + "/theme.json");			loadTheme(theme);		}		settings->endGroup();	}
开发者ID:KittyIM,项目名称:kitty.im,代码行数:14,


示例10: setCurrentPos

bool Scrollbar::mouseMoved(const PlatformMouseEvent& evt){    if (m_pressedPart == ThumbPart) {        if (theme()->shouldSnapBackToDragOrigin(this, evt))            setCurrentPos(m_dragOrigin, NotFromScrollAnimator);        else {            moveThumb(m_orientation == HorizontalScrollbar ?                       convertFromContainingWindow(evt.pos()).x() :                      convertFromContainingWindow(evt.pos()).y());        }        return true;    }    if (m_pressedPart != NoPart)        m_pressedPos = (orientation() == HorizontalScrollbar ? convertFromContainingWindow(evt.pos()).x() : convertFromContainingWindow(evt.pos()).y());    ScrollbarPart part = theme()->hitTest(this, evt);        if (part != m_hoveredPart) {        if (m_pressedPart != NoPart) {            if (part == m_pressedPart) {                // The mouse is moving back over the pressed part.  We                // need to start up the timer action again.                startTimerIfNeeded(theme()->autoscrollTimerDelay());                theme()->invalidatePart(this, m_pressedPart);            } else if (m_hoveredPart == m_pressedPart) {                // The mouse is leaving the pressed part.  Kill our timer                // if needed.                stopTimerIfNeeded();                theme()->invalidatePart(this, m_pressedPart);            }        }                 setHoveredPart(part);    }     return true;}
开发者ID:achellies,项目名称:WinCEWebKit,代码行数:37,


示例11: main

int main(int argc, char ** argv){    if (argc > 1) {      if (QString(argv[1]) == QString("--version")){        qDebug() << LUtils::LuminaDesktopVersion();        return 0;      }    }    if(!QFile::exists(LOS::LuminaShare())){      qDebug() << "Lumina does not appear to be installed correctly. Cannot find: " << LOS::LuminaShare();      return 1;    }    //Setup any pre-QApplication initialization values    LXDG::setEnvironmentVars();    setenv("DESKTOP_SESSION","LUMINA",1);    setenv("XDG_CURRENT_DESKTOP","LUMINA",1);    //Setup the log file    qDebug() << "Lumina Log File:" << logfile.fileName();    if(QFile::exists(logfile.fileName()+".old")){ QFile::remove(logfile.fileName()+".old"); }    if(logfile.exists()){ QFile::rename(logfile.fileName(), logfile.fileName()+".old"); }      //Make sure the parent directory exists      if(!QFile::exists(QDir::homePath()+"/.lumina/logs")){        QDir dir;        dir.mkpath(QDir::homePath()+"/.lumina/logs");      }    logfile.open(QIODevice::WriteOnly | QIODevice::Append);    QTime *timer=0;    if(DEBUG){ timer = new QTime(); timer->start(); }    //Startup the Application    if(DEBUG){ qDebug() << "Session Init:" << timer->elapsed(); }    LSession a(argc, argv);    if(DEBUG){ qDebug() << "Theme Init:" << timer->elapsed(); }    LuminaThemeEngine theme(&a);    //Setup Log File    qInstallMessageHandler(MessageOutput);    if(DEBUG){ qDebug() << "Session Setup:" << timer->elapsed(); }    a.setupSession();    if(DEBUG){ qDebug() << "Load Locale:" << timer->elapsed(); }    LUtils::LoadTranslation(&a, "lumina-desktop");    //a.LoadLocale(QLocale().name());    //Start launching external applications    QTimer::singleShot(3000, &a, SLOT(launchStartupApps()) ); //wait a couple seconds first    if(DEBUG){ qDebug() << "Exec Time:" << timer->elapsed(); delete timer;}    int retCode = a.exec();    //qDebug() << "Stopping the window manager";    qDebug() << "Finished Closing Down Lumina";    logfile.close();    return retCode;}
开发者ID:sadig41,项目名称:lumina,代码行数:49,


示例12: setPressedPart

void Scrollbar::mouseUp(const PlatformMouseEvent& mouseEvent){    setPressedPart(NoPart);    m_pressedPos = 0;    m_draggingDocument = false;    stopTimerIfNeeded();    if (m_scrollableArea) {        // m_hoveredPart won't be updated until the next mouseMoved or mouseDown, so we have to hit test        // to really know if the mouse has exited the scrollbar on a mouseUp.        ScrollbarPart part = theme()->hitTest(this, mouseEvent.position());        if (part == NoPart)            m_scrollableArea->mouseExitedScrollbar(this);    }}
开发者ID:kingysu,项目名称:blink-crosswalk,代码行数:15,


示例13: create_widget

void create_widget(const dictionary_t&  parameters,                    size_enum_t          size,                   reveal_t*&           widget){    std::string             name;    std::string             alt_text;    any_regular_t    show_value(true);    theme_t          theme(implementation::size_to_theme(size));    get_value(parameters, key_value_on, show_value);    get_value(parameters, key_alt_text, alt_text);    get_value(parameters, key_name, name);    widget = new reveal_t(name, show_value, theme, alt_text);}
开发者ID:ilelann,项目名称:legacy,代码行数:15,


示例14: switch

void Render::draw(int mode){	switch(mode)	{		case 0:			prelude();			break;		case 1:			theme();			break;		case 2:			finale();			break;	} // switch mode} // draw()
开发者ID:adahera222,项目名称:yogo-grenade,代码行数:15,


示例15: mask

 uint PropertySheetIconValue::compare(const PropertySheetIconValue &other) const {     uint diffMask = mask() | other.mask();     for (int i = 0; i < 8; i++) {         const uint flag = 1 << i;         if (diffMask & flag) { // if state is set in both icons, compare the values             const QPair<QIcon::Mode, QIcon::State> state = subPropertyFlagToIconModeState(flag);             if (pixmap(state.first, state.second) == other.pixmap(state.first, state.second))                 diffMask &= ~flag;         }     }     if ((diffMask & ThemeIconMask) && theme() == other.theme())         diffMask &= ~ThemeIconMask;     return diffMask; }
开发者ID:fluxer,项目名称:katie,代码行数:15,


示例16: GuiRadioButton

GuiRadioButton* GuiPane::addRadioButton(const GuiText& text, int myID, void* selection,                                         GuiTheme::RadioButtonStyle style) {    GuiRadioButton* c = addControl        (new GuiRadioButton(this, text, myID, Pointer<int>(reinterpret_cast<int*>(selection)), style));    Vector2 size(0, (float)CONTROL_HEIGHT);    if (style == GuiTheme::TOOL_RADIO_BUTTON_STYLE) {        Vector2 bounds = theme()->minButtonSize(text, GuiTheme::TOOL_BUTTON_STYLE);        size.x = max(float(TOOL_BUTTON_WIDTH), bounds.x);    } else if (style == 1) { // Doesn't compile on gcc unless we put the integer in. GuiTheme::BUTTON_RADIO_BUTTON_STYLE) {        size.x = BUTTON_WIDTH;        Vector2 bounds = theme()->minButtonSize(text, GuiTheme::NORMAL_BUTTON_STYLE);        size = size.max(bounds);    } else { // NORMAL_RADIO_BUTTON_STYLE        Vector2 bounds = theme()->minButtonSize(text, GuiTheme::NORMAL_BUTTON_STYLE);        size.x = bounds.x;    }    c->setSize(size);    return c;}
开发者ID:A7med-Shoukry,项目名称:g3d,代码行数:24,


示例17: theme

void GuiScrollPane::pack() {    float scrollBarWidth = theme()->scrollBarWidth();    m_viewPane->setPosition(0,0);    m_viewPane->pack();    Rect2D viewRect = m_viewPane->rect();    if (verticalEnabled) {        if (viewRect.width() > MIN_WINDOW_SIZE) {            setWidth(viewRect.width() + scrollBarWidth);        }    }    if (horizontalEnabled) {        if(viewRect.height() < m_rect.height() && viewRect.height() > MIN_WINDOW_SIZE) {            setHeight(viewRect.height() + scrollBarWidth);        }     }}
开发者ID:jackpoz,项目名称:G3D-backup,代码行数:16,


示例18: switch

void Game::update(){	switch(mode)	{		case PRELUDE:			prelude();			break;		case THEME:			theme();			break;		case FINALE:			finale();			break;	}; // switch state} // update()
开发者ID:adahera222,项目名称:yogo-grenade,代码行数:16,


示例19: settings

QIcon ConfigTabAppearance::createThemeIcon(const QString &fileName){    QSettings settings(fileName, QSettings::IniFormat);    Theme theme(settings);    QPixmap pix(16, 16);    pix.fill(Qt::black);    QPainter p(&pix);    QRect rect(1, 1, 14, 5);    p.setPen(Qt::NoPen);    p.setBrush( theme.color("sel_bg") );    p.drawRect(rect);    rect.translate(0, 5);    p.setBrush( theme.color("bg") );    p.drawRect(rect);    rect.translate(0, 5);    p.setBrush( theme.color("alt_bg") );    p.drawRect(rect);    QLine line;    line = QLine(2, 3, 14, 3);    QPen pen;    p.setOpacity(0.6);    pen.setColor( theme.color("sel_fg") );    pen.setDashPattern(QVector<qreal>() << 2 << 1 << 1 << 1 << 3 << 1 << 2 << 10);    p.setPen(pen);    p.drawLine(line);    line.translate(0, 5);    pen.setColor( theme.color("fg") );    pen.setDashPattern(QVector<qreal>() << 2 << 1 << 4 << 10);    p.setPen(pen);    p.drawLine(line);    line.translate(0, 5);    pen.setDashPattern(QVector<qreal>() << 3 << 1 << 2 << 1);    p.setPen(pen);    p.drawLine(line);    return pix;}
开发者ID:m4r71n,项目名称:CopyQ,代码行数:47,


示例20: style

void RenderSliderThumb::updateAppearance(RenderStyle* parentStyle){    if (parentStyle->appearance() == SliderVerticalPart)        style().setAppearance(SliderThumbVerticalPart);    else if (parentStyle->appearance() == SliderHorizontalPart)        style().setAppearance(SliderThumbHorizontalPart);    else if (parentStyle->appearance() == MediaSliderPart)        style().setAppearance(MediaSliderThumbPart);    else if (parentStyle->appearance() == MediaVolumeSliderPart)        style().setAppearance(MediaVolumeSliderThumbPart);    else if (parentStyle->appearance() == MediaFullScreenVolumeSliderPart)        style().setAppearance(MediaFullScreenVolumeSliderThumbPart);    if (style().hasAppearance()) {        ASSERT(element());        theme().adjustSliderThumbSize(style(), element());    }}
开发者ID:rodrigo-speller,项目名称:webkit,代码行数:17,


示例21: images

wxImageList& Pcsx2App::GetImgList_Config(){	ScopedPtr<wxImageList>& images( GetResourceCache().ConfigImages );	if( !images )	{		int image_size = MSW_GetDPIScale() * g_Conf->Listbook_ImageSize;		images = new wxImageList(image_size, image_size);		wxFileName mess;		bool useTheme = (g_Conf->DeskTheme != L"default");		if( useTheme )		{			wxDirName theme( PathDefs::GetThemes() + g_Conf->DeskTheme );			mess = theme.ToString();		}		wxImage img;		// GCC Specific: wxT() macro is required when using string token pasting.  For some		// reason L generates syntax errors. >_<		// TODO: This can be fixed with something like		// #define L_STR(x) L_STR2(x)		// #define L_STR2(x) L ## x		// but it's probably best to do it everywhere at once. wxWidgets		// recommends not to use it since v2.9.0.		#undef  FancyLoadMacro		#define FancyLoadMacro( name ) /		{ /			EmbeddedImage<res_ConfigIcon_##name> temp; /			LoadImageAny(img, useTheme, mess, L"ConfigIcon_" wxT(#name), temp); /			img.Rescale(image_size, image_size, wxIMAGE_QUALITY_HIGH); /			m_Resources->ImageId.Config.name = images->Add(img); /		}		FancyLoadMacro( Paths );		FancyLoadMacro( Plugins );		FancyLoadMacro( Gamefixes );		FancyLoadMacro( Speedhacks );		FancyLoadMacro( MemoryCard );		FancyLoadMacro( Video );		FancyLoadMacro( Cpu );		FancyLoadMacro( Appearance );	}	return *images;}
开发者ID:nkreadly07,项目名称:pcsx2,代码行数:46,


示例22: main

int main(int argc, char *argv[]){   ALLEGRO_DISPLAY *display;   ALLEGRO_FONT *font;   (void)argc;   (void)argv;   if (!al_init()) {      abort_example("Could not init Allegro./n");      return 1;   }   al_init_primitives_addon();   al_init_image_addon();   al_init_font_addon();   al_install_keyboard();   al_install_mouse();   al_set_new_display_flags(ALLEGRO_GENERATE_EXPOSE_EVENTS);   display = al_create_display(640, 480);   if (!display) {      abort_example("Error creating display/n");      return 1;   }   //printf("Display format = %d/n", al_get_display_format());   font = al_load_font("data/fixed_font.tga", 0, 0);   if (!font) {      abort_example("Failed to load data/fixed_font.tga/n");      return 1;   }   /* Don't remove these braces. */   {      Theme theme(font);      Prog prog(theme, display);      prog.run();   }   al_destroy_font(font);   return 0;}
开发者ID:hermanblarsen,项目名称:T1Y1_C_Assignment,代码行数:46,


示例23: main

int main(int argc, char ** argv){  LTHEME::LoadCustomEnvSettings();  QApplication a(argc, argv);  LUtils::LoadTranslation(&a, "lumina-fileinfo");  LuminaThemeEngine theme(&a);  //Read the input variables  QString path = "";  QString flag = "";  for(int i=1; i<argc; i++){    if( QString(argv[i]).startsWith("-") ){ flag = QString(argv[i]); }    else{ path = QString(argv[i]); break; }  }  //Check the input variables  // - path  if(!path.isEmpty()){ path = LUtils::PathToAbsolute(path); }  // - flag  if(!flag.isEmpty()){    if(flag=="-application"){      flag = "APP"; //for internal use    }else if(flag=="-link"){      flag = "LINK"; //for internal use    }else{      //Invalid flag - clear the path as well      flag.clear();      path.clear();    }  }  if(!path.isEmpty() || !flag.isEmpty()){     MainUI w;      QObject::connect(&theme, SIGNAL(updateIcons()), &w, SLOT(UpdateIcons()) );    w.LoadFile(path, flag);    w.show();    int retCode = a.exec();    return retCode;  }else{    //Show an error text and exit    qDebug() << "ERROR: Invalid input arguments";    qDebug() << "Usage: /"lumina-fileinfo [-application | -link] [file]";    return 1;  }}
开发者ID:yamajun,项目名称:lumina,代码行数:46,


示例24: theme

void Scrollbar::autoscrollPressedPart(double delay){    // Don't do anything for the thumb or if nothing was pressed.    if (m_pressedPart == ThumbPart || m_pressedPart == NoPart)        return;    // Handle the track.    if ((m_pressedPart == BackTrackPart || m_pressedPart == ForwardTrackPart) && thumbUnderMouse(this)) {        theme()->invalidatePart(this, m_pressedPart);        setHoveredPart(ThumbPart);        return;    }    // Handle the arrows and track.    if (m_scrollableArea && m_scrollableArea->scroll(pressedPartScrollDirection(), pressedPartScrollGranularity()))        startTimerIfNeeded(delay);}
开发者ID:sysrqb,项目名称:chromium-src,代码行数:17,


示例25: create_widget

void create_widget(const dictionary_t& parameters,                   size_enum_t         size,                   checkbox_t* &       checkbox){    std::string    name;    std::string    alt_text;    any_regular_t true_value(true);    any_regular_t false_value(false);    theme_t theme(implementation::size_to_theme(size));    get_value(parameters, key_name, name);    get_value(parameters, key_alt_text, alt_text);    get_value(parameters, key_value_on, true_value);    get_value(parameters, key_value_off, false_value);    checkbox = new checkbox_t(name, true_value, false_value, theme, alt_text);}
开发者ID:ilelann,项目名称:adobe_platform_libraries,代码行数:17,



注:本文中的theme函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ themeChanged函数代码示例
C++ the_canvas函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。