• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ setDefaultSize函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: setVisible

void LoginDialog::postInit()
{
    Window::postInit();
    setVisible(Visible_true);

    const int h = 200;
    if (mUpdateHostLabel)
        setContentSize(310, 250);
    setContentSize(310, h);
#ifdef ANDROID
    setDefaultSize(310, h, ImageRect::UPPER_CENTER, 0, 0);
#else
    setDefaultSize(310, h, ImageRect::CENTER, 0, 0);
#endif
    center();
    loadWindowState();
    reflowLayout();

    if (mUserField->getText().empty())
        mUserField->requestFocus();
    else
        mPassField->requestFocus();

    mLoginButton->setEnabled(canSubmit());
    if (loginHandler)
    {
        mRegisterButton->setEnabled(loginHandler->isRegistrationEnabled()
            || !mLoginData->registerUrl.empty());
    }
    else
    {
        mRegisterButton->setEnabled(false);
    }
}
开发者ID:Rawng,项目名称:ManaPlus,代码行数:34,代码来源:logindialog.cpp


示例2: Window

Minimap::Minimap() :
    // TRANSLATORS: mini map window name
    Window(_("Map"), Modal_false, nullptr, "map.xml"),
    mWidthProportion(0.5),
    mHeightProportion(0.5),
    mMapImage(nullptr),
    mMapOriginX(0),
    mMapOriginY(0),
    mCustomMapImage(false),
    mAutoResize(config.getBoolValue("autoresizeminimaps"))
{
    setWindowName("Minimap");
    mShow = config.getValueBool(getWindowName() + "Show", true);

    config.addListener("autoresizeminimaps", this);

    setDefaultSize(5, 25, 100, 100);
    // set this to false as the minimap window size is changed
    // depending on the map size
    setResizable(true);
    if (setupWindow)
        setupWindow->registerWindowForReset(this);

    setDefaultVisible(true);
    setSaveVisible(true);

    setStickyButton(true);
    setSticky(false);

    loadWindowState();
    setVisible(fromBool(mShow, Visible), isSticky());
    enableVisibleSound(true);
}
开发者ID:qpulsar,项目名称:ManaPlus,代码行数:33,代码来源:minimap.cpp


示例3: Window

BuySellDialog::BuySellDialog():
    Window(_("Shop")),
    mBuyButton(0)
{
    setWindowName("BuySell");

    static const char *buttonNames[] = {
        N_("Buy"), N_("Sell"), N_("Cancel"), 0
    };
    int x = 10, y = 10;

    for (const char **curBtn = buttonNames; *curBtn; curBtn++)
    {
        Button *btn = new Button(gettext(*curBtn), *curBtn, this);
        if (!mBuyButton)
            mBuyButton = btn; // For focus request
        btn->setPosition(x, y);
        add(btn);
        x += btn->getWidth() + 10;
    }
    mBuyButton->requestFocus();

    setContentSize(x, 2 * y + mBuyButton->getHeight());

    center();
    setDefaultSize();
    loadWindowState();
}
开发者ID:kai62656,项目名称:manabot,代码行数:28,代码来源:buysell.cpp


示例4: QSvgRenderer

void MySvgView::setSource(QUrl arg)
{
    if (m_source != arg) {
        m_source = arg;

        QString str = m_source.toLocalFile();
        if(str == "") {
            str = m_source.toString();
            if(str=="") {
                svg->deleteLater();
                svg = new QSvgRenderer(this);
                return;
            }
        }

        if( str.mid (0, 3) == "qrc")
            str = str.mid (3, str.count ()-3);
        svg->load (str);
        setDefaultSize (svg->defaultSize ());
        int width = svg->defaultSize ().width ();
        int height = svg->defaultSize ().height ();
        setImplicitWidth(width);
        setImplicitHeight(height);
        update ();
        emit sourceChanged(arg);
    }
}
开发者ID:cnstar,项目名称:QQStars,代码行数:27,代码来源:mysvgview.cpp


示例5: Window

