void LLNearbyChatBar::onToggleNearbyChatPanel()
{
	LLView* nearby_chat = getChildView("nearby_chat");

	if (nearby_chat->getVisible())
	{
		if (!isMinimized())
		{
			mExpandedHeight = getRect().getHeight();
		}
		setResizeLimits(getMinWidth(), COLLAPSED_HEIGHT);
		nearby_chat->setVisible(FALSE);
		reshape(getRect().getWidth(), COLLAPSED_HEIGHT);
		enableResizeCtrls(true, true, false);
		storeRectControl();
	}
	else
	{
		nearby_chat->setVisible(TRUE);
		setResizeLimits(getMinWidth(), EXPANDED_MIN_HEIGHT);
		reshape(getRect().getWidth(), mExpandedHeight);
		enableResizeCtrls(true);
		storeRectControl();
	}

	gSavedSettings.setBOOL("nearbychat_history_visibility", mNearbyChat->getVisible());
}
Exemplo n.º 2
0
MLAppWindow::MLAppWindow() :
	mpAppView(0),
	DocumentWindow (MLProjectInfo::projectName,
	  Colour::fromHSV(0.5f, 0.0f, 0.30f, 1.f),
	  DocumentWindow::allButtons,
	  true),
	mpConstrainer(0),
	mUsingGL(false),
	mGridUnitsX(0.),
	mGridUnitsY(0.)
{
    setResizable(true, false);
	setResizeLimits (400, 300, 8192, 8192);

    commandManager.registerAllCommandsForTarget (JUCEApplication::getInstance());
    
    // this lets the command manager use keypresses that arrive in our window to send
    // out commands
    addKeyListener (commandManager.getKeyMappings());
    
	mpBorder = std::unique_ptr<MLAppBorder>(new MLAppBorder());
    setContentOwned(mpBorder.get()->getComponent(), false);
	
	mpConstrainer = new MLBoundsConstrainer();
	setConstrainer (mpConstrainer);

	setUsingNativeTitleBar (true);
        
    // tells our menu bar model that it should watch this command manager for
    // changes, and send change messages accordingly.
    //&mBorder->setApplicationCommandManagerToWatch (&commandManager);

    //setVisible (true);
}
void LLFloaterWebContent::open_media(const Params& p)
{
	// Specifying a mime type of text/html here causes the plugin system to skip the MIME type probe and just open a browser plugin.
	LLViewerMedia::proxyWindowOpened(p.target(), p.id());
	mWebBrowser->setHomePageUrl(p.url, HTTP_CONTENT_TEXT_HTML);
	mWebBrowser->setTarget(p.target);
	mWebBrowser->navigateTo(p.url, HTTP_CONTENT_TEXT_HTML, p.clean_browser);
	
	set_current_url(p.url);

	getChild<LLLayoutPanel>("status_bar")->setVisible(p.show_chrome);
	getChild<LLLayoutPanel>("nav_controls")->setVisible(p.show_chrome);
	bool address_entry_enabled = p.allow_address_entry && !p.trusted_content;
    mAllowNavigation = p.allow_back_forward_navigation;
	getChildView("address")->setEnabled(address_entry_enabled);
	getChildView("popexternal")->setEnabled(address_entry_enabled);

	if (!p.show_chrome)
	{
		setResizeLimits(100, 100);
	}

	if (!p.preferred_media_size().isEmpty())
	{
		getChild<LLLayoutStack>("stack1")->updateLayout();
		LLRect browser_rect = mWebBrowser->calcScreenRect();
		LLCoordWindow window_size;
		getWindow()->getSize(&window_size);
		
		geometryChanged(browser_rect.mLeft, window_size.mY - browser_rect.mTop, p.preferred_media_size().getWidth(), p.preferred_media_size().getHeight());
	}

}
Exemplo n.º 4
0
void LLMultiFloater::updateResizeLimits()
{
	// initialize minimum size constraint to the original xml values.
	S32 new_min_width = mOrigMinWidth;
	S32 new_min_height = mOrigMinHeight;

	computeResizeLimits(new_min_width, new_min_height);

	setResizeLimits(new_min_width, new_min_height);

	S32 cur_height = getRect().getHeight();
	S32 new_width = llmax(getRect().getWidth(), new_min_width);
	S32 new_height = llmax(getRect().getHeight(), new_min_height);

	if (isMinimized())
	{
		const LLRect& expanded = getExpandedRect();
		LLRect newrect;
		newrect.setLeftTopAndSize(expanded.mLeft, expanded.mTop, llmax(expanded.getWidth(), new_width), llmax(expanded.getHeight(), new_height));
		setExpandedRect(newrect);
	}
	else
	{
		reshape(new_width, new_height);

		// make sure upper left corner doesn't move
		translate(0, cur_height - getRect().getHeight());

		// make sure this window is visible on screen when it has been modified
		// (tab added, etc)
		gFloaterView->adjustToFitScreen(this, TRUE);
	}
}
Exemplo n.º 5
0
MainAppWindow::MainAppWindow()
    : DocumentWindow (JUCEApplication::getInstance()->getApplicationName(),
                      Colours::lightgrey,
                      DocumentWindow::allButtons)
{
    setUsingNativeTitleBar (true);
    setResizable (true, false);
    setResizeLimits (400, 400, 10000, 10000);

   #if JUCE_IOS || JUCE_ANDROID
    setFullScreen (true);
   #else
    setBounds ((int) (0.1f * getParentWidth()),
               (int) (0.1f * getParentHeight()),
               jmax (850, (int) (0.5f * getParentWidth())),
               jmax (600, (int) (0.7f * getParentHeight())));
   #endif

    contentComponent = new ContentComponent();
    setContentNonOwned (contentComponent, false);
    setVisible (true);

    // this lets the command manager use keypresses that arrive in our window to send out commands
    addKeyListener (getApplicationCommandManager().getKeyMappings());

   #if JUCE_WINDOWS || JUCE_LINUX || JUCE_MAC
    taskbarIcon = new DemoTaskbarComponent();
   #endif

   #if JUCE_ANDROID
    setOpenGLRenderingEngine();
   #endif

    triggerAsyncUpdate();
}
BEGIN_JUCE_NAMESPACE


