Exemplo n.º 1
0
void QDirectFBWindowSurface::updateIsOpaque()
{
    const QWidget *win = window();
    Q_ASSERT(win);
    if (win->testAttribute(Qt::WA_OpaquePaintEvent) || win->testAttribute(Qt::WA_PaintOnScreen)) {
        setOpaque(true);
        return;
    }

    if (qFuzzyCompare(static_cast<float>(win->windowOpacity()), 1.0f)) {
        const QPalette &pal = win->palette();

        if (win->autoFillBackground()) {
            const QBrush &autoFillBrush = pal.brush(win->backgroundRole());
            if (autoFillBrush.style() != Qt::NoBrush && autoFillBrush.isOpaque()) {
                setOpaque(true);
                return;
            }
        }

        if (win->isWindow() && !win->testAttribute(Qt::WA_NoSystemBackground)) {
            const QBrush &windowBrush = win->palette().brush(QPalette::Window);
            if (windowBrush.style() != Qt::NoBrush && windowBrush.isOpaque()) {
                setOpaque(true);
                return;
            }
        }
    }
    setOpaque(false);
}
Exemplo n.º 2
0
//==============================================================================
GuitarNeckComponent::GuitarNeckComponent (MidiKeyboardState& state_)
    : state (state_),
      xOffset (0),
      midiChannel (1),
      midiInChannelMask (0xffff),
      velocity (1.0f),
	  numStrings(6),
	  numFrets(24),
	  dotSize(13.f),
      rangeStart (0),
      rangeEnd (24),
      firstFret (0),
      mouseDragging (false),
      octaveNumForMiddleC (3)
{
	setNumFrets(24);
	setNumStrings(6);

	for (int i=0;i<maxStrings;i++) {
		stringNote[i] = -1;
		currentlyFrettedFret[i]=-1;
	}
	stringNote[0] = 64;
	stringNote[1] = 59;
	stringNote[2] = 55;
	stringNote[3] = 50;
	stringNote[4] = 45;
	stringNote[5] = 40;

    setOpaque (true);
    setWantsKeyboardFocus (false);
    state.addListener (this);
}
Exemplo n.º 3
0
BEGIN_JUCE_NAMESPACE

//==============================================================================
Joystick::Joystick()
  : Component ("Joystick"),
    current_x (0),
    current_y (0),
    x_min (0),
    x_max (1),
    y_min (0),
    y_max (1),
    backgroundColour (Colours::black),
    sendChangeOnlyOnRelease (false),
    holdOnMouseRelease (false),
    isVelocityBased (false),
    menuEnabled (true),
    menuShown (false),
    mouseWasHidden (false),
    numDecimalPlaces (4)
{
    setOpaque (true);
    setWantsKeyboardFocus (true);

    calculateRatio();
    calculateSnapBack();
}
Exemplo n.º 4
0
BEGIN_JUCE_NAMESPACE

#include "juce_TooltipWindow.h"
#include "../windows/juce_ComponentPeer.h"
#include "../../../core/juce_Time.h"
#include "../../../threads/juce_Process.h"
#include "../lookandfeel/juce_LookAndFeel.h"
#include "../juce_Desktop.h"
#include "../mouse/juce_MouseInputSource.h"