BuddyWindow::BuddyWindow():
    Window(_("Buddy"))
{
    setWindowName("BuddyWindow");
    setCaption(_("Buddy List"));
    setResizable(true);
    setCloseButton(true);
    setSaveVisible(true);
    setMinWidth(110);
    setMinHeight(200);
    setDefaultSize(124, 41, 288, 330);

    Image *addImg = ResourceManager::getInstance()->getImage("buddyadd.png");
    Image *delImg = ResourceManager::getInstance()->getImage("buddydel.png");

    if (addImg && delImg)
    {
        Icon *addBuddy = new Icon(addImg);
        Icon *delBuddy = new Icon(delImg);

        add(addBuddy);
        add(delBuddy);
    }

    loadWindowState();
}
开发者ID:mekolat,项目名称:elektrogamesvn,代码行数:26,代码来源:buddywindow.cpp


示例6: Window

EquipmentWindow::EquipmentWindow(Equipment *equipment):
    Window(_("Equipment")),
    mEquipBox(0),
    mSelected(-1),
    mEquipment(equipment),
    mBoxesNumber(0)
{
    mItemPopup = new ItemPopup;
    setupWindow->registerWindowForReset(this);

    // Control that shows the Player
    PlayerBox *playerBox = new PlayerBox;
    playerBox->setDimension(gcn::Rectangle(50, 80, 74, 123));
    playerBox->setPlayer(local_player);

    setWindowName("Equipment");
    setCloseButton(true);
    setSaveVisible(true);
    setDefaultSize(180, 300, ImageRect::CENTER);
    loadWindowState();

    mUnequip = new Button(_("Unequip"), "unequip", this);
    const gcn::Rectangle &area = getChildrenArea();
    mUnequip->setPosition(area.width  - mUnequip->getWidth() - 5,
                          area.height - mUnequip->getHeight() - 5);
    mUnequip->setEnabled(false);

    add(playerBox);
    add(mUnequip);
}
开发者ID:TonyRice,项目名称:mana,代码行数:30,代码来源:equipmentwindow.cpp


示例7: Window

HelpWindow::HelpWindow():
    Window(_("Help"))
{
    setMinWidth(300);
    setMinHeight(250);
    setContentSize(455, 350);
    setWindowName("Help");
    setResizable(true);

    setDefaultSize(500, 400, ImageRect::CENTER);

    mBrowserBox = new BrowserBox;
    mBrowserBox->setOpaque(false);
    mScrollArea = new ScrollArea(mBrowserBox);
    Button *okButton = new Button(_("Close"), "close", this);

    mScrollArea->setDimension(gcn::Rectangle(5, 5, 445,
                                             335 - okButton->getHeight()));
    okButton->setPosition(450 - okButton->getWidth(),
                          345 - okButton->getHeight());

    mBrowserBox->setLinkHandler(this);

    place(0, 0, mScrollArea, 5, 3).setPadding(3);
    place(4, 3, okButton);

    Layout &layout = getLayout();
    layout.setRowHeight(0, Layout::AUTO_SET);

    loadWindowState();
}
开发者ID:kai62656,项目名称:manabot,代码行数:31,代码来源:help.cpp


示例8: Window

SkillDialog::SkillDialog():
    Window(_("Skills"))
{
    listen(Event::AttributesChannel);

    setWindowName("Skills");
    setCloseButton(true);
    setResizable(true);
    setSaveVisible(true);
    setDefaultSize(windowContainer->getWidth() - 280, 30, 275, 425);
    setMinHeight(113);
    setMinWidth(240);
    setupWindow->registerWindowForReset(this);

    mTabs = new TabbedArea();
    mPointsLabel = new Label("0");
    mIncreaseButton = new Button(_("Up"), "inc", this);

    place(0, 0, mTabs, 5, 5);
    place(0, 5, mPointsLabel, 4);
    place(4, 5, mIncreaseButton);

    center();
    loadWindowState();
}
开发者ID:TonyRice,项目名称:mana,代码行数:25,代码来源:skilldialog.cpp


示例9: Window