#include "juce_DocumentWindow.h"
#include "../lookandfeel/juce_LookAndFeel.h"
#include "../../graphics/imaging/juce_Image.h"


//==============================================================================
DocumentWindow::DocumentWindow (const String& title,
                                const Colour& backgroundColour,
                                const int requiredButtons_,
                                const bool addToDesktop_)
    : ResizableWindow (title, backgroundColour, addToDesktop_),
      titleBarHeight (26),
      menuBarHeight (24),
      requiredButtons (requiredButtons_),
#if JUCE_MAC
      positionTitleBarButtonsOnLeft (true),
#else
      positionTitleBarButtonsOnLeft (false),
#endif
      drawTitleTextCentred (true),
      menuBarModel (0)
{
    setResizeLimits (128, 128, 32768, 32768);

    lookAndFeelChanged();
}
Exemplo n.º 7
0
//==============================================================================
MainWindow::MainWindow ()
    : DocumentWindow ("JSDSP",
      Colours::azure,
      DocumentWindow::allButtons,
      true)
{
    setResizable (true, true); // resizability is a property of ResizableWindow
    setResizeLimits (1200, 500, 1200, 500);

    setSize (1200, 500);

	setUsingNativeTitleBar(true);
	mainComponent = new MainComponent();
	setContentNonOwned(mainComponent, false);
	mainComponent->setVisible(true);
    mainComponent->setSize(this->getWidth(), this->getHeight());

#if HIDE
	MainMenuBar *menuBar = new MainMenuBar();
    setContentOwned (menuBar, false);

    // this tells the DocumentWindow to automatically create and manage a MenuBarComponent
    // which uses our contentComp as its MenuBarModel
    setMenuBar (menuBar);
#endif
}
Exemplo n.º 8
0
// *TODO: mantipov: probably is deprecated
void LLSysWellWindow::handleItemAdded(EItemType added_item_type)
{
	bool should_be_shown = ++mTypedItemsCount[added_item_type] == 1 && anotherTypeExists(added_item_type);

	if (should_be_shown && !mSeparator->getVisible())
	{
		mSeparator->setVisible(TRUE);

		// refresh list to recalculate mSeparator position
		mMessageList->reshape(mMessageList->getRect().getWidth(), mMessageList->getRect().getHeight());
	}

	//fix for EXT-3254
	//set limits for min_height. 
	S32 parent_list_delta_height = getRect().getHeight() - mMessageList->getRect().getHeight();

	std::vector<LLPanel*> items;
	mMessageList->getItems(items);

	if(items.size()>1)//first item is separator
	{
		S32 min_height;
		S32 min_width;
		getResizeLimits(&min_width,&min_height);

		min_height = items[1]->getRect().getHeight() + 2 * mMessageList->getBorderWidth() + parent_list_delta_height;

		setResizeLimits(min_width,min_height);
	}
	mSysWellChiclet->updateWidget(isWindowEmpty());
}
Exemplo n.º 9
0
//=================================================================================================
MainWindow::MainWindow()
    : DocumentWindow (JUCEApplication::getInstance()->getApplicationName(),
                      Colours::lightgrey,
                      DocumentWindow::allButtons)
{   
    // 创建基础组件和读写文档的对象
    baseComponent = new BaseComponent();
    appDoc = LoadAndSaveDoc::getInstance();
    appDoc->addChangeListener(this);  // FileBasedDocument 对象绑定可变捕获器
    
    // 获取全局性的撤销管理器、命令管理器和程序属性
    undoManager     = AppSingleton::getInstance()->getUndoManager(); 
    commandManager  = AppSingleton::getInstance()->getCommandManager();
    appProperties   = AppSingleton::getInstance()->getAppProperties();
    
    // 注册命令目标
    commandManager->registerAllCommandsForTarget (JUCEApplication::getInstance());
    commandManager->registerAllCommandsForTarget (this); 

    // 获取所有命令默认的快捷键
    commandManager->getKeyMappings()->resetToDefaultMappings();

    // 获取用户自定义的快捷键
    ScopedPointer<XmlElement> keys(appProperties->getUserSettings()->getXmlValue("keyMappings")); 

    if (keys != nullptr)        
        commandManager->getKeyMappings()->restoreFromXml(*keys);

    // 本类绑定按键捕获器
    addKeyListener (commandManager->getKeyMappings());

    // 设置本类的默认属性
    centreWithSize (1280, 800);
    setResizable(true, false);
    setResizeLimits(800, 600, 4096, 4096);
    setVisible (true);
    setUsingNativeTitleBar(true);

    // 主菜单随时关注命令的变化
    setApplicationCommandManagerToWatch(commandManager);

    // 设置主菜单  
#ifdef JUCE_MAC
    setMacMainMenu(this);
#else
    setMenuBar(this);   
#endif

    // 恢复上次退出时的窗口状态
    restoreWindowStateFromString(appProperties->getUserSettings()->getValue("mainWindowState"));
    setName(AppString::appNameOnTitleBar + TRANS("Untitled"));      // 设置标题栏默认显示的文本

    // 设置并添加基础组件
    baseComponent->setSize(getWidth(), getHeight());
    setContentOwned(baseComponent, false);  

    // 设置当前进程为高优先级
    Process::setPriority (Process::HighPriority);
}
//static 
void LLFloaterNotificationConsole::updateResizeLimits()
{
	const LLFloater::Params& floater_params = LLFloater::getDefaultParams();
	S32 floater_header_size = floater_params.header_height;

	LLLayoutStack& stack = getChildRef<LLLayoutStack>("notification_channels");
	setResizeLimits(getMinWidth(), floater_header_size + HEADER_PADDING + ((NOTIFICATION_PANEL_HEADER_HEIGHT + 3) * stack.getNumPanels()));
}
Exemplo n.º 11
0
 ToolbarCustomisationDialog (ToolbarItemFactory& factory,
                             Toolbar* const toolbar_,
                             const int optionFlags)
     : DialogWindow (TRANS("Add/remove items from toolbar"), Colours::white, true, true),
       toolbar (toolbar_)
 {
     setContentOwned (new CustomiserPanel (factory, toolbar, optionFlags), true);
     setResizable (true, true);
     setResizeLimits (400, 300, 1500, 1000);
     positionNearBar();
 }
