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

C++ UIElement类代码示例

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

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



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

示例1: GetNumItems

void ListView::ChangeSelection(int delta, bool additive)
{
    if (selections_.Empty())
        return;
    if (!multiselect_)
        additive = false;

    // If going downwards, use the last selection as a base. Otherwise use first
    unsigned selection = delta > 0 ? selections_.Back() : selections_.Front();
    int direction = delta > 0 ? 1 : -1;
    unsigned numItems = GetNumItems();
    unsigned newSelection = selection;
    unsigned okSelection = selection;
    PODVector<unsigned> indices = selections_;

    while (delta != 0)
    {
        newSelection += direction;
        if (newSelection >= numItems)
            break;

        UIElement* item = GetItem(newSelection);
        if (item->IsVisible())
        {
            indices.Push(okSelection = newSelection);
            delta -= direction;
        }
    }

    if (!additive)
        SetSelection(okSelection);
    else
        SetSelections(indices);
}
开发者ID:CarloMaker,项目名称:Urho3D,代码行数:34,代码来源:ListView.cpp


示例2: left_walker

void
TabNavigationWalker::Sort (GPtrArray *array, Types *types)
{
	int end = array->len;
	bool swapped;

	do {
		end --;
		swapped = false;
		for (int i = 0; i < end; i++) {
			UIElement *left = NULL;
			UIElement *right = NULL;

			DeepTreeWalker left_walker ((UIElement *) array->pdata [i], Logical, types);
			DeepTreeWalker right_walker ((UIElement *) array->pdata [i + 1], Logical, types);

			while ((left = left_walker.Step ()) && !types->IsSubclassOf (left->GetObjectType (), Type::CONTROL)) { }
			while ((right = right_walker.Step ()) && !types->IsSubclassOf (right->GetObjectType (), Type::CONTROL)) { }

			if (TabCompare ((Control *)left, (Control *)right) > 0) {
				left = (UIElement *) array->pdata [i];
				array->pdata [i] = array->pdata [i + 1];
				array->pdata [i + 1] = left;
				swapped = true;
			}
		}
	} while (swapped);
}
开发者ID:snorp,项目名称:moon,代码行数:28,代码来源:tabnavigationwalker.cpp


示例3: SetLogoVisible

void LANDiscovery::CreateUI()
{
    SetLogoVisible(true); // We need the full rendering window

    auto* graphics = GetSubsystem<Graphics>();
    UIElement* root = GetSubsystem<UI>()->GetRoot();
    auto* cache = GetSubsystem<ResourceCache>();
    auto* uiStyle = cache->GetResource<XMLFile>("UI/DefaultStyle.xml");
    // Set style to the UI root so that elements will inherit it
    root->SetDefaultStyle(uiStyle);

    int marginTop = 20;
    CreateLabel("1. Start server", IntVector2(20, marginTop-20));
    startServer_ = CreateButton("Start server", 160, IntVector2(20, marginTop));
    stopServer_ = CreateButton("Stop server", 160, IntVector2(20, marginTop));
	stopServer_->SetVisible(false);

    // Create client connection related fields
    marginTop += 80;
    CreateLabel("2. Discover LAN servers", IntVector2(20, marginTop-20));
    refreshServerList_ = CreateButton("Search...", 160, IntVector2(20, marginTop));

	marginTop += 80;
	CreateLabel("Local servers:", IntVector2(20, marginTop - 20));
	serverList_ = CreateLabel("", IntVector2(20, marginTop));

    // No viewports or scene is defined. However, the default zone's fog color controls the fill color
    GetSubsystem<Renderer>()->GetDefaultZone()->SetFogColor(Color(0.0f, 0.0f, 0.1f));
}
开发者ID:1vanK,项目名称:Urho3D,代码行数:29,代码来源:LANDiscovery.cpp


示例4: GetRootElement

void PlatformWindowSite::OnMouseButtonDblClk(gm::PointF clientMousePos, int button)
{
	POINT screenMousePos;
	::GetCursorPos(&screenMousePos);

	UIElement* hitElement = nullptr;

	UIElement* child = GetRootElement();
//	Visual* child = get_Child();
	if (child)
	{
		hitElement = child->HitTest_(clientMousePos);
	}
//	hitElement = child;

	if (hitElement)
	{
		MouseButtonEventArgs* args = new MouseButtonEventArgs(nullptr, 0);

		if (button == 0)			args->set_RoutedEvent(UIElement::get_MouseLeftButtonDoubleClickEvent());
		else if (button == 1)	args->set_RoutedEvent(UIElement::get_MouseMiddleButtonDoubleClickEvent());
		else						args->set_RoutedEvent(UIElement::get_MouseRightButtonDoubleClickEvent());

		args->m_screenpos = Point(float(screenMousePos.x), float(screenMousePos.y));
		args->m_clientpos = clientMousePos;

		hitElement->RaiseEvent(args);
	}
}
开发者ID:sigurdle,项目名称:FirstProject2,代码行数:29,代码来源:Window.cpp