//==============================================================================
TooltipWindow::TooltipWindow (Component* const parentComponent,
                              const int millisecondsBeforeTipAppears_)
    : Component ("tooltip"),
      millisecondsBeforeTipAppears (millisecondsBeforeTipAppears_),
      mouseClicks (0),
      lastHideTime (0),
      lastComponentUnderMouse (0),
      changedCompsSinceShown (true)
{
    if (Desktop::getInstance().getMainMouseSource().canHover())
        startTimer (123);

    setAlwaysOnTop (true);
    setOpaque (true);

    if (parentComponent != 0)
        parentComponent->addChildComponent (this);
}
Exemplo n.º 5
0
//==============================================================================
GraphEditorPanel::GraphEditorPanel (FilterGraph& graph_)
    : graph (graph_),
      draggingConnector (nullptr)
{
    graph.addChangeListener (this);
    setOpaque (true);
}
Exemplo n.º 6
0
XYPad::XYPad() {
  mouse_down_ = false;
  x_slider_ = nullptr;
  y_slider_ = nullptr;
  active_ = true;
  setOpaque(true);
}
Exemplo n.º 7
0
//==============================================================================
GraphComponent::GraphComponent (HostFilterComponent* owner_)
    : host (0),
      owner (owner_),
      inputs (0),
      outputs (0),
      lassoComponent (0),
      currentClickedNode (0),
      currentFont (11.0f, Font::plain),
      defaultNodeWidth (50),
      defaultNodeHeight (50),
      leftToRight (true),
      somethingIsBeingDraggedOver (false),
      dragStartX (0),
      dragStartY (0)
{
    DBG ("GraphComponent::GraphComponent");

    setOpaque (true);
    //setBufferedToImage (true);
    setWantsKeyboardFocus (true);

    // setup config options
    leftToRight = Config::getInstance ()->graphLeftToRight;

    if (leftToRight)
    {
        defaultNodeWidth = JOST_GRAPH_NODE_HEIGHT;
        defaultNodeHeight = JOST_GRAPH_NODE_WIDTH;
    }
    else
    {
        defaultNodeWidth = JOST_GRAPH_NODE_WIDTH;
        defaultNodeHeight = JOST_GRAPH_NODE_HEIGHT;
    }
}
//==============================================================================
ProjectContentComponent::ProjectContentComponent()
    : project (nullptr),
      currentDocument (nullptr),
      sidebarTabs (TabbedButtonBar::TabsAtTop)
{
    setOpaque (true);
    setWantsKeyboardFocus (true);

    addAndMakeVisible (logo = new LogoComponent());
    addAndMakeVisible (header = new HeaderComponent());

    addAndMakeVisible (fileNameLabel = new Label());
    fileNameLabel->setJustificationType (Justification::centred);

    sidebarSizeConstrainer.setMinimumWidth (200);
    sidebarSizeConstrainer.setMaximumWidth (500);

    sidebarTabs.setOutline (0);
    sidebarTabs.getTabbedButtonBar().setMinimumTabScaleFactor (0.5);

    ProjucerApplication::getApp().openDocumentManager.addListener (this);

    Desktop::getInstance().addFocusChangeListener (this);
    startTimer (1600);
}
Exemplo n.º 9
0
AverageMeter::AverageMeter(const String& componentName, int posX, int posY, int width, int CrestFactor, int nNumChannels, int segment_height)
{
    setName(componentName);

    // this component blends in with the background
    setOpaque(false);

    nInputChannels = nNumChannels;
    nCrestFactor = CrestFactor;

    nNumberOfBars = 8;
    nSegmentHeight = segment_height;
    nMeterPositionBottom = 21;
    nMeterHeight = nNumberOfBars * nSegmentHeight + 1;

    nPosX = posX;
    nPosY = posY;
    nWidth = width;
    nHeight = nMeterHeight + nMeterPositionBottom;

    int nPositionX = 0;
    LevelMeters = new MeterBarAverage*[nInputChannels];

    for (int nChannel = 0; nChannel < nInputChannels; nChannel++)
    {
        nPositionX = TraKmeter::TRAKMETER_LABEL_WIDTH + nChannel * (TraKmeter::TRAKMETER_SEGMENT_WIDTH + 6) - 3;

        LevelMeters[nChannel] = new MeterBarAverage("Level Meter Average #" + String(nChannel), nPositionX, 0, TraKmeter::TRAKMETER_SEGMENT_WIDTH, nNumberOfBars, nCrestFactor, nSegmentHeight, true);
        addAndMakeVisible(LevelMeters[nChannel]);
    }
}
Exemplo n.º 10
0
BEGIN_JUCE_NAMESPACE

#include "jucetice_Joystick.h"
#include "../../text/juce_LocalisedStrings.h"
#include "../../gui/components/menus/juce_PopupMenu.h"


