• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ centreWithSize函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中centreWithSize函数的典型用法代码示例。如果您正苦于以下问题:C++ centreWithSize函数的具体用法?C++ centreWithSize怎么用?C++ centreWithSize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了centreWithSize函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: MainWindow

 MainWindow() : DocumentWindow ("MainWindow", Colours::lightgrey, DocumentWindow::allButtons) 
 {
     setContentOwned (new MainComponent(), true);
     centreWithSize (getWidth(), getHeight());
     setResizable (true, true);
     setUsingNativeTitleBar (true);
 }
开发者ID:frantic0,项目名称:Jojo,代码行数:7,代码来源:Jojo.cpp


示例2: DocumentWindow

AudioConfigurationWindow::AudioConfigurationWindow(AudioDeviceManager& adm, Button* cButton)
    : DocumentWindow("Audio Settings",
                     Colours::red,
                     DocumentWindow::closeButton),
    controlButton(cButton)

{
    centreWithSize(360,300);
    setUsingNativeTitleBar(true);
    setResizable(false,false);

    //std::cout << "Audio CPU usage:" << adm.getCpuUsage() << std::endl;

    AudioDeviceSelectorComponent* adsc = new AudioDeviceSelectorComponent
    (adm,
     0, // minAudioInputChannels
     2, // maxAudioInputChannels
     0, // minAudioOutputChannels
     2, // maxAudioOutputChannels
     false, // showMidiInputOptions
     false, // showMidiOutputSelector
     false, // showChannelsAsStereoPairs
     false); // hideAdvancedOptionsWithButton

    adsc->setBounds(0,0,450,240);

    setContentOwned(adsc, true);
    setVisible(false);
    //setContentComponentSize(getWidth(), getHeight());
}
开发者ID:KepecsLab,项目名称:GUI,代码行数:30,代码来源:AudioEditor.cpp


示例3: setName

void SplashScreen::show (const String& title,
                         const int width,
                         const int height,
                         const int minimumTimeToDisplayFor,
                         const bool useDropShadow,
                         const bool removeOnMouseClick)
{
    setName (title);
    setAlwaysOnTop (true);
    setVisible (true);
    centreWithSize (width, height);

    addToDesktop (useDropShadow ? ComponentPeer::windowHasDropShadow : 0);
    toFront (false);

   #if JUCE_MODAL_LOOPS_PERMITTED
    MessageManager::getInstance()->runDispatchLoopUntil (300);
   #endif

    repaint();

    originalClickCounter = removeOnMouseClick
                                ? Desktop::getMouseButtonClickCounter()
                                : std::numeric_limits<int>::max();

    earliestTimeToDelete = Time::getCurrentTime() + RelativeTime::milliseconds (minimumTimeToDisplayFor);

    startTimer (50);
}
开发者ID:Emisense,项目名称:S3Test,代码行数:29,代码来源:juce_SplashScreen.cpp


示例4: DialogWindow

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 ();
}
开发者ID:EQ4,项目名称:DSPFiltersDemo,代码行数:25,代码来源:SettingsWindow.cpp


示例5: DocumentWindow

	ZenDebugEditor::ZenDebugEditor() :
		DocumentWindow("Zen Debug",
			Colours::lightgrey,
			DocumentWindow::allButtons)
	{
		this->setName("ValueTreeEditorWindow");
	
		tabsComponent = new TabbedComponent(TabbedButtonBar::TabsAtTop);
		tabsComponent->setName("DebugTabbedComponent");
		
		valueTreeEditorComponent = new ValueTreeEditor::Editor("ValueTreeEditor");
		tabsComponent->addTab("Params", Colours::lightgrey, valueTreeEditorComponent, false);

		bufferVisualiserComponent = new BufferVisualiser("BufferVisualiser");
		tabsComponent->addTab("Buffers", Colours::lightgrey, bufferVisualiserComponent->getComponent(), false);

		midiVisualiserComponent = new ZenMidiVisualiserComponent("MidiVisualiser");
		tabsComponent->addTab("MIDI", Colours::lightgrey, midiVisualiserComponent, false);

		notepadComponent = new NotepadComponent("Notepad", "");
		tabsComponent->addTab("Notes", Colours::lightgrey, notepadComponent, false);

		componentVisualiserComponent = nullptr;

		this->setSize(400, 400);
		tabsComponent->setCurrentTabIndex(0);
		tabsComponent->setBounds(0, 0, getWidth(), getHeight());

		setContentNonOwned(tabsComponent, false);
		setResizable(true, false);
		setUsingNativeTitleBar(true);
		centreWithSize(getWidth(), getHeight());
		setVisible(true);

	}