示例5: Color

	void UIButton::InitDefaultElements()
	{
		UIElement Element;

		// Button
		{
			Element.SetTexture(0, UIManager::Instance().ElementTextureRect(UICT_Button, 0));
			Element.SetFont(0);
			Element.TextureColor().States[UICS_Normal] = Color(1, 1, 1, 150.0f / 255);
			Element.TextureColor().States[UICS_Pressed] = Color(1, 1, 1, 200.0f / 255);
			Element.FontColor().States[UICS_MouseOver] = Color(0, 0, 0, 1.0f);

			elements_.push_back(MakeSharedPtr<UIElement>(Element));
		}

		// Fill layer
		{
			Element.SetTexture(0, UIManager::Instance().ElementTextureRect(UICT_Button, 1), Color(1, 1, 1, 0));
			Element.TextureColor().States[UICS_MouseOver] = Color(1, 1, 1, 160.0f / 255);
			Element.TextureColor().States[UICS_Pressed] = Color(0, 0, 0, 60.0f / 255);
			Element.TextureColor().States[UICS_Focus] = Color(1, 1, 1, 30.0f / 255);

			elements_.push_back(MakeSharedPtr<UIElement>(Element));
		}
	}
开发者ID:BitYorkie,项目名称:KlayGE,代码行数:25,代码来源:UIButton.cpp


示例6: CreateUI

void SoundEffects::CreateUI()
{
    UIElement* root = GetSubsystem<UI>()->GetRoot();
    auto* cache = GetSubsystem<ResourceCache>();
    auto* uiStyle = cache->GetResource<XMLFile>("UI/DefaultStyle.xml");
    // Set style to the UI root so that elements will inherit it
    root->SetDefaultStyle(uiStyle);

    // Create buttons for playing back sounds
    for (unsigned i = 0; i < NUM_SOUNDS; ++i)
    {
        Button* button = CreateButton(i * 140 + 20, 20, 120, 40, soundNames[i]);
        // Store the sound effect resource name as a custom variable into the button
        button->SetVar(VAR_SOUNDRESOURCE, soundResourceNames[i]);
        SubscribeToEvent(button, E_PRESSED, URHO3D_HANDLER(SoundEffects, HandlePlaySound));
    }

    // Create buttons for playing/stopping music
    Button* button = CreateButton(20, 80, 120, 40, "Play Music");
    SubscribeToEvent(button, E_RELEASED, URHO3D_HANDLER(SoundEffects, HandlePlayMusic));

    button = CreateButton(160, 80, 120, 40, "Stop Music");
    SubscribeToEvent(button, E_RELEASED, URHO3D_HANDLER(SoundEffects, HandleStopMusic));

    auto* audio = GetSubsystem<Audio>();

    // Create sliders for controlling sound and music master volume
    Slider* slider = CreateSlider(20, 140, 200, 20, "Sound Volume");
    slider->SetValue(audio->GetMasterGain(SOUND_EFFECT));
    SubscribeToEvent(slider, E_SLIDERCHANGED, URHO3D_HANDLER(SoundEffects, HandleSoundVolume));

    slider = CreateSlider(20, 200, 200, 20, "Music Volume");
    slider->SetValue(audio->GetMasterGain(SOUND_MUSIC));
    SubscribeToEvent(slider, E_SLIDERCHANGED, URHO3D_HANDLER(SoundEffects, HandleMusicVolume));
}
开发者ID:TrevorCash,项目名称:Urho3D,代码行数:35,代码来源:SoundEffects.cpp


示例7: SaveXML

