当前位置: 首页>>代码示例>>C++>>正文


C++ Colour函数代码示例

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


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

示例1: GUIWindow


//.........这里部分代码省略.........
	m_pGameModeOptionController->Add(m_pGameOptionBox);
	m_pGameModeOptionController->Add(m_pDebugOptionBox);
	m_pGameModeOptionController->Add(m_pFrontEndOptionBox);
	m_pDebugOptionBox->SetToggled(true);

	m_pFaceMergingCheckbox = new CheckBox(m_pRenderer, m_defaultFont, "Face Merging");
	m_pFaceMergingCheckbox->SetDimensions(10, 10, 14, 14);
	m_pFaceMergingCheckbox->SetCallBackFunction(_FaceMergeCheckboxChanged);
	m_pFaceMergingCheckbox->SetCallBackData(this);

	m_pStepUpdateCheckbox = new CheckBox(m_pRenderer, m_defaultFont, "Step Update");
	m_pStepUpdateCheckbox->SetDimensions(110, 10, 14, 14);

	m_pStepUpdateButton = new Button(m_pRenderer, m_defaultFont, "Step");
	m_pStepUpdateButton->SetDimensions(200, 5, 65, 25);
	m_pStepUpdateButton->SetCallBackFunction(_StepUpdatePressed);
	m_pStepUpdateButton->SetCallBackData(this);

	m_pDebugCameraOptionBox = new OptionBox(m_pRenderer, m_defaultFont, "Debug");
	m_pDebugCameraOptionBox->SetDimensions(10, 70, 14, 14);
	m_pDebugCameraOptionBox->SetCallBackFunction(_CameraModeChanged);
	m_pDebugCameraOptionBox->SetCallBackData(this);
	m_pMouseRotateCameraOptionBox = new OptionBox(m_pRenderer, m_defaultFont, "Player Rotate");
	m_pMouseRotateCameraOptionBox->SetDimensions(10, 50, 14, 14);
	m_pMouseRotateCameraOptionBox->SetCallBackFunction(_CameraModeChanged);
	m_pMouseRotateCameraOptionBox->SetCallBackData(this);
	m_pAutoCameraOptionBox = new OptionBox(m_pRenderer, m_defaultFont, "Auto");
	m_pAutoCameraOptionBox->SetDimensions(10, 30, 14, 14);
	m_pAutoCameraOptionBox->SetCallBackFunction(_CameraModeChanged);
	m_pAutoCameraOptionBox->SetCallBackData(this);
	m_pFrontendCameraOptionBox = new OptionBox(m_pRenderer, m_defaultFont, "Frontend");
	m_pFrontendCameraOptionBox->SetDimensions(10, 10, 14, 14);
	m_pFrontendCameraOptionBox->SetCallBackFunction(_CameraModeChanged);
	m_pFrontendCameraOptionBox->SetCallBackData(this);
	m_pCameraModeOptionController = new OptionController(m_pRenderer, m_defaultFont, "Camera");
	m_pCameraModeOptionController->SetDisplayLabel(true);
	m_pCameraModeOptionController->SetDisplayBorder(true);
	m_pCameraModeOptionController->SetDimensions(160, 35, 105, 90);
	m_pCameraModeOptionController->Add(m_pDebugCameraOptionBox);
	m_pCameraModeOptionController->Add(m_pMouseRotateCameraOptionBox);
	m_pCameraModeOptionController->Add(m_pAutoCameraOptionBox);
	m_pCameraModeOptionController->Add(m_pFrontendCameraOptionBox);
	m_pDebugCameraOptionBox->SetToggled(true);
	m_pMouseRotateCameraOptionBox->SetDisabled(true);
	m_pAutoCameraOptionBox->SetDisabled(true);
	m_pFrontendCameraOptionBox->SetDisabled(true);

	m_pGameWindow->AddComponent(m_pGameModeOptionController);
	m_pGameWindow->AddComponent(m_pCameraModeOptionController);
	m_pGameWindow->AddComponent(m_pFaceMergingCheckbox);
	m_pGameWindow->AddComponent(m_pStepUpdateCheckbox);
	m_pGameWindow->AddComponent(m_pStepUpdateButton);

	// Console window
	m_pConsoleWindow = new GUIWindow(m_pRenderer, m_defaultFont, "Console");
	m_pConsoleWindow->AllowMoving(true);
	m_pConsoleWindow->AllowClosing(false);
	m_pConsoleWindow->AllowMinimizing(true);
	m_pConsoleWindow->AllowScrolling(true);
	m_pConsoleWindow->SetRenderTitleBar(true);
	m_pConsoleWindow->SetRenderWindowBackground(true);
	m_pConsoleWindow->SetOutlineRender(true);
	m_pConsoleWindow->SetDimensions(635, 35, 500, 140);
	m_pConsoleWindow->SetApplicationDimensions(m_windowWidth, m_windowHeight);

	m_pConsoleTextbox = new TextBox(m_pRenderer, m_defaultFont, "", "");
	m_pConsoleTextbox->SetDimensions(1, 1, 498, 16);
	m_pConsoleTextbox->SetDontLoseFocus(false);
	m_pConsoleTextbox->SetCallBackFunction_OnReturnPressed(_ConsoleReturnPressed);
	m_pConsoleTextbox->SetCallBackData_OnReturnPressed(this);
	m_pConsoleTextbox->SetPipeColour(Colour(0.0f, 0.0f, 0.0f));
	m_pConsoleTextbox->SetDontLoseFocus(true);

	m_pConsoleScrollbar = new ScrollBar(m_pRenderer);
	m_pConsoleScrollbar->SetScrollDirection(EScrollBarDirection_Vertical);
	m_pConsoleScrollbar->SetScrollSize(1.0f);
	m_pConsoleScrollbar->SetScrollPosition(1.0f);
	m_pConsoleScrollbar->SetScissorEnabled(true);
	m_pConsoleScrollbar->SetScrollArea(-484, 0, 490, 122);
	m_pConsoleScrollbar->SetDepth(2.0f);
	m_pConsoleScrollbar->SetDimensions(486, 18, 14, 122);
	m_pConsoleScrollbar->SetScissorEnabled(true);

	m_pConsoleWindow->AddComponent(m_pConsoleTextbox);
	m_pConsoleWindow->AddComponent(m_pConsoleScrollbar);

	m_pGUI->AddWindow(m_pMainWindow);
	m_pGUI->AddWindow(m_pGameWindow);
	m_pGUI->AddWindow(m_pConsoleWindow);

	UpdateCharactersPulldown();
	UpdateWeaponsPulldown();
	UpdateAnimationsPulldown();

	m_pCharacterPulldown->SetSelectedItem("Steve");
	m_pWeaponsPulldown->SetSelectedItem("None");
	m_pAnimationsPulldown->SetSelectedItem("BindPose");

	m_GUICreated = true;
}
开发者ID:rzh,项目名称:Vox,代码行数:101,代码来源:VoxGUI.cpp

