Ejemplo n.º 1
0
//==============================================================================
ComboBox::ComboBox (const String& name)
    : Component (name),
      lastCurrentId (0),
      isButtonDown (false),
      separatorPending (false),
      menuActive (false),
      scrollWheelEnabled (false),
      mouseWheelAccumulator (0),
      noChoicesMessage (TRANS("(no choices)"))
{
    setRepaintsOnMouseActivity (true);
    lookAndFeelChanged();
    currentId.addListener (this);
}
Ejemplo n.º 2
0
//==============================================================================
DemoContentComponent::DemoContentComponent (Component& mainComponent, std::function<void(bool)> callback)
    : TabbedComponent (TabbedButtonBar::Orientation::TabsAtTop),
      demoChangedCallback (callback)
{
    demoContent.reset (new DemoContent());
    addTab ("Demo",     Colours::transparentBlack, demoContent.get(), false);

   #if ! (JUCE_ANDROID || JUCE_IOS)
    codeContent.reset (new CodeContent());
    addTab ("Code",     Colours::transparentBlack, codeContent.get(), false);
   #endif

    addTab ("Settings", Colours::transparentBlack, new SettingsContent (dynamic_cast<MainComponent&> (mainComponent)), true);

    setTabBarDepth (40);
    lookAndFeelChanged();
}
Ejemplo n.º 3
0
// the bus window consists of a header and a tabbed control
BusWindow::BusWindow ()
#ifdef WIN32
 :	m_buswdm (NULL),
// deprecated	m_busdpc (NULL),
	m_busohci (NULL),
	m_busstats (NULL)
#endif // WIN32
{
	setName ("Bus Window");
	Colour tabColour(findColour(TCATLookAndFeel::tcatGlobalTabAreaColourId));

	// create and place controls. 
	//	the controls will be "live" after a bus listener is attached. 
	//	see mount() below
	m_tabs = new TabbedComponent(TabbedButtonBar::TabsAtTop);
	addAndMakeVisible (m_tabs);
	m_tabs->setBoundsInset(BorderSize<int> (0));
	m_tabs->getTabbedButtonBar().addChangeListener(this);
	m_tabs->setTabBarDepth(35);

	m_busgeneral = new BusGeneralComponent();
	m_tabs->addTab ("Bus", tabColour, m_busgeneral, true);
	
#ifdef WIN32
	m_buswdm = new BusWdmComponent();
	m_tabs->addTab ("WDM", tabColour, m_buswdm, true);
	m_buswdm->setBounds (0, 48, getWidth(), 160);
	if (appDefaults->getAppSettings()->getBoolValue("showDPC"))
	{
		m_busstats = new BusStatsComponent();
		m_tabs->addTab ("DPC", tabColour, m_busstats, true);
	}
#endif // WIN32

	if (appDefaults->getAppSettings()->getBoolValue("showSystem"))
	{
		m_busohci = new BusOhciCheckComponent();
		m_tabs->addTab ("System", tabColour, m_busohci, true);
	}
    
	m_businfo = new BusInfoComponent();
	m_tabs->addTab ("Info", tabColour, m_businfo, true);

	lookAndFeelChanged();
}
Ejemplo n.º 4
0
    AlertTextComp (const String& message,
                   const Font& font)
    {
        setReadOnly (true);
        setMultiLine (true, true);
        setCaretVisible (false);
        setScrollbarsShown (true);
        lookAndFeelChanged();
        setWantsKeyboardFocus (false);

        setFont (font);
        setText (message, false);

        bestWidth = 2 * (int) std::sqrt (font.getHeight() * font.getStringWidth (message));

        setColour (TextEditor::backgroundColourId, Colours::transparentBlack);
        setColour (TextEditor::outlineColourId, Colours::transparentBlack);
        setColour (TextEditor::shadowColourId, Colours::transparentBlack);
    }
