本文整理汇总了C++中WidgetList类的典型用法代码示例。如果您正苦于以下问题:C++ WidgetList类的具体用法?C++ WidgetList怎么用?C++ WidgetList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WidgetList类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: add_from_list
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);
}
}
开发者ID:GustavoMOG,项目名称:ede,代码行数:26,代码来源:Panel.cpp
示例2: pickAtXY
// This method performs intersection testing at the given XY coords, and returns true if
// any intersections were found. It will break after processing the first pickable Window
// it finds.
bool WindowManager::pickAtXY(float x, float y, WidgetList& wl)
{
Intersections intr;
osg::Camera* camera = _view->getCamera();
osgViewer::GraphicsWindow* gw = dynamic_cast<osgViewer::GraphicsWindow*>(camera->getGraphicsContext());
if (gw)
{
_view->computeIntersections(camera, osgUtil::Intersector::WINDOW, x, y, intr, _nodeMask);
}
if (!intr.empty())
{
// Get the first Window at the XY coordinates; if you want a Window to be
// non-pickable, set the NodeMask to something else.
Window* activeWin = 0;
// Iterate over every picked result and create a list of Widgets that belong
// to that Window.
for(Intersections::iterator i = intr.begin(); i != intr.end(); i++) {
Window* win = dynamic_cast<Window*>(i->nodePath.back()->getParent(0));
// Make sure that our window is valid, and that our pick is within the
// "visible area" of the Window.
if(
!win ||
(win->getVisibilityMode() == Window::VM_PARTIAL && !win->isPointerXYWithinVisible(x, y))
) {
continue;
}
// Set our activeWin, so that we know when we've got all the Widgets
// that belong to it.
if(!activeWin) activeWin = win;
// If we've found a new Widnow, break out!
else if(activeWin != win) break;
Widget* widget = dynamic_cast<Widget*>(i->drawable.get());
if(!widget) continue;
// We need to return a list of every Widget that was picked, so
// that the handler can operate on it accordingly.
else wl.push_back(widget);
}
if(wl.size()) {
// Potentially VERY expensive; only to be used for debugging. :)
if(_flags & WM_PICK_DEBUG) _updatePickWindow(&wl, x, y);
return true;
}
}
if(_flags & WM_PICK_DEBUG) _updatePickWindow(0, x, y);
return false;
}
开发者ID:yueying,项目名称:osg,代码行数:63,代码来源:WindowManager.cpp
示例3: getWidgetList
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;
}
开发者ID:merlinblack,项目名称:LuaBridgeTest,代码行数:11,代码来源:stdlist.cpp
示例4: setFirstFocusable
bool Window::setFirstFocusable() {
WidgetList focusList;
if(getFocusList(focusList)) {
_setFocused(focusList.front().get());
return true;
}
return false;
}
开发者ID:dev2dev,项目名称:OpenSceneGraph-port-to-IOS,代码行数:11,代码来源:Window.cpp
示例5: getChildren
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);
}
}
开发者ID:Jmos,项目名称:vaca,代码行数:11,代码来源:SplitBar.cpp
示例6: registeredWidgets
//____________________________________________________________
BaseEngine::WidgetList WidgetStateEngine::registeredWidgets( AnimationModes mode ) const
{
WidgetList out;
// the typedef is needed to make Krazy happy
typedef DataMap<WidgetStateData>::Value Value;
if( mode&AnimationHover )
{
foreach( const Value& value, hoverData_ )
{ if( value ) out.insert( value.data()->target().data() ); }
}
开发者ID:Archer90,项目名称:MuseScore,代码行数:14,代码来源:widgetstateengine.cpp
示例7: RoundTextBox
WidgetList * WidgetList::clone(){
WidgetList * list = WidgetList::createNiceList(parent());
list->setStyle(style());
list->setLocation(mapToParent(Nimble::Vector2(0, 0)));
for (ItemList::iterator it = m_itemList.begin(); it != m_itemList.end(); ++it ) {
RoundTextBox * tb = dynamic_cast<RoundTextBox*>(*it);
RoundTextBox * tb2 = new RoundTextBox(0, 0, MultiWidgets::TextBox::HCENTER);
tb2->setCSSClass("FloatingWord_clone");
tb2->setStyle(tb->style());
tb2->setText(tb->text());
tb2->setWidth(tb->width());
tb2->setHeight(tb->height());
tb2->setAlignFlags(MultiWidgets::TextBox::HCENTER | MultiWidgets::TextBox::VCENTER);
list->addItem(tb2);
}
//layout();
list->layout();
list->setDepth(depth());
list->setScale(scale());
list->setRotation(rotation());
return list;
}
开发者ID:mpenttila,项目名称:vacuum,代码行数:25,代码来源:widgetlist.cpp
示例8:
void QFormScriptRunner::QFormScriptRunnerPrivate::initializeEngine(QWidget *w, const WidgetList &children, QScriptEngine &scriptEngine) {
// Populate the script variables. This pushes a context which must be popped.
QScriptContext *ctx = scriptEngine.pushContext();
QScriptValue widgetObject = scriptEngine.newQObject(w);
QScriptValue childrenArray = scriptEngine.newArray (children.size());
for(int i = 0; i < children.size(); i++) {
childrenArray.setProperty(i, scriptEngine.newQObject(children[i]));
}
const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
ctx ->activationObject().setProperty(strings.scriptWidgetVariable, widgetObject);
ctx ->activationObject().setProperty(strings.scriptChildWidgetsVariable, childrenArray);
}
开发者ID:Fale,项目名称:qtmoko,代码行数:14,代码来源:formscriptrunner.cpp
示例9: getChildren
/**
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;
}
开发者ID:Jmos,项目名称:vaca,代码行数:18,代码来源:Mdi.cpp
示例10: getFocusList
bool Window::getFocusList(WidgetList& wl) const {
for(ConstIterator i = begin(); i != end(); i++) if(i->valid()) {
EmbeddedWindow* ew = dynamic_cast<EmbeddedWindow*>(i->get());
if(!ew) {
if(i->get()->canFocus()) wl.push_back(i->get());
}
else {
if(ew->getWindow()) ew->getWindow()->getFocusList(wl);
}
}
return wl.size() != 0;
}
开发者ID:dev2dev,项目名称:OpenSceneGraph-port-to-IOS,代码行数:15,代码来源:Window.cpp
示例11: getChildren
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();
}
开发者ID:Jmos,项目名称:vaca,代码行数:19,代码来源:Tab.cpp
示例12: PyErr_SetString
PyObject *viewList(PyObject *, PyObject *args)
{
if( !PyArg_ParseTuple(args, "") ){
PyErr_SetString(PyExc_TypeError, "no args required");
return NULL;
}
CUTE *cute = static_cast<CUTE*>(qApp->mainWidget());
PyObject *tuple = PyTuple_New(cute->windowsCount());
WidgetList list = cute->windows();
int i = 0;
for( QWidget* view = list.first(); view; view=list.next() ){
Buffer *buf = PyObject_New(Buffer, &buffer_type);
buf->view = static_cast<CUTEView*>(view)->scintilla();
Py_INCREF((PyObject*)buf);
PyTuple_SetItem(tuple, i, (PyObject*)buf);
i++;
}
return (PyObject*)tuple;
}
开发者ID:hkoehler,项目名称:cute,代码行数:21,代码来源:python_api.cpp
示例13: test
void test( lua_State* L )
{
getGlobalNamespace( L )
.beginClass<Widget>("Widget")
.addData("something", &Widget::something )
.endClass()
.addFunction( "getWidgets", &getWidgetList );
gWidgets.insert( std::pair<int, Widget::Ptr>( 1, new Widget(10) ) );
gWidgets.insert( std::pair<int, Widget::Ptr>( 2, new Widget(20) ) );
gWidgets.insert( std::pair<int, Widget::Ptr>( 3, new Widget(30) ) );
const char *source =
"print( _VERSION )\n"
"function dump(t)\n"
" print( 'Dump:' )\n"
" for k,v in pairs(t) do\n"
" print( k, v.something )\n"
" end\n"
"end\n";
cout << source << endl;
if( luaL_dostring( L, source ) )
{
cout << lua_tostring( L, -1 ) << endl;
lua_pop( L, 1 );
return;
}
for( int i=0; i <= 500; i++ )
{
luaL_dostring( L, "dump( getWidgets() )" );
lua_gc( L, LUA_GCCOLLECT, 0 );
}
return;
}
开发者ID:merlinblack,项目名称:LuaBridgeTest,代码行数:38,代码来源:stdlist.cpp
示例14: setNextFocusable
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;
}
开发者ID:dev2dev,项目名称:OpenSceneGraph-port-to-IOS,代码行数:23,代码来源:Window.cpp
示例15: WidgetList
WidgetList * WidgetList::createNiceList(Widget * parent, Widget * content) {
WidgetList * list = new WidgetList(parent);
if (content)
list->addItem(content);
list->setDepth(-1);
list->raiseFlag(WidgetList::LOCK_DEPTH);
list->addOperator(new MultiWidgets::StayInsideParentOperator);
//list->addOperator(new MultiWidgets::RotateTowardsHandsOperator);
list->addOperator(new MultiWidgets::LimitScaleOperator(MultiWidgets::LimitScaleOperator::COMPARE_SCALE,
1.0f, 2.0f));
return list;
}
开发者ID:mpenttila,项目名称:vacuum,代码行数:12,代码来源:widgetlist.cpp
示例16: run
bool QFormScriptRunner::run(const DomWidget *domWidget,
const QString &customWidgetScript,
QWidget *widget, const WidgetList &children,
QString *errorMessage)
{
typedef QList<DomScript*> DomScripts;
const Options scriptOptions = m_impl->options();
if (scriptOptions & DisableScripts)
return true;
// get list
const DomScripts domScripts = domWidget->elementScript();
// Concatenate snippets, starting with custom widget script
QString script = customWidgetScript;
if (script.isEmpty() && domScripts.empty())
return true;
foreach (const DomScript *scriptSnippet, domScripts) {
// Ensure new line
if (!script.isEmpty() && !script.endsWith(QLatin1Char('\n')))
script += QLatin1Char('\n');
script += scriptSnippet->text();
}
if (script.isEmpty())
return true;
const bool rc = m_impl->run(script, widget, children, errorMessage);
if (debugFormScriptRunner) {
qDebug() << "For " << widget << " with " << children.size() << " children, ran: " << script;
if (!rc)
qDebug() << *errorMessage;
}
if (!rc) {
if (!(scriptOptions & DisableWarnings)) {
const QString message = QCoreApplication::tr("An error occurred while running the script for %1: %2\nScript: %3").
arg(widget->objectName()).arg(*errorMessage).arg(script);
qWarning() << message;
}
}
return rc;
}
开发者ID:Fale,项目名称:qtmoko,代码行数:44,代码来源:formscriptrunner.cpp
示例17: callback_WidgetListScroller
void callback_WidgetListScroller(Scrollbar* s)
{
WidgetList* f = (WidgetList*)s->mParent;
f->UpdateChildrenPositions();
}
开发者ID:McManning,项目名称:fro_client,代码行数:5,代码来源:WidgetList.cpp
注:本文中的WidgetList类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论