Ejemplo n.º 1
0
BubbleComponent::BubbleComponent()
  : allowablePlacements (above | below | left | right)
{
    setInterceptsMouseClicks (false, false);

    shadow.setShadowProperties (DropShadow (Colours::black.withAlpha (0.35f), 5, Point<int>()));
    setComponentEffect (&shadow);
}
Ejemplo n.º 2
0
void ArrowButton::paintButton (Graphics& g, bool /*shouldDrawButtonAsHighlighted*/, bool shouldDrawButtonAsDown)
{
    Path p (path);

    const float offset = shouldDrawButtonAsDown ? 1.0f : 0.0f;
    p.applyTransform (path.getTransformToScaleToFit (offset, offset, getWidth() - 3.0f, getHeight() - 3.0f, false));

    DropShadow (Colours::black.withAlpha (0.3f), shouldDrawButtonAsDown ? 2 : 4, Point<int>()).drawForPath (g, p);

    g.setColour (colour);
    g.fillPath (p);
}
Ejemplo n.º 3
0
void pMixLookAndFeel::drawCallOutBoxBackground (CallOutBox& box, Graphics& g,
                                                const Path& path, Image& cachedImage)
{
  if (cachedImage.isNull())
  {
    cachedImage = Image (Image::ARGB, box.getWidth(), box.getHeight(), true);
    Graphics g2 (cachedImage);
    
    DropShadow (Colours::black.withAlpha (0.7f), 8, Point<int> (0, 2)).drawForPath (g2, path);
  }
  
  g.setColour (Colours::black);
  g.drawImageAt (cachedImage, 0, 0);
  
  g.setColour (Colours::lightgrey);
  g.fillPath (path);
}
Ejemplo n.º 4
0
LookAndFeel_V1::LookAndFeel_V1()
{
    setColour (TextButton::buttonColourId,          Colour (0xffbbbbff));
    setColour (ListBox::outlineColourId,            findColour (ComboBox::outlineColourId));
    setColour (ScrollBar::thumbColourId,            Colour (0xffbbbbdd));
    setColour (ScrollBar::backgroundColourId,       Colours::transparentBlack);
    setColour (Slider::thumbColourId,               Colours::white);
    setColour (Slider::trackColourId,               Colour (0x7f000000));
    setColour (Slider::textBoxOutlineColourId,      Colours::grey);
    setColour (ProgressBar::backgroundColourId,     Colours::white.withAlpha (0.6f));
    setColour (ProgressBar::foregroundColourId,     Colours::green.withAlpha (0.7f));
    setColour (PopupMenu::backgroundColourId,             Colour (0xffeef5f8));
    setColour (PopupMenu::highlightedBackgroundColourId,  Colour (0xbfa4c2ce));
    setColour (PopupMenu::highlightedTextColourId,        Colours::black);
    setColour (TextEditor::focusedOutlineColourId,  findColour (TextButton::buttonColourId));

    scrollbarShadow.setShadowProperties (DropShadow (Colours::black.withAlpha (0.5f), 2, Point<int>()));
}
Ejemplo n.º 5
0
void ShapeButton::setShape (const Path& newShape,
                            const bool resizeNowToFitThisShape,
                            const bool maintainShapeProportions_,
                            const bool hasShadow)
{
    shape = newShape;
    maintainShapeProportions = maintainShapeProportions_;

    shadow.setShadowProperties (DropShadow (Colours::black.withAlpha (0.5f), 3, Point<int>()));
    setComponentEffect (hasShadow ? &shadow : nullptr);

    if (resizeNowToFitThisShape)
    {
        Rectangle<float> newBounds (shape.getBounds());

        if (hasShadow)
            newBounds.expand (4.0f, 4.0f);

        shape.applyTransform (AffineTransform::translation (-newBounds.getX(), -newBounds.getY()));

        setSize (1 + (int) (newBounds.getWidth() + outlineWidth),
                 1 + (int) (newBounds.getHeight() + outlineWidth));
    }
}
Ejemplo n.º 6
0
//==============================================================================
CtrlrAbout::CtrlrAbout (CtrlrManager &_owner)
    : owner(_owner)
{
    //[Constructor_pre] You can add your own custom stuff here..
    //[/Constructor_pre]

    addAndMakeVisible (ctrlrName = new Label (String::empty,
                                              TRANS("Ctrlr")));
    ctrlrName->setFont (Font (48.00f, Font::bold));
    ctrlrName->setJustificationType (Justification::centredLeft);
    ctrlrName->setEditable (false, false, false);
    ctrlrName->setColour (Label::textColourId, Colour (0xd6000000));
    ctrlrName->setColour (TextEditor::textColourId, Colours::black);
    ctrlrName->setColour (TextEditor::backgroundColourId, Colour (0x00000000));

    addAndMakeVisible (ctrlrLogo = new ImageButton (String::empty));
    ctrlrLogo->addListener (this);

    ctrlrLogo->setImages (false, true, true,
                          Image(), 0.750f, Colour (0x00000000),
                          Image(), 0.850f, Colour (0x00000000),
                          Image(), 0.990f, Colour (0x00000000));
    addAndMakeVisible (versionInfoLabel = new TextEditor (String::empty));
    versionInfoLabel->setMultiLine (true);
    versionInfoLabel->setReturnKeyStartsNewLine (true);
    versionInfoLabel->setReadOnly (true);
    versionInfoLabel->setScrollbarsShown (true);
    versionInfoLabel->setCaretVisible (false);
    versionInfoLabel->setPopupMenuEnabled (true);
    versionInfoLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
    versionInfoLabel->setColour (TextEditor::outlineColourId, Colour (0x9c000000));
    versionInfoLabel->setColour (TextEditor::shadowColourId, Colour (0x00000000));
    versionInfoLabel->setText (String::empty);

    addAndMakeVisible (label = new Label ("new label",
                                          TRANS("Instance name")));
    label->setFont (Font (24.00f, Font::bold));
    label->setJustificationType (Justification::topRight);
    label->setEditable (false, false, false);
    label->setColour (TextEditor::textColourId, Colours::black);
    label->setColour (TextEditor::backgroundColourId, Colour (0x00000000));

    addAndMakeVisible (label2 = new Label ("new label",
                                           TRANS("Author")));
    label2->setFont (Font (24.00f, Font::plain));
    label2->setJustificationType (Justification::topRight);
    label2->setEditable (false, false, false);
    label2->setColour (TextEditor::textColourId, Colours::black);
    label2->setColour (TextEditor::backgroundColourId, Colour (0x00000000));

    addAndMakeVisible (label3 = new Label ("new label",
                                           TRANS("Version")));
    label3->setFont (Font (24.00f, Font::plain));
    label3->setJustificationType (Justification::topRight);
    label3->setEditable (false, false, false);
    label3->setColour (TextEditor::textColourId, Colours::black);
    label3->setColour (TextEditor::backgroundColourId, Colour (0x00000000));

    addAndMakeVisible (label4 = new Label ("new label",
                                           TRANS("URL")));
    label4->setFont (Font (24.00f, Font::plain));
    label4->setJustificationType (Justification::topRight);
    label4->setEditable (false, false, false);
    label4->setColour (TextEditor::textColourId, Colours::black);
    label4->setColour (TextEditor::backgroundColourId, Colour (0x00000000));

    addAndMakeVisible (instanceUrl = new HyperlinkButton (String::empty,
                                                          URL ("http://www.rawmaterialsoftware.com/juce")));
    instanceUrl->setTooltip (TRANS("http://www.rawmaterialsoftware.com/juce"));

    addAndMakeVisible (instanceVersion = new Label (String::empty,
                                                    String::empty));
    instanceVersion->setFont (Font (22.00f, Font::bold));
    instanceVersion->setJustificationType (Justification::topLeft);
    instanceVersion->setEditable (false, false, false);
    instanceVersion->setColour (TextEditor::textColourId, Colours::black);
    instanceVersion->setColour (TextEditor::backgroundColourId, Colour (0x00000000));

    addAndMakeVisible (instanceAuthor = new Label (String::empty,
                                                   String::empty));
    instanceAuthor->setFont (Font (22.00f, Font::bold));
    instanceAuthor->setJustificationType (Justification::topLeft);
    instanceAuthor->setEditable (false, false, false);
    instanceAuthor->setColour (TextEditor::textColourId, Colours::black);
    instanceAuthor->setColour (TextEditor::backgroundColourId, Colour (0x00000000));

    addAndMakeVisible (instanceName = new Label (String::empty,
                                                 String::empty));
    instanceName->setFont (Font (24.00f, Font::bold));
    instanceName->setJustificationType (Justification::topLeft);
    instanceName->setEditable (false, false, false);
    instanceName->setColour (TextEditor::textColourId, Colours::black);
    instanceName->setColour (TextEditor::backgroundColourId, Colour (0x00000000));

    addAndMakeVisible (instanceDescription = new TextEditor (String::empty));
    instanceDescription->setMultiLine (true);
    instanceDescription->setReturnKeyStartsNewLine (true);
    instanceDescription->setReadOnly (true);
    instanceDescription->setScrollbarsShown (true);
    instanceDescription->setCaretVisible (false);
    instanceDescription->setPopupMenuEnabled (false);
    instanceDescription->setColour (TextEditor::backgroundColourId, Colour (0x00ffffff));
    instanceDescription->setColour (TextEditor::outlineColourId, Colour (0x59000000));
    instanceDescription->setColour (TextEditor::shadowColourId, Colour (0x00000000));
    instanceDescription->setText (String::empty);


    //[UserPreSize]
	ctrlrLogo->setMouseCursor(MouseCursor::PointingHandCursor);
	ctrlrLogo->setImages (false, true, true,
                          IMAGE(ico_midi_small_png), 0.8500f, Colour (0x0),
                          IMAGE(ico_midi_small_png), 0.9500f, Colour (0x0),
                          IMAGE(ico_midi_small_png), 1.0000f, Colour (0x0));
	addVersionInfo ("Version", STR(ctrlrRevision));
	addVersionInfo ("Build date", STR(ctrlrRevisionDate));
#if CTRLR_NIGHTLY == 1
	addVersionInfo ("Branch", "Nightly");
#else
	addVersionInfo ("Branch", "Stable");
#endif
	addVersionInfo ("Juce", SystemStats::getJUCEVersion().fromLastOccurrenceOf("JUCE v", false, true));

	addVersionInfo ("libusb", "1.0.19");
    addVersionInfo ("liblo", "0.28");

	shadow.setShadowProperties (DropShadow (Colours::black, 5, Point <int> (2,2)));
	ctrlrName->setComponentEffect (&shadow);
    instanceName->setComponentEffect (&shadow);
    instanceAuthor->setComponentEffect (&shadow);
    instanceVersion->setComponentEffect (&shadow);

	versionInfoLabel->setFont (Font (14.0f, Font::bold));
	versionInfoLabel->setColour (TextEditor::backgroundColourId, Colours::transparentBlack);
	versionInfoLabel->setComponentEffect (&shadow);

	if (owner.getInstanceMode() == InstanceSingle || owner.getInstanceMode() == InstanceSingleRestriced)
	{
    //[/UserPreSize]

    setSize (600, 380);


    //[Constructor] You can add your own custom stuff here..
		if (owner.getActivePanel())
		{
			instanceName->setText (owner.getActivePanel()->getProperty(Ids::name).toString(), dontSendNotification);
			instanceAuthor->setText (owner.getActivePanel()->getProperty(Ids::panelAuthorName).toString(), dontSendNotification);
			instanceDescription->setText (owner.getActivePanel()->getProperty(Ids::panelAuthorDesc).toString(), dontSendNotification);
			instanceUrl->setButtonText (owner.getActivePanel()->getProperty(Ids::panelAuthorUrl));
			instanceUrl->setURL(URL(owner.getActivePanel()->getProperty(Ids::panelAuthorUrl)));
			instanceVersion->setText (owner.getActivePanel()->getVersionString(false, false, "."), dontSendNotification);
		}
	}
	else
	{
		setSize (600, 96);
	}
	updateVersionLabel();
    //[/Constructor]
}
Ejemplo n.º 7
0
void main()
{
    int sel = 0;

	redraw = 1;
	refresh = 1;
	

#ifndef CDROM
	xres_flags = XRES_SOFT;
	Enabled240p = 1;
	UseDefault = 0;
	EnabledSoft = 1;
	Enabled_C_BW = 0;
#endif

#ifdef CDROM
	RestoreGlobals();
#endif

#ifdef CDROM1	
	if(prev_select)
	{
		sel = prev_select;
		prev_select = 0;
	}
#endif

	disp_off();
	set_xres(320, xres_flags);
	if(Enabled240p)
		Set240p();

#ifndef CDROM
	disp_on();
	DrawIntro();
	disp_off();
#endif

    while(1)
    {   	
		vsync();
	
#ifdef CDROM1
		if(!HelpItem)
		{
#endif

        if(redraw)
        {
			RedrawMain();
            redraw = 0;
			refresh = 1;
			disp_on();
        }
		
		set_font_pal(15);
		
		if(refresh)
        {
            RefreshMain(sel);

            refresh = 0;
        }

        controller = joytrg(0);
		
		if (controller & JOY_SEL)
		{
#ifdef CDROM1
			x_g = 0;
#endif
			Options();
			redraw = 1;
		}
        
        if (controller & JOY_DOWN) 
        {
            sel++;
            if(sel > 14)
                sel = 0;
            refresh = 1;
        }

        if (controller & JOY_UP) 
        {
            sel--;
            if(sel < 0)
                sel = 14;
            refresh = 1;
        }
		
		if (controller & JOY_RUN)
		{
			showHelp(GENERAL_HELP);
			redraw = 1;
		}
#ifdef CDROM1
		}
		else
		{
			if(HelpItem <= OPTIONS_HELP)
			{
				sel = HelpItem;
				controller = JOY_I;
			}
				
			HelpItem = 0;
		}
#endif
		
		if (controller & JOY_I)
		{
			disp_off();
			ResetVideo();
			switch(sel)
			{
				case 0:
#ifndef CDROM1
					TestPatterns();
#else
					xres_flags_g = xres_flags;
					Enabled240p_g = Enabled240p;
					UseDefault_g = UseDefault;
					EnabledSoft_g = EnabledSoft;
					Enabled_C_BW_g = Enabled_C_BW;
					
					set_font_pal(14);
					put_string("Loading...", 27, 26);
					cd_execoverlay(PATTERNS_OVERLAY);
#endif
					break;
				case 1:
					DropShadow();
					break;
				case 2:
					StripedSprite();
					break;
				case 3:
					LagTest();
					break;
				case 4:
					ManualLagTest();
					break;
				case 5:
					ScrollTest();
					break;
				case 6:
					VScrollTest();
					break;
				case 7:
					DrawStripes();
					break;
				case 8:
					DrawCheck();
					break;
				case 9:
					LEDZoneTest();
					break;
				case 10:
					SoundTest();
					break;
				case 11:
					AudioSyncTest();
					break;
				case 12:
#ifdef CDROM1
					prev_select = sel;
#endif
					Options();
					break;
				case 13:
#ifdef CDROM1
					prev_select = sel;
#endif
					showHelp(GENERAL_HELP);
					break;
				case 14:
					DrawCredits();
					break;
			}
			redraw = 1;			
			disp_off();
		}
    }
}