SkillDialog::SkillDialog() :
    // TRANSLATORS: skills dialog name
    Window(_("Skills"), Modal_false, nullptr, "skills.xml"),
    ActionListener(),
    mSkills(),
    mDurations(),
    mTabs(CREATEWIDGETR(TabbedArea, this)),
    mDeleteTabs(),
    mPointsLabel(new Label(this, "0")),
    // TRANSLATORS: skills dialog button
    mUseButton(new Button(this, _("Use"), "use", this)),
    // TRANSLATORS: skills dialog button
    mIncreaseButton(new Button(this, _("Up"), "inc", this)),
    mDefaultModel(nullptr)
{
    setWindowName("Skills");
    setCloseButton(true);
    setResizable(true);
    setSaveVisible(true);
    setStickyButtonLock(true);
    setDefaultSize(windowContainer->getWidth() - 280, 30, 275, 425);
    if (setupWindow)
        setupWindow->registerWindowForReset(this);

    mUseButton->setEnabled(false);
    mIncreaseButton->setEnabled(false);

    place(0, 0, mTabs, 5, 5);
    place(0, 5, mPointsLabel, 4);
    place(3, 5, mUseButton);
    place(4, 5, mIncreaseButton);
}
开发者ID:Rawng,项目名称:ManaPlus,代码行数:32,代码来源:skilldialog.cpp


示例10: Window

MagicDialog::MagicDialog():
    Window(_("Magic"))
{
    setWindowName("Magic");
    setCloseButton(true);
    setSaveVisible(true);
    setDefaultSize(255, 30, 175, 225);

    gcn::Button *spellButton1 = new Button(_("Cast Test Spell 1"), "spell_1", this);
    gcn::Button *spellButton2 = new Button(_("Cast Test Spell 2"), "spell_2", this);
    gcn::Button *spellButton3 = new Button(_("Cast Test Spell 3"), "spell_3", this);

    spellButton1->setPosition(10, 30);
    spellButton2->setPosition(10, 60);
    spellButton3->setPosition(10, 90);

    add(spellButton1);
    add(spellButton2);
    add(spellButton3);

    update();

    setLocationRelativeTo(getParent());
    loadWindowState();
}
开发者ID:kai62656,项目名称:manabot,代码行数:25,代码来源:magic.cpp


示例11: Window

NpcIntegerDialog::NpcIntegerDialog():
    Window(_("NPC Input"))
{
    setWindowName("NPCInput");
    saveVisibility(false);

    mValueField = new IntTextField(0, "ok", this);

    okButton = new Button(_("OK"), "ok", this);
    cancelButton = new Button(_("Cancel"), "cancel", this);
    resetButton = new Button(_("Reset"), "reset", this);

    ContainerPlacer place;
    place = getPlacer(0, 0);

    place(0, 0, mValueField, 3);
    place.getCell().matchColWidth(1, 0);
    place = getPlacer(0, 1);
    place(0, 0, resetButton);
    place(2, 0, cancelButton);
    place(3, 0, okButton);

    setDefaultSize(175, 75, ImageRect::CENTER);

    loadWindowState();
}
开发者ID:stevecotton,项目名称:Aethyra,代码行数:26,代码来源:npcintegerdialog.cpp


示例12: Window

DebugWindow::DebugWindow():
    Window(_("Debug"), false, nullptr, "debug.xml")
{
    setWindowName("Debug");
    if (setupWindow)
        setupWindow->registerWindowForReset(this);

    setResizable(true);
    setCloseButton(true);
    setSaveVisible(true);
    setStickyButtonLock(true);

    setDefaultSize(400, 300, ImageRect::CENTER);

    mTabs = new TabbedArea;
    mMapWidget = new MapDebugTab;
    mTargetWidget = new TargetDebugTab;
    mNetWidget = new NetDebugTab;

    mTabs->addTab(std::string(_("Map")), mMapWidget);
    mTabs->addTab(std::string(_("Target")), mTargetWidget);
    mTabs->addTab(std::string(_("Net")), mNetWidget);

    mTabs->setDimension(gcn::Rectangle(0, 0, 600, 300));
    add(mTabs);

    mMapWidget->resize(getWidth(), getHeight());
    mTargetWidget->resize(getWidth(), getHeight());
    mNetWidget->resize(getWidth(), getHeight());
    loadWindowState();
}
开发者ID:EvolOnline,项目名称:ManaPlus,代码行数:31,代码来源:debugwindow.cpp