//==============================================================================
MainDemoWindow::MainDemoWindow(MainAudioProcessor* _myAudioProcessor) : DocumentWindow ("Echonest Crossfade",
                      Colours::black,
                      DocumentWindow::allButtons,
                      true)
{
    setResizable (true, false); // resizability is a property of ResizableWindow
    setResizeLimits (400, 300, 8192, 8192);

    setContentOwned(new ContentComp(this, _myAudioProcessor), false);
    
    setVisible (true);
 
}
Exemplo n.º 13
0
PrefsPanel::PrefsPanel()
    : DialogWindow ("Jucer Preferences", Colour::greyLevel (0.92f), true)
{
    PrefsTabComp* const p = new PrefsTabComp();
    p->setSize (456, 510);

    setContentOwned (p, true);

    if (! restoreWindowStateFromString (prefsWindowPos))
        centreAroundComponent (0, getWidth(), getHeight());

    setResizable (true, true);
    setResizeLimits (400, 400, 1000, 800);
}
Exemplo n.º 14
0
//==============================================================================
MainHostWindow::MainHostWindow()
    : DocumentWindow (JUCEApplication::getInstance()->getApplicationName(), Colours::lightgrey,
                      DocumentWindow::allButtons)
{
    XmlElement* const savedAudioState = ApplicationProperties::getInstance()->getUserSettings()
                                            ->getXmlValue (T("audioDeviceState"));

    deviceManager.initialise (256, 256, savedAudioState, true);

    delete savedAudioState;

    setResizable (true, false);
    setResizeLimits (500, 400, 10000, 10000);
    centreWithSize (800, 600);

    setContentComponent (new GraphDocumentComponent (&deviceManager));

    restoreWindowStateFromString (ApplicationProperties::getInstance()->getUserSettings()->getValue ("mainWindowPos"));

    setVisible (true);

    InternalPluginFormat internalFormat;
    internalFormat.getAllTypes (internalTypes);

    XmlElement* const savedPluginList = ApplicationProperties::getInstance()
                                          ->getUserSettings()
                                          ->getXmlValue (T("pluginList"));

    if (savedPluginList != 0)
    {
        knownPluginList.recreateFromXml (*savedPluginList);
        delete savedPluginList;
    }

    pluginSortMethod = (KnownPluginList::SortMethod) ApplicationProperties::getInstance()->getUserSettings()
                            ->getIntValue (T("pluginSortMethod"), KnownPluginList::sortByManufacturer);

    knownPluginList.addChangeListener (this);

    addKeyListener (commandManager->getKeyMappings());

    Process::setPriority (Process::HighPriority);

#if JUCE_MAC
    setMacMainMenu (this);
#else
    setMenuBar (this);
#endif
}
Exemplo n.º 15
0
        MainWindow (String name)  : DocumentWindow (name,
                                                    Colours::lightgrey,
                                                    DocumentWindow::allButtons)
        {
            setUsingNativeTitleBar (true);
            setContentOwned (new MainComponent(), true);

			setResizable (true, false);
			setResizeLimits (1280, 780, 3800, 3800);

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

            setWantsKeyboardFocus (false);
            getContentComponent()->grabKeyboardFocus();
        }