Ejemplo n.º 5
0
// the colors for different MLDial parts are generated algorithmically.
void MLMultiSlider::setFillColor (const Colour& c)
{
	float g = c.getFloatGreen();
	float b = (1.f - g);	

	// thumb fill
	setColour(fillColor, c);
	// bright line
	setColour(indicatorColor, Colour(c.getHue(), jmax(c.getSaturation() - (b*0.05), 0.), jmin((c.getBrightness() + b*2.f), 1.f), 1.f));

	MLLookAndFeel* myLookAndFeel = (&(getRootViewResources(this).mLookAndFeel));
	// track background plain
	setColour(trackEmptyDarkColor, myLookAndFeel->findColour(MLLookAndFeel::darkestFillColor));
	// dial fill selected 
	setColour(trackFullLightColor, findColour(fillColor).overlaidWith(findColour(indicatorColor).withAlpha(0.15f)));
	// track fill 
	setColour(trackFullDarkColor, c.overlaidWith(Colours::black.withAlpha(0.17f)).withMultipliedSaturation(1.5f));

    lookAndFeelChanged();
}
Ejemplo n.º 6
0
OnlineUnlockForm::OnlineUnlockForm (OnlineUnlockStatus& s,
                                    const String& userInstructions,
                                    bool hasCancelButton)
    : message (String(), userInstructions),
      passwordBox (String(), getDefaultPasswordChar()),
      registerButton (TRANS("Register")),
      cancelButton (TRANS ("Cancel")),
      status (s)
{
    // Please supply a message to tell your users what to do!
    jassert (userInstructions.isNotEmpty());

    setOpaque (true);

    emailBox.setText (status.getUserEmail());
    message.setJustificationType (Justification::centred);

    addAndMakeVisible (message);
    addAndMakeVisible (emailBox);
    addAndMakeVisible (passwordBox);
    addAndMakeVisible (registerButton);

    if (hasCancelButton)
        addAndMakeVisible (cancelButton);

    emailBox.setEscapeAndReturnKeysConsumed (false);
    passwordBox.setEscapeAndReturnKeysConsumed (false);

    registerButton.addShortcut (KeyPress (KeyPress::returnKey));

    registerButton.addListener (this);
    cancelButton.addListener (this);

    lookAndFeelChanged();
    setSize (500, 250);
}
Ejemplo n.º 7
0
BEGIN_JUCE_NAMESPACE

#include "juce_ComboBox.h"
#include "../menus/juce_PopupMenu.h"
#include "../lookandfeel/juce_LookAndFeel.h"
#include "../../../text/juce_LocalisedStrings.h"