示例13: Window

GuildWindow::GuildWindow():
    Window(_("Guild")),
    mFocus(false)
{
    setWindowName("Guild");
    setCaption(_("Guild"));
    setResizable(false);
    setCloseButton(true);
    setSaveVisible(true);
    setMinWidth(200);
    setMinHeight(280);
    setDefaultSize(124, 41, 288, 330);
    setupWindow->registerWindowForReset(this);

    // Set button events Id
    mGuildButton[0] = new Button(_("Create Guild"), "CREATE_GUILD", this);
    mGuildButton[1] = new Button(_("Invite User"), "INVITE_USER", this);
    mGuildButton[2] = new Button(_("Quit Guild"), "QUIT_GUILD", this);
    mGuildButton[1]->setEnabled(false);
    mGuildButton[2]->setEnabled(false);

    mGuildTabs = new TabbedArea;

    place(0, 0, mGuildButton[0]);
    place(1, 0, mGuildButton[1]);
    place(2, 0, mGuildButton[2]);
    place(0, 1, mGuildTabs);
    Layout &layout = getLayout();
    layout.setColWidth(0, 48);
    layout.setColWidth(1, 65);

    loadWindowState();
}
开发者ID:mekolat,项目名称:elektrogamesvn,代码行数:33,代码来源:guildwindow.cpp


示例14: Window

InventoryWindow::InventoryWindow(int invSize):
    Window(_("Inventory")),
    mMaxSlots(invSize),
    mSplit(false),
    mItemDesc(false)
{
    setWindowName("Inventory");
    setResizable(true);
    setCloseButton(true);
    setSaveVisible(true);

    setDefaultSize(387, 307, ImageRect::CENTER);
    setMinWidth(316);
    setMinHeight(179);
    addKeyListener(this);

    std::string longestUseString = getFont()->getWidth(_("Equip")) >
                                   getFont()->getWidth(_("Use")) ?
                                   _("Equip") : _("Use");

    if (getFont()->getWidth(longestUseString) <
        getFont()->getWidth(_("Unequip")))
    {
        longestUseString = _("Unequip");
    }

    mUseButton = new Button(longestUseString, "use", this);
    mDropButton = new Button(_("Drop"), "drop", this);
    mSplitButton = new Button(_("Split"), "split", this);
    mItems = new ItemContainer(player_node->getInventory());
    mItems->addSelectionListener(this);

    gcn::ScrollArea *invenScroll = new ScrollArea(mItems);
    invenScroll->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER);

    mTotalWeight = -1;
    mMaxWeight = -1;
    mUsedSlots = -1;

    mSlotsLabel = new Label(_("Slots:"));
    mWeightLabel = new Label(_("Weight:"));

    mSlotsBar = new ProgressBar(0.0f, 100, 20, gcn::Color(225, 200, 25));
    mWeightBar = new ProgressBar(0.0f, 100, 20, gcn::Color(0, 0, 255));

    place(0, 0, mWeightLabel).setPadding(3);
    place(1, 0, mWeightBar, 3);
    place(4, 0, mSlotsLabel).setPadding(3);
    place(5, 0, mSlotsBar, 2);
    place(0, 1, invenScroll, 7).setPadding(3);
    place(0, 2, mUseButton);
    place(1, 2, mDropButton);
    place(2, 2, mSplitButton);

    Layout &layout = getLayout();
    layout.setRowHeight(1, Layout::AUTO_SET);

    loadWindowState();
}
开发者ID:kai62656,项目名称:manabot,代码行数:59,代码来源:inventorywindow.cpp


示例15: Window