bool Menu::SaveXML(XMLElement& dest)
{
    // Write type and internal flag
    if (!dest.SetString("type", GetTypeName()))
        return false;
    if (internal_)
    {
        if (!dest.SetBool("internal", internal_))
            return false;
    }
    
    // Write attributes
    if (!Serializable::SaveXML(dest))
        return false;
    
    // Write child elements
    for (unsigned i = 0; i < children_.Size(); ++i)
    {
        UIElement* element = children_[i];
        XMLElement childElem = dest.CreateChild("element");
        if (!element->SaveXML(childElem))
            return false;
    }
    
    // Save the popup element as a "virtual" child element
    if (popup_)
    {
        XMLElement childElem = dest.CreateChild("element");
        childElem.SetBool("popup", true);
        if (!popup_->SaveXML(childElem))
            return false;
    }
    
    return true;
}
开发者ID:acremean,项目名称:urho3d,代码行数:35,代码来源:Menu.cpp


示例8: GetStackTop

UIElement * UserInterface::Activate(){
	UIElement * stackTop = GetStackTop();
	if (!stackTop)
		return NULL;
	UIElement * result = NULL;
	result = stackTop->Activate();
	if (result)
	{
		if (result->activationMessage.Length() == 0){
		//	assert(false && "Activatable UI element has no valid activation message string!");
			return NULL;
		}
		if (result->activationMessage.Length() != 0){
			if (result->activationMessage.Type() == String::WIDE_CHAR)
				result->activationMessage.ConvertToChar();
			List<String> msgs = result->activationMessage.Tokenize("&");
			for (int i = 0; i < msgs.Size(); ++i){
				Message * message = new Message(msgs[i]);
				message->element = result;
				MesMan.QueueMessage(message);
			}
			return result;
		}
		else {
			std::cout<<"\nonActivate and activationMessage both NULL in element: "<<result->name;
			return NULL;
		}
	}
	return result;
}
开发者ID:erenik,项目名称:engine,代码行数:30,代码来源:UserInterface.cpp


示例9: GetElementsByState

/// Fetches all elements conforming to the bitwise and'ed (&) state flags provided.
bool UserInterface::GetElementsByState(int stateFlag, List<UIElement*> & listToFill){
	UIElement * e = this->GetStackTop();
	if (!e)
		return false;
	e->GetElementsByState(stateFlag, listToFill);
	return true;
}
开发者ID:erenik,项目名称:engine,代码行数:8,代码来源:UserInterface.cpp


示例10: findElem

bool UserInterface::scroll(bool up){
    UIElement *clikedElem = findElem(userInterfaceListener.getMousePos());
    if(clikedElem!=nullptr){
        return clikedElem->executeScroll(up);
    }
    return false;
}
开发者ID:lazarev-pv,项目名称:robot-game,代码行数:7,代码来源:UserInterface.cpp


示例11: Update

void ScrollView::Update(float timeStep)
{
    // Update touch scrolling here if necessary
    if (touchScrollSpeed_ == Vector2::ZERO && touchScrollSpeedMax_ == Vector2::ZERO && !barScrolling_)
        return;

    // Check if we should not scroll:
    // - ScrollView is not visible, is not enabled, or doesn't have focus
    // - The element being dragged is not a child of the ScrollView, or is one of our scrollbars
    if (!IsVisible() || !IsEnabled() || !HasFocus())
    {
        touchScrollSpeed_ = Vector2::ZERO;
        touchScrollSpeedMax_ = Vector2::ZERO;
        return;
    }

    if (GetSubsystem<UI>()->IsDragging())
    {
        Vector<UIElement*> dragElements = GetSubsystem<UI>()->GetDragElements();

        for (unsigned i = 0; i < dragElements.Size(); i++)
        {
            UIElement* dragElement = dragElements[i];
            int dragButtons = dragElement->GetDragButtonCombo();

            if (dragButtons != MOUSEB_LEFT)
                continue;

            UIElement* dragParent = dragElement->GetParent();
            bool dragElementIsChild = false;

            while (dragParent)
            {
                if (dragParent == this)
                {
                    dragElementIsChild = true;
                    break;
                }
                dragParent = dragParent->GetParent();
            }

            if (!dragElementIsChild || dragElement == horizontalScrollBar_->GetSlider() ||
                dragElement == verticalScrollBar_->GetSlider())
            {
                touchScrollSpeed_ = Vector2::ZERO;
                touchScrollSpeedMax_ = Vector2::ZERO;
                return;
            }
        }
    }

    // Update view position
    IntVector2 newPosition = viewPosition_;
    newPosition.x_ += (int)touchScrollSpeed_.x_;
    newPosition.y_ += (int)touchScrollSpeed_.y_;
    SetViewPosition(newPosition);

    // Smooth deceleration
    ScrollSmooth(timeStep);
}
开发者ID:TheComet93,项目名称:Urho3D,代码行数:60,代码来源:ScrollView.cpp


示例12: Object

Console::Console(Context* context) :
    Object(context),
    historyRows_(DEFAULT_HISTORY_SIZE),
    historyPosition_(0)
{
    UI* ui = GetSubsystem<UI>();
    UIElement* uiRoot = ui->GetRoot();

    background_ = new BorderImage(context_);
    background_->SetBringToBack(false);
    background_->SetClipChildren(true);
    background_->SetEnabled(true);
    background_->SetVisible(false); // Hide by default
    background_->SetPriority(200); // Show on top of the debug HUD
    background_->SetLayout(LM_VERTICAL);

    rowContainer_ = new UIElement(context_);
    rowContainer_->SetClipChildren(true);
    rowContainer_->SetLayout(LM_VERTICAL);
    background_->AddChild(rowContainer_);

    lineEdit_ = new LineEdit(context_);
    lineEdit_->SetFocusMode(FM_FOCUSABLE); // Do not allow defocus with ESC
    background_->AddChild(lineEdit_);

    uiRoot->AddChild(background_);

    SetNumRows(DEFAULT_CONSOLE_ROWS);

    SubscribeToEvent(lineEdit_, E_TEXTFINISHED, HANDLER(Console, HandleTextFinished));
    SubscribeToEvent(lineEdit_, E_UNHANDLEDKEY, HANDLER(Console, HandleLineEditKey));
    SubscribeToEvent(E_SCREENMODE, HANDLER(Console, HandleScreenMode));
    SubscribeToEvent(E_LOGMESSAGE, HANDLER(Console, HandleLogMessage));
    SubscribeToEvent(E_POSTUPDATE, HANDLER(Console, HandlePostUpdate));
}
开发者ID:CarloMaker,项目名称:Urho3D,代码行数:35,代码来源:Console.cpp


示例13: hide

void UIElements::setup(const Common::Point &pt) {
	_slotStart = 0;
	_itemList.clear();
	_scoreValue = 0;
	_active = true;
	UICollection::setup(pt);
	hide();

	_object1.setup(1, 3, 1, 0, 0, 255);
	add(&_object1);

	// Set up the inventory slots
	int xp = 0;
	for (int idx = 0; idx < 4; ++idx) {
		UIElement *item = NULL;
		switch (idx) {
		case 0:
			item = &_slot1;
			break;
		case 1:
			item = &_slot2;
			break;
		case 2:
			item = &_slot3;
			break;
		case 3:
			item = &_slot4;
			break;
		}

		xp = idx * 63 + 2;
		item->setup(9, 1, idx, xp, 4, 255);
		add(item);
	}

	// Setup bottom-right hand buttons
	xp += 62;
	_question.setup(1, 4, 7, xp, 16, 255);
	_question.setEnabled(false);
	add(&_question);

	xp += 21;
	_scrollLeft.setup(1, 4, 1, xp, 16, 255);
	add(&_scrollLeft);
	_scrollLeft._isLeft = true;

	xp += 22;
	_scrollRight.setup(1, 4, 4, xp, 16, 255);
	add(&_scrollRight);
	_scrollRight._isLeft = false;

	// Set up the score
	_score.postInit();
	add(&_score);

	// Set interface area
	_bounds = Rect(0, BF_INTERFACE_Y - 1, SCREEN_WIDTH, SCREEN_HEIGHT);

	updateInventory();
}
开发者ID:AdamRi,项目名称:scummvm-pink,代码行数:60,代码来源:blueforce_ui.cpp


示例14: get_ShadowTree

void UIElement::OnComputedPropertyValueChanging(PropertyValue* pPropertyVal, const Variant& oldValue, const Variant& newValue, bool handled)
{
	if (pPropertyVal->m_dp == get_ShadowTreeProperty())
	{
		// remove old

		UIElement* uielement = get_ShadowTree();

		if (uielement)
		{
			uielement->SetRoot(nullptr);
			uielement->set_Parent(nullptr);
			uielement->set_ParentWindow(nullptr);
		}

		handled = true;
	}

	if (m_elementProvider)
	{
		PROPERTYID propertyId = 0;
		if (pPropertyVal->m_dp == Window::get_TitleTextProperty())
		{
			propertyId = UIA_NamePropertyId;
		}

		HRESULT hr;
		if (propertyId)
		{
			hr = UiaRaiseAutomationPropertyChangedEvent(m_elementProvider, propertyId, oldValue, newValue);
		}
	}

	baseClass::OnComputedPropertyValueChanging(pPropertyVal, oldValue, newValue, handled);
}
开发者ID:sigurdle,项目名称:FirstProject2,代码行数:35,代码来源:UIElement.cpp