开发者ID:SonicZentropy,项目名称:ZynVerb,代码行数:35,代码来源:ZenDebugEditor.cpp


示例6: centreWithSize

//==============================================================================
void TopLevelWindow::centreAroundComponent (Component* c, const int width, const int height)
{
    if (c == nullptr)
        c = TopLevelWindow::getActiveTopLevelWindow();

    if (c == nullptr || c->getBounds().isEmpty())
    {
        centreWithSize (width, height);
    }
    else
    {
        Point<int> targetCentre (c->localPointToGlobal (c->getLocalBounds().getCentre()));
        Rectangle<int> parentArea (c->getParentMonitorArea());

        if (getParentComponent() != nullptr)
        {
            targetCentre = getParentComponent()->getLocalPoint (nullptr, targetCentre);
            parentArea = getParentComponent()->getLocalBounds();
        }

        parentArea.reduce (12, 12);

        setBounds (jlimit (parentArea.getX(), jmax (parentArea.getX(), parentArea.getRight() - width), targetCentre.getX() - width / 2),
                   jlimit (parentArea.getY(), jmax (parentArea.getY(), parentArea.getBottom() - height), targetCentre.getY() - height / 2),
                   width, height);
    }
}
开发者ID:SonicPotions,项目名称:editor,代码行数:28,代码来源:juce_TopLevelWindow.cpp


示例7: DocumentWindow

//=================================================================================================
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);
}
开发者ID:LegendRhine,项目名称:practice,代码行数:60,代码来源:MainWindow.cpp


示例8: DocumentWindow

ProcessesWindow::ProcessesWindow() : DocumentWindow("Processes", Colours::white, DocumentWindow::closeButton)
{
	processesComponent = new ProcessesComponent();
	setResizable(false, false);
	setContentOwned(processesComponent, true);
	centreWithSize(getWidth(), getHeight());
	setVisible(false);
}
开发者ID:CreepGin,项目名称:Injectora,代码行数:8,代码来源:ProcessesWindow.cpp


示例9: MainWindow

 MainWindow (String name)  : DocumentWindow (name,Colour(0xff3f3f3f),DocumentWindow::allButtons)
 {
     setUsingNativeTitleBar (true);
     setContentOwned (new MainContentComponent(), true);
     LookAndFeel::setDefaultLookAndFeel (&lookAndFeelV1);
     centreWithSize (getWidth(), getHeight());
     setVisible (true);
 }
开发者ID:EQ4,项目名称:AcousticFilterBank,代码行数:8,代码来源:Main.cpp


示例10: CSLWindow

    CSLWindow() : DocumentWindow (T("CSL 5.0 OSC/MIDI Server"), 
				Colours::lightgrey, DocumentWindow::allButtons, true) {
		setContentComponent (createCSLComponent());	// create app window
		setResizable (false, false);
		setVisible (true);
		setUsingNativeTitleBar(true);
		centreWithSize(308, 200);					// top window size 8 @ 24 larger than the component
    }
开发者ID:eriser,项目名称:CSL,代码行数:8,代码来源:MainServer.cpp


示例11: DialogWindow

MidiConfigurationWindow::MidiConfigurationWindow(MTCSender& mtcSender)
    : DialogWindow(TRANS("Configure MIDI"), Colours::lightgrey, true, true)
    , m_mtcSender(mtcSender)
{
    setContentOwned(new MidiConfigurationComponent(this, m_mtcSender.getDevice()), true);
    centreWithSize(getWidth(), getHeight());
    setVisible(true);
    setResizable(true, true);
}
开发者ID:ServiusHack,项目名称:MStarPlayer,代码行数:9,代码来源:MidiConfiguration.cpp


示例12: MainWindow

        MainWindow()  : DocumentWindow ("MainWindow",
                                        Colours::lightgrey,
                                        DocumentWindow::allButtons)
        {
            setContentOwned (new MainContentComponent(), true);

            centreWithSize (getWidth(), getHeight());
            setVisible (true);
        }
开发者ID:bingo2011,项目名称:codes_GettingStartedWithJuce,代码行数:9,代码来源:Main.cpp


示例13: MainWindow

 MainWindow()  : DocumentWindow ("FPT Analyzer 2.0",
                                 Colours::lightgrey,
                                 DocumentWindow::allButtons)
 {
     setContentOwned (new MainContentComponent(), true);
     Rectangle<int> r = Desktop::getInstance().getDisplays().getMainDisplay().userArea;
     centreWithSize (r.getWidth(), r.getHeight());
     setVisible (true);
 }
开发者ID:DannyvanSwieten,项目名称:FPTProject,代码行数:9,代码来源:Main.cpp