Exemplo n.º 16
0
    EditorWindow (ValueList& list)
        : DocumentWindow ("Live Values", Colours::lightgrey, DocumentWindow::closeButton)
    {
        setLookAndFeel (&lookAndFeel);
        setUsingNativeTitleBar (true);

        viewport.setViewedComponent (new ValueListHolderComponent (list), true);
        viewport.setSize (700, 600);
        viewport.setScrollBarsShown (true, false);

        setContentNonOwned (&viewport, true);
        setResizable (true, false);
        setResizeLimits (500, 400, 10000, 10000);
        centreWithSize (getWidth(), getHeight());
        setVisible (true);
    }
Exemplo n.º 17
0
    InspectorWindow::InspectorWindow(sAttributeViewer attrsViewer) :
    BaseWindow("Inspector", Colours::lightgrey, minimiseButton | closeButton, true),
	m_attr_viewer(attrsViewer)
    {
        setResizable(true, false);
        setResizeLimits(50, 50, 32000, 32000);
        setTopLeftPosition(0, 0);
        setSize(300, 440);
        setVisible(true);
		
		if (m_attr_viewer)
		{
			m_attr_viewer->setBounds(getLocalBounds());
			setContentNonOwned(m_attr_viewer.get(), true);
		}
    }
Exemplo n.º 18
0
//==============================================================================
MainHostWindow::MainHostWindow()
    : DocumentWindow (JUCEApplication::getInstance()->getApplicationName(), Colours::lightgrey,
                      DocumentWindow::allButtons)
{
    formatManager.addDefaultFormats();
    formatManager.addFormat (new InternalPluginFormat());

    ScopedPointer<XmlElement> savedAudioState (appProperties->getUserSettings()
                                                   ->getXmlValue ("audioDeviceState"));

    deviceManager.initialise (256, 256, savedAudioState, true);

    setResizable (true, false);
    setResizeLimits (500, 400, 10000, 10000);
    centreWithSize (800, 600);

    setContentOwned (new GraphDocumentComponent (formatManager, &deviceManager), false);

    restoreWindowStateFromString (appProperties->getUserSettings()->getValue ("mainWindowPos"));

    setVisible (true);

    InternalPluginFormat internalFormat;
    internalFormat.getAllTypes (internalTypes);

    ScopedPointer<XmlElement> savedPluginList (appProperties->getUserSettings()->getXmlValue ("pluginList"));

    if (savedPluginList != nullptr)
        knownPluginList.recreateFromXml (*savedPluginList);

    pluginSortMethod = (KnownPluginList::SortMethod) appProperties->getUserSettings()
                            ->getIntValue ("pluginSortMethod", KnownPluginList::sortByManufacturer);

    knownPluginList.addChangeListener (this);

    addKeyListener (commandManager->getKeyMappings());

    Process::setPriority (Process::HighPriority);

   #if JUCE_MAC
    setMacMainMenu (this);
   #else
    setMenuBar (this);
   #endif

    commandManager->setFirstCommandTarget (this);
}
bool LLNearbyChatBar::applyRectControl()
{
	bool rect_controlled = LLFloater::applyRectControl();

	if (!mNearbyChat->getVisible())
	{
		reshape(getRect().getWidth(), getMinHeight());
		enableResizeCtrls(true, true, false);
	}
	else
	{
		enableResizeCtrls(true);
		setResizeLimits(getMinWidth(), EXPANDED_MIN_HEIGHT);
	}
	
	return rect_controlled;
}
Exemplo n.º 20
0
//==============================================================================
MainWindow::MainWindow()
    : DocumentWindow (ProjucerApplication::getApp().getApplicationName(),
                      ProjucerApplication::getApp().lookAndFeel.getCurrentColourScheme()
                                                   .getUIColour (LookAndFeel_V4::ColourScheme::UIColour::windowBackground),
                      DocumentWindow::allButtons,
                      false)
{
    setUsingNativeTitleBar (true);

   #if ! JUCE_MAC
    setMenuBar (ProjucerApplication::getApp().getMenuModel());
   #endif

    createProjectContentCompIfNeeded();

    setResizable (true, false);
    centreWithSize (800, 600);

    ApplicationCommandManager& commandManager = ProjucerApplication::getCommandManager();

    // Register all the app commands..
    commandManager.registerAllCommandsForTarget (this);
    commandManager.registerAllCommandsForTarget (getProjectContentComponent());

    // update key mappings..
    {
        commandManager.getKeyMappings()->resetToDefaultMappings();

        ScopedPointer<XmlElement> keys (getGlobalProperties().getXmlValue ("keyMappings"));

        if (keys != nullptr)
            commandManager.getKeyMappings()->restoreFromXml (*keys);

        addKeyListener (commandManager.getKeyMappings());
    }

    // don't want the window to take focus when the title-bar is clicked..
    setWantsKeyboardFocus (false);

    getLookAndFeel().setColour (ColourSelector::backgroundColourId, Colours::transparentBlack);

    projectNameValue.addListener (this);

    setResizeLimits (600, 500, 32000, 32000);
}
void LLFloaterWebContent::open_media(const Params& p)
{
    // Specifying a mime type of text/html here causes the plugin system to skip the MIME type probe and just open a browser plugin.
    LLViewerMedia::proxyWindowOpened(p.target(), p.id());
    mWebBrowser->setHomePageUrl(p.url, p.initial_mime_type);
    mWebBrowser->setTarget(p.target);
    mWebBrowser->navigateTo(p.url, p.initial_mime_type);

    set_current_url(p.url);

    getChild<LLPanel>("status_bar")->setVisible(p.show_chrome);
    getChild<LLPanel>("nav_controls")->setVisible(p.show_chrome);
    bool address_entry_enabled = p.allow_address_entry && !p.trusted_content;
    getChildView("address")->setEnabled(address_entry_enabled);
    getChildView("popexternal")->setEnabled(address_entry_enabled);

    if (!address_entry_enabled)
    {
        mWebBrowser->setFocus(TRUE);
    }

    if (!p.show_chrome)
    {
        setResizeLimits(100, 100);
    }
    else
    {
        // Singu Note: currently only true with normal browser floater, if this changes, this workaround breaks
        setRectControl("FloaterMediaRect");
        applyRectControl();
    }

    if (!p.preferred_media_size().isEmpty())
    {
        getChild<LLLayoutStack>("stack1")->updateLayout();
        LLRect browser_rect = mWebBrowser->calcScreenRect();
        LLCoordWindow window_size;
        getWindow()->getSize(&window_size);

        geometryChanged(browser_rect.mLeft, window_size.mY - browser_rect.mTop, p.preferred_media_size().getWidth(), p.preferred_media_size().getHeight());
    }

}
Exemplo n.º 22
0
void FloaterHop::open_media(const Params& p)
{
	// Specifying a mime type of text/html here causes the plugin system to skip the MIME type probe and just open a browser plugin.
	LLViewerMedia::proxyWindowOpened(p.target(), p.id());

	std::string grid = mSLURL.getGrid();
	LLSD grid_info;
	LLGridManager::getInstance()->getGridData(grid, grid_info);
	std::string url = grid_info[GRID_LOGIN_PAGE_VALUE].asString();

	mWebBrowser->setHomePageUrl(url, "text/html");
	mWebBrowser->setTarget(p.target);
	mWebBrowser->navigateTo(url, "text/html");
	
	set_current_url(url);

	getChild<LLLayoutPanel>("status_bar")->setVisible(p.show_chrome);
	getChild<LLLayoutPanel>("nav_controls")->setVisible(p.show_chrome);
	bool address_entry_enabled = p.allow_address_entry && !p.trusted_content;
	getChildView("address")->setEnabled(address_entry_enabled);
	getChildView("popexternal")->setEnabled(address_entry_enabled);

	if (!address_entry_enabled)
	{
		mWebBrowser->setFocus(TRUE);
	}

	if (!p.show_chrome)
	{
		setResizeLimits(100, 100);
	}

	if (!p.preferred_media_size().isEmpty())
	{
		LLLayoutStack::updateClass();
		LLRect browser_rect = mWebBrowser->calcScreenRect();
		LLCoordWindow window_size;
		getWindow()->getSize(&window_size);
		
		geometryChanged(browser_rect.mLeft, window_size.mY - browser_rect.mTop, p.preferred_media_size().getWidth(), p.preferred_media_size().getHeight());
	}

}
BEGIN_JUCE_NAMESPACE

