コード例 #1
0
ファイル: ObjectViewer.cpp プロジェクト: ma-tech/WlzQtApps
ObjectViewer::
ObjectViewer(
  ObjectViewerModel *objectViewerModel,
  bool is3D,
  bool isBlending):
ObjectSimpleViewer(is3D, isBlending),
m_camera(NULL),
m_sensor(NULL), 
m_linkedTo(NULL),
m_linkedPlaneTo(NULL),
m_ID(-1),
m_linkedViewerID(-1),
m_linkedPlaneID(-1)
{
  if(is3D)
  {
    m_camera = new SoPerspectiveCamera;
  }
  else
  {
    m_camera = new Camera2D;
  }

  // set camera viewpoint to match Woolz viewing point
  m_camera->position = SbVec3f(0, 0, -1);
  m_camera->pointAt(SbVec3f(0, 0, 0), SbVec3f(0, -1, 0));
  m_camera->ref();

  root->insertChild(m_camera, 1);// has to be added before view root
  m_viewer->setCamera(m_camera);

  if(m_sensor)     //make sure no sensor was allocated
  {
    m_sensor->detach();
    delete m_sensor;
    m_sensor = NULL;
  }
  m_sensor = new SoNodeSensor(cameraCB, this);
  m_sensor->attach(m_camera);

  //this has to go in the Editor
  connect(this, SIGNAL(removedViewerStart()),
          objectViewerModel, SLOT(removedViewerStart()));
  connect(this, SIGNAL(removedViewerFinished()),
          objectViewerModel, SLOT(removedViewerFinished()));
  connect(this, SIGNAL(addedView(ObjectView *)),
          objectViewerModel, SLOT(addedView(ObjectView *)));
  connect(this, SIGNAL(changedViewer()),
          objectViewerModel, SLOT(changedViewer()));

  connect(objectViewerModel, SIGNAL(setBackgroundColour()),
          this, SLOT(setBackgroundColour()));

  m_blinkButton->setVisible(true);
}
コード例 #2
0
ファイル: WAG_Button.cpp プロジェクト: SweetheartSquad/O-Jam
void WAG_Button::update(Step * _step){
	TextArea::update(_step);
	if(isHovered){
		if(isDown){
			setBackgroundColour(0, -1, -1);
			//setText(downLabel);
		}else{
			setBackgroundColour(-1, 0, -1);
			//setText(overLabel);
		}
	}else{
		setBackgroundColour(-1, -1, 0);
		//setText(normalLabel);
	}
}
コード例 #3
0
ファイル: juce_ResizableWindow.cpp プロジェクト: Neknail/JUCE
ResizableWindow::ResizableWindow (const String& name, Colour bkgnd, bool shouldAddToDesktop)
    : TopLevelWindow (name, shouldAddToDesktop)
{
    setBackgroundColour (bkgnd);

    initialise (shouldAddToDesktop);
}
コード例 #4
0
ファイル: SaveButton.cpp プロジェクト: NanoBreeze/TCP-Chess
SaveButton::SaveButton(int x, int y)
{
	setBackgroundColour(sf::Color::Green);
	setText("Save");
	setTextSize(30);
	setTextColor(sf::Color::Black);
	setPosition(x, y);
}
コード例 #5
0
Effector::Effector(BulletWorld* _world, CharacterLimbSolver * _solver) : NodeUI(_world) {
	solver = _solver;
	mouseEnabled = true;
	active = false;
	setBackgroundColour(1, 1, 1, 1);
	setWidth(25);
	setHeight(25);

	eventManager->addEventListener("click", [this](sweet::Event * event){
		active = !active;
		if(active) {
			setBackgroundColour(1, 0, 0);
		}else {
			setBackgroundColour(1, 1, 1);
		}
	});
}
コード例 #6
0
ファイル: main.cpp プロジェクト: AlexBeach/CGG
//------------------------------------------------------------------------------------------------------------------------------------
// called when we initialise the app
//------------------------------------------------------------------------------------------------------------------------------------
void init()
{
	// setting the background colour to a default grey!
	setBackgroundColour(0.6f, 0.6f, 0.7f);

	// turn off the internal maya camera (so we can use our own camera controls in 3D)
	disableMayaCamera();
}
コード例 #7
0
ファイル: MenuApp.cpp プロジェクト: DanNixon/Dilbert
/**
 * @brief Creates a new menu application.
 * @param itemSize Size of text for menu items (multiples of 8 pixels)
 * @param bgColour Background colour
 * @param textColour Text colour
 * @param iconColour CUrrent app selection colour
 */
