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

C++ setSize函数代码示例

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

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



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

示例1: size

	/// If the requested size is larger than the current capacity, then the 
	/// buffer will be resized.
	void size(int n){
		if(capacity() < n) resize(n);
		else setSize(n);
	}
开发者ID:LuaAV,项目名称:LuaAV,代码行数:6,代码来源:al_Buffer.hpp


示例2: locateROI

UMat Mat::getUMat(int accessFlags, UMatUsageFlags usageFlags) const
{
    UMat hdr;
    if(!data)
        return hdr;
    if (data != datastart)
    {
        Size wholeSize;
        Point ofs;
        locateROI(wholeSize, ofs);
        Size sz(cols, rows);
        if (ofs.x != 0 || ofs.y != 0)
        {
            Mat src = *this;
            int dtop = ofs.y;
            int dbottom = wholeSize.height - src.rows - ofs.y;
            int dleft = ofs.x;
            int dright = wholeSize.width - src.cols - ofs.x;
            src.adjustROI(dtop, dbottom, dleft, dright);
            return src.getUMat(accessFlags, usageFlags)(cv::Rect(ofs.x, ofs.y, sz.width, sz.height));
        }
    }
    CV_Assert(data == datastart);

    accessFlags |= ACCESS_RW;
    UMatData* new_u = NULL;
    {
        MatAllocator *a = allocator, *a0 = getDefaultAllocator();
        if(!a)
            a = a0;
        new_u = a->allocate(dims, size.p, type(), data, step.p, accessFlags, usageFlags);
    }
    bool allocated = false;
    try
    {
        allocated = UMat::getStdAllocator()->allocate(new_u, accessFlags, usageFlags);
    }
    catch (const cv::Exception& e)
    {
        fprintf(stderr, "Exception: %s\n", e.what());
    }
    if (!allocated)
    {
        allocated = getDefaultAllocator()->allocate(new_u, accessFlags, usageFlags);
        CV_Assert(allocated);
    }
    if (u != NULL)
    {
#ifdef HAVE_OPENCL
        if (ocl::useOpenCL() && new_u->currAllocator == ocl::getOpenCLAllocator())
        {
            CV_Assert(new_u->tempUMat());
        }
#endif
        new_u->originalUMatData = u;
        CV_XADD(&(u->refcount), 1);
        CV_XADD(&(u->urefcount), 1);
    }
    hdr.flags = flags;
    setSize(hdr, dims, size.p, step.p);
    finalizeHdr(hdr);
    hdr.u = new_u;
    hdr.offset = 0; //data - datastart;
    hdr.addref();
    return hdr;
}
开发者ID:jtkb,项目名称:opencv,代码行数:66,代码来源:umatrix.cpp


示例3: setSize

Rectangle::Rectangle(int w, int h){
	setSize(w, h);
}
开发者ID:Sergane,项目名称:ff_tasks,代码行数:3,代码来源:rectangle.cpp


示例4: setSize

MovableBox::MovableBox()
	:mBoxAnimation("data/images/movableblock.bmp",1)
	,mGravityHitTimer(0)
{
	setSize(float2(20.f,20.f));
}
开发者ID:olofn,项目名称:db_public,代码行数:6,代码来源:MovableBox.cpp


示例5: mTextIsSet

QgsLabelAttributes::QgsLabelAttributes( bool def )
    : mTextIsSet( false )
    , mFamilyIsSet( false )
    , mBoldIsSet( false )
    , mItalicIsSet( false )
    , mUnderlineIsSet( false )
    , mStrikeOutIsSet( false )
    , mSizeType( 0 )
    , mSize( 0.0 )
    , mSizeIsSet( false )
    , mColorIsSet( false )
    , mOffsetType( 0 )
    , mXOffset( 0 )
    , mYOffset( 0 )
    , mOffsetIsSet( false )
    , mAngle( 0.0 )
    , mAngleIsSet( false )
    , mAngleIsAuto( false )
    , mAlignment( 0 )
    , mAlignmentIsSet( false )
    , mBufferEnabledFlag( false )
    , mBufferSizeType( 0 )
    , mBufferSize( 0.0 )
    , mBufferSizeIsSet( false )
    , mBufferColorIsSet( false )
    , mBufferStyleIsSet( false )
    , mBorderColorIsSet( false )
    , mBorderWidthIsSet( false )
    , mBorderStyleIsSet( false )
    , mMultilineEnabledFlag( false )
    , mSelectedOnly( false )
{

  if ( def )   // set defaults
  {
    setText( QObject::tr( "Label" ) );

    mFont = QApplication::font();
    mFamilyIsSet = true;
    mBoldIsSet = true;
    mItalicIsSet = true;
    mUnderlineIsSet = true;

    setSize( 12.0, PointUnits );

    setOffset( 0, 0, PointUnits );
    setAngle( 0 );
    setAutoAngle( false );

    setAlignment( Qt::AlignCenter );
    setColor( QColor( 0, 0, 0 ) );

    setBufferSize( 1, PointUnits );
    setBufferColor( QColor( 255, 255, 255 ) );
    setBufferStyle( Qt::NoBrush );

    setBorderWidth( 0 );
    setBorderColor( QColor( 0, 0, 0 ) );
    setBorderStyle( Qt::NoPen );
  }
}
开发者ID:ACorradini,项目名称:QGIS,代码行数:61,代码来源:qgslabelattributes.cpp