#include "juce_FileChooserDialogBox.h"
#include "../lookandfeel/juce_LookAndFeel.h"
#include "../../../text/juce_LocalisedStrings.h"
#include "../windows/juce_AlertWindow.h"


//==============================================================================
FileChooserDialogBox::FileChooserDialogBox (const String& name,
                                            const String& instructions,
                                            FileBrowserComponent& chooserComponent,
                                            const bool warnAboutOverwritingExistingFiles_,
                                            const Colour& backgroundColour)
    : ResizableWindow (name, backgroundColour, true),
      warnAboutOverwritingExistingFiles (warnAboutOverwritingExistingFiles_)
{
    content = new ContentComponent();
    content->setName (name);
    content->instructions = instructions;
    content->chooserComponent = &chooserComponent;

    content->addAndMakeVisible (&chooserComponent);

    content->okButton = new TextButton (chooserComponent.getActionVerb());
    content->addAndMakeVisible (content->okButton);
    content->okButton->addButtonListener (this);
    content->okButton->setEnabled (chooserComponent.currentFileIsValid());
    content->okButton->addShortcut (KeyPress (KeyPress::returnKey, 0, 0));

    content->cancelButton = new TextButton (TRANS("Cancel"));
    content->addAndMakeVisible (content->cancelButton);
    content->cancelButton->addButtonListener (this);
    content->cancelButton->addShortcut (KeyPress (KeyPress::escapeKey, 0, 0));

    setContentComponent (content);

    setResizable (true, true);
    setResizeLimits (300, 300, 1200, 1000);

    content->chooserComponent->addListener (this);
}
Exemplo n.º 24
0
        MainWindow (String name)  : DocumentWindow (name,
                                                    Colours::lightgrey,
                                                    DocumentWindow::allButtons)
        {
            setUsingNativeTitleBar (true);
            setContentOwned (new MainContentComponent(), true);

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

			// Resize limits - 600 x 400 to screen size.
			Rectangle<int> rect = Desktop::getInstance().getDisplays().getMainDisplay().userArea;
			int desktopWidth = rect.getWidth();
			int desktopHeight = rect.getHeight();
			setResizeLimits(600, 400, desktopWidth, desktopHeight);
			
            setVisible (true);


        }