示例15: Object

DebugHud::DebugHud(Context* context) :
    Object(context),
    profilerMaxDepth_(M_MAX_UNSIGNED),
    profilerInterval_(1000),
    useRendererStats_(false),
    mode_(DEBUGHUD_SHOW_NONE)
{
    UI* ui = GetSubsystem<UI>();
    UIElement* uiRoot = ui->GetRoot();

    statsText_ = new Text(context_);
    statsText_->SetAlignment(HA_LEFT, VA_TOP);
    statsText_->SetPriority(100);
    statsText_->SetVisible(false);
    uiRoot->AddChild(statsText_);

    modeText_ = new Text(context_);
    modeText_->SetAlignment(HA_LEFT, VA_BOTTOM);
    modeText_->SetPriority(100);
    modeText_->SetVisible(false);
    uiRoot->AddChild(modeText_);

    profilerText_ = new Text(context_);
    profilerText_->SetAlignment(HA_RIGHT, VA_TOP);
    profilerText_->SetPriority(100);
    profilerText_->SetVisible(false);
    uiRoot->AddChild(profilerText_);

    SubscribeToEvent(E_POSTUPDATE, HANDLER(DebugHud, HandlePostUpdate));
}
开发者ID:RobertoMalatesta,项目名称:AtomicGameEngine,代码行数:30,代码来源:DebugHud.cpp


示例16: UIElement

void ListView::SetHierarchyMode(bool enable)
{
    if (enable == hierarchyMode_)
        return;

    hierarchyMode_ = enable;
    UIElement* container;
    if (enable)
    {
        overlayContainer_ = new UIElement(context_);
        overlayContainer_->SetName("LV_OverlayContainer");
        overlayContainer_->SetInternal(true);
        AddChild(overlayContainer_);
        overlayContainer_->SetSortChildren(false);
        overlayContainer_->SetClipChildren(true);

        container = new HierarchyContainer(context_, this, overlayContainer_);
    }
    else
    {
        if (overlayContainer_)
        {
            RemoveChild(overlayContainer_);
            overlayContainer_.Reset();
        }

        container = new UIElement(context_);
    }

    container->SetName("LV_ItemContainer");
    container->SetInternal(true);
    SetContentElement(container);
    container->SetEnabled(true);
    container->SetSortChildren(false);
}
开发者ID:03050903,项目名称:Urho3D,代码行数:35,代码来源:ListView.cpp


示例17: GetRoot

void Window::GetBatches(PODVector<UIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor)
{
    if (modal_)
    {
        // Modal shade
        if (modalShadeColor_ != Color::TRANSPARENT)
        {
            UIElement* rootElement = GetRoot();
            const IntVector2& rootSize = rootElement->GetSize();
            UIBatch batch(rootElement, BLEND_ALPHA, IntRect(0, 0, rootSize.x_, rootSize.y_), 0, &vertexData);
            batch.AddQuad(0, 0, rootSize.x_, rootSize.y_, 0, 0, 0, 0, modalShadeColor_);
            UIBatch::AddOrMerge(batch, batches);
        }

        // Modal frame
        if (modalFrameColor_ != Color::TRANSPARENT && modalFrameSize_ != IntVector2::ZERO)
        {
            UIBatch batch(this, BLEND_ALPHA, currentScissor, 0, &vertexData);
            int x = GetIndentWidth();
            IntVector2 size = GetSize();
            size.x_ -= x;
            batch.AddQuad(x - modalFrameSize_.x_, -modalFrameSize_.y_, size.x_ + 2 * modalFrameSize_.x_, size.y_ + 2 * modalFrameSize_.y_, 0, 0, 0, 0, modalFrameColor_);
            UIBatch::AddOrMerge(batch, batches);
        }
    }

    BorderImage::GetBatches(batches, vertexData, currentScissor);
}
开发者ID:jjiezheng,项目名称:urho3d,代码行数:28,代码来源:Window.cpp


示例18: GetRoot