//==============================================================================
Joystick::Joystick()
  : Component (T("Joystick")),
    current_x (0),
    current_y (0),
    x_min (0),
    x_max (1),
    y_min (0),
    y_max (1),
    backgroundColour (Colours::black),
    sendChangeOnlyOnRelease (false),
    holdOnMouseRelease (false),
    isVelocityBased (false),
    menuEnabled (true),
    menuShown (false),
    mouseWasHidden (false),
    numDecimalPlaces (4)
{
    setOpaque (true);
    setWantsKeyboardFocus (true);

    calculateRatio();
    calculateSnapBack();
}
//==============================================================================
GenericAudioProcessorEditor::GenericAudioProcessorEditor (AudioProcessor* const owner_)
    : AudioProcessorEditor (owner_)
{
    jassert (owner_ != nullptr);
    setOpaque (true);

    addAndMakeVisible (&panel);

    Array <PropertyComponent*> params;

    const int numParams = owner_->getNumParameters();
    int totalHeight = 0;

    for (int i = 0; i < numParams; ++i)
    {
        String name (owner_->getParameterName (i));
        if (name.trim().isEmpty())
            name = "Unnamed";

        ProcessorParameterPropertyComp* const pc = new ProcessorParameterPropertyComp (name, *owner_, i);
        params.add (pc);
        totalHeight += pc->getPreferredHeight();
    }

    panel.addProperties (params);

    setSize (400, jlimit (25, 400, totalHeight));
}
WebBrowserComponent::WebBrowserComponent (const bool unloadPageWhenBrowserIsHidden_)
    : browser (nullptr),
      blankPageShown (false),
      unloadPageWhenBrowserIsHidden (unloadPageWhenBrowserIsHidden_)
{
    setOpaque (true);
}
Exemplo n.º 13
0
Viewport::Viewport():
    mMap(0),
    mMouseX(0),
    mMouseY(0),
    mPixelViewX(0.0f),
    mPixelViewY(0.0f),
    mDebugFlags(0),
    mPlayerFollowMouse(false),
    mLocalWalkTime(-1),
    mHoverBeing(0),
    mHoverItem(0)
{
    setOpaque(false);
    addMouseListener(this);

    mScrollLaziness = config.getIntValue("ScrollLaziness");
    mScrollRadius = config.getIntValue("ScrollRadius");
    mScrollCenterOffsetX = config.getIntValue("ScrollCenterOffsetX");
    mScrollCenterOffsetY = config.getIntValue("ScrollCenterOffsetY");

    mPopupMenu = new PopupMenu;
    mBeingPopup = new BeingPopup;

    setFocusable(true);

    listen(Event::ConfigChannel);
    listen(Event::ActorSpriteChannel);
}
//==============================================================================
MidiKeyboardComponent::MidiKeyboardComponent (MidiKeyboardState& state_,
                                              const Orientation orientation_)
    : state (state_),
      xOffset (0),
      blackNoteLength (1),
      keyWidth (16.0f),
      orientation (orientation_),
      midiChannel (1),
      midiInChannelMask (0xffff),
      velocity (1.0f),
      noteUnderMouse (-1),
      mouseDownNote (-1),
      rangeStart (0),
      rangeEnd (127),
      firstKey (12 * 4),
      canScroll (true),
      mouseDragging (false),
      useMousePositionForVelocity (true),
      keyMappingOctave (6),
      octaveNumForMiddleC (3)
{
    addChildComponent (scrollDown = new MidiKeyboardUpDownButton (*this, -1));
    addChildComponent (scrollUp   = new MidiKeyboardUpDownButton (*this, 1));

    // initialise with a default set of querty key-mappings..
    const char* const keymap = "awsedftgyhujkolp;";

    for (int i = String (keymap).length(); --i >= 0;)
        setKeyPressForNote (KeyPress (keymap[i], 0, 0), i);

    setOpaque (true);
    setWantsKeyboardFocus (true);

    state.addListener (this);
}
Exemplo n.º 15
0
 CustomComponentHolder (Component* const customComp)
 {
     setVisible (true);
     setOpaque (true);
     addAndMakeVisible (customComp);
     setSize (jlimit (20, 800, customComp->getWidth()), customComp->getHeight());
 }
 MidiKeyboardUpDownButton (MidiKeyboardComponent& comp, const int d)
     : Button (String::empty),
       owner (comp),
       delta (d)
 {
     setOpaque (true);
 }
 MidiKeyboardUpDownButton (MidiKeyboardComponent& owner_, const int delta_)
     : Button (String::empty),
       owner (owner_),
       delta (delta_)
 {
     setOpaque (true);
 }