示例2: Colour

inline Colour operator +(const Colour& a, const Colour& b)
{
  return Colour(a.R()+b.R(), a.G()+b.G(), a.B()+b.B());
}
开发者ID:wienleung,项目名称:graphics,代码行数:4,代码来源:algebra.hpp

示例3: default_log

Plotter::Plotter(
    DataLog* log,
    float left, float right, float bottom, float top,
    float tickx, float ticky,
    Plotter* linked_plotter_x,
    Plotter* linked_plotter_y
)   : default_log(log),
      colour_wheel(0.6f),
      rview_default(left,right,bottom,top), rview(rview_default), target(rview),
      selection(0,0,0,0),
      track(false), track_x("$i"), track_y(""),
      trigger_edge(0), trigger("$0"),
      linked_plotter_x(linked_plotter_x),
      linked_plotter_y(linked_plotter_y)
{
    if(!log) {
        throw std::runtime_error("DataLog not specified");
    }
    // Prevent links to ourselves - this could cause infinite recursion.
    if(linked_plotter_x == this) this->linked_plotter_x = 0;
    if(linked_plotter_y == this) this->linked_plotter_y = 0;

    // Handle our own mouse / keyboard events
    this->handler = this;
    hover[0] = 0;
    hover[1] = 0;

    // Default colour scheme
    colour_bg = Colour(0.0f, 0.0f, 0.0f);
    colour_tk = Colour(0.2f, 0.2f, 0.2f);
    colour_ax = Colour(0.5f, 0.5f, 0.5f);

    SetTicks(tickx, ticky);

    // Create shader for drawing simple primitives
    prog_lines.AddShader( GlSlVertexShader,
                         "attribute vec2 a_position;\n"
                         "uniform vec4 u_color;\n"
                         "uniform vec2 u_scale;\n"
                         "uniform vec2 u_offset;\n"
                         "varying vec4 v_color;\n"
                         "void main() {\n"
                         "    gl_Position = vec4(u_scale * (a_position + u_offset),0,1);\n"
                         "    v_color = u_color;\n"
                         "}\n"
                         );
    prog_lines.AddShader( GlSlFragmentShader,
                      #ifdef HAVE_GLES_2
                          "precision mediump float;\n"
                      #endif // HAVE_GLES_2
                         "varying vec4 v_color;\n"
                         "void main() {\n"
                         "  gl_FragColor = v_color;\n"
                         "}\n"
                         );
    prog_lines.BindPangolinDefaultAttribLocationsAndLink();

    prog_text.AddShader( GlSlVertexShader,
                         "attribute vec2 a_position;\n"
                         "attribute vec2 a_texcoord;\n"
                         "uniform vec4 u_color;\n"
                         "uniform vec2 u_scale;\n"
                         "uniform vec2 u_offset;\n"
                         "varying vec4 v_color;\n"
                         "varying vec2 v_texcoord;\n"
                         "void main() {\n"
                         "    gl_Position = vec4(u_scale * (a_position + u_offset),0,1);\n"
                         "    v_color = u_color;\n"
                         "    v_texcoord = a_texcoord;\n"
                         "}\n"
                         );
    prog_text.AddShader( GlSlFragmentShader,
                     #ifdef HAVE_GLES_2
                         "precision mediump float;\n"
                     #endif // HAVE_GLES_2
                         "varying vec4 v_color;\n"
                         "varying vec2 v_texcoord;\n"
                         "uniform sampler2D u_texture;\n"
                         "void main() {\n"
                         "  gl_FragColor = v_color;\n"
                         "  gl_FragColor.a *= texture2D(u_texture, v_texcoord).a;\n"
                         "}\n"
                         );
    prog_text.BindPangolinDefaultAttribLocationsAndLink();

    const size_t RESERVED_SIZE = 100;

    // Setup default PlotSeries
    plotseries.reserve(RESERVED_SIZE);
    for(unsigned int i=0; i< 10; ++i) {
        std::ostringstream oss;
        oss << "$" << i;
        plotseries.push_back( PlotSeries() );
        plotseries.back().CreatePlot( "$i", oss.str(),
            colour_wheel.GetUniqueColour(),
            i < log->Labels().size() ? log->Labels()[i] : oss.str()
        );
    }

    // Setup test PlotMarkers
//.........这里部分代码省略.........
开发者ID:DapengChalmers,项目名称:ZSLAM_TX2,代码行数:101,代码来源:plotter.cpp

示例4:

void GUI::LeftPanel::paint (Graphics & g)
{
    // backGround Filling
    g.fillAll (Colour (0xff292929));
}
开发者ID:cyberCBM,项目名称:ScPlayer,代码行数:5,代码来源:LeftPanel.cpp

示例5: TLDebug_Break


//.........这里部分代码省略.........
			return SyncFalse;

		//	convert to normalised quaternion
		TLMaths::TAxisAngle AxisAngle( f );
		BinaryData.Write( AxisAngle );
		return SyncTrue;
	}
	
	case TLBinary_TypeRef(TRef):
	{
		TRef Ref( DataString );
		BinaryData.Write( Ref );
		return SyncTrue;
	}
	
	case TLBinary_TypeRef_String:
	{
		//	do string cleanup, convert "\n" to a linefeed etc
		if ( TLString::IsStringDirty( DataString ) )
		{
			TString OutputString = DataString;
			TLString::CleanString( OutputString );
			BinaryData.WriteString( OutputString );
		}
		else
		{
			//	already clean, just write the original
			BinaryData.WriteString( DataString );
		}

		return SyncTrue;
	}
	
	case TLBinary_TypeRef(TColour):
	{
		float4 f;
		if ( !TLString::ReadNextFloatArray( DataString, CharIndex, f.GetData(), f.GetSize() ) )
			return SyncFalse;
		
		//	check range
		//	gr: use TLDebug_CheckInRange() ?
		if ( f.x > 1.0f || f.x < 0.0f ||
			f.y > 1.0f || f.y < 0.0f ||
			f.z > 1.0f || f.z < 0.0f ||
			f.w > 1.0f || f.w < 0.0f )
		{
			if ( !TLDebug_Break( TString("Colour float type has components out of range (0..1); %.3f,%.3f,%.3f,%.3f", f.x, f.y, f.z, f.w) ) )
				return SyncFalse;
		}

		TColour Colour( f );
		BinaryData.Write( Colour );
		return SyncTrue;
	}
	
	case TLBinary_TypeRef(TColour24):
	{
		Type3<s32> Colours;
		if ( !TLString::ReadNextInteger( DataString, CharIndex, Colours.x ) )		return SyncFalse;
		if ( !TLString::ReadNextInteger( DataString, CharIndex, Colours.y ) )		return SyncFalse;
		if ( !TLString::ReadNextInteger( DataString, CharIndex, Colours.z ) )		return SyncFalse;
		
		//	check range
		//	gr: use TLDebug_CheckInRange() ?
		if ( Colours.x > 255 || Colours.x < 0 ||
			Colours.y > 255 || Colours.y < 0 ||
开发者ID:SoylentGraham,项目名称:Tootle,代码行数:67,代码来源:TLFile.cpp

示例6: graph

ControlPanel::ControlPanel(ProcessorGraph* graph_, AudioComponent* audio_)
    : graph(graph_), audio(audio_), initialize(true), open(false), lastEngineIndex(-1)
{

    if (1)
    {

        font = Font("Paragraph", 13, Font::plain);

        // MemoryInputStream mis(BinaryData::misoserialized, BinaryData::misoserializedSize, false);
        // Typeface::Ptr typeface = new CustomTypeface(mis);
        // font = Font(typeface);
        // font.setHeight(15);
    }

    audioEditor = (AudioEditor*) graph->getAudioNode()->createEditor();
    addAndMakeVisible(audioEditor);

    playButton = new PlayButton();
    playButton->addListener(this);
    addAndMakeVisible(playButton);

    recordButton = new RecordButton();
    recordButton->addListener(this);
    addAndMakeVisible(recordButton);

    masterClock = new Clock();
    addAndMakeVisible(masterClock);

    cpuMeter = new CPUMeter();
    addAndMakeVisible(cpuMeter);

    diskMeter = new DiskSpaceMeter();
    addAndMakeVisible(diskMeter);

    cpb = new ControlPanelButton(this);
    addAndMakeVisible(cpb);

    recordSelector = new ComboBox();
    recordSelector->addListener(this);
    for (int i =0; i < RecordEngineManager::getNumOfBuiltInEngines(); i++)
    {
        RecordEngineManager* rem = RecordEngineManager::createBuiltInEngineManager(i);
        recordSelector->addItem(rem->getName(),i+1);
        recordEngines.add(rem);
    }
    addChildComponent(recordSelector);

    recordOptionsButton = new UtilityButton("R",Font("Small Text", 15, Font::plain));
    recordOptionsButton->setEnabledState(true);
    recordOptionsButton->addListener(this);
    recordOptionsButton->setTooltip("Configure options for selected record engine");
    addChildComponent(recordOptionsButton);

    newDirectoryButton = new UtilityButton("+", Font("Small Text", 15, Font::plain));
    newDirectoryButton->setEnabledState(false);
    newDirectoryButton->addListener(this);
    newDirectoryButton->setTooltip("Start a new data directory");
    addChildComponent(newDirectoryButton);


    File executable = File::getSpecialLocation(File::currentExecutableFile);

#if defined(__APPLE__)
    const String executableDirectory =
        executable.getParentDirectory().getParentDirectory().getParentDirectory().getParentDirectory().getFullPathName();
#else
    const String executableDirectory = executable.getParentDirectory().getFullPathName();
#endif

    filenameComponent = new FilenameComponent("folder selector",
                                              executableDirectory,
                                              true,
                                              true,
                                              true,
                                              "*",
                                              "",
                                              "");
    addChildComponent(filenameComponent);

    prependText = new Label("Prepend","");
    prependText->setEditable(true);
    prependText->addListener(this);
    prependText->setColour(Label::backgroundColourId, Colours::lightgrey);
    prependText->setTooltip("Prepend to name of data directory");

    addChildComponent(prependText);

    dateText = new Label("Date","YYYY-MM-DD_HH-MM-SS");
    dateText->setColour(Label::backgroundColourId, Colours::lightgrey);
    dateText->setColour(Label::textColourId, Colours::grey);
    addChildComponent(dateText);

    appendText = new Label("Append","");
    appendText->setEditable(true);
    appendText->addListener(this);
    appendText->setColour(Label::backgroundColourId, Colours::lightgrey);
    addChildComponent(appendText);
    appendText->setTooltip("Append to name of data directory");

//.........这里部分代码省略.........
开发者ID:SunandhaSrikanth,项目名称:open-ephys-GUI,代码行数:101,代码来源:ControlPanel.cpp

示例7: vcolour

int vcolour(Vec3 c) { // converts a 4 vector to a colour.
    return Colour((int)(c[0]), (int)(c[1]), (int)(c[2]));
}
开发者ID:graingert,项目名称:comp3004-2,代码行数:3,代码来源:polygon.cpp

示例8: paint

void MainContentComponent::paint (Graphics& g)
{
    g.fillAll (Colour (0xffeeddff));
}
开发者ID:AndyBrown91,项目名称:JuceMonome,代码行数:4,代码来源:MainComponent.cpp

示例9: Colour

CodeEditorComponent::ColourScheme LuaTokeniser::getDefaultColourScheme()
{
    static const CodeEditorComponent::ColourScheme::TokenType types[] =
    {
        { "Error",          Colour (0xffcc0000) },
        { "Comment",        Colour (0xff3c3c3c) },
        { "Keyword",        Colour (0xff0000cc) },
        { "Operator",       Colour (0xff225500) },
        { "Identifier",     Colour (0xff000000) },
        { "Integer",        Colour (0xff880000) },
        { "Float",          Colour (0xff885500) },
        { "String",         Colour (0xff990099) },
        { "Bracket",        Colour (0xff000055) },
        { "Punctuation",    Colour (0xff004400) }
    };

    CodeEditorComponent::ColourScheme cs;

    for (auto& t : types)
        cs.set (t.name, Colour (t.colour));

    return cs;
}
开发者ID:imekon,项目名称:SampleBrowser2,代码行数:23,代码来源:juce_LuaCodeTokeniser.cpp

示例10: _commands

//==============================================================================
ChannelStripComponent::ChannelStripComponent(ApplicationCommandManager &commands, int trackID, const Audio::Engine &engine) :
	_commands(commands),
	_trackID(trackID),
	_engine(engine)
{
    addAndMakeVisible(label = new Label(String::empty, String::empty));
    label->setFont(Font(11.0f, Font::FontStyleFlags::plain));
    label->setJustificationType(Justification::centred);
    label->setEditable(false, true);
    label->addListener(this);
    
    // some method should be used to return the name of a track
    auto trackLabel = "Track" + String(trackID);
    label->setText(trackLabel, NotificationType::sendNotification);
    
    addAndMakeVisible(volumeSlider = new Slider(trackLabel + " v"));
    volumeSlider->setSliderStyle(Slider::SliderStyle::LinearVertical);
    volumeSlider->setRange(0.0f, 1.0f);
    volumeSlider->setSkewFactor(0.5f);
    volumeSlider->setTextBoxStyle(Slider::NoTextBox, false, 80, 20);
    volumeSlider->setValue(0.7f);
	_engine.getMixer()->changeGain(ChannelStripNode::GAIN, static_cast<float>(volumeSlider->getValue()));
    volumeSlider->addListener(this);
    
    addAndMakeVisible(panPot = new Slider(trackLabel + " p"));
	panPot->setSliderStyle(Slider::SliderStyle::RotaryVerticalDrag);
	panPot->setRange(0.0f, 1.0f);
        panPot->setTextBoxStyle(Slider::NoTextBox, false, 80, 20);
    panPot->setColour(Slider::rotarySliderFillColourId, Colour(0x7fffff));
    panPot->setColour(Slider::rotarySliderOutlineColourId, Colour(0x8cffff));
    panPot->setValue(0.5f);
	_engine.getMixer()->changePan(ChannelStripNode::PAN, static_cast<float>(panPot->getValue()));
    panPot->addListener(this);
    
    addAndMakeVisible(muteButton = new ToggleButton("Mute"));
    muteButton->setColour(TextButton::buttonColourId, Colours::blue);
	setButtonState("Mute", false);
    muteButton->addListener(this);
    
	if (trackID != 0)
	{
		addAndMakeVisible(soloButton = new ToggleButton("Solo"));
		soloButton->setColour(TextButton::buttonColourId, Colours::yellow);
		setButtonState("Solo", false);
		soloButton->addListener(this);
	}
	addAndMakeVisible(_pluginsButton = new TextButton("Plugins"));
	_pluginsButton->addListener(this);

    addAndMakeVisible(plugins1 = new TextButton("Plugin 1"));
    plugins1->addListener(this);
    
    addAndMakeVisible(plugins2 = new TextButton("Plugin 2"));
    plugins2->addListener(this);
	plugins2->setEnabled(false);
    
    addAndMakeVisible(plugins3 = new TextButton("Plugin 3"));
    plugins3->addListener(this);
	plugins3->setEnabled(false);

    addAndMakeVisible(plugins4 = new TextButton("Plugin 4"));
    plugins4->addListener(this);
	plugins4->setEnabled(false);

	addAndMakeVisible(plugins5 = new TextButton("Plugin 1"));
	plugins5->addListener(this);

	addAndMakeVisible(plugins6 = new TextButton("Plugin 2"));
	plugins6->addListener(this);
	plugins6->setEnabled(false);

	addAndMakeVisible(plugins7 = new TextButton("Plugin 3"));
	plugins7->addListener(this);
	plugins7->setEnabled(false);

	addAndMakeVisible(plugins8 = new TextButton("Plugin 4"));
	plugins8->addListener(this);
	plugins8->setEnabled(false);
}
开发者ID:dmtaudio,项目名称:mordaw,代码行数:80,代码来源:ChannelStripComponent.cpp

示例11: sprintf

void VoxGame::AddConsoleLabel(string message)
{
	if (m_GUICreated == false)
	{
		m_vStringCache.push_back(message);

		return;
	}

	char lChatString[8192];
	sprintf(lChatString, "%s", message.c_str());

	string chatString = lChatString;

	int lCharIndex = 0;
	int lStartLineIndex = 0;
	int lPreviousSpaceIndex = 0;

	// Our position
	float lCurrentTextX = 0.0f;
	int newLineIndex = 1;

	int indexToUse = (int)m_vpConsoleLabels.size() + (int)m_vpConsoleLabels_Add.size();

	while (lChatString[lCharIndex] != 0)
	{
		char lpChar = lChatString[lCharIndex];
		char lpNextChar = lChatString[lCharIndex + 1];

		// Check for spaces
		if (lpChar == ' ')
		{
			string lString(chatString.substr(lStartLineIndex, lCharIndex - lStartLineIndex));
			int lTextLineWidth = m_pRenderer->GetFreeTypeTextWidth(m_defaultFont, "%s", lString.c_str());

			// If the current X position, plus our new text length is greater than the width, then we know we will go out of bounds
			if (lCurrentTextX + lTextLineWidth > m_pConsoleScrollbar->GetScrollArea().m_width)
			{
				string lString(chatString.substr(lStartLineIndex, lPreviousSpaceIndex - lStartLineIndex));

				Label* pNewLabel = new Label(m_pRenderer, m_defaultFont, lString.c_str(), Colour(1.0f, 1.0f, 1.0f));
				int xPos = m_pConsoleScrollbar->GetScrollArea().m_x;
				int yPos = m_pConsoleScrollbar->GetScrollArea().m_y + m_pConsoleScrollbar->GetScrollArea().m_height - (indexToUse + newLineIndex) * 14;
				pNewLabel->SetLocation(xPos, yPos);

				m_vpConsoleLabels_Add.push_back(pNewLabel);

				// Skip over the new line, else we will detect it on the next loop
				lStartLineIndex = lPreviousSpaceIndex + 1;
				newLineIndex++;
			}

			lPreviousSpaceIndex = lCharIndex;
		}

		// Check for the end of the string
		if (lpNextChar == 0)
		{
			string lString(chatString.substr(lStartLineIndex, lCharIndex + 1 - lStartLineIndex));
			int lTextLineWidth = m_pRenderer->GetFreeTypeTextWidth(m_defaultFont, "%s", lString.c_str());

			Label* pNewLabel = new Label(m_pRenderer, m_defaultFont, lString.c_str(), Colour(1.0f, 1.0f, 1.0f));
			int xPos = m_pConsoleScrollbar->GetScrollArea().m_x;
			int yPos = m_pConsoleScrollbar->GetScrollArea().m_y + m_pConsoleScrollbar->GetScrollArea().m_height - (indexToUse + newLineIndex) * 14;
			pNewLabel->SetLocation(xPos, yPos);

			m_vpConsoleLabels_Add.push_back(pNewLabel);
		}

		lCharIndex++;
	}
}
开发者ID:rzh,项目名称:Vox,代码行数:72,代码来源:VoxGUI.cpp

示例12: Colour

//==============================================================================
const Colour Colours::findColourForName (const String& colourName,
                                         const Colour& defaultColour)
{
    static const int presets[] =
    {
        // (first value is the string's hashcode, second is ARGB)

        0x05978fff, 0xff000000, /* black */
        0x06bdcc29, 0xffffffff, /* white */
        0x002e305a, 0xff0000ff, /* blue */
        0x00308adf, 0xff808080, /* grey */
        0x05e0cf03, 0xff008000, /* green */
        0x0001b891, 0xffff0000, /* red */
        0xd43c6474, 0xffffff00, /* yellow */
        0x620886da, 0xfff0f8ff, /* aliceblue */
        0x20a2676a, 0xfffaebd7, /* antiquewhite */
        0x002dcebc, 0xff00ffff, /* aqua */
        0x46bb5f7e, 0xff7fffd4, /* aquamarine */
        0x0590228f, 0xfff0ffff, /* azure */
        0x05947fe4, 0xfff5f5dc, /* beige */
        0xad388e35, 0xffffe4c4, /* bisque */
        0x00674f7e, 0xffffebcd, /* blanchedalmond */
        0x39129959, 0xff8a2be2, /* blueviolet */
        0x059a8136, 0xffa52a2a, /* brown */
        0x89cea8f9, 0xffdeb887, /* burlywood */
        0x0fa260cf, 0xff5f9ea0, /* cadetblue */
        0x6b748956, 0xff7fff00, /* chartreuse */
        0x2903623c, 0xffd2691e, /* chocolate */
        0x05a74431, 0xffff7f50, /* coral */
        0x618d42dd, 0xff6495ed, /* cornflowerblue */
        0xe4b479fd, 0xfffff8dc, /* cornsilk */
        0x3d8c4edf, 0xffdc143c, /* crimson */
        0x002ed323, 0xff00ffff, /* cyan */
        0x67cc74d0, 0xff00008b, /* darkblue */
        0x67cd1799, 0xff008b8b, /* darkcyan */
        0x31bbd168, 0xffb8860b, /* darkgoldenrod */
        0x67cecf55, 0xff555555, /* darkgrey */
        0x920b194d, 0xff006400, /* darkgreen */
        0x923edd4c, 0xffbdb76b, /* darkkhaki */
        0x5c293873, 0xff8b008b, /* darkmagenta */
        0x6b6671fe, 0xff556b2f, /* darkolivegreen */
        0xbcfd2524, 0xffff8c00, /* darkorange */
        0xbcfdf799, 0xff9932cc, /* darkorchid */
        0x55ee0d5b, 0xff8b0000, /* darkred */
        0xc2e5f564, 0xffe9967a, /* darksalmon */
        0x61be858a, 0xff8fbc8f, /* darkseagreen */
        0xc2b0f2bd, 0xff483d8b, /* darkslateblue */
        0xc2b34d42, 0xff2f4f4f, /* darkslategrey */
        0x7cf2b06b, 0xff00ced1, /* darkturquoise */
        0xc8769375, 0xff9400d3, /* darkviolet */
        0x25832862, 0xffff1493, /* deeppink */
        0xfcad568f, 0xff00bfff, /* deepskyblue */
        0x634c8b67, 0xff696969, /* dimgrey */
        0x45c1ce55, 0xff1e90ff, /* dodgerblue */
        0xef19e3cb, 0xffb22222, /* firebrick */
        0xb852b195, 0xfffffaf0, /* floralwhite */
        0xd086fd06, 0xff228b22, /* forestgreen */
        0xe106b6d7, 0xffff00ff, /* fuchsia */
        0x7880d61e, 0xffdcdcdc, /* gainsboro */
        0x00308060, 0xffffd700, /* gold */
        0xb3b3bc1e, 0xffdaa520, /* goldenrod */
        0xbab8a537, 0xffadff2f, /* greenyellow */
        0xe4cacafb, 0xfff0fff0, /* honeydew */
        0x41892743, 0xffff69b4, /* hotpink */
        0xd5796f1a, 0xffcd5c5c, /* indianred */
        0xb969fed2, 0xff4b0082, /* indigo */
        0x05fef6a9, 0xfffffff0, /* ivory */
        0x06149302, 0xfff0e68c, /* khaki */
        0xad5a05c7, 0xffe6e6fa, /* lavender */
        0x7c4d5b99, 0xfffff0f5, /* lavenderblush */
        0x195756f0, 0xfffffacd, /* lemonchiffon */
        0x28e4ea70, 0xffadd8e6, /* lightblue */
        0xf3c7ccdb, 0xfff08080, /* lightcoral */
        0x28e58d39, 0xffe0ffff, /* lightcyan */
        0x21234e3c, 0xfffafad2, /* lightgoldenrodyellow */
        0xf40157ad, 0xff90ee90, /* lightgreen */
        0x28e744f5, 0xffd3d3d3, /* lightgrey */
        0x28eb3b8c, 0xffffb6c1, /* lightpink */
        0x9fb78304, 0xffffa07a, /* lightsalmon */
        0x50632b2a, 0xff20b2aa, /* lightseagreen */
        0x68fb7b25, 0xff87cefa, /* lightskyblue */
        0xa8a35ba2, 0xff778899, /* lightslategrey */
        0xa20d484f, 0xffb0c4de, /* lightsteelblue */
        0xaa2cf10a, 0xffffffe0, /* lightyellow */
        0x0032afd5, 0xff00ff00, /* lime */
        0x607bbc4e, 0xff32cd32, /* limegreen */
        0x06234efa, 0xfffaf0e6, /* linen */
        0x316858a9, 0xffff00ff, /* magenta */
        0xbf8ca470, 0xff800000, /* maroon */
        0xbd58e0b3, 0xff66cdaa, /* mediumaquamarine */
        0x967dfd4f, 0xff0000cd, /* mediumblue */
        0x056f5c58, 0xffba55d3, /* mediumorchid */
        0x07556b71, 0xff9370db, /* mediumpurple */
        0x5369b689, 0xff3cb371, /* mediumseagreen */
        0x066be19e, 0xff7b68ee, /* mediumslateblue */
        0x3256b281, 0xff00fa9a, /* mediumspringgreen */
        0xc0ad9f4c, 0xff48d1cc, /* mediumturquoise */
        0x628e63dd, 0xffc71585, /* mediumvioletred */
        0x168eb32a, 0xff191970, /* midnightblue */
//.........这里部分代码省略.........
开发者ID:SonicPotions,项目名称:editor,代码行数:101,代码来源:juce_Colours.cpp

示例13: TemplateFileProperty

    };

    //==============================================================================
    class TemplateFileProperty    : public ComponentTextProperty <Component>
    {
    public:
        TemplateFileProperty (JucerDocument& doc)
            : ComponentTextProperty <Component> ("Template file", 2048, false, 0, doc)
        {}

        void setText (const String& newText) override    { document.setTemplateFile (newText); }
        String getText() const override                  { return document.getTemplateFile(); }
    };
};

static const Colour tabColour (Colour (0xff888888));

static SourceCodeEditor* createCodeEditor (const File& file, SourceCodeDocument& sourceCodeDoc)
{
    return new SourceCodeEditor (&sourceCodeDoc,
                                 new CppCodeEditorComponent (file, sourceCodeDoc.getCodeDocument()));
}

//==============================================================================
JucerDocumentEditor::JucerDocumentEditor (JucerDocument* const doc)
    : document (doc),
      tabbedComponent (TabbedButtonBar::TabsAtTop),
      compLayoutPanel (0),
      lastViewportX (0),
      lastViewportY (0),
      currentZoomLevel (1.0)
开发者ID:Harrisson-,项目名称:BGU-MIDI-Emulator,代码行数:31,代码来源:jucer_JucerDocumentEditor.cpp

示例14: deviceManager

//==============================================================================
AudioDemoPlaybackPage::AudioDemoPlaybackPage (AudioDeviceManager& deviceManager_)
    : deviceManager (deviceManager_),
      thread ("audio file preview"),
      directoryList (0, thread),
      zoomLabel (0),
      explanation (0),
      zoomSlider (0),
      thumbnail (0),
      startStopButton (0),
      fileTreeComp (0)
{
    addAndMakeVisible (zoomLabel = new Label (String::empty,
                                              "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,
                                                "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 ("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:adrien59cadri,项目名称:test,代码行数:64,代码来源:AudioDemoPlaybackPage.cpp

示例15: addAndMakeVisible

//==============================================================================
RhythmicGateAudioProcessorEditor::RhythmicGateAudioProcessorEditor ()
{
    //[Constructor_pre] You can add your own custom stuff here..
    //[/Constructor_pre]

    addAndMakeVisible (slider = new Slider ("new slider"));
    slider->setRange (0, 1, 0.01);
    slider->setSliderStyle (Slider::LinearBar);
    slider->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20);
    slider->setColour (Slider::backgroundColourId, Colour (0x4ef78181));
    slider->addListener (this);

    addAndMakeVisible (slider2 = new Slider ("new slider"));
    slider2->setRange (0, 1, 0.01);
    slider2->setSliderStyle (Slider::LinearBar);
    slider2->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20);
    slider2->addListener (this);

    addAndMakeVisible (slider3 = new Slider ("new slider"));
    slider3->setRange (0, 1, 0.01);
    slider3->setSliderStyle (Slider::LinearBar);
    slider3->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20);
    slider3->addListener (this);

    addAndMakeVisible (slider4 = new Slider ("new slider"));
    slider4->setRange (0, 1, 0.01);
    slider4->setSliderStyle (Slider::LinearBar);
    slider4->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20);
    slider4->addListener (this);

    addAndMakeVisible (slider5 = new Slider ("new slider"));
    slider5->setRange (0, 1, 0.01);
    slider5->setSliderStyle (Slider::LinearBar);
    slider5->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20);
    slider5->setColour (Slider::backgroundColourId, Colour (0x4ef78181));
    slider5->addListener (this);

    addAndMakeVisible (slider6 = new Slider ("new slider"));
    slider6->setRange (0, 1, 0.01);
    slider6->setSliderStyle (Slider::LinearBar);
    slider6->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20);
    slider6->addListener (this);

    addAndMakeVisible (slider7 = new Slider ("new slider"));
    slider7->setRange (0, 1, 0.01);
    slider7->setSliderStyle (Slider::LinearBar);
    slider7->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20);
    slider7->addListener (this);

    addAndMakeVisible (slider8 = new Slider ("new slider"));
    slider8->setRange (0, 1, 0.01);
    slider8->setSliderStyle (Slider::LinearBar);
    slider8->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20);
    slider8->addListener (this);

    addAndMakeVisible (slider9 = new Slider ("new slider"));
    slider9->setRange (0, 1, 0.01);
    slider9->setSliderStyle (Slider::LinearBar);
    slider9->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20);
    slider9->setColour (Slider::backgroundColourId, Colour (0x4ef78181));
    slider9->addListener (this);

    addAndMakeVisible (slider10 = new Slider ("new slider"));
    slider10->setRange (0, 1, 0.01);
    slider10->setSliderStyle (Slider::LinearBar);
    slider10->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20);
    slider10->addListener (this);

    addAndMakeVisible (slider11 = new Slider ("new slider"));
    slider11->setRange (0, 1, 0.01);
    slider11->setSliderStyle (Slider::LinearBar);
    slider11->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20);
    slider11->addListener (this);

    addAndMakeVisible (slider12 = new Slider ("new slider"));
    slider12->setRange (0, 1, 0.01);
    slider12->setSliderStyle (Slider::LinearBar);
    slider12->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20);
    slider12->addListener (this);

    addAndMakeVisible (slider13 = new Slider ("new slider"));
    slider13->setRange (0, 1, 0.01);
    slider13->setSliderStyle (Slider::LinearBar);
    slider13->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20);
    slider13->setColour (Slider::backgroundColourId, Colour (0x4ef78181));
    slider13->addListener (this);

    addAndMakeVisible (slider14 = new Slider ("new slider"));
    slider14->setRange (0, 1, 0.01);
    slider14->setSliderStyle (Slider::LinearBar);
    slider14->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20);
    slider14->addListener (this);

    addAndMakeVisible (slider15 = new Slider ("new slider"));
    slider15->setRange (0, 1, 0.01);
    slider15->setSliderStyle (Slider::LinearBar);
    slider15->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20);
    slider15->addListener (this);

//.........这里部分代码省略.........
开发者ID:eriser,项目名称:blankenhain,代码行数:101,代码来源:RhythmicGateAudioProcessorEditor.cpp


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