当前位置: 首页>>代码示例>>C++>>正文


C++ IWidget类代码示例

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


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

示例1: ASSERT_NULL

void WidgetContainer::OnInputPointerMove(const EventInputPointer *ev)
{
	ASSERT_NULL(ev);

	WidgetIterator it = vWidget.begin();
	WidgetIterator end = vWidget.end();

	for (; it != end; ++it)
	{
		IWidget *w = (*it);
		ASSERT_NULL(w);

		bEventConsumed = FALSE;

		if (w->IsDisabled())
			continue;

		if (w->GetObjectType() == Seed::ObjectGuiWidgetContainer)
		{
			WidgetContainer *wc = reinterpret_cast<WidgetContainer *>(w);
			wc->OnInputPointerMove(ev);

			bEventConsumed = wc->IsEventConsumed();
			if (bEventConsumed)
				break;
		}

		bEventConsumed = this->UpdateStates(ev, w);
		//if (UpdateStates(ev, w))
		if (bEventConsumed)
			break;
	}
}
开发者ID:doorxp,项目名称:seed,代码行数:33,代码来源:WidgetContainer.cpp

示例2: SetSizeOf

void
SetSizeOf(IWidget& wgt, const Size& s)
{
	wgt.GetRenderer().SetSize(s);
	wgt.GetView().SetSize(s);
	CallEvent<Resize>(wgt, UIEventArgs(wgt));
}
开发者ID:jwk000,项目名称:YSLib,代码行数:7,代码来源:YWidget.cpp

示例3: main

int main()
{
	LinuxFactory* linuxFactory = new (LinuxFactory);
	IFactory* ifactory = &linuxFactory->ifactory;
	IWidget* iwidget = ifactory->createWidget(ifactory);
	iwidget->show(iwidget);
	IButton* ibutton = ifactory->createButton(ifactory);
	ibutton->click(ibutton);
	delete (LinuxWidget, container_of(iwidget, LinuxWidget, iwidget));
	delete (LinuxButton, container_of(ibutton, LinuxButton, ibutton));

	MacFactory* macFactory = new (MacFactory);
	ifactory = &macFactory->ifactory;
	iwidget = ifactory->createWidget(ifactory);
	iwidget->show(iwidget);
	ibutton = ifactory->createButton(ifactory);
	ibutton->click(ibutton);
	delete (MacWidget, container_of(iwidget, MacWidget, iwidget));
	delete (MacButton, container_of(ibutton, MacButton, ibutton));

	WindowsFactory* windowsFactory = new (WindowsFactory);
	ifactory = &windowsFactory->ifactory;
	iwidget = ifactory->createWidget(ifactory);
	iwidget->show(iwidget);
	ibutton = ifactory->createButton(ifactory);
	ibutton->click(ibutton);
	delete (WindowsWidget, container_of(iwidget, WindowsWidget, iwidget));
	delete (WindowsButton, container_of(ibutton, WindowsButton, ibutton));

	delete (LinuxFactory, linuxFactory);
	delete (MacFactory, macFactory);
	delete (WindowsFactory, windowsFactory);

	return 0;
}
开发者ID:AAAJet,项目名称:OOC-Design-Pattern,代码行数:35,代码来源:main.c

示例4: deregisterDrawable

//-----------------------------------------------------------------
void
MenuOptions::prepareMenu()
{
    if (m_container) {
        deregisterDrawable(m_container);
        delete m_container;
        m_container = NULL;
    }

    Labels labels(Path::dataReadPath("script/labels.lua"));
    IWidget *soundBox = createSoundPanel(labels);
    IWidget *musicBox = createMusicPanel(labels);

    VBox *vbox = new VBox();
    vbox->addWidget(soundBox);
    vbox->addWidget(new WiSpace(0, 10));
    vbox->addWidget(musicBox);
    vbox->addWidget(new WiSpace(0, 10));
    vbox->addWidget(createLangPanel(labels));
    vbox->addWidget(new WiSpace(0, 5));
    vbox->addWidget(createSpeechPanel(labels));
    vbox->addWidget(new WiSpace(0, 5));
    vbox->addWidget(createSubtitlesPanel(labels));

    IWidget *backButton = createBackButton(labels);
    m_statusBar = createStatusBar(musicBox->getW() - backButton->getW());
    HBox *backBox = new HBox();
    backBox->addWidget(m_statusBar);
    backBox->addWidget(backButton);

    vbox->addWidget(backBox);
    m_container = vbox;
    registerDrawable(m_container);
}
开发者ID:FishFilletsNG,项目名称:ffng-android,代码行数:35,代码来源:MenuOptions.cpp

示例5: main

int	main(void)
{
  IWidget*	aWidget;

  aWidget = new ILoveGeraldine(new BorderDecorator(new ScrollDecorator(new BorderDecorator(new TextField(80, 24)))));
  aWidget->draw();
  delete aWidget;
}
开发者ID:canercandan,项目名称:design-pattern,代码行数:8,代码来源:main.cpp

示例6: WiButton

//-----------------------------------------------------------------
IWidget *
MenuOptions::createBackButton(const Labels &labels)
{
    IWidget *button = new WiButton(
            new WiPicture(Path::dataReadPath("images/menu/back.png")),
            new SimpleMsg(this, "quit"));
    button->setTip(labels.getLabel("menu_back"));
    return button;
}
开发者ID:FishFilletsNG,项目名称:ffng-android,代码行数:10,代码来源:MenuOptions.cpp

示例7: InvalidateChildren

void
InvalidateChildren(IWidget& wgt, const Rect& bounds)
{
	Rect r(wgt.GetRenderer().CommitInvalidation(bounds));

	for(auto pr(wgt.GetChildren()); pr.first != pr.second; ++pr.first)
	{
		auto& child(*pr.first);

		InvalidateChildren(child, Rect(r - GetLocationOf(child)));
	}
}
开发者ID:jwk000,项目名称:YSLib,代码行数:12,代码来源:YWidget.cpp

示例8: Update

void WidgetContainer::Update(f32 dt)
{
	WidgetIterator it = vWidget.begin();
	WidgetIterator end = vWidget.end();
	for (; it != end; ++it)
	{
		IWidget *w = (*it);
		ASSERT_NULL(w);

		w->Update(dt);
	}

	std::sort(vWidget.begin(), vWidget.end(), ITransformable2DDescendingPrioritySort());
}
开发者ID:Patuti,项目名称:seed,代码行数:14,代码来源:WidgetContainer.cpp

示例9: SetDisabled

INLINE void WidgetContainer::SetDisabled(BOOL b)
{
	IWidget::SetDisabled(b);

	WidgetIterator it = vWidget.begin();
	WidgetIterator end = vWidget.end();
	for (; it != end; ++it)
	{
		IWidget *w = (*it);
		ASSERT_NULL(w);

		w->SetDisabled(b);
	}
}
开发者ID:doorxp,项目名称:seed,代码行数:14,代码来源:WidgetContainer.cpp

示例10: Render

INLINE void WidgetContainer::Render()
{
	WidgetIterator it = vWidget.begin();
	WidgetIterator end = vWidget.end();
	for (; it != end; ++it)
	{
		IWidget *w = (*it);
		ASSERT_NULL(w);

		w->Render();
	}

	if (pConfiguration->bDebugContainer)
		pRendererDevice->DrawRect(this->GetX(), this->GetY(), this->GetWidth(), this->GetHeight(), PIXEL_COLOR(255, 0, 255, 255));
}
开发者ID:doorxp,项目名称:seed,代码行数:15,代码来源:WidgetContainer.cpp

示例11: PaintChild

void
PaintChild(IWidget& wgt, PaintEventArgs&& e)
{
	auto& sender(e.GetSender());

	if(Clip(e.ClipArea, Rect(e.Location += GetLocationOf(sender),
		GetSizeOf(sender))))
		wgt.GetRenderer().Paint(sender, std::move(e));
}
开发者ID:jwk000,项目名称:YSLib,代码行数:9,代码来源:YWidget.cpp

示例12: onTouchDown

	void onTouchDown(int x, int y)
	{
		Point pt(x,y);

		if ( m_activeButton ) 
		{
			m_activeButton->onTouchUp( Point(-1,-1) );
			m_activeButton = NULL;
		}

		IWidget* wdgt = m_activePane ? m_activePane->hitTest(pt) : NULL;

		if ( wdgt != NULL ) 
		{
			m_activeButton = wdgt;
			m_activeButton->onTouchDown(pt);
		}
	}
开发者ID:quarck,项目名称:csetup,代码行数:18,代码来源:UIManager.hpp

示例13: AddChild

  void LayoutBox::AddChild (IWidget& child, Align align)
  {
    BaseWidget::AddChild (child);
    items_.Add (&child, align);

    if (child.IsFocusable ())    
      focusables_.Add (&child);
	  
    GeneratePosition ();
  }
开发者ID:Noxalus,项目名称:YAPOG,代码行数:10,代码来源:LayoutBox.cpp

示例14: RemoveChild

  void LayoutBox::RemoveChild (IWidget& child)
  {
    BaseWidget::RemoveChild (child);
    items_.Remove (&child);

    if (child.IsFocusable ())
      focusables_.Remove (&child);

    GeneratePosition ();
  }
开发者ID:Noxalus,项目名称:YAPOG,代码行数:10,代码来源:LayoutBox.cpp

示例15: HandleOnPriorityEvent

  bool LayoutBox::HandleOnPriorityEvent (const GuiEvent& guiEvent)
  {
    if (guiEvent.type == sf::Event::KeyPressed)
    {
      if (guiEvent.key.code == sf::Keyboard::Tab)
      {
        if (focusables_.Count () == 0 || !isFocused_)
          return false;

        IWidget* child;
        uint cycle = focusedChild_;

        // if current focussable is a layout, give it control for tab
        if (focusables_[cycle]->OnPriorityEvent (guiEvent))
          return true;
        focusedChild_ = (focusedChild_ + 1) % focusables_.Count ();

        //Performed a cycle, give control to the parent
        if (focusedChild_ == 0)
        {
          child = focusables_[focusedChild_];          
          child->SetFocused (true);
          eventHandlers_.Remove (child);
          eventHandlers_.AddFront (child);
          isFocused_ = true; //to make cycle
          return false;
        }

        child = focusables_[focusedChild_];
        child->SetFocused (true);
        eventHandlers_.Remove (child);
        eventHandlers_.AddFront (child);

        return true;
      }
      return false;
    }
    return false;
  }
开发者ID:Noxalus,项目名称:YAPOG,代码行数:39,代码来源:LayoutBox.cpp


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