这篇教程C++ Font函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中Font函数的典型用法代码示例。如果您正苦于以下问题:C++ Font函数的具体用法?C++ Font怎么用?C++ Font使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了Font函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: Component//==============================================================================CombSplit::CombSplit () : Component (L"CombSplit"), groupComponent (0), textButton (0), label (0), block_sizeslider (0), number_of_filesslider (0), label2 (0), resetbutton (0), textButton2 (0){ addAndMakeVisible (groupComponent = new GroupComponent (L"new group", L"Comb Split")); groupComponent->setTextLabelPosition (Justification::centredLeft); groupComponent->setColour (GroupComponent::outlineColourId, Colour (0xb0000000)); addAndMakeVisible (textButton = new TextButton (L"new button")); textButton->setButtonText (L"Do it!"); textButton->addListener (this); textButton->setColour (TextButton::buttonColourId, Colour (0x2ebbbbff)); addAndMakeVisible (label = new Label (L"new label", L"Block size (# of bins)")); 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 (block_sizeslider = new Slider (L"new slider")); block_sizeslider->setRange (0, 99, 1); block_sizeslider->setSliderStyle (Slider::LinearHorizontal); block_sizeslider->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20); block_sizeslider->setColour (Slider::thumbColourId, Colour (0x79ffffff)); block_sizeslider->setColour (Slider::textBoxBackgroundColourId, Colour (0xffffff)); block_sizeslider->addListener (this); addAndMakeVisible (number_of_filesslider = new Slider (L"new slider")); number_of_filesslider->setRange (1, 10, 1); number_of_filesslider->setSliderStyle (Slider::LinearHorizontal); number_of_filesslider->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20); number_of_filesslider->setColour (Slider::thumbColourId, Colour (0x6effffff)); number_of_filesslider->setColour (Slider::textBoxBackgroundColourId, Colour (0xffffff)); number_of_filesslider->addListener (this); addAndMakeVisible (label2 = new Label (L"new label", L"Number of files")); 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 (resetbutton = new TextButton (L"resetbutton")); resetbutton->setButtonText (L"reset"); resetbutton->addListener (this); resetbutton->setColour (TextButton::buttonColourId, Colour (0x35bbbbff)); 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,代码行数:82,
示例2: SurfaceTextBox::TextBox(int x, int y, const Color &textColor, const std::string &text, FontName fontName, TextureManager &textureManager) : Surface(x, y, 1, 1){ this->fontName = fontName; // Split "text" into lines of text. this->textLines = [&text]() { auto temp = std::vector<std::string>(); // Add one empty string to start. temp.push_back(std::string()); const char newLine = '/n'; int textLineIndex = 0; for (auto &c : text) { if (c != newLine) { // std::string has push_back! Yay! Intuition + 1. temp.at(textLineIndex).push_back(c); } else { temp.push_back(std::string()); textLineIndex++; } } return temp; }(); // Calculate the proper dimensions of the text box. // No need for a "FontSurface" type... just do the heavy lifting in this class. auto font = Font(fontName); int upperCharWidth = font.getUpperCharacterWidth(); int upperCharHeight = font.getUpperCharacterHeight(); int lowerCharWidth = font.getLowerCharacterWidth(); int lowerCharHeight = font.getLowerCharacterHeight(); const int newWidth = [](const std::vector<std::string> &lines, int upperCharWidth, int lowerCharWidth) { // Find longest line (in pixels) out of all lines. int longestLength = 0; for (auto &line : lines) { // Sum of all character lengths in the current line. int linePixels = 0; for (auto &c : line) { linePixels += islower(c) ? lowerCharWidth : upperCharWidth; } // Check against the current longest line. if (linePixels > longestLength) { longestLength = linePixels; } } // In pixels. return longestLength; }(this->textLines, upperCharWidth, lowerCharWidth); const int newHeight = static_cast<int>(this->textLines.size()) * upperCharHeight; // Resize the surface with the proper dimensions for fitting all the text. SDL_FreeSurface(this->surface); this->surface = [](int width, int height, int colorBits) { return SDL_CreateRGBSurface(0, width, height, colorBits, 0, 0, 0, 0); }(newWidth, newHeight, Surface::DEFAULT_BPP); // Make this surface transparent. this->setTransparentColor(Color::Transparent); this->fill(Color::Transparent); // Blit each character surface in at the right spot. auto point = Int2(); auto fontSurface = textureManager.getSurface(font.getFontTextureName()); int upperCharOffsetWidth = font.getUpperCharacterOffsetWidth(); int upperCharOffsetHeight = font.getUpperCharacterOffsetHeight(); int lowerCharOffsetWidth = font.getLowerCharacterOffsetWidth(); int lowerCharOffsetHeight = font.getLowerCharacterOffsetHeight(); for (auto &line : this->textLines) { for (auto &c : line) { int width = islower(c) ? lowerCharWidth : upperCharWidth; int height = islower(c) ? lowerCharHeight : upperCharHeight; auto letterSurface = [&]() { auto cellPosition = Font::getCharacterCell(c); int offsetWidth = islower(c) ? lowerCharOffsetWidth : upperCharOffsetWidth; int offsetHeight = islower(c) ? lowerCharOffsetHeight : upperCharOffsetHeight; // Make a copy surface of the font character. auto pixelPosition = Int2(//.........这里部分代码省略.........
开发者ID:basecq,项目名称:OpenTESArena,代码行数:101,
示例3: returnconst Font CtrlrFontManager::getFontFromString (const String &string){ //_DBG(string); if (!string.contains (";")) { //_DBG("/tno ; in string"); if (string == String::empty) { //_DBG("/tstring is empty, return default font"); return (Font (15.0f)); } return (Font::fromString(string)); } StringArray fontProps; fontProps.addTokens (string, ";", "/"/'"); Font font; if (fontProps[fontTypefaceName] != String::empty) { //_DBG("/tfont name not empty: "+fontProps[fontTypefaceName]); if (fontProps[fontSet] != String::empty && fontProps[fontSet].getIntValue() >= 0) { //_DBG("/tfont set is not empty and >= 0: "+_STR(fontProps[fontSet])); /* We need to fetch the typeface for the font from the correct font set */ Array<Font> &fontSetToUse = getFontSet((const FontSet)fontProps[fontSet].getIntValue()); for (int i=0; i<fontSetToUse.size(); i++) { if (fontSetToUse[i].getTypefaceName() == fontProps[fontTypefaceName]) { //_DBG("/tgot font from set, index: "+_STR(i)); font = fontSetToUse[i]; break; } } } else { /* The font set is not specified, fall back to JUCE to find the typeface name this will actualy be the OS set */ font.setTypefaceName (fontProps[fontTypefaceName]); } font.setHeight (fontProps[fontHeight].getFloatValue()); font.setBold (false); font.setUnderline (false); font.setItalic (false); if (fontProps[fontBold] != String::empty) font.setBold (fontProps[fontBold].getIntValue() ? true : false); if (fontProps[fontItalic] != String::empty) font.setItalic (fontProps[fontItalic].getIntValue() ? true : false); if (fontProps[fontUnderline] != String::empty) font.setUnderline (fontProps[fontUnderline].getIntValue() ? true : false); if (fontProps[fontKerning] != String::empty) font.setExtraKerningFactor (fontProps[fontKerning].getFloatValue()); if (fontProps[fontHorizontalScale] != String::empty) font.setHorizontalScale (fontProps[fontHorizontalScale].getFloatValue()); } return (font);}
开发者ID:noscript,项目名称:ctrlr,代码行数:72,
示例4: 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, T("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 (thumbnail = new DemoThumbnailComp()); addAndMakeVisible (startStopButton = new TextButton (String::empty)); startStopButton->setButtonText (T("Play/Stop")); startStopButton->addButtonListener (this); startStopButton->setColour (TextButton::buttonColourId, Colour (0xff79ed7f)); addAndMakeVisible (fileTreeComp = new FileTreeComponent (directoryList)); addAndMakeVisible (explanation = new Label (String::empty, T("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); //[UserPreSize] //[/UserPreSize] setSize (600, 400); //[Constructor] You can add your own custom stuff here.. 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); currentAudioFileSource = 0; //[/Constructor]}
开发者ID:alessandropetrolati,项目名称:juced,代码行数:62,
示例5: edoGaduComponent//==============================================================================EdoGaduSearch::EdoGaduSearch (EdoGadu *_edoGaduComponent) : edoGaduComponent(_edoGaduComponent), inpUin (0), label (0), inpFristName (0), label2 (0), inpLastName (0), label3 (0), label4 (0), inpNickName (0), label5 (0), inpCity (0), inpSex (0), label6 (0), label7 (0), inpBirthYear (0), searchResult (0), btnSearch (0), searchRunning (0){ addAndMakeVisible (inpUin = new TextEditor (T("new text editor"))); inpUin->setMultiLine (false); inpUin->setReturnKeyStartsNewLine (false); inpUin->setReadOnly (false); inpUin->setScrollbarsShown (true); inpUin->setCaretVisible (true); inpUin->setPopupMenuEnabled (true); inpUin->setColour (TextEditor::backgroundColourId, Colour (0x97ffffff)); inpUin->setColour (TextEditor::outlineColourId, Colours::black); inpUin->setColour (TextEditor::shadowColourId, Colour (0x0)); inpUin->setText (String::empty); addAndMakeVisible (label = new Label (T("new label"), T("UIN"))); label->setFont (Font (18.0000f, Font::bold)); label->setJustificationType (Justification::centred); label->setEditable (false, false, false); label->setColour (TextEditor::textColourId, Colours::black); label->setColour (TextEditor::backgroundColourId, Colour (0x0)); addAndMakeVisible (inpFristName = new TextEditor (T("new text editor"))); inpFristName->setMultiLine (false); inpFristName->setReturnKeyStartsNewLine (false); inpFristName->setReadOnly (false); inpFristName->setScrollbarsShown (true); inpFristName->setCaretVisible (true); inpFristName->setPopupMenuEnabled (true); inpFristName->setColour (TextEditor::backgroundColourId, Colour (0x97ffffff)); inpFristName->setColour (TextEditor::outlineColourId, Colours::black); inpFristName->setColour (TextEditor::shadowColourId, Colour (0x0)); inpFristName->setText (String::empty); addAndMakeVisible (label2 = new Label (T("new label"), T("First Name"))); label2->setFont (Font (18.0000f, Font::bold)); label2->setJustificationType (Justification::centred); label2->setEditable (false, false, false); label2->setColour (TextEditor::textColourId, Colours::black); label2->setColour (TextEditor::backgroundColourId, Colour (0x0)); addAndMakeVisible (inpLastName = new TextEditor (T("new text editor"))); inpLastName->setMultiLine (false); inpLastName->setReturnKeyStartsNewLine (false); inpLastName->setReadOnly (false); inpLastName->setScrollbarsShown (true); inpLastName->setCaretVisible (true); inpLastName->setPopupMenuEnabled (true); inpLastName->setColour (TextEditor::backgroundColourId, Colour (0x97ffffff)); inpLastName->setColour (TextEditor::outlineColourId, Colours::black); inpLastName->setColour (TextEditor::shadowColourId, Colour (0x0)); inpLastName->setText (String::empty); addAndMakeVisible (label3 = new Label (T("new label"), T("Last Name"))); label3->setFont (Font (18.0000f, Font::bold)); label3->setJustificationType (Justification::centred); label3->setEditable (false, false, false); label3->setColour (TextEditor::textColourId, Colours::black); label3->setColour (TextEditor::backgroundColourId, Colour (0x0)); addAndMakeVisible (label4 = new Label (T("new label"), T("Nick Name"))); label4->setFont (Font (18.0000f, Font::bold)); label4->setJustificationType (Justification::centred); label4->setEditable (false, false, false); label4->setColour (TextEditor::textColourId, Colours::black); label4->setColour (TextEditor::backgroundColourId, Colour (0x0)); addAndMakeVisible (inpNickName = new TextEditor (T("new text editor"))); inpNickName->setMultiLine (false); inpNickName->setReturnKeyStartsNewLine (false); inpNickName->setReadOnly (false); inpNickName->setScrollbarsShown (true); inpNickName->setCaretVisible (true); inpNickName->setPopupMenuEnabled (true); inpNickName->setColour (TextEditor::backgroundColourId, Colour (0x97ffffff)); inpNickName->setColour (TextEditor::outlineColourId, Colours::black); inpNickName->setColour (TextEditor::shadowColourId, Colour (0x0)); inpNickName->setText (String::empty);//.........这里部分代码省略.........
开发者ID:orisha85,项目名称:edoapp,代码行数:101,
示例6: Fontconst Font StatusBar::getFont() { return Font(Font::getDefaultMonospacedFontName(), (float)kFontSize, Font::plain);}
开发者ID:EQ4,项目名称:TeragonGuiComponents,代码行数:3,
示例7: AudioProcessorEditor//==============================================================================mlrVSTGUI::mlrVSTGUI (mlrVSTAudioProcessor* owner, const int &newNumChannels, const int &newNumStrips) : AudioProcessorEditor (owner), // Communication //////////////////////// parent(owner), // Style / positioning objects ////////// myLookAndFeel(), overrideLF(), // Fonts /////////////////////////////////////////////////////// fontSize(12.f), defaultFont("ProggyCleanTT", 18.f, Font::plain), // Volume controls ////////////////////////////////////////////////// masterGainSlider("master gain"), masterSliderLabel("master", "mstr"), slidersArray(), slidersMuteBtnArray(), // Tempo controls /////////////////////////////////////// bpmSlider("bpm slider"), bpmLabel(), quantiseSettingsCbox("quantise settings"), quantiseLabel("quantise label", "quant."), // Buttons ////////////////////////////////// loadFilesBtn("load samples", "load samples"), sampleStripToggle("sample strip toggle", DrawableButton::ImageRaw), patternStripToggle("pattern strip toggle", DrawableButton::ImageRaw), sampleImg(), patternImg(), // Record / Resample / Pattern UI //////////////////////////////////////// precountLbl("precount", "precount"), recordLengthLbl("length", "length"), bankLbl("bank", "bank"), recordPrecountSldr(), recordLengthSldr(), recordBankSldr(), resamplePrecountSldr(), resampleLengthSldr(), resampleBankSldr(), patternPrecountSldr(), patternLengthSldr(), patternBankSldr(), recordBtn("record", Colours::black, Colours::white), resampleBtn("resample", Colours::black, Colours::white), patternBtn("pattern", Colours::black, Colours::white), // branding vstNameLbl("vst label", "mlrVST"), // Misc /////////////////////////////////////////// lastDisplayedPosition(), debugButton("loadfile", DrawableButton::ImageRaw), // temporary button // Presets ////////////////////////////////////////////////// presetLabel("presets", "presets"), presetCbox(), presetPrevBtn("prev", 0.25, Colours::black, Colours::white), presetNextBtn("next", 0.75, Colours::black, Colours::white), addPresetBtn("add", "add preset"), toggleSetlistBtn("setlist"), presetPanelBounds(294, PAD_AMOUNT, THUMBNAIL_WIDTH, 725), presetPanel(presetPanelBounds, owner), // Settings /////////////////////////////////////// numChannels(newNumChannels), useExternalTempo(true), toggleSettingsBtn("settings"), settingsPanelBounds(294, PAD_AMOUNT, THUMBNAIL_WIDTH, 725), settingsPanel(settingsPanelBounds, owner, this), // Mappings ////////////////////////////////////// mappingPanelBounds(294, PAD_AMOUNT, THUMBNAIL_WIDTH, 725), toggleMappingBtn("mappings"), mappingPanel(mappingPanelBounds, owner), // SampleStrip controls /////////////////////////// sampleStripControlArray(), numStrips(newNumStrips), waveformControlHeight( (GUI_HEIGHT - numStrips * PAD_AMOUNT) / numStrips), waveformControlWidth(THUMBNAIL_WIDTH), // Overlays ////////////////////////////// patternStripArray(), hintOverlay(owner){ DBG("GUI loaded " << " strips of height " << waveformControlHeight); parent->addChangeListener(this); // these are compile time constants setSize(GUI_WIDTH, GUI_HEIGHT); setWantsKeyboardFocus(true); int xPosition = PAD_AMOUNT; int yPosition = PAD_AMOUNT; // set up volume sliders buildSliders(xPosition, yPosition); // add the bpm slider and quantise settings setupTempoUI(xPosition, yPosition); // set up the various panels (settings, mapping, etc) // and the buttons that control them setupPanels(xPosition, yPosition); // preset associated UI elements setupPresetUI(xPosition, yPosition); // useful UI debugging components addAndMakeVisible(&debugButton); debugButton.addListener(this);//.........这里部分代码省略.........
开发者ID:grimtraveller,项目名称:mlrVST,代码行数:101,
示例8: addAndMakeVisible//==============================================================================OscillatorEditor::OscillatorEditor (){ //[Constructor_pre] You can add your own custom stuff here.. //[/Constructor_pre] addAndMakeVisible (m_waveformTypeSlider = new Slider ("Waveform Type Slider")); m_waveformTypeSlider->setRange (0, 1, 0); m_waveformTypeSlider->setSliderStyle (Slider::RotaryVerticalDrag); m_waveformTypeSlider->setTextBoxStyle (Slider::NoTextBox, true, 80, 20); m_waveformTypeSlider->setColour (Slider::thumbColourId, Colour (0xff1de9b6)); m_waveformTypeSlider->setColour (Slider::trackColourId, Colour (0x00000000)); m_waveformTypeSlider->setColour (Slider::rotarySliderFillColourId, Colour (0xff1de9b6)); m_waveformTypeSlider->setColour (Slider::rotarySliderOutlineColourId, Colour (0xff212121)); m_waveformTypeSlider->setColour (Slider::textBoxTextColourId, Colour (0xff212121)); m_waveformTypeSlider->setColour (Slider::textBoxBackgroundColourId, Colour (0x00000000)); m_waveformTypeSlider->setColour (Slider::textBoxHighlightColourId, Colour (0xff1de9b6)); m_waveformTypeSlider->setColour (Slider::textBoxOutlineColourId, Colour (0x00000000)); m_waveformTypeSlider->addListener (this); addAndMakeVisible (m_detuneLabel = new Label ("Detune Label", TRANS("DETUNE"))); m_detuneLabel->setFont (Font ("Avenir Next", 14.00f, Font::plain)); m_detuneLabel->setJustificationType (Justification::centred); m_detuneLabel->setEditable (false, false, false); m_detuneLabel->setColour (Label::textColourId, Colour (0xff212121)); m_detuneLabel->setColour (TextEditor::textColourId, Colour (0xff212121)); m_detuneLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); m_detuneLabel->setColour (TextEditor::highlightColourId, Colour (0xff1de9b6)); addAndMakeVisible (m_waveTypeLabel = new Label ("Waveform Type Label", TRANS("WAVE"))); m_waveTypeLabel->setFont (Font ("Avenir Next", 14.00f, Font::plain)); m_waveTypeLabel->setJustificationType (Justification::centred); m_waveTypeLabel->setEditable (false, false, false); m_waveTypeLabel->setColour (Label::textColourId, Colour (0xff212121)); m_waveTypeLabel->setColour (TextEditor::textColourId, Colour (0xff212121)); m_waveTypeLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); m_waveTypeLabel->setColour (TextEditor::highlightColourId, Colour (0xff1de9b6)); addAndMakeVisible (m_detuneSlider = new Slider ("Detune Slider")); m_detuneSlider->setRange (0, 1, 0.0104166); m_detuneSlider->setSliderStyle (Slider::RotaryVerticalDrag); m_detuneSlider->setTextBoxStyle (Slider::NoTextBox, true, 80, 20); m_detuneSlider->setColour (Slider::thumbColourId, Colour (0xff1de9b6)); m_detuneSlider->setColour (Slider::trackColourId, Colour (0x00000000)); m_detuneSlider->setColour (Slider::rotarySliderFillColourId, Colour (0xff1de9b6)); m_detuneSlider->setColour (Slider::rotarySliderOutlineColourId, Colour (0xff212121)); m_detuneSlider->setColour (Slider::textBoxTextColourId, Colour (0xff212121)); m_detuneSlider->setColour (Slider::textBoxBackgroundColourId, Colour (0x00000000)); m_detuneSlider->setColour (Slider::textBoxHighlightColourId, Colour (0xff1de9b6)); m_detuneSlider->setColour (Slider::textBoxOutlineColourId, Colour (0x00000000)); m_detuneSlider->addListener (this); addAndMakeVisible (m_distortionSlider = new Slider ("Distortion Slider")); m_distortionSlider->setRange (0, 1, 0); m_distortionSlider->setSliderStyle (Slider::RotaryVerticalDrag); m_distortionSlider->setTextBoxStyle (Slider::NoTextBox, true, 80, 20); m_distortionSlider->setColour (Slider::thumbColourId, Colour (0xff1de9b6)); m_distortionSlider->setColour (Slider::trackColourId, Colour (0x00000000)); m_distortionSlider->setColour (Slider::rotarySliderFillColourId, Colour (0xff1de9b6)); m_distortionSlider->setColour (Slider::rotarySliderOutlineColourId, Colour (0xff212121)); m_distortionSlider->setColour (Slider::textBoxTextColourId, Colour (0xff212121)); m_distortionSlider->setColour (Slider::textBoxBackgroundColourId, Colour (0x00000000)); m_distortionSlider->setColour (Slider::textBoxHighlightColourId, Colour (0xff1de9b6)); m_distortionSlider->setColour (Slider::textBoxOutlineColourId, Colour (0x00000000)); m_distortionSlider->addListener (this); addAndMakeVisible (m_distLabel = new Label ("Distortion Label", TRANS("DIST."))); m_distLabel->setFont (Font ("Avenir Next", 14.00f, Font::plain)); m_distLabel->setJustificationType (Justification::centred); m_distLabel->setEditable (false, false, false); m_distLabel->setColour (Label::textColourId, Colour (0xff212121)); m_distLabel->setColour (TextEditor::textColourId, Colour (0xff212121)); m_distLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); m_distLabel->setColour (TextEditor::highlightColourId, Colour (0xff1de9b6)); //[UserPreSize] m_detuneSlider->setValue(0.5); //[/UserPreSize] setSize (176, 68); //[Constructor] You can add your own custom stuff here.. //[/Constructor]}
开发者ID:nick-thompson,项目名称:Artifakt,代码行数:89,
示例9: GlyphsDemo GlyphsDemo (ControllersComponent& cc) : GraphicsDemoBase (cc, "Glyphs") { glyphs.addFittedText (Font (20.0f), "The Quick Brown Fox Jumped Over The Lazy Dog", -120, -50, 240, 100, Justification::centred, 2, 1.0f); }
开发者ID:CraigAlbright,项目名称:JUCE,代码行数:6,
示例10: main//.........这里部分代码省略......... if(teams[0].getStatus() == 3 || teams[1].getStatus() == 3) { teams[0].changeStatus(3); teams[1].changeStatus(3); teams[0].clearCaught(); teams[1].clearCaught(); teams[0].changeInit(false); teams[1].changeInit(false); if(teams[0].lineUp(FIELDW, FIELDH, YARDSIZE) ) teams[0].changeStatus(0); if(teams[1].lineUp(FIELDW, FIELDH, YARDSIZE) ) teams[1].changeStatus(0); disc.restart(); } //teams[0].sortClosest(disc); //teams[1].sortClosest(disc); if(test.isKeyDown('z') && !zkey) { teams[1].nextSelected(); zkey = true; } if(test.isKeyDown('7') && !nkey) { teams[0].nextSelected(); nkey = true; } if(!test.isKeyDown('z') && zkey) zkey = false; if(!test.isKeyDown('7') && nkey) nkey = false; if(teams[0].getInit()+teams[1].getInit() && (teams[1].getCaught()-1!= teams[1].isSelected()) ) { if(test.isKeyDown(NamedKey::LEFT_ARROW)) { teams[1].move(teams[1].isSelected(), -8, 0, FIELDW, FIELDH, YARDSIZE); } if(test.isKeyDown(NamedKey::RIGHT_ARROW)) { teams[1].move(teams[1].isSelected(), 8, 0, FIELDW, FIELDH, YARDSIZE); } if(test.isKeyDown(NamedKey::UP_ARROW)) { teams[1].move(teams[1].isSelected(), 0,-8, FIELDW, FIELDH, YARDSIZE); } if(test.isKeyDown(NamedKey::DOWN_ARROW)) { teams[1].move(teams[1].isSelected(), 0, 8, FIELDW, FIELDH, YARDSIZE); } } if(teams[0].getInit()+teams[1].getInit() && (teams[0].getCaught()-1!=teams[0].isSelected()) ) { if(test.isKeyDown('1')) { teams[0].move(teams[0].isSelected(), -8, 0, FIELDW, FIELDH, YARDSIZE); } if(test.isKeyDown('3')) { teams[0].move(teams[0].isSelected(), 8, 0, FIELDW, FIELDH, YARDSIZE); } if(test.isKeyDown('5')) { teams[0].move(teams[0].isSelected(), 0, -8, FIELDW, FIELDH, YARDSIZE); } if(test.isKeyDown('2')) { teams[0].move(teams[0].isSelected(), 0, 8, FIELDW, FIELDH, YARDSIZE); } } teams[0].decisiveMove(disc, teams[1], teams[0].getInit()+teams[1].getInit(), FIELDW, FIELDH, YARDSIZE); teams[1].decisiveMove(disc, teams[0], teams[0].getInit()+teams[1].getInit(), FIELDW, FIELDH, YARDSIZE); teams[0].drawTeam(test, x, y); teams[1].drawTeam(test, x, y); disc.drawFrisbee(test, x, y); //Scoreboard //test.drawRectangleFilled(Style::BLACK, 0, test.getHeight()*6/7, test.getWidth(), test.getHeight() ); test.drawText( Style(Color::WHITE, 2), Font(Font::ROMAN, 16), 5, test.getHeight()-42, "Fish"); test.drawText( Style(Color::WHITE, 2), Font(Font::ROMAN, 16), 160, test.getHeight()-42, test.numberToString(teams[0].getScore() ) ); test.drawText( Style(Color::WHITE, 2), Font(Font::ROMAN, 16), 5, test.getHeight()-17, "Veggies"); test.drawText( Style(Color::WHITE, 2), Font(Font::ROMAN, 16), 160, test.getHeight()-17, test.numberToString(teams[1].getScore() )); //Powerbar test.drawText( Style(Color::WHITE, 1.5), Font(Font::ROMAN, 10), test.getWidth()/3+40, test.getHeight()-40, "Power:"); test.drawRectangleFilled(Style(Color(255,145,0), 1), test.getWidth()/3-10, test.getHeight()-33, test.getWidth()/3-10+(power*16.666), test.getHeight()-21); test.drawRectangleOutline(Style(Color::WHITE, 1), test.getWidth()/3-10, test.getHeight()-33, test.getWidth()/3 + 140, test.getHeight()-21); //Heightbar test.drawLine( Style(Color::WHITE, 5), test.getWidth()/3 +202.5+(27.5*cos(height)), test.getHeight()-35+(27.5*sin(height)), test.getWidth()/3+202.5+(27.5*cos(height+PI)), test.getHeight()-35+(27.5*sin(height+PI))); //Feild Map test.drawRectangleFilled(Style::GREEN, test.getWidth()*3/4, test.getHeight()-55, test.getWidth()*3/4+(FIELDW/YARDSIZE), test.getHeight()-55+(FIELDH/YARDSIZE)); test.drawRectangleOutline(Style(Color::WHITE, 1), test.getWidth()*3/4, test.getHeight()-55, test.getWidth()*3/4+(FIELDW/YARDSIZE), test.getHeight()-55+(FIELDH/YARDSIZE)); test.drawRectangleOutline(Style(Color::WHITE, 1), test.getWidth()*3/4+(ENDZONE/YARDSIZE), test.getHeight()-55, test.getWidth()*3/4+(FIELDW-ENDZONE)/YARDSIZE, test.getHeight()-55+(FIELDH/YARDSIZE)); teams[0].drawPixels(test, YARDSIZE); teams[1].drawPixels(test, YARDSIZE); disc.drawPixel(test, YARDSIZE); test.flipPage(); } return 0;}
开发者ID:keithhackbarth,项目名称:Ultimate-Frisbee-Computer-Game,代码行数:101,
示例11: FontGraphViewer::GraphViewer(){ labelFont = Font("Paragraph", 50, Font::plain); rootNum = 0;}
开发者ID:jperge,项目名称:GUI_Jan7_2016,代码行数:6,
示例12: FontFont JucerTreeViewBase::getFont() const{ return Font (getItemHeight() * 0.6f);}
开发者ID:lauyoume,项目名称:JUCE,代码行数:4,
示例13: Exception Font Font::load(Canvas &canvas, const std::string &family_name, const FontDescription &reference_desc, FontFamily &font_family, const XMLResourceDocument &doc, std::function<Resource<Sprite>(Canvas &, const std::string &)> cb_get_sprite) { DomElement font_element; XMLResourceNode resource; resource = doc.get_resource(family_name); font_element = resource.get_element(); DomElement sprite_element = font_element.named_item("sprite").to_element(); if (!sprite_element.is_null()) { if (!sprite_element.has_attribute("glyphs")) throw Exception(string_format("Font resource %1 has no 'glyphs' attribute.", resource.get_name())); if (!sprite_element.has_attribute("letters")) throw Exception(string_format("Font resource %1 has no 'letters' attribute.", resource.get_name())); if (!cb_get_sprite) throw Exception(string_format("Font resource %1 requires a sprite loader callback specified.", resource.get_name())); Resource<Sprite> spr_glyphs = cb_get_sprite(canvas, sprite_element.get_attribute("glyphs")); const std::string &letters = sprite_element.get_attribute("letters"); int spacelen = StringHelp::text_to_int(sprite_element.get_attribute("spacelen", "-1")); bool monospace = StringHelp::text_to_bool(sprite_element.get_attribute("monospace", "false")); // Modify the default font metrics, if specified float height = 0.0f; float line_height = 0.0f; float ascent = 0.0f; float descent = 0.0f; float internal_leading = 0.0f; float external_leading = 0.0f; if (sprite_element.has_attribute("height")) height = StringHelp::text_to_float(sprite_element.get_attribute("height", "0")); if (sprite_element.has_attribute("line_height")) line_height = StringHelp::text_to_float(sprite_element.get_attribute("line_height", "0")); if (sprite_element.has_attribute("ascent")) ascent = StringHelp::text_to_float(sprite_element.get_attribute("ascent", "0")); if (sprite_element.has_attribute("descent")) descent = StringHelp::text_to_float(sprite_element.get_attribute("descent", "0")); if (sprite_element.has_attribute("internal_leading")) internal_leading = StringHelp::text_to_float(sprite_element.get_attribute("internal_leading", "0")); if (sprite_element.has_attribute("external_leading")) external_leading = StringHelp::text_to_float(sprite_element.get_attribute("external_leading", "0")); FontMetrics font_metrics(height, ascent, descent, internal_leading, external_leading, line_height, canvas.get_pixel_ratio()); font_family.add(canvas, spr_glyphs.get(), letters, spacelen, monospace, font_metrics); FontDescription desc = reference_desc.clone(); return Font(font_family, desc); } DomElement ttf_element = font_element.named_item("ttf").to_element(); if (ttf_element.is_null()) ttf_element = font_element.named_item("freetype").to_element(); if (!ttf_element.is_null()) { FontDescription desc = reference_desc.clone(); std::string filename; if (ttf_element.has_attribute("file")) { filename = PathHelp::combine(resource.get_base_path(), ttf_element.get_attribute("file")); } if (!ttf_element.has_attribute("typeface")) throw Exception(string_format("Font resource %1 has no 'typeface' attribute.", resource.get_name())); std::string font_typeface_name = ttf_element.get_attribute("typeface"); if (ttf_element.has_attribute("height")) desc.set_height(ttf_element.get_attribute_int("height", 0)); if (ttf_element.has_attribute("average_width")) desc.set_average_width(ttf_element.get_attribute_int("average_width", 0)); if (ttf_element.has_attribute("anti_alias")) desc.set_anti_alias(ttf_element.get_attribute_bool("anti_alias", true)); if (ttf_element.has_attribute("subpixel")) desc.set_subpixel(ttf_element.get_attribute_bool("subpixel", true)); if (filename.empty()) { font_family.add(font_typeface_name, desc); return Font(font_family, desc); } else//.........这里部分代码省略.........
开发者ID:tornadocean,项目名称:ClanLib,代码行数:101,
示例14: grpTextLayoutEditor//==============================================================================WindowComponent::WindowComponent () : grpTextLayoutEditor (0), grpLayout (0), lblWordWrap (0), lblReadingDirection (0), lblJustification (0), lblLineSpacing (0), cmbWordWrap (0), cmbReadingDirection (0), cmbJustification (0), slLineSpacing (0), grpFont (0), lblFontFamily (0), lblFontStyle (0), tbUnderlined (0), tbStrikethrough (0), cmbFontFamily (0), cmbFontStyle (0), grpColor (0), ceColor (0), lblColor (0), grpDbgCaret (0), lblCaretPos (0), slCaretPos (0), lblCaretSelStart (0), slCaretSelStart (0), slCaretSelEnd (0), lblCaretSelEnd (0), grpDbgRanges (0), txtDbgRanges (0), txtEditor (0), tbDbgRanges (0), slFontSize (0), lblFontSize (0), grpDbgActions (0), tbR1C1 (0), tbR2C1 (0), tbR3C1 (0), tbR4C1 (0), tbR1C2 (0), tbR2C2 (0), tbR3C2 (0), tbR4C2 (0), tbR1C3 (0), tbR2C3 (0), tbR3C3 (0), tbR4C7 (0), tbR1C4 (0), tbR1C5 (0), tbR2C4 (0), tbR3C4 (0), tbR4C8 (0), tbR2C5 (0), tbR3C5 (0), tbR4C9 (0), tbR5C1 (0), tbR5C2 (0), tbR5C3 (0), tbR5C4 (0), tbR5C5 (0){ addAndMakeVisible (grpTextLayoutEditor = new GroupComponent (L"grpTextLayoutEditor", L"Text Layout Editor")); addAndMakeVisible (grpLayout = new GroupComponent (L"grpLayout", L"Layout")); addAndMakeVisible (lblWordWrap = new Label (L"lblWordWrap", L"Word Wrap:")); lblWordWrap->setFont (Font (15.0000f)); lblWordWrap->setJustificationType (Justification::centredLeft); lblWordWrap->setEditable (false, false, false); lblWordWrap->setColour (TextEditor::textColourId, Colours::black); lblWordWrap->setColour (TextEditor::backgroundColourId, Colour (0x0)); addAndMakeVisible (lblReadingDirection = new Label (L"lblReadingDirection", L"Reading Direction:")); lblReadingDirection->setFont (Font (15.0000f)); lblReadingDirection->setJustificationType (Justification::centredLeft); lblReadingDirection->setEditable (false, false, false); lblReadingDirection->setColour (TextEditor::textColourId, Colours::black); lblReadingDirection->setColour (TextEditor::backgroundColourId, Colour (0x0)); addAndMakeVisible (lblJustification = new Label (L"lblJustification", L"Justification:")); lblJustification->setFont (Font (15.0000f)); lblJustification->setJustificationType (Justification::centredLeft); lblJustification->setEditable (false, false, false); lblJustification->setColour (TextEditor::textColourId, Colours::black); lblJustification->setColour (TextEditor::backgroundColourId, Colour (0x0)); addAndMakeVisible (lblLineSpacing = new Label (L"lblLineSpacing", L"Line Spacing:")); lblLineSpacing->setFont (Font (15.0000f)); lblLineSpacing->setJustificationType (Justification::centredLeft); lblLineSpacing->setEditable (false, false, false); lblLineSpacing->setColour (TextEditor::textColourId, Colours::black); lblLineSpacing->setColour (TextEditor::backgroundColourId, Colour (0x0));//.........这里部分代码省略.........
开发者ID:sonic59,项目名称:JuceEditor,代码行数:101,
示例15: paintvoid HintOverlay::paint(Graphics &g){ // see which button has been pressed const int modifierStatus = processor->getModifierBtnState(); // if no button is pressed then don't display the hint if (modifierStatus == MappingEngine::rmNoBtn) return; // start with the background colour g.setColour(Colours::black.withAlpha(0.5f)); g.fillRect(overlayPaintBounds); // TODO: should be not hardcoded. const int numMappings = 8; int buttonPadding; if (numMappings > 8) { buttonPadding = PAD_AMOUNT/2; g.setFont(Font("Verdana", 12.f, Font::plain)); } else { buttonPadding = PAD_AMOUNT; g.setFont(Font("Verdana", 16.f, Font::plain)); } const int buttonSize = (overlayPaintBounds.getWidth() - (numMappings + 1) * buttonPadding) / numMappings; for (int i = 0; i < numMappings; ++i) { const float xPos = (float) ((buttonPadding + buttonSize)*i + buttonPadding); const float yPos = (overlayPaintBounds.getHeight() - buttonSize) / 2.0f; // highlight any mappings that are held if (processor->isColumnHeld(i)) g.setColour(Colours::orange); else g.setColour(Colours::white.withAlpha(0.9f)); g.fillRoundedRectangle(xPos, yPos, (float) buttonSize, (float) buttonSize, buttonSize/10.0f); if (i > 7) break; // get the ID of the mapping associated with this type of modifier button const int currentMapping = processor->getMonomeMapping(modifierStatus, i); // and find out what its name is const String mappingName = processor->mappingEngine.getMappingName(modifierStatus, currentMapping); g.setColour(Colours::black); //g.drawMultiLineText(mappingName, xPos+2, yPos+10, buttonSize); g.drawFittedText(mappingName, (int) (xPos) + 1, (int) (yPos) + 1, buttonSize-2, buttonSize-2, Justification::centred, 4, 1.0f); }}
开发者ID:grimtraveller,项目名称:mlrVST,代码行数:61,
示例16: addAndMakeVisible//==============================================================================WaveGenerationComponent::WaveGenerationComponent (){ //[Constructor_pre] You can add your own custom stuff here.. //[/Constructor_pre] addAndMakeVisible (comboBox = new ComboBox ("new combo box")); comboBox->setEditableText (false); comboBox->setJustificationType (Justification::centredLeft); comboBox->setTextWhenNothingSelected (String::empty); comboBox->setTextWhenNoChoicesAvailable (TRANS("(no choices)")); comboBox->addItem (TRANS("Sine"), 1); comboBox->addItem (TRANS("Square"), 2); comboBox->addItem (TRANS("Saw"), 3); comboBox->addItem (TRANS("Triangle"), 4); comboBox->addItem (TRANS("Noise"), 5); comboBox->addListener (this); addAndMakeVisible (slider = new Slider ("new slider")); slider->setRange (0, 10, 0); slider->setSliderStyle (Slider::IncDecButtons); slider->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20); slider->addListener (this); addAndMakeVisible (slider2 = new Slider ("new slider")); slider2->setRange (0, 10, 0); slider2->setSliderStyle (Slider::IncDecButtons); slider2->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20); slider2->addListener (this); addAndMakeVisible (slider3 = new Slider ("new slider")); slider3->setRange (0, 10, 0); slider3->setSliderStyle (Slider::RotaryVerticalDrag); slider3->setTextBoxStyle (Slider::TextBoxBelow, false, 80, 20); slider3->addListener (this); addAndMakeVisible (label = new Label ("new label", TRANS("Octave"))); label->setFont (Font (15.00f, Font::plain)); label->setJustificationType (Justification::centredLeft); label->setEditable (false, false, false); label->setColour (TextEditor::textColourId, Colours::black); label->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); addAndMakeVisible (label2 = new Label ("new label", TRANS("Pitch"))); label2->setFont (Font (15.00f, Font::plain)); label2->setJustificationType (Justification::centredLeft); label2->setEditable (false, false, false); label2->setColour (TextEditor::textColourId, Colours::black); label2->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); addAndMakeVisible (label3 = new Label ("new label", TRANS("Detune"))); label3->setFont (Font (15.00f, Font::plain)); label3->setJustificationType (Justification::centred); label3->setEditable (false, false, false); label3->setColour (TextEditor::textColourId, Colours::black); label3->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); //[UserPreSize] //[/UserPreSize] setSize (600, 400); //[Constructor] You can add your own custom stuff here.. //[/Constructor]}
开发者ID:eriser,项目名称:blankenhain,代码行数:70,
示例17: returnFont CtrlrLookAndFeel::getSliderPopupFont(Slider &){ return (owner.getFontManager().getFontFromString(getPanelProperty(Ids::uiPanelTooltipFont, Font(15.0f, Font::bold).toString())));}
开发者ID:atomicstack,项目名称:ctrlr,代码行数:4,
示例18: Component//==============================================================================Content::Content () : Component ("Content"){ addAndMakeVisible (GroupServer = new GroupComponent ("GroupServer", "Server")); addAndMakeVisible (GroupSettings = new GroupComponent ("GroupSettings", "Settings")); addAndMakeVisible (InputDevices = new ComboBox ("InputDevices")); InputDevices->setEditableText (false); InputDevices->setJustificationType (Justification::centredLeft); InputDevices->setTextWhenNothingSelected ("(no server)"); InputDevices->setTextWhenNoChoicesAvailable ("(no server)"); InputDevices->addListener (this); addAndMakeVisible (LabelInputDevice = new Label ("LabelInputDevice", "Input Device:")); LabelInputDevice->setFont (Font (15.00f, Font::plain)); LabelInputDevice->setJustificationType (Justification::centredRight); LabelInputDevice->setEditable (false, false, false); LabelInputDevice->setColour (TextEditor::textColourId, Colours::black); LabelInputDevice->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); addAndMakeVisible (OutputDevices = new ComboBox ("OutputDevices")); OutputDevices->setEditableText (false); OutputDevices->setJustificationType (Justification::centredLeft); OutputDevices->setTextWhenNothingSelected ("(no server)"); OutputDevices->setTextWhenNoChoicesAvailable ("(no server)"); OutputDevices->addListener (this); addAndMakeVisible (LabelOutputDevice = new Label ("LabelOutputDevice", "Output Device:")); LabelOutputDevice->setFont (Font (15.00f, Font::plain)); LabelOutputDevice->setJustificationType (Justification::centredRight); LabelOutputDevice->setEditable (false, false, false); LabelOutputDevice->setColour (TextEditor::textColourId, Colours::black); LabelOutputDevice->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); addAndMakeVisible (SampleRate = new ComboBox ("SampleRate")); SampleRate->setEditableText (false); SampleRate->setJustificationType (Justification::centredLeft); SampleRate->setTextWhenNothingSelected ("(no server)"); SampleRate->setTextWhenNoChoicesAvailable ("(no choices)"); SampleRate->addItem ("44100", 1); SampleRate->addItem ("48000", 2); SampleRate->addItem ("88200", 3); SampleRate->addItem ("96000", 4); SampleRate->addListener (this); addAndMakeVisible (LabelSampleRate = new Label ("LabelSampleRate", "Sample Rate:")); LabelSampleRate->setFont (Font (15.00f, Font::plain)); LabelSampleRate->setJustificationType (Justification::centredRight); LabelSampleRate->setEditable (false, false, false); LabelSampleRate->setColour (TextEditor::textColourId, Colours::black); LabelSampleRate->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); addAndMakeVisible (LabelServerAddress = new Label ("LabelServerAddress", "Server Address:")); LabelServerAddress->setFont (Font (15.00f, Font::plain)); LabelServerAddress->setJustificationType (Justification::centredRight); LabelServerAddress->setEditable (false, false, false); LabelServerAddress->setColour (TextEditor::textColourId, Colours::black); LabelServerAddress->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); addAndMakeVisible (Server = new ComboBox ("Server")); Server->setEditableText (true); Server->setJustificationType (Justification::centredLeft); Server->setTextWhenNothingSelected (String::empty); Server->setTextWhenNoChoicesAvailable ("(no choices)"); Server->addItem ("127.0.0.1", 1); Server->addListener (this); addAndMakeVisible (LabelInput = new Label ("LabelInput", "I N P U T S")); LabelInput->setFont (Font (15.00f, Font::plain)); LabelInput->setJustificationType (Justification::centredLeft); LabelInput->setEditable (false, false, false); LabelInput->setColour (TextEditor::textColourId, Colours::black); LabelInput->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); addAndMakeVisible (LabelInput2 = new Label ("LabelInput", "O/nU/nT/nP/nU/nT/nS")); LabelInput2->setFont (Font (15.00f, Font::plain)); LabelInput2->setJustificationType (Justification::centredTop); LabelInput2->setEditable (false, false, false); LabelInput2->setColour (TextEditor::textColourId, Colours::black); LabelInput2->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); addAndMakeVisible (textButton = new TextButton ("new button")); textButton->setButtonText ("Resync"); textButton->addListener (this); textButton->setColour (TextButton::buttonColourId, Colour (0xffff8a8a)); textButton->setColour (TextButton::buttonOnColourId, Colour (0xffff7373)); //[UserPreSize] addAndMakeVisible (matrixView = new MatrixView());//.........这里部分代码省略.........
开发者ID:burnson,项目名称:Mixy,代码行数:101,
示例19: isDraggingProcessorList::ProcessorList() : isDragging(false), totalHeight(800), itemHeight(32), subItemHeight(22), xBuffer(1), yBuffer(1){ listFontLight = Font("Default Light", 25, Font::plain); listFontPlain = Font("Default", 20, Font::plain); setColour(PROCESSOR_COLOR, Colour(59, 59, 59)); setColour(FILTER_COLOR, Colour(0, 174, 239)); setColour(SINK_COLOR, Colour(0, 166, 81)); setColour(SOURCE_COLOR, Colour(241, 90, 41)); setColour(UTILITY_COLOR, Colour(147, 149, 152)); ProcessorListItem* sources = new ProcessorListItem("Sources"); //sources->addSubItem(new ProcessorListItem("RHA2000-EVAL")); //sources->addSubItem(new ProcessorListItem("Signal Generator")); //sources->addSubItem(new ProcessorListItem("Custom FPGA")); sources->addSubItem(new ProcessorListItem("Rhythm FPGA")); sources->addSubItem(new ProcessorListItem("File Reader")); //sources->addSubItem(new ProcessorListItem("Network Events")); sources->addSubItem(new ProcessorListItem("Serial Port")); //sources->addSubItem(new ProcessorListItem("Event Generator")); ProcessorListItem* filters = new ProcessorListItem("Filters"); filters->addSubItem(new ProcessorListItem("Bandpass Filter")); filters->addSubItem(new ProcessorListItem("Spike Detector")); //filters->addSubItem(new ProcessorListItem("Resampler")); filters->addSubItem(new ProcessorListItem("Phase Detector")); //filters->addSubItem(new ProcessorListItem("Digital Ref")); filters->addSubItem(new ProcessorListItem("Channel Map")); //filters->addSubItem(new ProcessorListItem("Eye Tracking")); ProcessorListItem* sinks = new ProcessorListItem("Sinks"); sinks->addSubItem(new ProcessorListItem("LFP Viewer")); //sinks->addSubItem(new ProcessorListItem("LFP Trig. Avg.")); sinks->addSubItem(new ProcessorListItem("Spike Viewer")); //sinks->addSubItem(new ProcessorListItem("PSTH")); //sinks->addSubItem(new ProcessorListItem("Network Sink")); //sinks->addSubItem(new ProcessorListItem("WiFi Output")); //sinks->addSubItem(new ProcessorListItem("Arduino Output")); // sinks->addSubItem(new ProcessorListItem("FPGA Output")); sinks->addSubItem(new ProcessorListItem("Pulse Pal")); ProcessorListItem* utilities = new ProcessorListItem("Utilities"); utilities->addSubItem(new ProcessorListItem("Splitter")); utilities->addSubItem(new ProcessorListItem("Merger")); utilities->addSubItem(new ProcessorListItem("Record Control")); //utilities->addSubItem(new ProcessorListItem("Advancers")); baseItem = new ProcessorListItem("Processors"); baseItem->addSubItem(sources); baseItem->addSubItem(filters); baseItem->addSubItem(sinks); baseItem->addSubItem(utilities); // set parent names / colors baseItem->setParentName("Processors"); for (int n = 0; n < baseItem->getNumSubItems(); n++) { const String category = baseItem->getSubItem(n)->getName(); baseItem->getSubItem(n)->setParentName(category); for (int m = 0; m < baseItem->getSubItem(n)->getNumSubItems(); m++) { baseItem->getSubItem(n)->getSubItem(m)->setParentName(category);// = category; } }}
开发者ID:AGenews,项目名称:GUI,代码行数:76,
示例20: owner//==============================================================================//transport controls//==============================================================================TransportComponent::TransportComponent(SidebarPanel &ownerPanel, String name): owner(ownerPanel), PropertyComponent(name, 70), lookAndFeel(), playButton("playButton", DrawableButton::ImageOnButtonBackground), stopButton("stopButton", DrawableButton::ImageOnButtonBackground), bpmSlider("bpmSlider"), timeLabel("TimeLabel"), beatsLabel("beatsLabel"), timingInfoBox(), standardLookAndFeel(new LookAndFeel_V2()){ bpmSlider.setSliderStyle(Slider::SliderStyle::LinearBarVertical); bpmSlider.setRange(1, 500, 1); bpmSlider.setValue(60, dontSendNotification); bpmSlider.addListener(this); bpmSlider.setVelocityBasedMode(true); bpmSlider.setColour(Slider::ColourIds::thumbColourId, Colours::black); bpmSlider.setColour(Slider::ColourIds::textBoxTextColourId, Colours::white); bpmSlider.setColour(Slider::ColourIds::textBoxBackgroundColourId, Colours::black); timeSigNum.setSliderStyle(Slider::SliderStyle::LinearBarVertical); timeSigNum.setRange(1, 24, 1); timeSigNum.setValue(4, dontSendNotification); timeSigNum.addListener(this); timeSigNum.setColour(Slider::ColourIds::thumbColourId, Colours::black); timeSigNum.setColour(Slider::ColourIds::textBoxTextColourId, Colours::white); timeSigNum.setColour(Slider::ColourIds::textBoxBackgroundColourId, Colours::black); timeSigDen.setSliderStyle(Slider::SliderStyle::LinearBarVertical); timeSigDen.setRange(1, 24, 1); timeSigDen.setValue(4, dontSendNotification); timeSigDen.addListener(this); timeSigDen.setColour(Slider::ColourIds::thumbColourId, Colours::black); timeSigDen.setColour(Slider::ColourIds::textBoxTextColourId, Colours::white); timeSigDen.setColour(Slider::ColourIds::textBoxBackgroundColourId, Colours::black); bpmSlider.setVelocityModeParameters(0.9); bpmSlider.setTextValueSuffix(" BPM"); timeLabel.setJustificationType(Justification::left); timeLabel.setFont(Font(24, 1)); timeLabel.setLookAndFeel(standardLookAndFeel); timeLabel.setColour(Label::backgroundColourId, Colours::black); timeLabel.setColour(Label::textColourId, Colours::cornflowerblue); timeLabel.setText("00 : 00 : 00", dontSendNotification); beatsLabel.setJustificationType(Justification::right); beatsLabel.setFont(Font(18, 1)); beatsLabel.setLookAndFeel(standardLookAndFeel); beatsLabel.setColour(Label::backgroundColourId, Colours::black); beatsLabel.setColour(Label::textColourId, Colours::cornflowerblue); beatsLabel.setText("Beat 1", dontSendNotification); playButton.setLookAndFeel(&lookAndFeel); playButton.setColour(TextButton::buttonColourId, Colours::green.darker(.8f)); playButton.setColour(TextButton::buttonOnColourId, Colours::yellow); playButton.setClickingTogglesState(true); stopButton.setLookAndFeel(&lookAndFeel); stopButton.setColour(TextButton::buttonColourId, Colours::green.darker(.8f)); playButton.setImages(cUtils::createPlayButtonPath(30, Colours::white), cUtils::createPlayButtonPath(30, Colours::white), cUtils::createPauseButtonPath(30), cUtils::createPauseButtonPath(30), cUtils::createPauseButtonPath(30)); stopButton.setImages(cUtils::createStopButtonPath(30, Colours::white)); addAndMakeVisible (timingInfoBox); addAndMakeVisible (playButton); addAndMakeVisible (stopButton); addAndMakeVisible (bpmSlider); addAndMakeVisible (bpmLabel); addAndMakeVisible (timeLabel); addAndMakeVisible (beatsLabel);// addAndMakeVisible (timeSigNum);// addAndMakeVisible (timeSigDen); playButton.addListener (this); stopButton.addListener (this);}
开发者ID:gsenna,项目名称:cabbage,代码行数:89,
示例21: painter//////////////////////////////////////////////////////////////////////// Called to draw an overlay bitmap containing items that// does not need to be recreated every fft data update.//////////////////////////////////////////////////////////////////////void CMeter::DrawOverlay(){ if(m_OverlayPixmap.isNull()) return; int w = m_OverlayPixmap.width(); int h = m_OverlayPixmap.height(); int x,y; QRect rect; QPainter painter(&m_OverlayPixmap); m_OverlayPixmap.fill(QColor(0x20,0x20,0x20,0xFF));#if 0 //fill background with gradient QLinearGradient gradient(0, 0, 0 ,h); gradient.setColorAt(1, Qt::black); gradient.setColorAt(0, Qt::black); painter.setBrush(gradient); painter.drawRect(0, 0, w, h);#endif //Draw scale lines qreal marg = (qreal)w*CTRL_MARGIN; qreal hline = (qreal)h*CTRL_XAXIS_HEGHT; qreal magstart = (qreal)h*CTRL_MAJOR_START; qreal minstart = (qreal)h*CTRL_MINOR_START; qreal hstop = (qreal)w-marg; painter.setPen(QPen(Qt::white, 1, Qt::SolidLine)); painter.drawLine(QLineF(marg, hline, hstop, hline)); // top line with ticks painter.drawLine(QLineF(marg, hline+8, hstop, hline+8)); // bottom line qreal xpos = marg; for(x=0; x<11; x++) { if(x&1) //minor tics painter.drawLine( QLineF(xpos, minstart, xpos, hline) ); else painter.drawLine( QLineF(xpos, magstart, xpos, hline) ); xpos += (hstop-marg)/10.0; } //draw scale text //create Font to use for scales QFont Font("Arial"); QFontMetrics metrics(Font); y = h/4; Font.setPixelSize(y); Font.setWeight(QFont::Normal); painter.setFont(Font); int rwidth = (int)((hstop-marg)/5.0); m_Str = "-100"; rect.setRect(marg/2-5, 0, rwidth, magstart); for (x = MIN_DB; x <= MAX_DB; x += 20) { m_Str.setNum(x); painter.drawText(rect, Qt::AlignHCenter|Qt::AlignVCenter, m_Str); rect.translate(rwidth, 0); } /* for(x=1; x<=9; x+=2) { m_Str.setNum(x); painter.drawText(rect, Qt::AlignHCenter|Qt::AlignVCenter, m_Str); rect.translate( rwidth,0); } painter.setPen(QPen(Qt::red, 1,Qt::SolidLine)); for(x=20; x<=60; x+=20) { m_Str = "+" + m_Str.setNum(x); painter.drawText(rect, Qt::AlignHCenter|Qt::AlignVCenter, m_Str); rect.translate( rwidth,0); } */}
开发者ID:Anonofish,项目名称:gqrx,代码行数:76,
示例22: Component//==============================================================================AmplitudeToPhase::AmplitudeToPhase () : Component (T("AmplitudeToPhase")), groupComponent (0), amplitude_multiplierslider (0), label (0), textButton (0), resetbutton (0), label2 (0), textButton2 (0){ addAndMakeVisible (groupComponent = new GroupComponent (T("new group"), T("Amplitude->Phase"))); groupComponent->setTextLabelPosition (Justification::centredLeft); groupComponent->setColour (GroupComponent::outlineColourId, Colour (0xb0000000)); addAndMakeVisible (amplitude_multiplierslider = new Slider (T("new slider"))); amplitude_multiplierslider->setRange (0, 100, 0); amplitude_multiplierslider->setSliderStyle (Slider::LinearHorizontal); amplitude_multiplierslider->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20); amplitude_multiplierslider->setColour (Slider::backgroundColourId, Colour (0x956565)); amplitude_multiplierslider->setColour (Slider::thumbColourId, Colour (0x79fffcfc)); amplitude_multiplierslider->setColour (Slider::textBoxBackgroundColourId, Colour (0xffffff)); amplitude_multiplierslider->addListener (this); addAndMakeVisible (label = new Label (T("new label"), T("Amplitude multiplier (0-100)"))); 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 (T("new button"))); textButton->setButtonText (T("Do it!")); textButton->addListener (this); textButton->setColour (TextButton::buttonColourId, Colour (0x4bbbbbff)); addAndMakeVisible (resetbutton = new TextButton (T("resetbutton"))); resetbutton->setButtonText (T("reset")); resetbutton->addListener (this); resetbutton->setColour (TextButton::buttonColourId, Colour (0x40bbbbff)); addAndMakeVisible (label2 = new Label (T("new label"), T("The phases of the partials are set to their respective amplitudes, after a specified gain multiplication. Rather useless."))); 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 (T("new button"))); textButton2->setButtonText (T("Redo it!")); textButton2->addListener (this); textButton2->setColour (TextButton::buttonColourId, Colour (0x40bbbbff)); setSize (600, 400); //[Constructor] You can add your own custom stuff here.. buttonClicked(resetbutton);#undef Slider //[/Constructor]}
开发者ID:kmatheussen,项目名称:mammut,代码行数:69,
示例23: painter//////////////////////////////////////////////////////////////////////// Called to draw an overlay bitmap containing grid and text that// does not need to be recreated every fft data update.//////////////////////////////////////////////////////////////////////void CPlotter::DrawOverlay(){ if (m_OverlayPixmap.isNull()) return; int w = m_OverlayPixmap.width(); int h = m_OverlayPixmap.height(); int x,y; float pixperdiv; QRect rect; QPainter painter(&m_OverlayPixmap); painter.initFrom(this); // horizontal grids (size and grid calcs could be moved to resize) m_VerDivs = h/m_VdivDelta+1; m_HorDivs = w/m_HdivDelta; if (m_HorDivs % 2) m_HorDivs++; // we want an odd number of divs so that we have a center line //m_OverlayPixmap.fill(Qt::black); //fill background with gradient QLinearGradient gradient(0, 0, 0 ,h); gradient.setColorAt(0, QColor(0x20,0x20,0x20,0xFF)); gradient.setColorAt(1, QColor(0x4F,0x4F,0x4F,0xFF)); painter.setBrush(gradient); painter.drawRect(0, 0, w, h); //Draw demod filter box if (m_FilterBoxEnabled) { ClampDemodParameters(); m_DemodFreqX = XfromFreq(m_DemodCenterFreq); m_DemodLowCutFreqX = XfromFreq(m_DemodCenterFreq + m_DemodLowCutFreq); m_DemodHiCutFreqX = XfromFreq(m_DemodCenterFreq + m_DemodHiCutFreq); int dw = m_DemodHiCutFreqX - m_DemodLowCutFreqX; painter.setBrush(Qt::SolidPattern); painter.setOpacity(0.3); painter.fillRect(m_DemodLowCutFreqX, 0, dw, h, Qt::gray); painter.setOpacity(1.0); painter.setPen(QPen(QColor(0xFF,0x71,0x71,0xFF), 1, Qt::SolidLine)); painter.drawLine(m_DemodFreqX, 0, m_DemodFreqX, h); } //create Font to use for scales QFont Font("Arial"); Font.setPointSize(m_FontSize); QFontMetrics metrics(Font); Font.setWeight(QFont::Normal); painter.setFont(Font); // draw vertical grids pixperdiv = (float)w / (float)m_HorDivs; y = h - h/m_VerDivs/2; for (int i = 1; i < m_HorDivs; i++) { x = (int)((float)i*pixperdiv); if ((i == m_HorDivs/2) && m_CenterLineEnabled) // center line painter.setPen(QPen(QColor(0x78,0x82,0x96,0xFF), 1, Qt::SolidLine)); else painter.setPen(QPen(QColor(0xF0,0xF0,0xF0,0x30), 1, Qt::DotLine)); painter.drawLine(x, 0, x , y); } //draw frequency values MakeFrequencyStrs(); painter.setPen(QColor(0xD8,0xBA,0xA1,0xFF)); y = h - (h/m_VerDivs); for (int i = 1; i < m_HorDivs; i++) { x = (int)((float)i*pixperdiv - pixperdiv/2); rect.setRect(x, y, (int)pixperdiv, h/m_VerDivs); painter.drawText(rect, Qt::AlignHCenter|Qt::AlignBottom, m_HDivText[i]); } m_dBStepSize = abs(m_MaxdB-m_MindB)/(double)m_VerDivs; pixperdiv = (float)h / (float)m_VerDivs; painter.setPen(QPen(QColor(0xF0,0xF0,0xF0,0x30), 1,Qt::DotLine)); for (int i = 1; i < m_VerDivs; i++) { y = (int)((float) i*pixperdiv); painter.drawLine(5*metrics.width("0",-1), y, w, y); } //draw amplitude values painter.setPen(QColor(0xD8,0xBA,0xA1,0xFF)); //Font.setWeight(QFont::Light); painter.setFont(Font); int dB = m_MaxdB; m_YAxisWidth = metrics.width("-120 "); for (int i = 1; i < m_VerDivs; i++)//.........这里部分代码省略.........
开发者ID:igutekunst,项目名称:gqrx,代码行数:101,
示例24: Fontvoid CtrlrLuaMethodEditArea::insertOutput(const String &textToInsert, const Colour what){ output->setCaretPosition(output->getText().length()); output->insertText (textToInsert, Font (owner.getOwner().getOwner().getFontManager().getDefaultMonoFontName(), 16.0f, Font::plain), what);}
开发者ID:grimtraveller,项目名称:ctrlr,代码行数:5,
示例25: Font//----------------------------------------------------------------------------static uint font_family_table[] ={ FF_DONTCARE, // DEFAULT_FAMILY FF_DECORATIVE, // DECORATIVE FF_MODERN, // MODERN FF_ROMAN, // ROMAN FF_SCRIPT, // SCRIPT FF_SWISS // SWISS};//----------------------------------------------------------------------------static Font system_font = Font("Tahoma", 8);//----------------------------------------------------------------------------static void SetRect(RECT* r, const Rect& rect){ r->left = rect.Left(); r->top = rect.Top(); r->right = rect.Right(); r->bottom = rect.Bottom();}//----------------------------------------------------------------------------WinGraphics::WinGraphics() : m_dc(0),
开发者ID:harnold,项目名称:magrathea,代码行数:30,
示例26: DrawGlyphRun JUCE_COMRESULT DrawGlyphRun (void* clientDrawingContext, FLOAT baselineOriginX, FLOAT baselineOriginY, DWRITE_MEASURING_MODE, DWRITE_GLYPH_RUN const* glyphRun, DWRITE_GLYPH_RUN_DESCRIPTION const* runDescription, IUnknown* clientDrawingEffect) { TextLayout* const layout = static_cast<TextLayout*> (clientDrawingContext); if (baselineOriginY != lastOriginY) { lastOriginY = baselineOriginY; ++currentLine; if (currentLine >= layout->getNumLines()) { jassert (currentLine == layout->getNumLines()); TextLayout::Line* const newLine = new TextLayout::Line(); layout->addLine (newLine); newLine->lineOrigin = Point<float> (baselineOriginX, baselineOriginY); } } TextLayout::Line& glyphLine = layout->getLine (currentLine); DWRITE_FONT_METRICS dwFontMetrics; glyphRun->fontFace->GetMetrics (&dwFontMetrics); glyphLine.ascent = jmax (glyphLine.ascent, scaledFontSize (dwFontMetrics.ascent, dwFontMetrics, glyphRun)); glyphLine.descent = jmax (glyphLine.descent, scaledFontSize (dwFontMetrics.descent, dwFontMetrics, glyphRun)); String fontFamily, fontStyle; getFontFamilyAndStyle (glyphRun, fontFamily, fontStyle); TextLayout::Run* const glyphRunLayout = new TextLayout::Run (Range<int> (runDescription->textPosition, runDescription->textPosition + runDescription->stringLength), glyphRun->glyphCount); glyphLine.runs.add (glyphRunLayout); glyphRun->fontFace->GetMetrics (&dwFontMetrics); const float totalHeight = std::abs ((float) dwFontMetrics.ascent) + std::abs ((float) dwFontMetrics.descent); const float fontHeightToEmSizeFactor = (float) dwFontMetrics.designUnitsPerEm / totalHeight; glyphRunLayout->font = Font (fontFamily, fontStyle, glyphRun->fontEmSize / fontHeightToEmSizeFactor); glyphRunLayout->colour = getColourOf (static_cast<ID2D1SolidColorBrush*> (clientDrawingEffect)); const Point<float> lineOrigin (layout->getLine (currentLine).lineOrigin); float x = baselineOriginX - lineOrigin.x; for (UINT32 i = 0; i < glyphRun->glyphCount; ++i) { const float advance = glyphRun->glyphAdvances[i]; if ((glyphRun->bidiLevel & 1) != 0) x -= advance; // RTL text glyphRunLayout->glyphs.add (TextLayout::Glyph (glyphRun->glyphIndices[i], Point<float> (x, baselineOriginY - lineOrigin.y), advance)); if ((glyphRun->bidiLevel & 1) == 0) x += advance; // LTR text } return S_OK; }
开发者ID:2DaT,项目名称:Obxd,代码行数:64,
示例27: addAndMakeVisibleToolBarControls::ToolBarControls(){ addAndMakeVisible (audioStreamToggleButton = new ImageButton ("playButton")); audioStreamToggleButton->setClickingTogglesState(true); audioStreamToggleButton->setImages (false, true, true, ImageCache::getFromMemory (BinaryData::Play128_png, BinaryData::Play128_pngSize), 1.0f, Colour (0x00000000), Image::null, 0.7f, Colour (0x00000000), ImageCache::getFromMemory (BinaryData::Stop128_png, BinaryData::Stop128_pngSize), 1.0f, Colour (0x00000000)); addAndMakeVisible (recordToggleButton = new ImageButton ("recordButton")); recordToggleButton->setClickingTogglesState(true); recordToggleButton->setImages (false, true, true, ImageCache::getFromMemory (BinaryData::RecordOff128_png, BinaryData::RecordOff128_pngSize), 1.0f, Colour (0x00000000), Image::null, 0.7f, Colour (0x00000000), ImageCache::getFromMemory (BinaryData::RecordOn128_png, BinaryData::RecordOn128_pngSize), 1.0f, Colour (0x00000000)); addAndMakeVisible (saveTrainingButton = new ImageButton ("saveTrainingButton")); saveTrainingButton->setClickingTogglesState(false); saveTrainingButton->setImages (false, true, true, ImageCache::getFromMemory (BinaryData::Save128_png, BinaryData::Save128_pngSize), 1.0f, Colour (0x00000000), Image::null, 0.7f, Colour (0x00000000), Image::null, 1.0f, Colour (0x77000000)); addAndMakeVisible (loadTrainingButton = new ImageButton ("loadTrainingButton")); loadTrainingButton->setClickingTogglesState(false); loadTrainingButton->setImages (false, true, true, ImageCache::getFromMemory (BinaryData::Load128_png, BinaryData::Load128_pngSize), 1.0f, Colour (0x00000000), Image::null, 0.7f, Colour (0x00000000), Image::null, 1.0f, Colour (0x77000000)); addAndMakeVisible (addClassButton = new ImageButton ("addClassButton")); addClassButton->setClickingTogglesState(false); addClassButton->setImages (false, true, true, ImageCache::getFromMemory (BinaryData::AddClass128_png, BinaryData::AddClass128_pngSize), 1.0f, Colour (0x00000000), Image::null, 0.7f, Colour (0x00000000), Image::null, 1.0f, Colour (0x77000000)); addAndMakeVisible (deleteClassButton = new ImageButton ("deleteClassButton")); deleteClassButton->setClickingTogglesState(false); deleteClassButton->setTriggeredOnMouseDown(true); deleteClassButton->setImages (false, true, true, ImageCache::getFromMemory (BinaryData::DeleteClass128_png, BinaryData::DeleteClass128_pngSize), 1.0f, Colour (0x00000000), Image::null, 0.7f, Colour (0x00000000), Image::null, 1.0f, Colour (0x77000000)); //--- Labels ---// addAndMakeVisible (trainClassLabel = new Label ("trainClassLabel", TRANS("Train"))); trainClassLabel->setFont (Font ("Myriad Pro", 11.90f, Font::plain)); trainClassLabel->setJustificationType (Justification::centred); trainClassLabel->setEditable (false, false, false); trainClassLabel->setColour (Label::textColourId, Colour (0xFF5C6266)); trainClassLabel->setColour (TextEditor::textColourId, Colour (0xFF3D4248)); trainClassLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); trainClassLabel->setColour (TextEditor::highlightColourId, Colour (0x00000000)); addAndMakeVisible (playLabel = new Label ("playLabel", TRANS("Play"))); playLabel->setFont (Font ("Myriad Pro", 11.90f, Font::plain)); playLabel->setJustificationType (Justification::centred); playLabel->setEditable (false, false, false); playLabel->setColour (Label::textColourId, Colour (0xFF5C6266)); playLabel->setColour (TextEditor::textColourId, Colour (0xFF3D4248)); playLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); playLabel->setColour (TextEditor::highlightColourId, Colour (0x00000000)); addAndMakeVisible (addClassLabel = new Label ("addClassLabel", TRANS("Add Class"))); addClassLabel->setFont (Font ("Myriad Pro", 11.90f, Font::plain)); addClassLabel->setJustificationType (Justification::centred); addClassLabel->setEditable (false, false, false); addClassLabel->setColour (Label::textColourId, Colour (0xFF5C6266)); addClassLabel->setColour (TextEditor::textColourId, Colour (0xFF3D4248)); addClassLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); addClassLabel->setColour (TextEditor::highlightColourId, Colour (0x00000000)); addAndMakeVisible (deleteClassLabel = new Label ("deleteClassLabel", TRANS("Delete Class"))); deleteClassLabel->setFont (Font ("Myriad Pro", 11.90f, Font::plain)); deleteClassLabel->setJustificationType (Justification::centred); deleteClassLabel->setEditable (false, false, false); deleteClassLabel->setColour (Label::textColourId, Colour (0xFF5C6266)); deleteClassLabel->setColour (TextEditor::textColourId, Colour (0xFF3D4248)); deleteClassLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); deleteClassLabel->setColour (TextEditor::highlightColourId, Colour (0x00000000)); addAndMakeVisible (saveTrainingLabel = new Label ("saveTrainingLabel", TRANS("Save"))); saveTrainingLabel->setFont (Font ("Myriad Pro", 11.90f, Font::plain)); saveTrainingLabel->setJustificationType (Justification::centred); saveTrainingLabel->setEditable (false, false, false); saveTrainingLabel->setColour (Label::textColourId, Colour (0xFF5C6266)); saveTrainingLabel->setColour (TextEditor::textColourId, Colour (0xFF3D4248)); saveTrainingLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); saveTrainingLabel->setColour (TextEditor::highlightColourId, Colour (0x00000000)); //.........这里部分代码省略.........
开发者ID:govind678,项目名称:BeatSurface,代码行数:101,
示例28: Font //--------------------------------------------------------------------- Resource* FontManager::createImpl(const String& name, ResourceHandle handle, const String& group, bool isManual, ManualResourceLoader* loader, const NameValuePairList* params) { return OGRE_NEW Font(this, name, handle, group, isManual, loader); }
开发者ID:MrLobo,项目名称:El-Rayo-de-Zeus,代码行数:7,
注:本文中的Font函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ FontPlatformData函数代码示例 C++ Fmt函数代码示例 |