Exemplo n.º 25
0
    PluginListWindow (KnownPluginList& knownPluginList)
        : DocumentWindow ("Available Plugins", Colours::white,
                          DocumentWindow::minimiseButton | DocumentWindow::closeButton)
    {
        currentPluginListWindow = this;

        const File deadMansPedalFile (ApplicationProperties::getInstance()->getUserSettings()
                                        ->getFile().getSiblingFile ("RecentlyCrashedPluginsList"));

        setContentComponent (new PluginListComponent (knownPluginList,
                                                      deadMansPedalFile,
                                                      ApplicationProperties::getInstance()->getUserSettings()), true, true);

        setResizable (true, false);
        setResizeLimits (300, 400, 800, 1500);
        setTopLeftPosition (60, 60);

        restoreWindowStateFromString (ApplicationProperties::getInstance()->getUserSettings()->getValue ("listWindowPos"));
        setVisible (true);
    }
Exemplo n.º 26
0
    PluginListWindow (MainHostWindow& owner_, AudioPluginFormatManager& formatManager)
        : DocumentWindow ("Available Plugins", Colours::white,
                          DocumentWindow::minimiseButton | DocumentWindow::closeButton),
          owner (owner_)
    {
        const File deadMansPedalFile (getAppProperties().getUserSettings()
                                        ->getFile().getSiblingFile ("RecentlyCrashedPluginsList"));

        setContentOwned (new PluginListComponent (formatManager,
                                                  owner.knownPluginList,
                                                  deadMansPedalFile,
                                                  getAppProperties().getUserSettings()), true);

        setResizable (true, false);
        setResizeLimits (300, 400, 800, 1500);
        setTopLeftPosition (60, 60);

        restoreWindowStateFromString (getAppProperties().getUserSettings()->getValue ("listWindowPos"));
        setVisible (true);
    }