void Menu::HandleFocusChanged(StringHash eventType, VariantMap& eventData)
{
    if (!showPopup_)
        return;
    
    using namespace FocusChanged;
    
    UIElement* element = static_cast<UIElement*>(eventData[P_ELEMENT].GetPtr());
    UIElement* root = GetRoot();
    
    // If another element was focused due to the menu button being clicked, do not hide the popup
    if (eventType == E_FOCUSCHANGED && static_cast<UIElement*>(eventData[P_CLICKEDELEMENT].GetPtr()))
        return;
    
    // If clicked emptiness or defocused, hide the popup
    if (!element)
    {
        ShowPopup(false);
        return;
    }
    
    // Otherwise see if the clicked element has either the menu item or the popup in its parent chain.
    // In that case, do not hide
    while (element)
    {
        if (element == this || element == popup_)
            return;
        if (element->GetParent() == root)
            element = static_cast<UIElement*>(element->GetVar(originHash).GetPtr());
        else
            element = element->GetParent();
    }
    
    ShowPopup(false);
}
开发者ID:acremean,项目名称:urho3d,代码行数:35,代码来源:Menu.cpp


示例19: GetFilter

void FileSelector::RefreshFiles()
{
    FileSystem* fileSystem = GetSubsystem<FileSystem>();

    ignoreEvents_ = true;

    fileList_->RemoveAllItems();
    fileEntries_.Clear();

    Vector<String> directories;
    Vector<String> files;
    fileSystem->ScanDir(directories, path_, "*", SCAN_DIRS, false);
    fileSystem->ScanDir(files, path_, GetFilter(), SCAN_FILES, false);

    fileEntries_.Reserve(directories.Size() + files.Size());

    for (unsigned i = 0; i < directories.Size(); ++i)
    {
        FileSelectorEntry newEntry;
        newEntry.name_ = directories[i];
        newEntry.directory_ = true;
        fileEntries_.Push(newEntry);
    }

    for (unsigned i = 0; i < files.Size(); ++i)
    {
        FileSelectorEntry newEntry;
        newEntry.name_ = files[i];
        newEntry.directory_ = false;
        fileEntries_.Push(newEntry);
    }

    // Sort and add to the list view
    // While items are being added, disable layout update for performance optimization
    Sort(fileEntries_.Begin(), fileEntries_.End(), CompareEntries);
    UIElement* listContent = fileList_->GetContentElement();
    listContent->DisableLayoutUpdate();
    for (unsigned i = 0; i < fileEntries_.Size(); ++i)
    {
        String displayName;
        if (fileEntries_[i].directory_)
            displayName = "<DIR> " + fileEntries_[i].name_;
        else
            displayName = fileEntries_[i].name_;

        Text* entryText = new Text(context_);
        fileList_->AddItem(entryText);
        entryText->SetText(displayName);
        entryText->SetStyle("FileSelectorListText");
    }
    listContent->EnableLayoutUpdate();
    listContent->UpdateLayout();

    ignoreEvents_ = false;

    // Clear filename from the previous dir so that there is no confusion
    SetFileName(String::EMPTY);
    lastUsedFilter_ = GetFilter();
}
开发者ID:ElishaMcNutt,项目名称:Clockwork,代码行数:59,代码来源:FileSelector.cpp


示例20: get_Clip

geometry UIElement::MakeVisibleGeometry(geometry clip)
{
	m_visibleGeometryValid = true;

	//gm::RectF bounds = clip.GetBounds();

	geometry clipThis = get_Clip();
	if (clipThis != nullptr)
	{
		clip &= clipThis;
	}

#ifdef _DEBUG
	gm::RectF bounds = clip.GetBounds();
#endif

	geometry geom = GetHitGeometry();
#ifdef _DEBUG
	gm::RectF bounds2 = geom.GetBounds();
#endif

	clip &= geom;

#ifdef _DEBUG
	gm::RectF bounds3 = clip.GetBounds();
#endif

	size_t nchildren = GetChildrenCount();
	for (size_t i = nchildren; i > 0; --i)
	{
		Visual* child = GetChild(i-1);

		geometry geom2 = child->MakeVisibleGeometry(clip);

		clip |= geom2;
	}

	UIElement* shadowTree = get_ShadowTree();
	if (shadowTree)
	{
		geometry geom2 = shadowTree->MakeVisibleGeometry(clip);

#ifdef _DEBUG
	gm::RectF bounds5 = geom2.GetBounds();
#endif

		clip |= geom2;
	}

#ifdef _DEBUG
	gm::RectF bounds4 = clip.GetBounds();
#endif

	set_VisibleGeometry(clip);

	return clip;
}
开发者ID:sigurdle,项目名称:FirstProject2,代码行数:57,代码来源:UIElement.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ UIForegroundRecPtr类代码示例发布时间:2022-05-31
下一篇:
C++ UIDrawingSurfaceRefPtr类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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