示例14: MainWindow

    MainWindow(String name) : DocumentWindow(name, Colours::lightgrey,
                                             DocumentWindow::closeButton) {
      setUsingNativeTitleBar(true);
      setContentOwned(new HelmStandaloneEditor(), true);
      setResizable(true, true);

      centreWithSize(getWidth(), getHeight());
      setVisible(true);
    }
开发者ID:cameronbroe,项目名称:helm,代码行数:9,代码来源:main.cpp


示例15: CContourPickerDialog

  CContourPickerDialog ()
    : DocumentWindow ("Edit Contour", Colours::grey, DocumentWindow::closeButton, true)
  {
    CContourCurveEditor* c = new CContourCurveEditor;
    setContentOwned (c, true);

    centreWithSize (getWidth(), getHeight());
    setVisible (true);
  }
开发者ID:EQ4,项目名称:LayerEffects,代码行数:9,代码来源:CContourPicker.cpp


示例16: jassert

void MainWindow::showNewProjectWizard()
{
    jassert (currentProject == nullptr);
    setContentOwned (createNewProjectWizardComponent(), true);
    centreWithSize (900, 630);
    setVisible (true);
    addToDesktop();
    getContentComponent()->grabKeyboardFocus();
}
开发者ID:azeteg,项目名称:HISE,代码行数:9,代码来源:jucer_MainWindow.cpp


示例17: MainWindow

        MainWindow (String name)
            : DocumentWindow (name, Colours::lightgrey, DocumentWindow::allButtons)
        {
            setUsingNativeTitleBar (true);
            setContentOwned (new MPETestClasses::MainComponent(), true);

            centreWithSize (getWidth(), getHeight());
            setVisible (true);
        }
开发者ID:Skilpad,项目名称:JUCE,代码行数:9,代码来源:Main.cpp


示例18: DocumentWindow

//==============================================================================
MainWindow::MainWindow()
    : DocumentWindow ("The Jucer",
                      Colours::azure,
                      DocumentWindow::allButtons)
{
    if (oldLook == 0)
        oldLook = new OldSchoolLookAndFeel();

    setContentOwned (multiDocHolder = new MultiDocHolder(), false);

    setApplicationCommandManagerToWatch (commandManager);

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

    setResizable (true, false);

    centreWithSize (700, 600);

    // restore the last size and position from our settings file..
    restoreWindowStateFromString (StoredSettings::getInstance()->getProps()
                                    .getValue ("lastMainWindowPos"));

    // Register all the app commands..
    {
        commandManager->registerAllCommandsForTarget (JUCEApplication::getInstance());
        commandManager->registerAllCommandsForTarget (this);

        // use a temporary one of these to harvest its commands..
        JucerDocumentHolder tempDesignHolder (ObjectTypes::createNewDocument (0));
        commandManager->registerAllCommandsForTarget (&tempDesignHolder);
    }

    commandManager->getKeyMappings()->resetToDefaultMappings();

    XmlElement* const keys = StoredSettings::getInstance()->getProps().getXmlValue ("keyMappings");

    if (keys != 0)
    {
        commandManager->getKeyMappings()->restoreFromXml (*keys);
        delete keys;
    }

    addKeyListener (commandManager->getKeyMappings());

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

   #ifndef JUCE_DEBUG
    // scan for fonts before the app gets started rather than glitching later
    FontPropertyComponent::preloadAllFonts();
   #endif
}
开发者ID:Frongo,项目名称:JUCE,代码行数:57,代码来源:jucer_MainWindow.cpp


示例19: AserveWindow

        AserveWindow (String name, Audio& audio)  :     DocumentWindow (name,
                    Colours::lightgrey,
                    DocumentWindow::allButtons)
        {
            setUsingNativeTitleBar (true);
            setContentOwned (new AserveComponent (audio), true);

            centreWithSize (getWidth(), getHeight());
            setVisible (true);
        }
开发者ID:tommymitch,项目名称:Aserve,代码行数:10,代码来源:AserveApplication.cpp


示例20: MainWindow

 MainWindow()  : DocumentWindow (ProjectInfo::projectName,
                                 Colours::lightgrey,
                                 DocumentWindow::allButtons)
 {
     setUsingNativeTitleBar (true);
     setContentOwned (new StringDemoComponent(), true);
     setResizable (true, false);
     centreWithSize (getWidth(), getHeight());
     setVisible (true);
 }
开发者ID:AlessandroGiacomini,项目名称:pyplasm,代码行数:10,代码来源:Main.cpp



注:本文中的centreWithSize函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ centroid函数代码示例发布时间:2022-05-30
下一篇:
C++ centre函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap