コード例 #1
0
ファイル: Panel.cpp プロジェクト: GustavoMOG/ede
static void add_from_list(WidgetList &lst, Panel *self, int &X, bool inc) {
	WidgetListIt it = lst.begin(), ite = lst.end();
	Fl_Widget    *o;

	while(it != ite) {
		o = *it;

		/* 'inc == false' means we are going from right to left */
		if(!inc)
			X -= o->w();

		/* place it correctly */
		o->position(X, o->y());

		self->add(o);

		if(inc) {
			X += DEFAULT_SPACING;
			X += o->w();
		} else {
			X -= DEFAULT_SPACING;
		}

		it = lst.erase(it);
	}
}
コード例 #2
0
ファイル: SplitBar.cpp プロジェクト: Jmos/vaca
void SplitBar::updateChildrenVisibility()
{
  // Hide children that aren't first or second
  WidgetList children = getChildren();
  for (WidgetList::iterator
	 it = children.begin(); it != children.end(); ++it) {
    Widget* child = *it;
    child->setVisible(child == m_pane1 ||
		      child == m_pane2);
  }
}
コード例 #3
0
ファイル: stdlist.cpp プロジェクト: merlinblack/LuaBridgeTest
LuaRef getWidgetList( lua_State* L )
{
    LuaRef table = newTable(L);

    for( WidgetListIter i = gWidgets.begin(); i != gWidgets.end(); i++ )
    {
        table[i->first] = i->second;
    }

    return table;
}
コード例 #4
0
ファイル: Mdi.cpp プロジェクト: Jmos/vaca
/**
   Returns a MdiChild by its ID.
*/
MdiChild* MdiClient::getChildById(int wID)
{
  WidgetList children = getChildren();

  for (WidgetList::iterator
	 it=children.begin(); it!=children.end(); ++it) {
    HWND hChild = (*it)->getHandle();
    assert(hChild != NULL);

    if (GetWindowLong(hChild, GWL_ID) == wID)
      return static_cast<MdiChild*>(*it);
  }

  return NULL;
}
コード例 #5
0
ファイル: Tab.cpp プロジェクト: Jmos/vaca
void Tab::onPageChange(Event& ev)
{
  TabBase::onPageChange(ev);

  WidgetList pages = getChildren();
  int pageIndex = 0;
  int selectedPage = getActivePage();

  for (WidgetList::iterator
	 it = pages.begin(); it != pages.end(); ++it, ++pageIndex) {
    TabPage* page = dynamic_cast<TabPage*>(*it);

    assert(page != NULL);

    page->setVisible(pageIndex == selectedPage);
  }

  layout();
}
コード例 #6
0
bool Window::setNextFocusable() {
    WidgetList focusList;

    if(!getFocusList(focusList)) return false;

    WidgetList::iterator w = focusList.begin();

    // TODO: This needs to be a more complicated object, since the focus may be
    // in a child Window instead of a Widget.
    unsigned int focusedIndex = 0;

    for(unsigned int i = 0; w != focusList.end(); w++, i++) if(*w == _focused) {
        focusedIndex = i;

        break;
    }

    if(focusedIndex < focusList.size() - 1) _setFocused((++w)->get());

    else _setFocused(focusList.front().get());

    return true;
}