//==============================================================================
ComboBox::ComboBox (const String& name)
    : Component (name),
      lastCurrentId (0),
      isButtonDown (false),
      separatorPending (false),
      menuActive (false),
      label (0)
{
    noChoicesMessage = TRANS("(no choices)");
    setRepaintsOnMouseActivity (true);

    lookAndFeelChanged();

    currentId.addListener (this);
}
Ejemplo n.º 8
0
void ComboBox::parentHierarchyChanged()
{
    lookAndFeelChanged();
}
Ejemplo n.º 9
0
void ComboBox::colourChanged()
{
    lookAndFeelChanged();
}
Ejemplo n.º 10
0
void ProgressBar::colourChanged()
{
    lookAndFeelChanged();
}
Ejemplo n.º 11
0
void FilenameComponent::setBrowseButtonText (const String& newBrowseButtonText)
{
    browseButtonText = newBrowseButtonText;
    lookAndFeelChanged();
}
Ejemplo n.º 12
0
void CtrlrImageSlider::valueTreePropertyChanged (ValueTree &treeWhosePropertyHasChanged, const Identifier &property)
{
	if (property == Ids::uiImageSliderResource)
	{
		setResource();
	}
	else if (property == Ids::resourceImageWidth)
	{
		lf->setImage (filmStripImage, (int)getProperty(Ids::resourceImageWidth), (int)getProperty(Ids::resourceImageHeight));
	}
	else if (property == Ids::resourceImageHeight)
	{
		lf->setImage (filmStripImage, (int)getProperty(Ids::resourceImageWidth), (int)getProperty(Ids::resourceImageHeight));
	}
	else if (property == Ids::resourceImagePaintMode)
	{
		lf->setPaintMode ((RectanglePlacement)(int)getProperty(Ids::resourceImagePaintMode));
	}
	else if (property == Ids::resourceImageOrientation)
	{
		lf->setOrientation((bool)getProperty(Ids::resourceImageOrientation));
	}
	else if (property == Ids::uiSliderInterval || property == Ids::uiSliderMax || property == Ids::uiSliderMin)
	{
		ctrlrSlider->setRange ( getProperty (Ids::uiSliderMin), getProperty (Ids::uiSliderMax), getProperty (Ids::uiSliderInterval) );
		owner.setProperty (Ids::modulatorMax, ctrlrSlider->getMaximum());
		owner.setProperty (Ids::modulatorMin, ctrlrSlider->getMinimum());
	}
	else if (property == Ids::uiSliderValueTextColour)
	{
		ctrlrSlider->setColour (Slider::textBoxTextColourId, VAR2COLOUR(getProperty (Ids::uiSliderValueTextColour)) );
	}
	else if (property == Ids::uiSliderValueBgColour)
	{
		ctrlrSlider->setColour (Slider::textBoxBackgroundColourId, VAR2COLOUR(getProperty (Ids::uiSliderValueBgColour)) );
	}
	else if (property == Ids::uiSliderValueHighlightColour)
	{
		ctrlrSlider->setColour (Slider::textBoxHighlightColourId, VAR2COLOUR(getProperty (Ids::uiSliderValueOutlineColour)) );
	}
	else if (property == Ids::uiSliderValueOutlineColour)
	{
		ctrlrSlider->setColour (Slider::textBoxOutlineColourId, VAR2COLOUR(getProperty (Ids::uiSliderValueOutlineColour)) );
	}
	else if (property == Ids::uiSliderValuePosition || property == Ids::uiSliderValueHeight || property == Ids::uiSliderValueWidth)
	{
		ctrlrSlider->setTextBoxStyle (
			(Slider::TextEntryBoxPosition)(int)getProperty (Ids::uiSliderValuePosition),
			false,
			getProperty (Ids::uiSliderValueWidth, 64),
			getProperty (Ids::uiSliderValueHeight, 12));
	}

	else if (property == Ids::uiSliderIncDecButtonColour
		|| property == Ids::uiSliderIncDecTextColour
		|| property == Ids::uiSliderValueFont
		|| property == Ids::uiSliderValueTextJustification
		)
	{
		lf->setOrientation((bool)getProperty(Ids::resourceImageOrientation));
		lf->setImage (filmStripImage, (int)getProperty(Ids::resourceImageWidth), (int)getProperty(Ids::resourceImageHeight));
		lookAndFeelChanged();
	}

	else if (property == Ids::uiSliderStyle)
	{
		ctrlrSlider->setSliderStyle ((Slider::SliderStyle)CtrlrComponentTypeManager::sliderStringToStyle (getProperty (Ids::uiSliderStyle)));
	}
	else if (property == Ids::uiSliderVelocityMode
		|| property == Ids::uiSliderVelocityModeKeyTrigger
		|| property == Ids::uiSliderVelocitySensitivity
		|| property == Ids::uiSliderVelocityThreshold
		|| property == Ids::uiSliderVelocityOffset
		)
	{
		ctrlrSlider->setVelocityBasedMode((bool)getProperty(Ids::uiSliderVelocityMode));
		ctrlrSlider->setVelocityModeParameters ((double)getProperty(Ids::uiSliderVelocitySensitivity),
												(int)getProperty(Ids::uiSliderVelocityThreshold),
												(double)getProperty(Ids::uiSliderVelocityOffset),
												(bool)getProperty(Ids::uiSliderVelocityModeKeyTrigger));
	}
	else if (property == Ids::uiSliderSpringValue)
	{
		ctrlrSlider->setValue (getProperty(property), dontSendNotification);
	}
	else if (property == Ids::uiSliderDoubleClickValue
			|| property == Ids::uiSliderDoubleClickEnabled)
	{
		ctrlrSlider->setDoubleClickReturnValue ((bool)getProperty(Ids::uiSliderDoubleClickEnabled), getProperty(Ids::uiSliderDoubleClickValue));
	}
	else if (property == Ids::uiSliderSpringMode)
	{
		if ((bool)getProperty(property) == true)
		{
			ctrlrSlider->setValue (getProperty(Ids::uiSliderSpringValue), dontSendNotification);
		}
	}
	else if (property == Ids::uiSliderPopupBubble)
	{
		ctrlrSlider->setPopupDisplayEnabled ((bool)getProperty(property), (bool)getProperty(property), owner.getOwnerPanel().getEditor());
	}
	else
	{
		CtrlrComponent::valueTreePropertyChanged(treeWhosePropertyHasChanged, property);
	}

	if (restoreStateInProgress == false)
	{
		resized();
	}
}
Ejemplo n.º 13
0
CtrlrEditor::CtrlrEditor (CtrlrProcessor *_ownerFilter, CtrlrManager &_owner)
	:	AudioProcessorEditor (_ownerFilter), ownerFilter(_ownerFilter),
		owner(_owner), resizer(this, 0),
		tempResult(Result::ok()),
		menuHandlerCalled(false),
		lastCommandInvocationMillis(0)
{
	Rectangle<int> editorRect;
    // http://www.juce.com/forum/topic/applicationcommandmanager-menus-not-active-annoyance#new
    owner.getCommandManager().setFirstCommandTarget (this);

	addAndMakeVisible (menuBar = new MenuBarComponent (this));
	menuBarLookAndFeel = new CtrlrMenuBarLookAndFeel (*this);

	setApplicationCommandManagerToWatch (&owner.getCommandManager());

	owner.getCommandManager().registerAllCommandsForTarget (this);
	owner.getCommandManager().registerAllCommandsForTarget (JUCEApplication::getInstance());
	ScopedPointer <XmlElement> xml(XmlDocument::parse(owner.getProperty(Ids::ctrlrKeyboardMapping)));

	if (xml)
	{
		owner.getCommandManager().getKeyMappings()->restoreFromXml (*xml);
	}

	owner.setEditor (this);

	addAndMakeVisible (&owner.getCtrlrDocumentPanel());

	if (!JUCEApplication::isStandaloneApp())
	{
	    if (owner.getInstanceMode() != InstanceSingleRestriced)
        {
            /* Restricted instances don't get to be resizable */
            addAndMakeVisible (&resizer);
            resizer.setAlwaysOnTop (false);
            resizer.grabKeyboardFocus();
            resizer.toFront (true);
        }
	}

	if (owner.getProperty (Ids::ctrlrEditorBounds).toString() != String::empty)
	{
		if (owner.getInstanceMode() != InstanceSingle
			&& owner.getInstanceMode() != InstanceSingleRestriced)
		{
			editorRect = VAR2RECT(owner.getProperty (Ids::ctrlrEditorBounds));
		}
		else if (owner.getActivePanel())
		{
			editorRect = VAR2RECT(owner.getActivePanel()->getEditor()->getProperty(Ids::uiPanelCanvasRectangle));

			if ((bool)owner.getActivePanel()->getEditor()->getProperty(Ids::uiPanelMenuBarVisible))
				editorRect.setHeight (editorRect.getHeight() + CTRLR_MENUBAR_HEIGHT);
			else
				editorRect.setHeight (editorRect.getHeight());
		}
	}
	else
		editorRect.setSize(640,480);

	setBounds (editorRect);

	lookAndFeelChanged();
	activeCtrlrChanged();
}
Ejemplo n.º 14
0
//==============================================================================
WdmChMapComponent::WdmChMapComponent () :
		m_out (false),
		m_group (0),
		m_input (0),
		m_output (0),
		m_dragging (0),
		m_speaker_label (0),
		m_speaker_table (0),
		m_dev_ch_label (0),
		m_device_channels (0),
		m_speaker(0),
		m_update (0)
{
	setName("WDM Ch Mapper");

	initWdmNames();
	getChannelNames();
	getMappedNames();

    addAndMakeVisible (m_group = new GroupComponent ("channelsGroup", "In Channels"));

    addAndMakeVisible (m_input = new ToggleButton ("input"));
    m_input->setButtonText ("Input");
    m_input->addListener (this);
	m_input->setRadioGroupId(1234);
	
    addAndMakeVisible (m_output = new ToggleButton ("output"));
    m_output->setButtonText ("Output");
    m_output->addListener (this);
	m_output->setRadioGroupId(1234);

    addAndMakeVisible (m_reset = new TextButton ("reset"));
    m_reset->setButtonText ("Reset");
    m_reset->addListener (this);

	addAndMakeVisible (m_speaker_label = new Label ("wdmChannelsLabel", "WDM Channels"));
    m_speaker_label->setFont (Font (15.0000f, Font::plain));
    m_speaker_label->setJustificationType (Justification::centredBottom);
    m_speaker_label->setEditable (false, false, false);

    addAndMakeVisible (m_speaker_table = new SpeakerListComponent (*this, 
																		m_wdm_names,
																		m_in_ch_names, 
																		m_out_ch_names, 
																		m_in_map_names,
																		m_out_map_names, 
																		false));
    m_speaker_table->setOutlineThickness(1);
	
    addAndMakeVisible (m_wdm_ch_label = new Label ("wdmChLabel", "Mapped WDM Channels"));
    m_wdm_ch_label->setFont (Font (15.0000f, Font::plain));
    m_wdm_ch_label->setJustificationType (Justification::topLeft);
    m_wdm_ch_label->setEditable (false, false, false);

    addAndMakeVisible (m_dev_ch_label = new Label ("devChLabel", "Device Channels"));
    m_dev_ch_label->setFont (Font (15.0000f, Font::plain));
    m_dev_ch_label->setJustificationType (Justification::topLeft);
    m_dev_ch_label->setEditable (false, false, false);

    addAndMakeVisible (m_instr_label = new Label ("instLabel", "Drag WDM channels \nto Device channels to map them.\n\nDrag maps out of the \nDevice channels list\nto unmap them."));
    m_instr_label->setFont (Font (15.0000f, Font::plain));
    m_instr_label->setJustificationType (Justification::centred);
    m_instr_label->setEditable (false, false, false);

    addAndMakeVisible (m_device_channels = new ChannelListComponent (*this,  
																		m_wdm_names, 
																		m_in_ch_names, 
																		m_out_ch_names, 
																		m_in_map_names,
																		m_out_map_names));
    m_device_channels->setOutlineThickness(1);

	if (m_out)
		m_input->setToggleState(true, true);
	else
		m_output->setToggleState(true, true);

	lookAndFeelChanged();
}
Ejemplo n.º 15
0
void MLEnvelope::colourChanged()
{
    lookAndFeelChanged();
}
void DocumentWindow::parentHierarchyChanged()
{
    lookAndFeelChanged();
}