亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? slider.cpp

?? Linux系統(tǒng)下的《紅色警戒》游戲
?? CPP
字號:
/*      _______   __   __   __   ______   __   __   _______   __   __                  *     / _____/\ / /\ / /\ / /\ / ____/\ / /\ / /\ / ___  /\ /  |\/ /\                 *    / /\____\// / // / // / // /\___\// /_// / // /\_/ / // , |/ / /                  *   / / /__   / / // / // / // / /    / ___  / // ___  / // /| ' / /                   *  / /_// /\ / /_// / // / // /_/_   / / // / // /\_/ / // / |  / /                    * /______/ //______/ //_/ //_____/\ /_/ //_/ //_/ //_/ //_/ /|_/ /                     * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/                       * * Copyright (c) 2004, 2005 darkbits                        Js_./ * Per Larsson a.k.a finalman                          _RqZ{a<^_aa * Olof Naess閚 a.k.a jansem/yakslem                _asww7!uY`>  )\a// *                                                 _Qhm`] _f "'c  1!5m * Visit: http://guichan.darkbits.org             )Qk<P ` _: :+' .'  "{[ *                                               .)j(] .d_/ '-(  P .   S * License: (BSD)                                <Td/Z <fP"5(\"??"\a.  .L * Redistribution and use in source and          _dV>ws?a-?'      ._/L  #' * binary forms, with or without                 )4d[#7r, .   '     )d`)[ * modification, are permitted provided         _Q-5'5W..j/?'   -?!\)cam' * that the following conditions are met:       j<<WP+k/);.        _W=j f * 1. Redistributions of source code must       .$%w\/]Q  . ."'  .  mj$ *    retain the above copyright notice,        ]E.pYY(Q]>.   a     J@\ *    this list of conditions and the           j(]1u<sE"L,. .   ./^ ]{a *    following disclaimer.                     4'_uomm\.  )L);-4     (3= * 2. Redistributions in binary form must        )_]X{Z('a_"a7'<a"a,  ]"[ *    reproduce the above copyright notice,       #}<]m7`Za??4,P-"'7. ).m *    this list of conditions and the            ]d2e)Q(<Q(  ?94   b-  LQ/ *    following disclaimer in the                <B!</]C)d_, '(<' .f. =C+m *    documentation and/or other materials      .Z!=J ]e []('-4f _ ) -.)m]' *    provided with the distribution.          .w[5]' _[ /.)_-"+?   _/ <W" * 3. Neither the name of Guichan nor the      :$we` _! + _/ .        j? *    names of its contributors may be used     =3)= _f  (_yQmWW$#(    " *    to endorse or promote products derived     -   W,  sQQQQmZQ#Wwa].. *    from this software without specific        (js, \[QQW$QWW#?!V"". *    prior written permission.                    ]y:.<\..          . *                                                 -]n w/ '         [. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT       )/ )/           ! * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY         <  (; sac    ,    ' * EXPRESS OR IMPLIED WARRANTIES, INCLUDING,               ]^ .-  % * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF            c <   r * MERCHANTABILITY AND FITNESS FOR A PARTICULAR            aga<  <La * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE          5%  )P'-3L * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR        _bQf` y`..)a * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,          ,J?4P'.P"_(\?d'., * EXEMPLARY, OR CONSEQUENTIAL DAMAGES               _Pa,)!f/<[]/  ?" * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT      _2-..:. .r+_,.. . * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,     ?a.<%"'  " -'.a_ _, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION)                     ^ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *//* * For comments regarding functions please see the header file.  */#include "guichan/widgets/slider.h"#include "guichan/mouseinput.h"namespace gcn{    Slider::Slider(double scaleEnd)    {        mMouseDrag = false;        mScaleStart = 0;        mScaleEnd = scaleEnd;                setFocusable(true);        setBorderSize(1);        setOrientation(HORIZONTAL);        setValue(0);        setStepLength(scaleEnd / 10);        setMarkerLength(10);            addMouseListener(this);        addKeyListener(this);    }    Slider::Slider(double scaleStart, double scaleEnd)    {        mMouseDrag = false;                mScaleStart = scaleStart;        mScaleEnd = scaleEnd;                setFocusable(true);        setBorderSize(1);        setOrientation(HORIZONTAL);        setValue(scaleStart);        setStepLength((scaleEnd  - scaleStart)/ 10);        setMarkerLength(10);            addMouseListener(this);        addKeyListener(this);    }    void Slider::setScale(double scaleStart, double scaleEnd)    {        mScaleStart = scaleStart;        mScaleEnd = scaleEnd;    }    double Slider::getScaleStart() const    {        return mScaleStart;    }    void Slider::setScaleStart(double scaleStart)    {        mScaleStart = scaleStart;    }    double Slider::getScaleEnd() const    {        return mScaleEnd;    }    void Slider::setScaleEnd(double scaleEnd)    {        mScaleEnd = scaleEnd;    }    void Slider::draw(gcn::Graphics* graphics)    {        Color shadowColor = getBaseColor() - 0x101010;        int alpha = getBaseColor().a;                 shadowColor.a = alpha;                        graphics->setColor(shadowColor);        graphics->fillRectangle(gcn::Rectangle(0,0,getWidth(),getHeight()));            drawMarker(graphics);    }    void Slider::drawBorder(gcn::Graphics* graphics)    {        Color faceColor = getBaseColor();        Color highlightColor, shadowColor;        int alpha = getBaseColor().a;        int width = getWidth() + getBorderSize() * 2 - 1;        int height = getHeight() + getBorderSize() * 2 - 1;        highlightColor = faceColor + 0x303030;        highlightColor.a = alpha;        shadowColor = faceColor - 0x303030;        shadowColor.a = alpha;                unsigned int i;        for (i = 0; i < getBorderSize(); ++i)        {            graphics->setColor(shadowColor);            graphics->drawLine(i,i, width - i, i);            graphics->drawLine(i,i + 1, i, height - i - 1);            graphics->setColor(highlightColor);            graphics->drawLine(width - i,i + 1, width - i, height - i);             graphics->drawLine(i,height - i, width - i - 1, height - i);        }    }        void Slider::drawMarker(gcn::Graphics* graphics)    {        gcn::Color faceColor = getBaseColor();        Color highlightColor, shadowColor;        int alpha = getBaseColor().a;        highlightColor = faceColor + 0x303030;        highlightColor.a = alpha;        shadowColor = faceColor - 0x303030;        shadowColor.a = alpha;                        graphics->setColor(faceColor);            if (getOrientation() == HORIZONTAL)        {            int v = getMarkerPosition();            graphics->fillRectangle(gcn::Rectangle(v + 1, 1, getMarkerLength() - 2, getHeight() - 2));            graphics->setColor(highlightColor);            graphics->drawLine(v, 0, v + getMarkerLength() - 1,0);            graphics->drawLine(v, 0, v, getHeight() - 1);            graphics->setColor(shadowColor);            graphics->drawLine(v + getMarkerLength() - 1, 1, v + getMarkerLength() - 1, getHeight() - 1);            graphics->drawLine(v + 1, getHeight() - 1, v + getMarkerLength() - 1, getHeight() - 1);            if (hasFocus())            {                graphics->setColor(getForegroundColor());                graphics->drawRectangle(Rectangle(v + 2, 2, getMarkerLength() - 4, getHeight() - 4));            }            }        else        {            int v = (getHeight() - getMarkerLength()) - getMarkerPosition();            graphics->fillRectangle(gcn::Rectangle(1, v + 1, getWidth() - 2, getMarkerLength() - 2));            graphics->setColor(highlightColor);            graphics->drawLine(0, v, 0, v + getMarkerLength() - 1);            graphics->drawLine(0, v, getWidth() - 1, v);            graphics->setColor(shadowColor);            graphics->drawLine(1, v + getMarkerLength() - 1, getWidth() - 1, v + getMarkerLength() - 1);            graphics->drawLine(getWidth() - 1, v + 1, getWidth() - 1, v + getMarkerLength() - 1);            if (hasFocus())            {                graphics->setColor(getForegroundColor());                graphics->drawRectangle(Rectangle(2, v + 2, getWidth() - 4, getMarkerLength() - 4));            }            }    }        void Slider::mousePress(int x, int y, int button)    {        if (button == gcn::MouseInput::LEFT            && x >= 0 && x <= getWidth()            && y >= 0 && y <= getHeight())        {            if (getOrientation() == HORIZONTAL)            {                setValue(markerPositionToValue(x - getMarkerLength() / 2));            }            else            {                setValue(markerPositionToValue(getHeight() - y - getMarkerLength() / 2));            }                  mMouseDrag = true;            generateAction();        }        else        {            mMouseDrag = false;        }    }        void Slider::mouseRelease(int x, int y, int button)    {        mMouseDrag = false;    }        void Slider::lostFocus()    {        mMouseDrag = false;    }        void Slider::mouseMotion(int x, int y)    {        if (mMouseDrag)        {            if (getOrientation() == HORIZONTAL)            {                setValue(markerPositionToValue(x - getMarkerLength() / 2));            }            else            {                setValue(markerPositionToValue(getHeight() - y - getMarkerLength() / 2));            }                  generateAction();        }    }        void Slider::setValue(double value)    {        if (value > getScaleEnd())        {            mValue = getScaleEnd();            return;        }        if (value < getScaleStart())        {            mValue = getScaleStart();            return;        }        mValue = value;    }        double Slider::getValue() const    {        return mValue;    }    int Slider::getMarkerLength() const    {        return mMarkerLength;    }    void Slider::setMarkerLength(int length)    {        mMarkerLength = length;    }    bool Slider::keyPress(const Key& key)    {        bool ret = false;        if (getOrientation() == HORIZONTAL)        {            if (key.getValue() == Key::RIGHT)            {                setValue(getValue() + getStepLength());                generateAction();                ret = true;            }            else if (key.getValue() == Key::LEFT)            {                setValue(getValue() - getStepLength());                generateAction();                ret = true;            }        }        else        {            if (key.getValue() == Key::UP)            {                setValue(getValue() + getStepLength());                generateAction();                ret = true;            }            else if (key.getValue() == Key::DOWN)            {                setValue(getValue() - getStepLength());                generateAction();                ret = true;            }        }        return ret;    }    void Slider::setOrientation(unsigned int orientation)    {        mOrientation = orientation;        }    unsigned int Slider::getOrientation() const    {        return mOrientation;    }    double Slider::markerPositionToValue(int v) const    {        int w;        if (getOrientation() == HORIZONTAL)        {            w = getWidth();        }        else        {            w = getHeight();        }            double pos = v / ((double)w - getMarkerLength());        return (1.0 - pos) * getScaleStart() + pos * getScaleEnd();        }      int Slider::valueToMarkerPosition(double value) const    {        int v;        if (getOrientation() == HORIZONTAL)        {            v = getWidth();        }        else        {            v = getHeight();        }        int w =  (int)((v - getMarkerLength())                       * (value  - getScaleStart())                       / (getScaleEnd() - getScaleStart()));            if (w < 0)        {            return 0;        }              if (w > v - getMarkerLength())        {            return v - getMarkerLength();        }              return w;    }    void Slider::setStepLength(double length)    {        mStepLength = length;    }    double Slider::getStepLength() const    {        return mStepLength;    }    int Slider::getMarkerPosition() const    {        return valueToMarkerPosition(getValue());    }    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品视频色一区| 久久久久久免费毛片精品| 亚洲va中文字幕| 国产午夜精品一区二区三区视频 | 一色桃子久久精品亚洲| 久久精品国产免费| 亚洲自拍与偷拍| 中文字幕在线不卡视频| 一本色道久久综合亚洲aⅴ蜜桃| 欧美aaaaaa午夜精品| 麻豆一区二区99久久久久| 裸体在线国模精品偷拍| 麻豆成人综合网| 国产电影一区在线| 91在线无精精品入口| 欧美在线免费观看亚洲| 欧美久久久久免费| 日韩色视频在线观看| 久久精品亚洲精品国产欧美kt∨ | 中文字幕二三区不卡| 国产精品嫩草久久久久| 亚洲欧美国产77777| 一区二区三区成人在线视频| 亚洲国产综合91精品麻豆| 免费成人美女在线观看.| 国内精品在线播放| 不卡一区二区在线| 欧美手机在线视频| 日韩精品自拍偷拍| 国产精品久久久久久久久搜平片 | www.色综合.com| 91国产福利在线| 日韩欧美国产wwwww| 国产精品日韩成人| 亚洲国产aⅴ天堂久久| 久国产精品韩国三级视频| 成人免费看黄yyy456| 欧美精品三级在线观看| 亚洲精品在线免费播放| 一区二区三区四区高清精品免费观看| 日日噜噜夜夜狠狠视频欧美人| 九九**精品视频免费播放| av不卡免费在线观看| 欧美一区日本一区韩国一区| 国产婷婷一区二区| 性做久久久久久| 丁香婷婷综合色啪| 欧美精品精品一区| 国产精品每日更新在线播放网址| 亚洲国产欧美在线| 国产成人综合网站| 制服丝袜成人动漫| 久久久综合视频| 亚洲最新视频在线播放| av一本久道久久综合久久鬼色| 在线看国产一区二区| 2欧美一区二区三区在线观看视频| 国产精品美女www爽爽爽| 成人免费高清在线| 欧美久久一二区| 亚洲乱码中文字幕综合| 精品一区二区三区免费| 欧美在线观看视频在线| 亚洲国产另类av| 亚洲欧洲国产日韩| 久久国产婷婷国产香蕉| 日本精品视频一区二区三区| 日韩女优av电影| 亚洲成人动漫在线免费观看| 成人精品免费网站| 精品国产sm最大网站| 日精品一区二区三区| 色综合久久久久网| 日本一区二区不卡视频| 久久国产视频网| 宅男噜噜噜66一区二区66| 亚洲人亚洲人成电影网站色| 韩日av一区二区| 3atv一区二区三区| 亚洲一区二区三区四区五区黄| 丁香天五香天堂综合| 久久毛片高清国产| 久久激五月天综合精品| 91精品国产色综合久久| 亚洲主播在线观看| 99热在这里有精品免费| 久久久久久一二三区| 加勒比av一区二区| 日韩欧美一区二区免费| 天天影视涩香欲综合网| 欧美午夜不卡在线观看免费| 136国产福利精品导航| 成人激情午夜影院| 中文一区在线播放| 国产福利精品一区二区| 久久久久综合网| 国产精品一区二区在线看| 精品国产一区久久| 精品在线播放免费| 久久人人97超碰com| 精品一二三四区| 久久综合色综合88| 国产一区二区福利视频| 久久亚洲一区二区三区明星换脸| 久久精品噜噜噜成人88aⅴ| 欧美一区二区三区电影| 蜜桃视频在线观看一区| 精品欧美久久久| 国产精品一区免费在线观看| 国产欧美日韩三区| 99国内精品久久| 一区二区三区自拍| 欧美精品久久一区二区三区| 日韩精品91亚洲二区在线观看| 在线不卡欧美精品一区二区三区| 无码av中文一区二区三区桃花岛| 蜜桃av噜噜一区二区三区小说| 一区二区三区中文字幕电影 | 成a人片亚洲日本久久| 亚洲国产裸拍裸体视频在线观看乱了| 精品国产免费一区二区三区四区| 激情六月婷婷久久| 亚洲成av人综合在线观看| 亚洲欧洲无码一区二区三区| 884aa四虎影成人精品一区| 91精品国产91久久综合桃花| 久久综合九色综合97_久久久| 国产在线国偷精品免费看| 国产欧美日韩在线| 欧洲av一区二区嗯嗯嗯啊| 日本欧美加勒比视频| 久久综合色综合88| 色综合中文综合网| 亚洲三级电影网站| 欧美日韩国产中文| 国产一区二区三区四| 国产精品久久午夜夜伦鲁鲁| 色呦呦网站一区| 日韩av网站在线观看| 国产清纯在线一区二区www| 色综合天天综合网天天看片| 日一区二区三区| 中文字幕精品三区| 欧美人与z0zoxxxx视频| 韩国三级在线一区| 亚洲视频综合在线| 日韩午夜av电影| av动漫一区二区| 美女尤物国产一区| 亚洲欧美一区二区三区久本道91 | 欧美日韩亚洲丝袜制服| 久久成人综合网| 亚洲日本一区二区三区| 在线成人高清不卡| 99riav一区二区三区| 日韩1区2区日韩1区2区| 国产精品高潮久久久久无| 欧美肥大bbwbbw高潮| 成人黄色小视频在线观看| 日本在线不卡视频| 亚洲欧美日韩国产成人精品影院| 欧美一激情一区二区三区| aaa欧美大片| 国产一区二区三区香蕉| 图片区小说区区亚洲影院| 国产精品成人免费精品自在线观看| 制服丝袜激情欧洲亚洲| 91视频在线看| 粉嫩aⅴ一区二区三区四区 | 日本视频在线一区| 国产91精品免费| 亚洲色图.com| 国产成a人无v码亚洲福利| 91久久精品国产91性色tv| 亚洲视频一区在线| 亚洲成人av在线电影| 国产v综合v亚洲欧| 精品国精品自拍自在线| 亚洲柠檬福利资源导航| 久久精品久久99精品久久| 色婷婷av久久久久久久| www欧美成人18+| 国产成人在线观看免费网站| 青草av.久久免费一区| 中文字幕一区二区三区四区 | 欧美成人国产一区二区| 欧美午夜理伦三级在线观看| av亚洲精华国产精华| 国产成人综合在线| 国内成人自拍视频| 蜜桃传媒麻豆第一区在线观看| 亚洲五码中文字幕| 一区二区三区中文字幕精品精品| 国产精品私房写真福利视频| 精品少妇一区二区三区免费观看| 欧美美女bb生活片| 欧美日韩久久不卡| 欧美久久一二三四区| 欧美日韩国产综合一区二区| 欧美在线观看你懂的|