WhoIsOnline::WhoIsOnline() :
    // TRANSLATORS: who is online window name
    Window(_("Who Is Online - Updating"), false, nullptr, "whoisonline.xml"),
    mThread(nullptr),
    mDownloadStatus(UPDATE_LIST),
    mDownloadComplete(true),
    mDownloadedBytes(0),
    mMemoryBuffer(nullptr),
    mCurlError(new char[CURL_ERROR_SIZE]),
    mBrowserBox(new BrowserBox(this)),
    mScrollArea(new ScrollArea(mBrowserBox, false)),
    mUpdateTimer(0),
    mOnlinePlayers(),
    mOnlineNicks(),
    // TRANSLATORS: who is online. button.
    mUpdateButton(new Button(this, _("Update"), "update", this)),
    mAllowUpdate(true),
    mShowLevel(false),
    mUpdateOnlineList(config.getBoolValue("updateOnlineList")),

    mGroupFriends(true)
{
    mCurlError[0] = 0;
    setWindowName("WhoIsOnline");

    const int h = 350;
    const int w = 200;
    setDefaultSize(w, h, ImageRect::CENTER);
    setVisible(false);
    setCloseButton(true);
    setResizable(true);
    setStickyButtonLock(true);
    setSaveVisible(true);

    mUpdateButton->setEnabled(false);
    mUpdateButton->setDimension(gcn::Rectangle(5, 5, w - 10, 20 + 5));

    mBrowserBox->setOpaque(false);
    mBrowserBox->setHighlightMode(BrowserBox::BACKGROUND);
    mScrollArea->setDimension(gcn::Rectangle(5, 20 + 10, w - 10, h - 10 - 30));
    mScrollArea->setSize(w - 10, h - 10 - 30);
    mBrowserBox->setLinkHandler(this);

    add(mUpdateButton);
    add(mScrollArea);

    setLocationRelativeTo(getParent());

    loadWindowState();
    enableVisibleSound(true);

    download();

    widgetResized(gcn::Event(nullptr));
    config.addListener("updateOnlineList", this);
    config.addListener("groupFriends", this);
    mGroupFriends = config.getBoolValue("groupFriends");
}
开发者ID:koo5,项目名称:manaplus,代码行数:58,代码来源:whoisonline.cpp


示例16: _

void Minimap::setMap(Map *map)
{
    // Set the title for the Minimap
    std::string caption;

    if (map)
        caption = map->getName();

    if (caption.empty())
        caption = _("Map");

    minimap->setCaption(caption);

    // Adapt the image
    if (mMapImage)
    {
        mMapImage->decRef();
        mMapImage = 0;
    }

    if (map)
    {
        ResourceManager *resman = ResourceManager::getInstance();
        mMapImage = resman->getImage(map->getProperty("minimap"));
    }

    if (mMapImage)
    {
        const int offsetX = 2 * getPadding();
        const int offsetY = getTitleBarHeight() + getPadding();
        const int titleWidth = getFont()->getWidth(getCaption()) + 15;
        const int mapWidth = mMapImage->getWidth() < 100 ?
                             mMapImage->getWidth() + offsetX : 100;
        const int mapHeight = mMapImage->getHeight() < 100 ?
                              mMapImage->getHeight() + offsetY : 100;

        setMinWidth(mapWidth > titleWidth ? mapWidth : titleWidth);
        setMinHeight(mapHeight);

        mWidthProportion = (float) mMapImage->getWidth() / map->getWidth();
        mHeightProportion = (float) mMapImage->getHeight() / map->getHeight();

        setMaxWidth(mMapImage->getWidth() > titleWidth ?
                    mMapImage->getWidth() + offsetX : titleWidth);
        setMaxHeight(mMapImage->getHeight() + offsetY);

        setDefaultSize(getX(), getY(), getWidth(), getHeight());
        resetToDefaultSize();

        if (mShow)
            setVisible(true);
    }
    else
    {
        if (!isSticky())
            setVisible(false);
    }
}
开发者ID:kai62656,项目名称:manabot,代码行数:58,代码来源:minimap.cpp


示例17: Window