Exemplo n.º 18
0
TextBox::TextBox() :
    mTextColor(&Theme::getThemeColor(Theme::TEXT))
{
    setOpaque(false);
    setFrameSize(0);
    mMinWidth = getWidth();
}
TracktionMarketplaceUnlockForm::TracktionMarketplaceUnlockForm (TracktionMarketplaceStatus& s,
                                                                const String& userInstructions)
    : status (s),
      message (String(), userInstructions),
      passwordBox (String(), getDefaultPasswordChar()),
      registerButton (TRANS("Register")),
      cancelButton (TRANS ("Cancel"))
{
    // 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);
    addAndMakeVisible (cancelButton);

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

    lookAndFeelChanged();
    setSize (500, 250);
}
Exemplo n.º 20
0
CharacterModule::CharacterModule() : characterPortrait(NULL)
{
   characterStats = new gcn::contrib::AdjustingContainer();
   characterNameLabel = new edwt::Label();
   characterHPLabel = new edwt::Label();
   characterSPLabel = new edwt::Label();

   characterNameLabel->setForegroundColor(0xFFFFFF);
   characterHPLabel->setForegroundColor(0xFFFFFF);
   characterSPLabel->setForegroundColor(0xFFFFFF);

   characterPortrait = new edwt::Icon();

   characterStats->setNumberOfColumns(1);
   characterStats->setColumnAlignment(0, gcn::contrib::AdjustingContainer::LEFT);
   characterStats->add(characterNameLabel);
   characterStats->add(characterHPLabel);
   characterStats->add(characterSPLabel);
   characterStats->setOpaque(false);

   setNumberOfColumns(2);
   setColumnAlignment(0, gcn::contrib::AdjustingContainer::LEFT);
   setColumnAlignment(1, gcn::contrib::AdjustingContainer::RIGHT);
   setHorizontalSpacing(10);
   setPadding(5, 5, 5, 5);

   add(characterPortrait);
   add(characterStats);
   addMouseListener(this);
   setOpaque(false);
}
Exemplo n.º 21
0
    ProgramAudioProcessorEditor (AudioProcessor* const p)
        : AudioProcessorEditor (p)
    {
        jassert (p != nullptr);
        setOpaque (true);

        addAndMakeVisible (panel);

        Array<PropertyComponent*> programs;

        const int numPrograms = p->getNumPrograms();
        int totalHeight = 0;

        for (int i = 0; i < numPrograms; ++i)
        {
            String name (p->getProgramName (i).trim());

            if (name.isEmpty())
                name = "Unnamed";

            ProcessorProgramPropertyComp* const pc = new ProcessorProgramPropertyComp (name, *p, i);
            programs.add (pc);
            totalHeight += pc->getPreferredHeight();
        }

        panel.addProperties (programs);

        setSize (400, jlimit (25, 400, totalHeight));
    }
