本文整理汇总了C++中setRoot函数的典型用法代码示例。如果您正苦于以下问题:C++ setRoot函数的具体用法?C++ setRoot怎么用?C++ setRoot使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setRoot函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
}
}
}
示例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));
}
}
示例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;
}
示例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();
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
}
示例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
}
示例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);
}
示例12: StandardModel
StandardImageModel::StandardImageModel(const QList<QMap<int, QVariant> > &headerData, QObject *parent) :
StandardModel(parent)
{
StandardImageItem* root = new StandardImageItem(headerData);
root->setRoot(true);
setRoot(root);
}
示例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);
}
}
示例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;
}
示例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);
}