MailWindow::MailWindow() :
    // TRANSLATORS: mail window name
    Window(_("Mail"), Modal_false, nullptr, "mail.xml"),
    ActionListener(),
    mMessages(),
    mMessagesMap(),
    mMailModel(new ExtendedNamesModel),
    mListBox(CREATEWIDGETR(ExtendedListBox,
        this, mMailModel, "extendedlistbox.xml")),
    mListScrollArea(new ScrollArea(this, mListBox,
        fromBool(getOptionBool("showlistbackground"), Opaque),
        "mail_listbackground.xml")),
    // TRANSLATORS: mail window button
    mRefreshButton(new Button(this, _("Refresh"), "refresh", this)),
    // TRANSLATORS: mail window button
    mNewButton(new Button(this, _("New"), "new", this)),
    // TRANSLATORS: mail window button
    mDeleteButton(new Button(this, _("Delete"), "delete", this)),
    // TRANSLATORS: mail window button
    mReturnButton(new Button(this, _("Return"), "return", this)),
    // TRANSLATORS: mail window button
    mOpenButton(new Button(this, _("Open"), "open", this))
{
    setWindowName("Mail");
    setCloseButton(true);
    setResizable(true);
    setCloseButton(true);
    setSaveVisible(true);
    setStickyButtonLock(true);

    if (setupWindow)
        setupWindow->registerWindowForReset(this);

    setDefaultSize(310, 180, ImagePosition::CENTER);
    setMinWidth(310);
    setMinHeight(250);
    center();

    mListScrollArea->setHorizontalScrollPolicy(ScrollArea::SHOW_NEVER);

    ContainerPlacer placer;
    placer = getPlacer(0, 0);

    placer(0, 0, mListScrollArea, 4, 5).setPadding(3);
    placer(4, 0, mRefreshButton);
    placer(4, 1, mOpenButton);
    placer(4, 2, mNewButton);
    placer(4, 3, mDeleteButton);
    placer(4, 4, mReturnButton);

    Layout &layout = getLayout();
    layout.setRowHeight(0, LayoutType::SET);

    loadWindowState();
    enableVisibleSound(true);
}
开发者ID:dreamsxin,项目名称:ManaPlus,代码行数:56,代码来源:mailwindow.cpp


示例18: setDefaultSize