Exemplo n.º 22
0
AudioOptions::AudioOptions(RootWidget * top) : gcn::Window("Audio"),
                                               m_top(top)
{
  gcn::Color base = getBaseColor();
  base.a = 128;
  setBaseColor(base);

  setOpaque(true);

  gcn::Box * vbox = new gcn::VBox(6);
  m_widgets.push_back(SPtr<gcn::Widget>(vbox));

  gcn::Box * hbox = new gcn::HBox(6);
  m_widgets.push_back(SPtr<gcn::Widget>(hbox));

  gcn::Button * b = new gcn::Button("Apply");
  m_widgets.push_back(SPtr<gcn::Widget>(b));
  b->setActionEventId("apply");
  b->setFocusable(false);
  b->addActionListener(this);
  hbox->pack(b);

  b = new gcn::Button("Close");
  m_widgets.push_back(SPtr<gcn::Widget>(b));
  b->setActionEventId("close");
  b->setFocusable(false);
  b->addActionListener(this);
  hbox->pack(b);

  vbox->pack(hbox);

  add(vbox);

  resizeToContent();
}
Exemplo n.º 23
0
FilterIOConfigurationWindow::FilterIOConfigurationWindow (AudioProcessor& p)
   : AudioProcessorEditor (&p),
     title ("title", p.getName())
{
    setOpaque (true);

    title.setFont (title.getFont().withStyle (Font::bold));
    addAndMakeVisible (title);

    {
        ScopedLock renderLock (p.getCallbackLock());
        p.suspendProcessing (true);
        p.releaseResources();
    }

    if (p.getBusCount (true)  > 0 || p.canAddBus (true))
    {
        inConfig.reset (new InputOutputConfig (*this, true));
        addAndMakeVisible (inConfig.get());
    }

    if (p.getBusCount (false) > 0 || p.canAddBus (false))
    {
        outConfig.reset (new InputOutputConfig (*this, false));
        addAndMakeVisible (outConfig.get());
    }

    currentLayout = p.getBusesLayout();
    setSize (400, (inConfig != nullptr && outConfig != nullptr ? 160 : 0) + 200);
}
Exemplo n.º 24
0
SettingsWindow::SettingsWindow ()
: DialogWindow (TRANS("Settings"),
                Colour (192,192,192),
                true,
                false) // do not add to desktop yet
{
  SettingsPanel* contentComp = new SettingsPanel;

  setOpaque (true);
  //setDropShadowEnabled (false);

  // iOS doesn't have a native title bar
  //setUsingNativeTitleBar (true);

  // must happen AFTER setUsingNativeTitleBar()
  Component::addToDesktop (getDesktopWindowStyleFlags());

  // must happen after addToDesktop()
  setContentOwned (contentComp, true);

  centreWithSize (getWidth(), getHeight());
  setVisible (true);

  enterModalState ();
}
Exemplo n.º 25
0
FullInterface::FullInterface(mopo::control_map controls, mopo::output_map modulation_sources,
                             mopo::output_map mono_modulations,
                             mopo::output_map poly_modulations,
                             MidiKeyboardState* keyboard_state) : SynthSection("full_interface") {
  addSubSection(synthesis_interface_ = new SynthesisInterface(controls, keyboard_state));
  addSubSection(arp_section_ = new ArpSection("ARP"));

  addSlider(beats_per_minute_ = new SynthSlider("beats_per_minute"));
  beats_per_minute_->setSliderStyle(Slider::LinearBar);
  beats_per_minute_->setTextBoxStyle(Slider::TextBoxAbove, false, 150, 20);
  beats_per_minute_->setColour(Slider::textBoxTextColourId, Colours::white);

  addAndMakeVisible(global_tool_tip_ = new GlobalToolTip());

  addAndMakeVisible(patch_selector_ = new PatchSelector());
  addAndMakeVisible(oscilloscope_ = new Oscilloscope());

  setAllValues(controls);
  createModulationSliders(modulation_sources, mono_modulations, poly_modulations);

  logo_button_ = new ImageButton("logo_button");
  const Desktop::Displays::Display& display = Desktop::getInstance().getDisplays().getMainDisplay();
  if (display.scale > 1.5) {
    Image helm = ImageCache::getFromMemory(BinaryData::helm_icon_128_2x_png,
                                           BinaryData::helm_icon_128_2x_pngSize);
    logo_button_->setImages(false, true, false,
                            helm, 1.0, Colours::transparentBlack,
                            helm, 1.0, Colour(0x11ffffff),
                            helm, 1.0, Colour(0x11000000));
  }
  else {
    Image helm_small = ImageCache::getFromMemory(BinaryData::helm_icon_32_2x_png,
                                                 BinaryData::helm_icon_32_2x_pngSize);
    logo_button_->setImages(false, true, false,
                            helm_small, 1.0, Colours::transparentBlack,
                            helm_small, 1.0, Colour(0x11ffffff),
                            helm_small, 1.0, Colour(0x11000000));
  }
  addAndMakeVisible(logo_button_);
  logo_button_->addListener(this);

  addChildComponent(patch_browser_ = new PatchBrowser());
  patch_selector_->setBrowser(patch_browser_);

  addChildComponent(save_section_ = new SaveSection("save_section"));
  patch_browser_->setSaveSection(save_section_);
  patch_selector_->setSaveSection(save_section_);

  addChildComponent(delete_section_ = new DeleteSection("delete_section"));
  patch_browser_->setDeleteSection(delete_section_);

  about_section_ = new AboutSection("about");
  addChildComponent(about_section_);

  update_check_section_ = new UpdateCheckSection("update_check");
  addChildComponent(update_check_section_);

  setOpaque(true);
}
Exemplo n.º 26
0
MLPluginView::MLPluginView (MLPluginProcessor* const ownerProcessor, MLPluginController* pR) :
	MLAppView(pR, pR),
	mpProcessor(ownerProcessor),
	mpController(pR)
{
	MLWidget::setComponent(this);
	setOpaque (false);
}
Exemplo n.º 27
0
void TestComponent::resized()
{
    if (Component* const c = getChildComponent (0))
    {
        setOpaque (c->isOpaque());
        c->setBounds (getLocalBounds());
    }
}
//==============================================================================
MultiDocumentPanel::MultiDocumentPanel()
    : mode (MaximisedWindowsWithTabs),
      backgroundColour (Colours::lightblue),
      maximumNumDocuments (0),
      numDocsBeforeTabsUsed (0)
{
    setOpaque (true);
}
//==============================================================================
WebBrowserComponent::WebBrowserComponent (const bool unloadPageWhenBrowserIsHidden_)
    : browser (nullptr),
      blankPageShown (false),
      unloadPageWhenBrowserIsHidden (unloadPageWhenBrowserIsHidden_)
{
    setOpaque (true);
    addAndMakeVisible (browser = new WebBrowserComponentInternal());
}
Exemplo n.º 30
0
ParamView::ParamView(PMixAudioEngine& audioEngine)
: audioEngine (audioEngine)
{
  audioEngine.getDoc().addChangeListener (this);
  
  setOpaque (true);
  addAndMakeVisible (&panel);
}