示例6: setSize

U8* LLImageBase::allocateDataSize(S32 width, S32 height, S32 ncomponents, S32 size)
{
	setSize(width, height, ncomponents);
	return allocateData(size); // virtual
}
开发者ID:OS-Development,项目名称:VW.Meerkat,代码行数:5,代码来源:llimage.cpp


示例7: label

//==============================================================================
ThorConfigComponent::ThorConfigComponent (ThorConfig *_config)
    : label (0),
      thorConfigEncodeFormat (0),
      label2 (0),
      thorOggQuality (0),
      thorVersionCheck (0),
      label3 (0),
      thorOutputAction (0),
      internalCachedImage1 (0)
{
    addAndMakeVisible (label = new Label (T("new label"),
                                          T("Ogg quality")));
    label->setFont (Font (12.0000f, Font::plain));
    label->setJustificationType (Justification::centredLeft);
    label->setEditable (false, false, false);
    label->setColour (TextEditor::textColourId, Colours::black);
    label->setColour (TextEditor::backgroundColourId, Colour (0x0));

    addAndMakeVisible (thorConfigEncodeFormat = new ComboBox (T("new combo box")));
    thorConfigEncodeFormat->setEditableText (false);
    thorConfigEncodeFormat->setJustificationType (Justification::centredLeft);
    thorConfigEncodeFormat->setTextWhenNothingSelected (String::empty);
    thorConfigEncodeFormat->setTextWhenNoChoicesAvailable (T("(no choices)"));
    thorConfigEncodeFormat->addItem (T("Ogg"), 1);
    thorConfigEncodeFormat->addItem (T("Flac"), 2);
    thorConfigEncodeFormat->addListener (this);

    addAndMakeVisible (label2 = new Label (T("new label"),
                                           T("Encode To:")));
    label2->setFont (Font (12.0000f, Font::plain));
    label2->setJustificationType (Justification::centredLeft);
    label2->setEditable (false, false, false);
    label2->setColour (TextEditor::textColourId, Colours::black);
    label2->setColour (TextEditor::backgroundColourId, Colour (0x0));

    addAndMakeVisible (thorOggQuality = new ComboBox (T("Ogg Quality")));
    thorOggQuality->setEditableText (false);
    thorOggQuality->setJustificationType (Justification::centredLeft);
    thorOggQuality->setTextWhenNothingSelected (String::empty);
    thorOggQuality->setTextWhenNoChoicesAvailable (T("(no choices)"));
    thorOggQuality->addItem (T("Low"), 1);
    thorOggQuality->addItem (T("Medium"), 2);
    thorOggQuality->addItem (T("High"), 3);
    thorOggQuality->addListener (this);

    addAndMakeVisible (thorVersionCheck = new ToggleButton (T("new toggle button")));
    thorVersionCheck->setButtonText (T("version check"));
    thorVersionCheck->addButtonListener (this);
    thorVersionCheck->setToggleState (true, false);

    addAndMakeVisible (label3 = new Label (T("new label"),
                                           T("Output:")));
    label3->setFont (Font (12.0000f, Font::plain));
    label3->setJustificationType (Justification::centredLeft);
    label3->setEditable (false, false, false);
    label3->setColour (TextEditor::textColourId, Colours::black);
    label3->setColour (TextEditor::backgroundColourId, Colour (0x0));

    addAndMakeVisible (thorOutputAction = new ComboBox (T("Ogg Quality")));
    thorOutputAction->setEditableText (false);
    thorOutputAction->setJustificationType (Justification::centredLeft);
    thorOutputAction->setTextWhenNothingSelected (String::empty);
    thorOutputAction->setTextWhenNoChoicesAvailable (T("(no choices)"));
    thorOutputAction->addItem (T("Kepp and create ZIP"), 1);
    thorOutputAction->addItem (T("Keep output DIR (no ZIP)"), 2);
    thorOutputAction->addItem (T("Keep both"), 3);
    thorOutputAction->addListener (this);

    internalCachedImage1 = ImageCache::getFromMemory (vorbis_png, vorbis_pngSize);

    //[UserPreSize]
    config = _config;
    //[/UserPreSize]

    setSize (256, 106);

    //[Constructor] You can add your own custom stuff here..
    thorOggQuality->setSelectedItemIndex (config->getOggQuality(), false);
    thorVersionCheck->setToggleState (config->getVersionCheck(), false);
    thorOutputAction->setSelectedItemIndex (config->getDefaultOutputAction(), false);

    if (config->getFileExtension() == T("flac"))
    {
        thorConfigEncodeFormat->setSelectedId (2);
    }

    if (config->getFileExtension() == T("ogg"))
    {
        thorConfigEncodeFormat->setSelectedId (1);
    }
    //[/Constructor]
}
开发者ID:j3LLostyL3Z,项目名称:thor-v2,代码行数:93,代码来源:ThorConfigComponent.cpp


示例8: while

bool RVPFile::msnftp() {
	bool error = false;
	while (!completed) {
		char *params = "";
		char *line = connection->recvLine();
		if (line != NULL && strlen(line) > 2) {
			if (strlen(line) > 3) {
				params = line + 4;
			}
			int command = (int)line[0] | (((int)line[1]) << 8) | (((int)line[2]) << 16);
			command = (command&0x00FFFFFF)|0x20000000;
			switch (command) {
				case ' REV':
					{
						char protocol[7];
						bool msnftp = false;
						while (params != NULL && sscanf(params, "%6s", protocol) >= 1) {
							if (strcmp(protocol, "MSNFTP") == 0) {
								msnftp = true;
								break;
							}
							params = strstr(params, " ");
							if (params != NULL) params ++;
						}
						if (getMode() == RVPFile::MODE_SEND) {
							connection->send("VER MSNFTP\r\n");
						} else {
							if (msnftp) {
								connection->sendText("USR %s %s\r\n",getLogin(),getAuthCookie());
							} else {
								/* error */
							}
						}
					}
					break;
				case ' RSU':
					{
						char email[130], cookie[14];
						if (sscanf(params,"%129s %13s",email, cookie) >= 2) {
							if (!strcmp(email, getLogin()) && !strcmp(cookie, getAuthCookie())) {
								connection->sendText("FIL %i\r\n", getSize());
							} else {
								/* error */
							}
							break;
						}
					}
					break;
				case ' LIF':
					{
						char filesize[ 30 ];
						if ( sscanf( params, "%s", filesize ) >= 1 ) {
							setSize(atol(filesize));
							connection->send("TFR\r\n");
							/* ack initializing */
							if (listener != NULL) {
								listener->onFileProgress(this, RVPFileListener::PROGRESS_INITIALIZING, 0);
							}
							/* receive data */
							int fileId = _open(getPath(), _O_BINARY|_O_WRONLY|_O_CREAT|_O_TRUNC, _S_IREAD|_S_IWRITE);
							error = false;
							if (fileId >= 0) {
								int bytesToReceive = getSize();
								while (!error && bytesToReceive > 0) {
									char buffer[2048];
									int header = 0;
									if (connection->recv((char *)&header, 3)) {
										int blockSize = header >> 8;
										while (!error && blockSize > 0) {
											error = true;
											int readSize = min(2048, blockSize);
											if (connection->recv(buffer, readSize)) {
												blockSize -= readSize;
												bytesToReceive -= readSize;
												if (_write(fileId, buffer, readSize) == readSize) {
													error = false;
												}
											}
										}
										if (listener != NULL) {
											listener->onFileProgress(this, RVPFileListener::PROGRESS_PROGRESS, getSize() - bytesToReceive);
										}
										if (header&0xFF != 0) {
											break;
										}
									} else {
										error = true;
									}
								}
								_close(fileId);
							} else {
								error = true;
							}
							completed = true;
						}
开发者ID:BackupTheBerlios,项目名称:mtlen-svn,代码行数:95,代码来源:RVPFile.cpp


示例9: setSize

//  update track on resize
void Slider::setSize(int _width, int _height)
{
    setSize(IntSize(_width, _height));
}
开发者ID:sureandrew,项目名称:stuntrally,代码行数:5,代码来源:Slider.cpp


示例10: Component

//==============================================================================
Threshold::Threshold ()
    : Component (L"Threshold"),
      groupComponent (0),
      threshold_levelslider (0),
      label (0),
      textButton (0),
      toggleButton (0),
      resetbutton (0),
      label2 (0),
      textButton2 (0)
{
    addAndMakeVisible (groupComponent = new GroupComponent (L"new group",
                                                            L"Threshold"));
    groupComponent->setTextLabelPosition (Justification::centredLeft);
    groupComponent->setColour (GroupComponent::outlineColourId, Colour (0xb0000000));

    addAndMakeVisible (threshold_levelslider = new Slider (L"new slider"));
    threshold_levelslider->setRange (0, 10, 0);
    threshold_levelslider->setSliderStyle (Slider::LinearHorizontal);
    threshold_levelslider->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20);
    threshold_levelslider->setColour (Slider::backgroundColourId, Colour (0x956565));
    threshold_levelslider->setColour (Slider::thumbColourId, Colour (0x6efffcfc));
    threshold_levelslider->setColour (Slider::textBoxBackgroundColourId, Colour (0xffffff));
    threshold_levelslider->addListener (this);

    addAndMakeVisible (label = new Label (L"new label",
                                          L"Threshold level (0-10)"));
    label->setFont (Font (15.0000f, Font::plain));
    label->setJustificationType (Justification::centredLeft);
    label->setEditable (false, false, false);
    label->setColour (Label::backgroundColourId, Colour (0x0));
    label->setColour (Label::textColourId, Colours::black);
    label->setColour (Label::outlineColourId, Colour (0x0));
    label->setColour (TextEditor::textColourId, Colours::black);
    label->setColour (TextEditor::backgroundColourId, Colour (0x0));

    addAndMakeVisible (textButton = new TextButton (L"new button"));
    textButton->setButtonText (L"Do it!");
    textButton->addListener (this);
    textButton->setColour (TextButton::buttonColourId, Colour (0x40bbbbff));

    addAndMakeVisible (toggleButton = new ToggleButton (L"new toggle button"));
    toggleButton->setButtonText (L"Remove above threshold");
    toggleButton->addListener (this);

    addAndMakeVisible (resetbutton = new TextButton (L"resetbutton"));
    resetbutton->setButtonText (L"reset");
    resetbutton->addListener (this);
    resetbutton->setColour (TextButton::buttonColourId, Colour (0x3bbbbbff));

    addAndMakeVisible (label2 = new Label (L"new label",
                                           L"Removes all partials below a given amplitude threshold."));
    label2->setFont (Font (15.0000f, Font::plain));
    label2->setJustificationType (Justification::centredLeft);
    label2->setEditable (false, false, false);
    label2->setColour (Label::backgroundColourId, Colour (0x0));
    label2->setColour (Label::textColourId, Colours::black);
    label2->setColour (Label::outlineColourId, Colour (0x0));
    label2->setColour (TextEditor::textColourId, Colours::black);
    label2->setColour (TextEditor::backgroundColourId, Colour (0x0));

    addAndMakeVisible (textButton2 = new TextButton (L"new button"));
    textButton2->setButtonText (L"Redo it!");
    textButton2->addListener (this);
    textButton2->setColour (TextButton::buttonColourId, Colour (0x40bbbbff));


    //[UserPreSize]
    //[/UserPreSize]

    setSize (600, 400);


    //[Constructor] You can add your own custom stuff here..
    buttonClicked(resetbutton);
#undef Slider
    //[/Constructor]
}
开发者ID:jeremysalwen,项目名称:mammut-updated,代码行数:79,代码来源:Threshold.cpp


示例11: png_get_image_width

void PNGImageDecoder::headerAvailable()
{
    png_structp png = m_reader->pngPtr();
    png_infop info = m_reader->infoPtr();
    png_uint_32 width = png_get_image_width(png, info);
    png_uint_32 height = png_get_image_height(png, info);

    // Protect against large PNGs. See http://bugzil.la/251381 for more details.
    const unsigned long maxPNGSize = 1000000UL;
    if (width > maxPNGSize || height > maxPNGSize) {
        longjmp(JMPBUF(png), 1);
        return;
    }

    // Set the image size now that the image header is available.
    if (!setSize(width, height)) {
        longjmp(JMPBUF(png), 1);
        return;
    }

    int bitDepth, colorType, interlaceType, compressionType, filterType, channels;
    png_get_IHDR(png, info, &width, &height, &bitDepth, &colorType, &interlaceType, &compressionType, &filterType);

    // The options we set here match what Mozilla does.

    // Expand to ensure we use 24-bit for RGB and 32-bit for RGBA.
    if (colorType == PNG_COLOR_TYPE_PALETTE || (colorType == PNG_COLOR_TYPE_GRAY && bitDepth < 8))
        png_set_expand(png);

    png_bytep trns = 0;
    int trnsCount = 0;
    if (png_get_valid(png, info, PNG_INFO_tRNS)) {
        png_get_tRNS(png, info, &trns, &trnsCount, 0);
        png_set_expand(png);
    }

    if (bitDepth == 16)
        png_set_strip_16(png);

    if (colorType == PNG_COLOR_TYPE_GRAY || colorType == PNG_COLOR_TYPE_GRAY_ALPHA)
        png_set_gray_to_rgb(png);

#if USE(QCMSLIB)
    if ((colorType & PNG_COLOR_MASK_COLOR) && !m_ignoreGammaAndColorProfile) {
        // We only support color profiles for color PALETTE and RGB[A] PNG. Supporting
        // color profiles for gray-scale images is slightly tricky, at least using the
        // CoreGraphics ICC library, because we expand gray-scale images to RGB but we
        // do not similarly transform the color profile. We'd either need to transform
        // the color profile or we'd need to decode into a gray-scale image buffer and
        // hand that to CoreGraphics.
        bool sRGB = false;
        ColorProfile colorProfile;
        getColorProfile(png, info, colorProfile, sRGB);
        bool imageHasAlpha = (colorType & PNG_COLOR_MASK_ALPHA) || trnsCount;
        m_reader->createColorTransform(colorProfile, imageHasAlpha, sRGB);
        m_hasColorProfile = !!m_reader->colorTransform();
    }
#endif

    if (!m_hasColorProfile) {
        // Deal with gamma and keep it under our control.
        const double inverseGamma = 0.45455;
        const double defaultGamma = 2.2;
        double gamma;
        if (!m_ignoreGammaAndColorProfile && png_get_gAMA(png, info, &gamma)) {
            const double maxGamma = 21474.83;
            if ((gamma <= 0.0) || (gamma > maxGamma)) {
                gamma = inverseGamma;
                png_set_gAMA(png, info, gamma);
            }
            png_set_gamma(png, defaultGamma, gamma);
        } else {
            png_set_gamma(png, defaultGamma, inverseGamma);
        }
    }

    // Tell libpng to send us rows for interlaced pngs.
    if (interlaceType == PNG_INTERLACE_ADAM7)
        png_set_interlace_handling(png);

    // Update our info now.
    png_read_update_info(png, info);
    channels = png_get_channels(png, info);
    ASSERT(channels == 3 || channels == 4);

    m_reader->setHasAlpha(channels == 4);

    if (m_reader->decodingSizeOnly()) {
        // If we only needed the size, halt the reader.
#if PNG_LIBPNG_VER_MAJOR > 1 || (PNG_LIBPNG_VER_MAJOR == 1 && PNG_LIBPNG_VER_MINOR >= 5)
        // '0' argument to png_process_data_pause means: Do not cache unprocessed data.
        m_reader->setReadOffset(m_reader->currentBufferSize() - png_process_data_pause(png, 0));
#else
        m_reader->setReadOffset(m_reader->currentBufferSize() - png->buffer_size);
        png->buffer_size = 0;
#endif
    }
}
开发者ID:joone,项目名称:chromium-crosswalk,代码行数:98,代码来源:PNGImageDecoder.cpp


示例12: mSpikeTile

Spike::Spike()
: mSpikeTile(Resource::getBitmap("data/images/tileset1.bmp"), 70, 0, 10, 10)
{
	setSize(float2(10,10));
}
开发者ID:kulgan,项目名称:playn-greengrappler,代码行数:5,代码来源:Spike.cpp


示例13: deviceManager

//==============================================================================
AudioDemoPlaybackPage::AudioDemoPlaybackPage (AudioDeviceManager& deviceManager_)
    : deviceManager (deviceManager_),
      thread ("audio file preview"),
      directoryList (0, thread),
      zoomLabel (0),
      thumbnail (0),
      startStopButton (0),
      fileTreeComp (0),
      explanation (0),
      zoomSlider (0)
{
    addAndMakeVisible (zoomLabel = new Label (String::empty,
                                              L"zoom:"));
    zoomLabel->setFont (Font (15.0000f, Font::plain));
    zoomLabel->setJustificationType (Justification::centredRight);
    zoomLabel->setEditable (false, false, false);
    zoomLabel->setColour (TextEditor::textColourId, Colours::black);
    zoomLabel->setColour (TextEditor::backgroundColourId, Colour (0x0));

    addAndMakeVisible (explanation = new Label (String::empty,
                                                L"Select an audio file in the treeview above, and this page will display its waveform, and let you play it.."));
    explanation->setFont (Font (14.0000f, Font::plain));
    explanation->setJustificationType (Justification::bottomRight);
    explanation->setEditable (false, false, false);
    explanation->setColour (TextEditor::textColourId, Colours::black);
    explanation->setColour (TextEditor::backgroundColourId, Colour (0x0));

    addAndMakeVisible (zoomSlider = new Slider (String::empty));
    zoomSlider->setRange (0, 1, 0);
    zoomSlider->setSliderStyle (Slider::LinearHorizontal);
    zoomSlider->setTextBoxStyle (Slider::NoTextBox, false, 80, 20);
    zoomSlider->addListener (this);
    zoomSlider->setSkewFactor (2);

    addAndMakeVisible (thumbnail = new DemoThumbnailComp (formatManager, transportSource, *zoomSlider));

    addAndMakeVisible (startStopButton = new TextButton (String::empty));
    startStopButton->setButtonText (L"Play/Stop");
    startStopButton->addListener (this);
    startStopButton->setColour (TextButton::buttonColourId, Colour (0xff79ed7f));

    addAndMakeVisible (fileTreeComp = new FileTreeComponent (directoryList));

    //[UserPreSize]
    //[/UserPreSize]

    setSize (600, 400);


    //[Constructor] You can add your own custom stuff here..
    formatManager.registerBasicFormats();

    directoryList.setDirectory (File::getSpecialLocation (File::userHomeDirectory), true, true);
    thread.startThread (3);

    fileTreeComp->setColour (FileTreeComponent::backgroundColourId, Colours::white);
    fileTreeComp->addListener (this);

    deviceManager.addAudioCallback (&audioSourcePlayer);
    audioSourcePlayer.setSource (&transportSource);
    //[/Constructor]
}
开发者ID:furio,项目名称:pyplasm,代码行数:63,代码来源:AudioDemoPlaybackPage.cpp


示例14: AudioProcessorEditor

//==============================================================================
PluginEditor::PluginEditor (PluginProcessor& p)
    : AudioProcessorEditor (&p),
      buttonAB ("A-B"),
      buttonCopyAB ("Copy"),
      backgroundImage {ImageCache::getFromMemory (BinaryData::BalanceWidth_02fs8_png,
                                                  BinaryData::BalanceWidth_02fs8_pngSize)},
      knobStyleImage  {ImageCache::getFromMemory (BinaryData::knob05LargeForeground4fs8_png,
                                                  BinaryData::knob05LargeForeground4fs8_pngSize)},
      filmstripImage  {ImageCache::getFromMemory (BinaryData::markerFilmstripfs8_png,
                                                  BinaryData::markerFilmstripfs8_pngSize)},
      processor (p)
{
    // Button AB
    buttonAB.setColour (TextButton::textColourOffId, Colour (0xff373737));
    buttonAB.setColour (TextButton::buttonColourId, Colour (0xff808080));
    addAndMakeVisible (buttonAB);
    buttonAB.addListener (this);

    // Button copy
    buttonCopyAB.setColour (TextButton::textColourOffId, Colour (0xff373737));
    buttonCopyAB.setColour (TextButton::buttonColourId, Colour (0xff808080));
    addAndMakeVisible (buttonCopyAB);
    buttonCopyAB.addListener (this);

    // StepSize slider
    String stepSizeParamName = processor.getParam(0).name;                     // magic constant!

    Slider* stepSizeSlider = new Slider (stepSizeParamName);
    jassert (stepSizeSlider);
    sliders.add (stepSizeSlider);

    stepSizeSlider->setSliderStyle (Slider::LinearHorizontal);
    stepSizeSlider->setTextBoxStyle (Slider::TextBoxLeft,false,60,15);         // magic constants!
    stepSizeSlider->setColour (Slider::textBoxTextColourId,       Colour (0xff373737));
    stepSizeSlider->setColour (Slider::textBoxBackgroundColourId, Colour (0xff707070));
    stepSizeSlider->setColour (Slider::textBoxHighlightColourId,  Colour (0xffffffff));
    stepSizeSlider->setColour (Slider::textBoxOutlineColourId,    Colour (0x00000000));

    addAndMakeVisible (stepSizeSlider);
    stepSizeSlider->addListener (this);

    // StepSize label
    Label* stepSizeLabel = new Label (stepSizeParamName, stepSizeParamName);
    jassert (stepSizeLabel);
    labels.add (stepSizeLabel);

    stepSizeLabel->setJustificationType (Justification::centredLeft);
    stepSizeLabel->setEditable (false, false, false);
    stepSizeLabel->setColour (Label::textColourId, Colour (0xff2b2b2b));

    addAndMakeVisible (stepSizeLabel);

    // Main knob
    knob = new FilmStrip {filmstripImage, knobStyleImage};

    sliders.add (knob);

    knob->setDoubleClickReturnValue (true, sliders[0]->getValue()); // current getValue() is
                                                                    // the default value (0dB)

    addAndMakeVisible (knob);
    knob->addListener (this);

    // Init and size setting
    updateSlidersFromProcParams();  // set slider values and ranges

    setSize (400, 400);             // must be set before xtor finished

    startTimerHz (30);
}
开发者ID:johnflynnjohnflynn,项目名称:BalanceWidth,代码行数:71,代码来源:PluginEditor.cpp


示例15: setSize

void Image::setScale(const QSizeF& scale)
      {
      setSize(sizeForScale(scale));
      }
开发者ID:aeliot,项目名称:MuseScore,代码行数:4,代码来源:image.cpp


示例16: while

void PageFormat::read(XmlReader& e, Score* score)
      {
      qreal _oddRightMargin  = 0.0;
      qreal _evenRightMargin = 0.0;
      bool landscape = false;
      QString type;

      while (e.readNextStartElement()) {
            const QStringRef& tag(e.name());
            if (tag == "pageFormat")            // obsolete
                  setSize(getPaperSize(e.readElementText()));
            else if (tag == "landscape")        // obsolete
                  landscape = e.readInt();
            else if (tag == "page-margins") {
                  type = e.attribute("type","both");
                  qreal lm = 0.0, rm = 0.0, tm = 0.0, bm = 0.0;
                  while (e.readNextStartElement()) {
                        const QStringRef& tag(e.name());
                        qreal val = e.readDouble() * 0.5 / PPI;
                        if (tag == "left-margin")
                              lm = val;
                        else if (tag == "right-margin")
                              rm = val;
                        else if (tag == "top-margin")
                              tm = val;
                        else if (tag == "bottom-margin")
                              bm = val;
                        else
                              e.unknown();
                        }
                  _twosided = type == "odd" || type == "even";
                  if (type == "odd" || type == "both") {
                        _oddLeftMargin   = lm;
                        _oddRightMargin  = rm;
                        _oddTopMargin    = tm;
                        _oddBottomMargin = bm;
                        }
                  if (type == "even" || type == "both") {
                        _evenLeftMargin   = lm;
                        _evenRightMargin  = rm;
                        _evenTopMargin    = tm;
                        _evenBottomMargin = bm;
                        }
                  }
            else if (tag == "page-height")
                  _size.rheight() = e.readDouble() * 0.5 / PPI;
            else if (tag == "page-width")
                  _size.rwidth() = e.readDouble() * .5 / PPI;
            else if (tag == "page-offset") {           // obsolete, moved to Score
                  QString val(e.readElementText());
                  if(score)
                        score->setPageNumberOffset(val.toInt());
                  }
            else
                  e.unknown();
            }
      if (landscape)
            _size.transpose();
      qreal w1 = _size.width() - _oddLeftMargin - _oddRightMargin;
      qreal w2 = _size.width() - _evenLeftMargin - _evenRightMargin;
      _printableWidth = qMax(w1, w2);     // silently adjust right margins
      }
开发者ID:MatthewStein,项目名称:MuseScore,代码行数:62,代码来源:page.cpp


示例17: setSize

PawnHashTable::PawnHashTable()
{
    setSize(4); 
}
开发者ID:mAarnos,项目名称:Hakkapeliitta,代码行数:4,代码来源:pht.cpp


示例18: mappingsList

//==============================================================================
MappingsDialog::MappingsDialog (MidiMappingManager *manager, OscMappingManager *manager2, AudioProcessorGraph::Node *plugin, Array<Mapping *> maps, PluginField *field)
    : mappingsList (0),
      addMidiButton (0),
      addOscButton (0),
      deleteButton (0),
      overrideMidiButton (0),
      oscMidiAddressLabel (0),
      oscMidiAddress (0),
      oscHintLabel (0)
{
    addAndMakeVisible (mappingsList = new ListBox (String::empty, this));
    mappingsList->setName (L"mappingsList");

    addAndMakeVisible (addMidiButton = new TextButton (L"addMidiButton"));
    addMidiButton->setButtonText (L"add MIDI");
    addMidiButton->addListener (this);

    addAndMakeVisible (addOscButton = new TextButton (L"addOscButton"));
    addOscButton->setButtonText (L"add OSC");
    addOscButton->addListener (this);

    addAndMakeVisible (deleteButton = new TextButton (L"deleteButton"));
    deleteButton->setButtonText (L"remove");
    deleteButton->addListener (this);

    addAndMakeVisible (overrideMidiButton = new ToggleButton (L"overrideMidiButton"));
    overrideMidiButton->setButtonText (L"Override plugin\'s default MIDI behaviour");
    overrideMidiButton->addListener (this);

    addAndMakeVisible (oscMidiAddressLabel = new Label (L"oscMidiAddressLabel",
                                                        L"OSC MIDI Address:"));
    oscMidiAddressLabel->setFont (Font (15.0000f, Font::plain));
    oscMidiAddressLabel->setJustificationType (Justification::centredLeft);
    oscMidiAddressLabel->setEditable (false, false, false);
    oscMidiAddressLabel->setColour (TextEditor::textColourId, Colours::black);
    oscMidiAddressLabel->setColour (TextEditor::backgroundColourId, Colour (0x0));

    addAndMakeVisible (oscMidiAddress = new TextEditor (L"oscMidiAddress"));
    oscMidiAddress->setMultiLine (false);
    oscMidiAddress->setReturnKeyStartsNewLine (false);
    oscMidiAddress->setReadOnly (false);
    oscMidiAddress->setScrollbarsShown (true);
    oscMidiAddress->setCaretVisible (true);
    oscMidiAddress->setPopupMenuEnabled (true);
    oscMidiAddress->setText (String::empty);

    addAndMakeVisible (oscHintLabel = new Label (L"oscHintLabel",
                                                 L"(leave blank if you don\'t want to receive MIDI over OSC)"));
    oscHintLabel->setFont (Font (15.0000f, Font::plain));
    oscHintLabel->setJustificationType (Justification::centredRight);
    oscHintLabel->setEditable (false, false, false);
    oscHintLabel->setColour (Label::textColourId, Colours::black);
    oscHintLabel->setColour (TextEditor::textColourId, Colours::black);
    oscHintLabel->setColour (TextEditor::backgroundColourId, Colour (0x0));


    //[UserPreSize]
	midiManager = manager;
	oscManager = manager2;
	pluginNode = plugin;
	mappings = maps;
	pluginField = field;

	mappingsList->updateContent();
	mappingsList->setOutlineThickness(1);
	mappingsList->setColour(ListBox::outlineColourId, Colour(0x60000000));
	mappingsList->setRowHeight(40);
	mappingsList->setMouseClickGrabsKeyboardFocus(true);
	mappingsList->setWantsKeyboardFocus(true);
	mappingsList->setColour(ListBox::backgroundColourId,
							ColourScheme::getInstance().colours[L"Dialog Inner Background"]);

	overrideMidiButton->setToggleState(!pluginField->getMidiEnabledForNode(pluginNode), false);

	{
		BypassableInstance *proc = dynamic_cast<BypassableInstance *>(pluginNode->getProcessor());

		if(proc)
			oscMidiAddress->setText(oscManager->getMIDIProcessorAddress(proc));
	}
	oscMidiAddress->addListener(this);
    //[/UserPreSize]

    setSize (738, 400);


    //[Constructor] You can add your own custom stuff here..
    //[/Constructor]
}
开发者ID:eriser,项目名称:guitareffectvst,代码行数:90,代码来源:MappingsDialog.cpp


示例19: setSize

void GuiControl::setSize(float x, float y) {
    setSize(Vector2(x, y));
}
开发者ID:luaman,项目名称:g3d-cvs,代码行数:3,代码来源:GuiControl.cpp


示例20: setSize

void PHIContext2D::setSize( const QSize &size )
{
    setSize( size.width(), size.height() );
}
开发者ID:Phisketeer,项目名称:phisketeer,代码行数:4,代码来源:phicontext2d.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ setSizeGripEnabled函数代码示例发布时间:2022-05-30
下一篇:
C++ setShortcut函数代码示例发布时间: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