void MyImage::setImage(QImage &image)
{
    setDefaultSize(image.size());

    if(m_cache){
        QPixmap *temp_pixmap = new QPixmap(QPixmap::fromImage(image));
        pixmapCache.insert(m_source.toString(), temp_pixmap);
    }

    QSize temp_size = m_sourceSize;
    if(temp_size==QSize(0,0)){
        temp_size = m_defaultSize;
    }else if(temp_size.width()==0){
        temp_size.setWidth((double)temp_size.height()/m_defaultSize.height()*m_defaultSize.width());
    }else if(temp_size.height()==0){
        temp_size.setHeight((double)temp_size.width()/m_defaultSize.width()*m_defaultSize.height());
    }
    if(m_defaultSize!=temp_size)
        image = image.scaled(temp_size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);

    if(m_grayscale){//如果为黑白
        chromaticToGrayscale(image);//转换为黑白图
    }

    if(pixmap!=NULL)
        delete pixmap;
    pixmap = new QPixmap(QPixmap::fromImage(image));

    QString str = m_maskSource.toLocalFile();
    if(str==""){
        str = m_maskSource.toString();
    }
    if(str!=""){
        if( str.mid (0, 3) == "qrc")
            str = str.mid (3, str.count ()-3);
        QBitmap bitmap(str);
        if(!bitmap.isNull()){
            int max_width = bitmap.width();
            int max_height = bitmap.height();
            max_width = pixmap->width()>max_width?pixmap->width():max_width;
            max_height = pixmap->height()>max_height?pixmap->height():max_height;

            QPixmap temp_pixmap = pixmap->scaled(max_width, max_height);
            temp_pixmap.setMask (bitmap.scaled(temp_pixmap.size()));
            *pixmap = temp_pixmap.scaled(image.size(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
        }
    }

    setImplicitWidth(image.width());
    setImplicitHeight(image.height());

    update();

    setStatus(Ready);
    emit loadReady();
}
开发者ID:9smart,项目名称:9News,代码行数:56,代码来源:myimage.cpp


示例19: Window

DidYouKnowWindow::DidYouKnowWindow() :
    // TRANSLATORS: did you know window name
    Window(_("Did You Know?"), Modal_false, nullptr, "didyouknow.xml"),
    ActionListener(),
    mItemLinkHandler(new ItemLinkHandler),
    mBrowserBox(new BrowserBox(this, BrowserBox::AUTO_SIZE, Opaque_true,
        "browserbox.xml")),
    mScrollArea(new ScrollArea(this, mBrowserBox,
        Opaque_true, "didyouknow_background.xml")),
    // TRANSLATORS: did you know window button
    mButtonPrev(new Button(this, _("< Previous"), "prev", this)),
    // TRANSLATORS: did you know window button
    mButtonNext(new Button(this, _("Next >"), "next", this)),
    // TRANSLATORS: did you know window checkbox
    mOpenAgainCheckBox(new CheckBox(this, _("Auto open this window"),
        config.getBoolValue("showDidYouKnow"), this, "openagain"))
{
    setMinWidth(300);
    setMinHeight(220);
    setContentSize(455, 350);
    setWindowName("DidYouKnow");
    setCloseButton(true);
    setResizable(true);
    setStickyButtonLock(true);

    if (setupWindow)
        setupWindow->registerWindowForReset(this);
    setDefaultSize(500, 400, ImagePosition::CENTER);

    mBrowserBox->setOpaque(Opaque_false);
    // TRANSLATORS: did you know window button
    Button *const okButton = new Button(this, _("Close"), "close", this);

    mBrowserBox->setLinkHandler(mItemLinkHandler);
    if (gui)
        mBrowserBox->setFont(gui->getHelpFont());
    mBrowserBox->setProcessVars(true);
    mBrowserBox->setEnableImages(true);
    mBrowserBox->setEnableKeys(true);
    mBrowserBox->setEnableTabs(true);

    place(0, 0, mScrollArea, 5, 3).setPadding(3);
    place(0, 3, mOpenAgainCheckBox, 5);
    place(1, 4, mButtonPrev, 1);
    place(2, 4, mButtonNext, 1);
    place(4, 4, okButton);

    Layout &layout = getLayout();
    layout.setRowHeight(0, LayoutType::SET);

    loadWindowState();
    enableVisibleSound(true);
}
开发者ID:dreamsxin,项目名称:ManaPlus,代码行数:53,代码来源:didyouknowwindow.cpp


示例20: Window

EquipmentWindow::EquipmentWindow(Equipment *equipment, Being *being,
                                 bool foring):
    Window(_("Equipment"), false, nullptr, "equipment.xml"),
    mEquipment(equipment),
    mSelected(-1),
    mForing(foring),
    mImageSet(nullptr)
{
    mBeing = being;
    mItemPopup = new ItemPopup;
    if (setupWindow)
        setupWindow->registerWindowForReset(this);

    // Control that shows the Player
    mPlayerBox = new PlayerBox;
    mPlayerBox->setDimension(gcn::Rectangle(50, 80, 74, 168));
    mPlayerBox->setPlayer(being);

    if (foring)
        setWindowName("Being equipment");
    else
        setWindowName("Equipment");

    setCloseButton(true);
    setSaveVisible(true);
    setStickyButtonLock(true);

    setDefaultSize(180, 345, ImageRect::CENTER);

    mBoxes.reserve(BOX_COUNT);
    for (int f = 0; f < BOX_COUNT; f ++)
        mBoxes.push_back(nullptr);

    fillBoxes();

    loadWindowState();

    mUnequip = new Button(_("Unequip"), "unequip", this);
    const gcn::Rectangle &area = getChildrenArea();
    mUnequip->setPosition(area.width  - mUnequip->getWidth() - 5,
                          area.height - mUnequip->getHeight() - 5);
    mUnequip->setEnabled(false);

    add(mPlayerBox);
    add(mUnequip);

    mHighlightColor = Theme::getThemeColor(Theme::HIGHLIGHT);
    mBorderColor = Theme::getThemeColor(Theme::BORDER);
    setForegroundColor(Theme::getThemeColor(Theme::TEXT));
}
开发者ID:EvolOnline,项目名称:ManaPlus,代码行数:50,代码来源:equipmentwindow.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setDefaultValues函数代码示例发布时间:2022-05-30
下一篇:
C++ setDefaultBtn函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap