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

C++ setRoot函数代码示例

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

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



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

示例1: newText

void FileBrowserComponent::comboBoxChanged (ComboBox*)
{
    const String newText (currentPathBox.getText().trim().unquoted());

    if (newText.isNotEmpty())
    {
        const int index = currentPathBox.getSelectedId() - 1;

        StringArray rootNames, rootPaths;
        getRoots (rootNames, rootPaths);

        if (rootPaths [index].isNotEmpty())
        {
            setRoot (File (rootPaths [index]));
        }
        else
        {
            File f (newText);

            for (;;)
            {
                if (f.isDirectory())
                {
                    setRoot (f);
                    break;
                }

                if (f.getParentDirectory() == f)
                    break;

                f = f.getParentDirectory();
            }
        }
    }
}
开发者ID:randi2kewl,项目名称:ShoutOut,代码行数:35,代码来源:juce_FileBrowserComponent.cpp


示例2: f

void FileBrowserComponent::textEditorReturnKeyPressed (TextEditor&)
{
    if (filenameBox.getText().containsChar (File::separator))
    {
        const File f (currentRoot.getChildFile (filenameBox.getText()));

        if (f.isDirectory())
        {
            setRoot (f);
            chosenFiles.clear();
            filenameBox.setText (String::empty);
        }
        else
        {
            setRoot (f.getParentDirectory());
            chosenFiles.clear();
            chosenFiles.add (f);
            filenameBox.setText (f.getFileName());
        }
    }
    else
    {
        fileDoubleClicked (getSelectedFile (0));
    }
}
开发者ID:randi2kewl,项目名称:ShoutOut,代码行数:25,代码来源:juce_FileBrowserComponent.cpp


示例3: set_union

 inline static
 LabelT set_union(LabelT *P, LabelT i, LabelT j){
     LabelT root = findRoot(P, i);
     if(i != j){
         LabelT rootj = findRoot(P, j);
         if(root > rootj){
             root = rootj;
         }
         setRoot(P, j, root);
     }
     setRoot(P, i, root);
     return root;
 }
开发者ID:sclee0095,项目名称:vco,代码行数:13,代码来源:connectedcomponents.cpp


示例4: horizontal

SplashLetter::SplashLetter(QChar l, int d)
{
    ImageView *letterImage = ImageView::create().
            horizontal(HorizontalAlignment::Center).
            vertical(VerticalAlignment::Center).
            image(Image("asset:///images/splash/" + QString(l) + ".png")).
            opacity(0.1).
            tx(-50);

    FadeTransition *fadeIn = FadeTransition::create(letterImage).
            duration(500).
            to(1);

    TranslateTransition *moveIn = TranslateTransition::create(letterImage).
            duration(500).
            toX(0);

    ParallelAnimation *comboAnim = ParallelAnimation::create(letterImage).
            parent(this).
            delay(d).
            add(fadeIn).
            add(moveIn);

    Container *rootC = Container::create().
            layout(DockLayout::create()).
            add(letterImage);

    setRoot(rootC);

    comboAnim->play();
}
开发者ID:SuhairZain,项目名称:Momentum,代码行数:31,代码来源:SplashLetter.cpp


示例5: ASSERTP

/**
 * Add the given node to the tree.
 * @param node		Node to add.
 */
void SortedBinTree::insert(Node *node) {
	ASSERTP(node, "null node");
	if(isEmpty())
		setRoot(node);
	else
		insert(root(), node);
}
开发者ID:alexjordan,项目名称:otawa,代码行数:11,代码来源:inhstruct_SortedBinTree.cpp


示例6: esReport

Process::
~Process()
{
#ifdef VERBOSE
    esReport("Process::~Process %p\n", this);
#endif

    setInput(0);
    setOutput(0);
    setError(0);
    setRoot(0);

    for (SyscallProxy* proxy(syscallTable);
         proxy < &syscallTable[INTERFACE_POINTER_MAX];
         ++proxy)
    {
        proxy->addRef();
        while (0 < proxy->release())
            ;
   }

    while (!upcallList.isEmpty())
    {
        upcallCount.decrement();
        UpcallRecord* record(upcallList.removeFirst());
        delete record;
    }
    ASSERT(upcallCount == 0);

    ASSERT(threadList.isEmpty());

    unmap(USER_MIN, static_cast<u8*>(USER_MAX) - static_cast<u8*>(USER_MIN));
    ASSERT(mmu);
    delete mmu;
}
开发者ID:giobeatle1794,项目名称:es-operating-system,代码行数:35,代码来源:process.cpp


示例7: setRoot

	void Chat::init()
	{
		instance = this;
		
		_root = newWidget<gcn::Container>();
		_root->setPosition(10, 10);
		_root->setOpaque(false);
		setRoot(_root);
		
		gcn::TextField *input = newNamedWidget<gcn::TextField>("text_input");
		input->setWidth(500);
		input->setHeight(20);
		input->setPosition(0, 0);
		input->setFocusable(true);
		
		gcn::Button *send = newWidget<gcn::Button>("Send");
		send->setWidth(100);
		send->setHeight(20);
		send->setX(input->getRight() + 10);
		send->setY(0);
		
		ChatTyped *listener = newListener<ChatTyped>();
		input->addKeyListener(listener);
		send->addActionListener(listener);
		
		_root->setWidth(send->getRight());
		_root->setHeight(input->getHeight());
		
		_root->add(send);
		_root->add(input);
	}
开发者ID:aadarshasubedi,项目名称:Foreverworld,代码行数:31,代码来源:chat.cpp


示例8: maxLineCount

QuotesItem::QuotesItem(Color color)
{
    name = Label::create().
            maxLineCount(2).
            multiline(TRUE);
    //name->autoSize()->setMaxLineCount(3);
    name->textStyle()->setColor(Color::Black);
    name->textStyle()->setFontSize(FontSize::PointValue);
    name->textStyle()->setFontSizeValue(10);
    name->textStyle()->setFontWeight(FontWeight::W100);

    Container *rootC = Container::create().
            //horizontal(HorizontalAlignment::Fill).
            left(6).
            top(6).
            right(6).
            bottom(6).
            preferredWidth(1440).
            background(color).
            add(name);

    setRoot(rootC);
    //setHorizontalAlignment(HorizontalAlignment::Fill);
    setBottomMargin(6);
}
开发者ID:SuhairZain,项目名称:Momentum,代码行数:25,代码来源:QuotesItemProvider.cpp


示例9: Process

Process::
Process() :
    end(0),
    exitValue(0),
    startup(0),
    tlsImage(0),
    tlsImageSize(0),
    tlsSize(0),
    threadCount(0),
    root(0),
    current(0),
    in(0),
    out(0),
    error(0),
    log(false),
    upcallCount(0)
{
    es::Cache* cache = es::Cache::createInstance(zero);
    mmu = new Mmu(dynamic_cast<Cache*>(cache));
    ASSERT(mmu);

    syscallTable[0].set(esCurrentProcess(), es::CurrentProcess::iid(), true);

    Process* current(Process::getCurrentProcess());
    if (current)
    {
        setRoot(current->root);
        setInput(current->in);
        setOutput(current->out);
        setError(current->error);
    }
}
开发者ID:giobeatle1794,项目名称:es-operating-system,代码行数:32,代码来源:process.cpp


示例10: ConfigTreePanel

    ConfigTreePanel (Project& p)
        : TreePanelBase (&p, "settingsTreeState")
    {
        tree.setMultiSelectEnabled (false);
        setRoot (new ConfigTreeItemTypes::RootItem (p));

        if (tree.getNumSelectedItems() == 0)
            tree.getRootItem()->setSelected (true, true);

       #if JUCE_MAC || JUCE_WINDOWS
        ApplicationCommandManager& commandManager = IntrojucerApp::getCommandManager();

        addAndMakeVisible (createExporterButton);
        createExporterButton.setCommandToTrigger (&commandManager, CommandIDs::createNewExporter, true);
        createExporterButton.setButtonText (commandManager.getNameOfCommand (CommandIDs::createNewExporter));
        createExporterButton.setColour (TextButton::buttonColourId, Colours::white.withAlpha (0.5f));

        addAndMakeVisible (openProjectButton);
        openProjectButton.setCommandToTrigger (&commandManager, CommandIDs::openInIDE, true);
        openProjectButton.setButtonText (commandManager.getNameOfCommand (CommandIDs::openInIDE));
        openProjectButton.setColour (TextButton::buttonColourId, Colours::white.withAlpha (0.5f));

        addAndMakeVisible (saveAndOpenButton);
        saveAndOpenButton.setCommandToTrigger (&commandManager, CommandIDs::saveAndOpenInIDE, true);
        saveAndOpenButton.setButtonText (commandManager.getNameOfCommand (CommandIDs::saveAndOpenInIDE));
        saveAndOpenButton.setColour (TextButton::buttonColourId, Colours::white.withAlpha (0.5f));
       #endif
    }
开发者ID:EthanZuo,项目名称:JUCE,代码行数:28,代码来源:jucer_ProjectContentComponent.cpp


示例11: StandardModel

StandardImageModel::StandardImageModel(const QMap<int, QMap<int, QVariant> > &data, QObject *parent) :
StandardModel(parent)
{
    StandardImageItem* root = new StandardImageItem(data, this);
    root->setRoot(true);
    setRoot(root);
}
开发者ID:DmitryMasley,项目名称:ImageProcessingProgect,代码行数:7,代码来源:standardimagemodel.cpp


示例12: StandardModel

StandardImageModel::StandardImageModel(const QList<QMap<int, QVariant> > &headerData, QObject *parent) :
StandardModel(parent)
{
    StandardImageItem* root = new StandardImageItem(headerData);
    root->setRoot(true);
    setRoot(root);
}
开发者ID:DmitryMasley,项目名称:satImageManager,代码行数:7,代码来源:standardimagemodel.cpp


示例13: setRoot

void DoubleList03::insert_tree(NODE *root, int num)   
{
	NODE *newnode = (NODE*)malloc(sizeof(NODE));  
	newnode->num = num;
	newnode->left = newnode->right = NULL;
	if (m_Root == NULL)
	{
		setRoot(newnode);
	}
	else
	{
		while (root) {                                          
			if (root->num == newnode->num)        
				break;
			if (root->num > newnode->num)          
				if (!root->left) {                      
				root->left = newnode;          
				return;
				}
				else
					root = root->left;              
			else                                                                                   
				if (!root->right) {
				root->right = newnode;
				return;
				}
				else
					root = root->right;
		}
		free(newnode);
	}
}
开发者ID:wtan0202,项目名称:codingground,代码行数:32,代码来源:kthMin.cpp


示例14: setRoot

/** Put the leaf node kl into the place of inner node ki
  */
void BinaryTree::replace(BinaryNode *ki, BinaryNode *kl)
{
    kl->balance_ = ki->balance_;
    kl->weight_ = ki->weight_;

    // establish links to neighbors
    kl->parent_ = ki->parent_;
    kl->left_ = ki->left_;
    kl->right_ = ki->right_;

    // establish links from neighbors
    BinaryNode *kp = ki->parent_;
    if (kp) {
        if (kp->left_ == ki)
            kp->left_ = kl;
        else
            kp->right_ = kl;
    }
    else {
        setRoot(kl);
    }
    if (ki->left_)
        ki->left_->parent_ = kl;
    if (ki->right_)
        ki->right_->parent_ = kl;
}
开发者ID:frankencode,项目名称:fluxkit,代码行数:28,代码来源:BinaryTree.cpp


示例15: CustomControl

PostTypeRenderer::PostTypeRenderer() :
	CustomControl()
{
	Container *itemContainer = new Container();

	    // Dock layout with margins inside.
	    DockLayout *itemLayout = new DockLayout();
	    itemContainer->setLayout(itemLayout);
	    itemContainer->setPreferredWidth(300);

	    // A list item label, docked to the bottom, the text is set in updateItem.
	    postType = Label::create()
	        .text(" ")
	        .layoutProperties(DockLayoutProperties::create()
	        .horizontal(HorizontalAlignment::Center)
	        .vertical(VerticalAlignment::Bottom))
	        .bottomMargin(10.0f)
	        .leftMargin(10.0f);

	    // Add the three controls to the item container.
	    //itemContainer->add(imageContainer);
	    itemContainer->add(postType);

	    setRoot(itemContainer);
}
开发者ID:ekke,项目名称:tumblr,代码行数:25,代码来源:PostTypeRenderer.cpp


示例16: background

void LandscapeImageGridItem::addItemsToRoot()
{
    Container *BG = Container::create().
            background(Color::fromARGB(0xffae734b)).
            opacity(0.6f).
            preferredSize(2000, 150);

    image->setPreferredHeight(150);
    image->setScalingMethod(ScalingMethod::AspectFit);

    fileNameLabel->setHorizontalAlignment(HorizontalAlignment::Right);
    durationLabel->setHorizontalAlignment(HorizontalAlignment::Right);

    Container *textC = Container::create().
            horizontal(HorizontalAlignment::Right).
            vertical(VerticalAlignment::Center).
            layoutProperties(StackLayoutProperties::create().spaceQuota(1)).
            add(fileNameLabel).
            add(durationLabel);
    textC->add(fileNameLabel);

    Container *content = Container::create().
            layout(StackLayout::create().orientation(LayoutOrientation::LeftToRight)).
            add(image).
            add(textC);

    Container *rootC = Container::create().
            layout(DockLayout::create()).
            add(BG).
            add(content);
    setRoot(rootC);

    setBottomMargin(6.0f);
}
开发者ID:SuhairZain,项目名称:SnapPlayer,代码行数:34,代码来源:LandscapeImageGridItem.cpp


示例17: PrologLoader

PrologLoader :: PrologLoader (PrologRoot * root) {
	instructions = 0;
	echo = false;
	reload = false;
	old_caption_id = 0;
	old_auto_atoms = false;
	setRoot (root);
}
开发者ID:HERCsMusicSystems,项目名称:prolog,代码行数:8,代码来源:prolog_loader.cpp


示例18: setRoot

void PropertyTreeModel::clear()
{
	if(root_)
		root_->clear();
	root_ = 0;
	setRoot(new PropertyRow());
	root_->setNames("", "root", "rootType");
	selection_.clear();
}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:9,代码来源:PropertyTreeModel.cpp


示例19: XMLDocument

void XMLDocument::setRoot(const std::string & xmlCode, std::string * error) const
{
    XMLDocument doc = XMLDocument(xmlCode, false, error);

    if (error->empty())
    {
        setRoot(*doc.getRoot());
    }
}
开发者ID:ScilabOrg,项目名称:scilab,代码行数:9,代码来源:XMLDocument.cpp


示例20: FileFilter

//==============================================================================
BasicFileBrowser::BasicFileBrowser (int flags_,
                                    const File& initialFileOrDirectory,
                                    const FileFilter* fileFilter_)
    : FileFilter (String::empty),
      fileFilter (fileFilter_),
      flags (flags_),
      thread ("Juce BasicFileBrowser"),
      showResizer(true)
{
    // You need to specify one or other of the open/save flags..
    jassert ((flags & (saveMode | openMode)) != 0);
    jassert ((flags & (saveMode | openMode)) != (saveMode | openMode));
    
    // You need to specify at least one of these flags..
    jassert ((flags & (canSelectFiles | canSelectDirectories)) != 0);
    
    String filename;
    
    if (initialFileOrDirectory == File::nonexistent)
    {
        currentRoot = File::getCurrentWorkingDirectory();
    }
    else if (initialFileOrDirectory.isDirectory())
    {
        currentRoot = initialFileOrDirectory;
    }
    else
    {
        chosenFiles.add (initialFileOrDirectory);
        currentRoot = initialFileOrDirectory.getParentDirectory();
        filename = initialFileOrDirectory.getFileName();
    }
    
    fileList = new DirectoryContentsList (this, thread);
	
    FileListComponent* const list = new FileListComponent (*fileList);
    fileListComponent = list;
    list->setOutlineThickness (0);
	list->getViewport()->setScrollBarThickness (10);
	list->setRowHeight (18);
    
    if ((flags & canSelectMultipleItems) != 0)
        list->setMultipleSelectionEnabled (true);
    
    addAndMakeVisible (list);
    	
    fileListComponent->addListener (this);
	list->getViewport()->getVerticalScrollBar()->setAutoHide (false);
		
	resizer = new ResizableCornerComponent (this, &resizeLimits);
	addAndMakeVisible (resizer);
	resizer->setMouseCursor (MouseCursor::LeftRightResizeCursor);

    setRoot (currentRoot);
		
    thread.startThread (4);
}
开发者ID:JeromeGill,项目名称:genie,代码行数:58,代码来源:dRowAudio_BasicFileBrowser.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ setRootIsDecorated函数代码示例发布时间:2022-05-30
下一篇:
C++ setRoleNames函数代码示例发布时间: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