//==============================================================================
FileChooserDialogBox::FileChooserDialogBox (const String& name,
                                            const String& instructions,
                                            FileBrowserComponent& chooserComponent,
                                            const bool warnAboutOverwritingExistingFiles_,
                                            const Colour& backgroundColour)
    : ResizableWindow (name, backgroundColour, true),
      warnAboutOverwritingExistingFiles (warnAboutOverwritingExistingFiles_)
{
    content = new ContentComponent (name, instructions, chooserComponent);
    setContentOwned (content, false);

    setResizable (true, true);
    setResizeLimits (300, 300, 1200, 1000);

    content->okButton.addListener (this);
    content->cancelButton.addListener (this);
    content->newFolderButton.addListener (this);
    content->chooserComponent.addListener (this);

    FileChooserDialogBox::selectionChanged();
}
Exemplo n.º 28
0
FileLocationEditorWindow::FileLocationEditorWindow(int posX, int posY, 
                                                   ApplicationCommandManager* acm, 
                                                   UndoManager& um)
    : DocumentWindow("File Locations",
                     Colour::greyLevel(0.6f),
                     DocumentWindow::allButtons,
                     true)
{
    setUsingNativeTitleBar (true);
    
    setContentOwned(new FileLocationEditor(um, acm), true);
    
    restoreWindowPosition(posX, posY);

    Component::setVisible(true);
    setResizable(true, false);

    setWantsKeyboardFocus (false);

    setResizeLimits(400, 200, 32000, 32000);
}
Exemplo n.º 29
0
void LLFloaterMap::adjustLayout( bool expand )
{
	S32 radar_height = mPanelRadar->getRect().getHeight();
	S32 height = getRect().getHeight();
	LLRect map_rect = mPanelMap->getRect();
	S32 map_bottom = map_rect.mBottom;

	S32 min_width, min_height;
	getResizeLimits( &min_width, &min_height );

	S32 adjust = radar_height;
	if (!expand)
	{
		adjust = -adjust;
	}
	
	height += adjust;
	min_height += adjust;
	map_bottom += adjust;

	map_rect.set( map_rect.mLeft,  map_rect.mTop,
	              map_rect.mRight, map_bottom );
	mPanelMap->setRect(map_rect);

	setResizeLimits( min_width, min_height );
	reshape( getRect().getWidth(), height, false );

	LLRect temp_rect = getRect();
	temp_rect.translate( 0, -adjust );
	setRect( temp_rect );

	LLButton* toggle = getChild<LLButton>("toggle_radar");
	if (toggle)
	{
		temp_rect = toggle->getRect();
		temp_rect.translate( 0, adjust );
		toggle->setRect( temp_rect );
	}
}
Exemplo n.º 30
0
//==============================================================================
JuceDemoPluginAudioProcessorEditor::JuceDemoPluginAudioProcessorEditor (JuceDemoPluginAudioProcessor& owner)
    : AudioProcessorEditor (owner),
      midiKeyboard (owner.keyboardState, MidiKeyboardComponent::horizontalKeyboard),
      timecodeDisplayLabel (String::empty),
      gainLabel (String::empty, "Throughput level:"),
      delayLabel (String::empty, "Delay:")
{
    // add some sliders..
    addAndMakeVisible (gainSlider = new ParameterSlider (*owner.gainParam));
    gainSlider->setSliderStyle (Slider::Rotary);

    addAndMakeVisible (delaySlider = new ParameterSlider (*owner.delayParam));
    delaySlider->setSliderStyle (Slider::Rotary);

    // add some labels for the sliders..
    gainLabel.attachToComponent (gainSlider, false);
    gainLabel.setFont (Font (11.0f));

    delayLabel.attachToComponent (delaySlider, false);
    delayLabel.setFont (Font (11.0f));

    // add the midi keyboard component..
    addAndMakeVisible (midiKeyboard);

    // add a label that will display the current timecode and status..
    addAndMakeVisible (timecodeDisplayLabel);
    timecodeDisplayLabel.setColour (Label::textColourId, Colours::blue);
    timecodeDisplayLabel.setFont (Font (Font::getDefaultMonospacedFontName(), 15.0f, Font::plain));

    // set resize limits for this plug-in
    setResizeLimits (400, 200, 800, 300);

    // set our component's initial size to be the last one that was stored in the filter's settings
    setSize (owner.lastUIWidth,
             owner.lastUIHeight);

    // start a timer which will keep our timecode display updated
    startTimerHz (30);
}