MenuApp::MenuApp(uint8_t itemSize, uint16_t bgColour, uint16_t textColour, uint16_t iconColour)
    : App("App Menu")
    , m_itemSize(itemSize)
    , m_textColour(textColour)
    , m_iconColour(iconColour)
    , m_selectedAppIndex(0)
{
  setBackgroundColour(bgColour);
}
コード例 #8
0
Keyframe::Keyframe(BulletWorld * _bulletWorld, PD_Character * _character) :
	NodeUI(_bulletWorld),
	character(_character)
{
	step = new PD_CharacterAnimationStep();
	setWidth(20.f);
	setHeight(20.f);
	setBackgroundColour(1.f, 0.f, 0.f);
	marginRight.setPixelSize(5.0f);
	mouseEnabled = true;
}
コード例 #9
0
//==============================================================================
VstPluginWindow::VstPluginWindow (PluginEditorWindowHolder* owner_,
                                  BasePlugin* plugin_)
  : DialogWindow (String::empty, Colours::beige, true, false),
    plugin (0),
    owner (owner_),
    specialEditor (0),
    nativeEditor (0),
    externalEditor (0),
    content (0)
{
    DBG ("VstPluginWindow::VstPluginWindow");

    // add to desktop
    addToDesktop (getDesktopWindowStyleFlags());

    // setup window default values
    setTitleBarHeight (24);
    centreWithSize (400, 300);
    setWantsKeyboardFocus (true);
    setBackgroundColour (Config::getInstance ()->getColour (T("mainBackground")));

    // try to move the window to its old position
    int oldX = -1, oldY = -1, oldW = -1, oldH = -1, lastPage = 0;
    if (plugin_)
    {
        oldX = plugin_->getIntValue (PROP_WINDOWXPOS, -1);
        oldY = plugin_->getIntValue (PROP_WINDOWYPOS, -1);
        oldW = plugin_->getIntValue (PROP_WINDOWWSIZE, -1);
        oldH = plugin_->getIntValue (PROP_WINDOWHSIZE, -1);
        lastPage = plugin_->getIntValue (PROP_WINDOWPAGE, 0);
    }

    // try to move the window to its old position
    if (oldX >= 0 && oldY >= 0)
        setTopLeftPosition (oldX, oldY);

    // try to set the window to its old size
    if ((lastPage == 0 && ! externalEditor)
        || (lastPage == 1 && externalEditor))
    {
        if (oldW >= 0 && oldY >= 0)
            setSize (oldW, oldH);
    }

    // default plugin to open
    setPlugin (plugin_);
    
    // setMenuBar here, after setting the plugin, so the plugin's menu items are there immediately
    setMenuBar (this, getMenuBarHeight ());

    // restore window to front
    toFront (false);
    setVisible (true);
}
コード例 #10
0
ファイル: Slider.cpp プロジェクト: SweetheartSquad/S-Tengine2
Slider::Slider(BulletWorld * _world, float _defaultValue, float _valueMin, float _valueMax, bool _horizontal, bool _flipped) :
	NodeUI(_world),
	layout(_horizontal ? (LinearLayout *)new HorizontalLinearLayout(_world) : (LinearLayout *)new VerticalLinearLayout(_world)),
	fill(new NodeUI(_world)),
	thumb(new NodeUI(_world)),
	valueMin(_valueMin),
	valueMax(_valueMax),
	value(0),
	prevValue(0),
	horizontal(_horizontal),
	stepped(false),
	valueStep(0),
	flipped(_flipped)
{
	setBackgroundColour(0.f, 0.f, 0.f);

	if(horizontal){
		layout->horizontalAlignment = kLEFT;
		//setRationalWidth(1.f);
		setHeight(10);

		fill->setRationalHeight(1.f, this);
		thumb->setRationalHeight(1.f, this);
		thumb->setWidth(thumb->getHeight(true, false));
		thumb->background->meshTransform->translate(-0.5f, 0, 0);
		layout->addChild(fill);
		layout->addChild(thumb);
	}else{
		layout->verticalAlignment = kBOTTOM;
		//setRationalHeight(1.f);
		setWidth(10);
		fill->setRationalWidth(1.f, this);
		thumb->setRationalWidth(1.f, this);
		thumb->setHeight(thumb->getWidth(true, false));
		thumb->background->meshTransform->translate(0, -0.5f, 0);
		layout->addChild(thumb);
		layout->addChild(fill);
	}

	fill->setBackgroundColour(1.f, 1.f, 1.f);
	thumb->setBackgroundColour(0.5f, 1.f, 1.f, 0.5f);

	layout->setRationalWidth(1.f, this);
	layout->setRationalHeight(1.f, this);
	addChild(layout);

	setMouseEnabled(true);
	setValue(_defaultValue);
}
コード例 #11
0
ResizableWindow::ResizableWindow (const String& name, Colour bkgnd, bool shouldAddToDesktop)
    : TopLevelWindow (name, shouldAddToDesktop),
      ownsContentComponent (false),
      resizeToFitContent (false),
      fullscreen (false),
      canDrag (true),
      dragStarted (false),
      constrainer (nullptr)
     #if JUCE_DEBUG
      , hasBeenResized (false)
     #endif
{
    setBackgroundColour (bkgnd);

    initialise (shouldAddToDesktop);
}
コード例 #12
0
ファイル: juce_ResizableWindow.cpp プロジェクト: AGenews/GUI
ResizableWindow::ResizableWindow (const String& name,
                                  const Colour& backgroundColour_,
                                  const bool addToDesktop_)
    : TopLevelWindow (name, addToDesktop_),
      ownsContentComponent (false),
      resizeToFitContent (false),
      fullscreen (false),
      constrainer (nullptr)
     #if JUCE_DEBUG
      , hasBeenResized (false)
     #endif
{
    setBackgroundColour (backgroundColour_);

    initialise (addToDesktop_);
}
コード例 #13
0
ファイル: display.cpp プロジェクト: MuesliReep/MicroFlip
void Display::drawHeader() {
  resetAttributes();

  // Set background to blue
//  std::cout << "\x1b[44m";
  setBackgroundColour(BLUE);

  // Set foreground to white
  std::cout << "\x1b[37m";

  // Draw header
  for(int i=0; i<columns; i++) {
    std::cout << ' ';
  }

  currentLine = 2;
}
コード例 #14
0
void PreferencesPane::paint (Graphics &g)
{    
	// The PreferencesPane only has a paint function to enable the
	// JUCE_LIVE_CONSTANT functionality. Sadly, this makes the GUI of the host (!!!)
	// as well as the GUI of the LUFSMeter non-responsive with Reaper on Windows.
	// Therefore the "#ifndef    JUCE_ENABLE_LIVE_CONSTANT_EDITOR" has been added.

#if JUCE_ENABLE_LIVE_CONSTANT_EDITOR
	setBackgroundColour (JUCE_LIVE_CONSTANT (Colours::white.withAlpha (0.5f)));
#endif

	AnimatedSidePanel::paint (g);

#if JUCE_ENABLE_LIVE_CONSTANT_EDITOR
	loudnessBarSize.setColour (Slider::thumbColourId, JUCE_LIVE_CONSTANT (Colours::black));
	loudnessBarRange.setColour (Slider::thumbColourId, JUCE_LIVE_CONSTANT (Colours::black));
	loudnessBarRange.setColour (Slider::trackColourId, JUCE_LIVE_CONSTANT (Colours::black));

	Colour loudnessHistoryGroupColour = JUCE_LIVE_CONSTANT (Colour (0xff000000)); // (Colour (0xff00ad00)); //Colour (0xff7f7f7f);
	loudnessHistoryGroup.setColour (GroupComponent::outlineColourId, loudnessHistoryGroupColour);
	loudnessHistoryGroup.setColour (GroupComponent::textColourId, loudnessHistoryGroupColour);

	Colour textColourOn = JUCE_LIVE_CONSTANT (Colours::black);
	Colour buttonOnColour = JUCE_LIVE_CONSTANT (Colour (0xffffff00));
	Colour textColourOff = JUCE_LIVE_CONSTANT (Colour (0xff9a9a9a));
	Colour buttonOffColour = JUCE_LIVE_CONSTANT (Colour (0xff383838));
	showIntegratedLoudnessHistory.setColour (TextButton::buttonOnColourId, Colours::yellow.darker ().darker ());
	showIntegratedLoudnessHistory.setColour (TextButton::textColourOnId, textColourOn);
	showIntegratedLoudnessHistory.setColour (TextButton::buttonColourId, buttonOffColour);
	showIntegratedLoudnessHistory.setColour (TextButton::textColourOffId, textColourOff);
	showLoudnessRangeHistory.setColour (TextButton::buttonOnColourId, Colours::blue.darker ());
	showLoudnessRangeHistory.setColour (TextButton::textColourOnId, textColourOn);
	showLoudnessRangeHistory.setColour (TextButton::buttonColourId, buttonOffColour);
	showLoudnessRangeHistory.setColour (TextButton::textColourOffId, textColourOff);
	showShortTimeLoudnessHistory.setColour (TextButton::buttonOnColourId, Colours::green);
	showShortTimeLoudnessHistory.setColour (TextButton::textColourOnId, textColourOn);
	showShortTimeLoudnessHistory.setColour (TextButton::buttonColourId, buttonOffColour);
	showShortTimeLoudnessHistory.setColour (TextButton::textColourOffId, textColourOff);
	showMomentaryLoudnessHistory.setColour (TextButton::buttonOnColourId, Colours::darkgreen);
	showMomentaryLoudnessHistory.setColour (TextButton::textColourOnId, textColourOn);
	showMomentaryLoudnessHistory.setColour (TextButton::buttonColourId, buttonOffColour);
	showMomentaryLoudnessHistory.setColour (TextButton::textColourOffId, textColourOff);
#endif
}
コード例 #15
0
ファイル: main.cpp プロジェクト: igneus/particled
/** Parse command line options */
void parseOptions(int argc, char *argv[], Options &options)
{
  static struct option long_options[] = {
    {"help", no_argument, 0, 'h'},
    {"win-width", required_argument, 0, 'W'},
    {"win-height", required_argument, 0, 'H'},
    {"effect-x", required_argument, 0, 'x'},
    {"effect-y", required_argument, 0, 'y'},
    {"quit-on-end", no_argument, 0, 'q'},
    {"loop", no_argument, 0, 'l'},
    {"datadir", required_argument, 0, 'd'},
    {"bg-colour", required_argument, 0, 'b'},
    {0, 0, 0, 0}
  };

  const char *optstring = "hW:H:x:y:qld:b:";

  while (1) {
    int result = getopt_long(argc, argv, optstring, long_options, NULL);

    if (result == -1)
      break;

    switch (result) {
    case 'h':
      options.printHelpAndExit = true;
      break;
    case 'W':
      options.winWidth = (int) atoi(optarg);
      break;
    case 'H':
      options.winHeight = (int) atoi(optarg);
      break;
    case 'x':
      options.effectX = (int) atoi(optarg);
      break;
    case 'y':
      options.effectY = (int) atoi(optarg);
      break;
    case 'q':
      options.quitOnEffectEnd = true;
      if (options.loop) {
	logger->log("Error: --loop shouldn't be used together with --quit-on-end");
      }
      break;
    case 'l':
      options.loop = true;
      if (options.quitOnEffectEnd) {
	logger->log("Error: --quit-on-end shouldn't be used together with --loop");
      }
      break;
    case 'd':
      options.dataDir = optarg;
      break;
    case 'b':
      setBackgroundColour(optarg);
      break;
    default:
      break;
    }
  }

  // non-option argument: name of effect file
  if (optind < argc) {
    // std::cout << (argc - optind) << std::endl;
    options.effectFile = argv[optind];
  }
}
コード例 #16
0
ファイル: jucer_MainWindow.cpp プロジェクト: Frongo/JUCE
 MultiDocHolder()
 {
     setBackgroundColour (Colour (0xffe6f0ff));
 }
コード例 #17
0
//==============================================================================
PreferencesPane::PreferencesPane (const Value& loudnessBarWidth,
                                  const Value& loudnessBarMinValue,
                                  const Value& loudnessBarMaxValue,
                                  const Value& showIntegratedLoudnessHistoryValue,
                                  const Value& showLoudnessRangeHistoryValue,
                                  const Value& showShortTermLoudnessHistoryValue,
                                  const Value& showMomentaryLoudnessHistoryValue)
  : loudnessHistoryGroup (String::empty, "History Graph"),
    showIntegratedLoudnessHistory ("I"),
    showLoudnessRangeHistory("LRA"),
    showShortTimeLoudnessHistory ("S"),
    showMomentaryLoudnessHistory ("M")
{
    // Get the icons from the embedded zip.
    // ------------------------------------
    // Source: JuceDemo WidgetsDemo.cpp:616
    StringArray iconNames;
    OwnedArray<Drawable> iconsFromZipFile;
    
    const bool dontKeepInternalCopyOfData = false;
    MemoryInputStream iconsFileStream (BinaryData::icons_zip, BinaryData::icons_zipSize, dontKeepInternalCopyOfData);
    const bool dontDeleteStreamWhenDestroyed = false;
    ZipFile icons (&iconsFileStream, dontDeleteStreamWhenDestroyed);
    
    for (int i = 0; i < icons.getNumEntries(); ++i)
    {
        ScopedPointer<InputStream> svgFileStream (icons.createStreamForEntry (i));
        
        if (svgFileStream != 0)
        {
            // DBG(icons.getEntry(i)->filename);
            iconNames.add (icons.getEntry(i)->filename);
            iconsFromZipFile.add (Drawable::createFromImageDataStream (*svgFileStream));
        }
    }
    
    ScopedPointer<DrawableComposite> wrench = dynamic_cast <DrawableComposite*> (iconsFromZipFile [iconNames.indexOf ("wrenchByIonicons.svg")]->createCopy());
    AnimatedSidePanel::setCaptionAndIcon("Preferences", wrench);

    loudnessBarSizeLeftIcon = dynamic_cast <DrawableComposite*> (iconsFromZipFile [iconNames.indexOf ("barsWide.svg")]->createCopy());
    addAndMakeVisible (loudnessBarSizeLeftIcon);
    loudnessBarSizeRightIcon = dynamic_cast <DrawableComposite*> (iconsFromZipFile [iconNames.indexOf ("barsNarrow.svg")]->createCopy());
    addAndMakeVisible (loudnessBarSizeRightIcon);
    loudnessBarRangeLeftIcon = dynamic_cast <DrawableComposite*> (iconsFromZipFile [iconNames.indexOf ("rangeArrow.svg")]->createCopy());
    addAndMakeVisible (loudnessBarRangeLeftIcon);
    
    resized();
    
    
    const bool isReadOnly = false;
    const int textEntryBoxWidth = 0;
    const int textEntryBoxHeight = 0;
    
    loudnessBarSize.setRange (-300.0, -5.0, 1.0); // This value multiplied by -1 results in the used with
        // for each loudness bar. Negative values have been chosen to invert the behaviour of the slider
        // (left side: big bars, right side: small bars).
    loudnessBarSize.getValueObject().referTo(loudnessBarWidth);
    loudnessBarSize.setTextBoxStyle(Slider::NoTextBox, isReadOnly, textEntryBoxWidth, textEntryBoxHeight);
    loudnessBarSize.setColour(Slider::trackColourId, Colours::black);
    addAndMakeVisible (&loudnessBarSize);

    loudnessBarRange.setRange (-100, 0.0, 1.0);
    loudnessBarRange.getMinValueObject().referTo (loudnessBarMinValue);
    loudnessBarRange.getMaxValueObject().referTo (loudnessBarMaxValue);
    loudnessBarRange.setTextBoxStyle (Slider::NoTextBox, isReadOnly, textEntryBoxWidth, textEntryBoxHeight);
    loudnessBarRange.setPopupDisplayEnabled (true, this);
    loudnessBarRange.setTextValueSuffix (" LUFS");
    addAndMakeVisible (&loudnessBarRange);
    
    addAndMakeVisible (&loudnessHistoryGroup);
    
    showIntegratedLoudnessHistory.setClickingTogglesState (true);
    showIntegratedLoudnessHistory.getToggleStateValue().referTo (showIntegratedLoudnessHistoryValue);
    showIntegratedLoudnessHistory.setWantsKeyboardFocus (false);
    loudnessHistoryGroup.addAndMakeVisible (&showIntegratedLoudnessHistory);
    
    showLoudnessRangeHistory.setClickingTogglesState (true);
    showLoudnessRangeHistory.getToggleStateValue().referTo (showLoudnessRangeHistoryValue);
    showLoudnessRangeHistory.setWantsKeyboardFocus (false);
    loudnessHistoryGroup.addAndMakeVisible (&showLoudnessRangeHistory);
    
    showShortTimeLoudnessHistory.setClickingTogglesState (true);
    showShortTimeLoudnessHistory.getToggleStateValue().referTo (showShortTermLoudnessHistoryValue);
    showShortTimeLoudnessHistory.setWantsKeyboardFocus (false);
    loudnessHistoryGroup.addAndMakeVisible (&showShortTimeLoudnessHistory);
    
    showMomentaryLoudnessHistory.setClickingTogglesState (true);
    showMomentaryLoudnessHistory.getToggleStateValue().referTo (showMomentaryLoudnessHistoryValue);
    showMomentaryLoudnessHistory.setWantsKeyboardFocus (false);
    loudnessHistoryGroup.addAndMakeVisible (&showMomentaryLoudnessHistory);


	// Colours
	// -------

	setBackgroundColour (Colours::white.withAlpha (0.5f));

	loudnessBarSize.setColour (Slider::thumbColourId, Colours::black);
	loudnessBarRange.setColour (Slider::thumbColourId, Colours::black);
	loudnessBarRange.setColour (Slider::trackColourId, Colours::black);

	Colour loudnessHistoryGroupColour = Colour (0xff000000); // (Colour (0xff00ad00)); //Colour (0xff7f7f7f);
	loudnessHistoryGroup.setColour (GroupComponent::outlineColourId, loudnessHistoryGroupColour);
	loudnessHistoryGroup.setColour (GroupComponent::textColourId, loudnessHistoryGroupColour);

	Colour textColourOn = Colours::black;
	Colour buttonOnColour = Colour (0xffffff00);
	Colour textColourOff = Colour (0xff9a9a9a);
	Colour buttonOffColour = Colour (0xff383838);
	showIntegratedLoudnessHistory.setColour (TextButton::buttonOnColourId, Colours::yellow.darker ().darker ());
	showIntegratedLoudnessHistory.setColour (TextButton::textColourOnId, textColourOn);
	showIntegratedLoudnessHistory.setColour (TextButton::buttonColourId, buttonOffColour);
	showIntegratedLoudnessHistory.setColour (TextButton::textColourOffId, textColourOff);
	showLoudnessRangeHistory.setColour (TextButton::buttonOnColourId, Colours::blue.darker ());
	showLoudnessRangeHistory.setColour (TextButton::textColourOnId, textColourOn);
	showLoudnessRangeHistory.setColour (TextButton::buttonColourId, buttonOffColour);
	showLoudnessRangeHistory.setColour (TextButton::textColourOffId, textColourOff);
	showShortTimeLoudnessHistory.setColour (TextButton::buttonOnColourId, Colours::green);
	showShortTimeLoudnessHistory.setColour (TextButton::textColourOnId, textColourOn);
	showShortTimeLoudnessHistory.setColour (TextButton::buttonColourId, buttonOffColour);
	showShortTimeLoudnessHistory.setColour (TextButton::textColourOffId, textColourOff);
	showMomentaryLoudnessHistory.setColour (TextButton::buttonOnColourId, Colours::darkgreen);
	showMomentaryLoudnessHistory.setColour (TextButton::textColourOnId, textColourOn);
	showMomentaryLoudnessHistory.setColour (TextButton::buttonColourId, buttonOffColour);
	showMomentaryLoudnessHistory.setColour (TextButton::textColourOffId, textColourOff);
}
コード例 #18
0
void ObjectSimpleViewer::
init()
{
  setBackgroundColour();
}