pawsSimpleTreeNode::pawsSimpleTreeNode() { textBox = NULL; image = NULL; SetWidget(new pawsWidget()); factory = "pawsSimpleTreeNode"; }
bool pawsWidgetTreeNode::Load(iDocumentNode* node) { csRef<iDocumentNode> nodewidgetNode, widgetNode; csString factory; pawsWidget* newWidget; name = node->GetAttributeValue("name"); nodewidgetNode = node->GetNode("nodewidget"); if(nodewidgetNode == NULL) return false; widgetNode = nodewidgetNode->GetNode("widget"); if(widgetNode == NULL) return false; factory = widgetNode->GetAttributeValue("factory"); newWidget = PawsManager::GetSingleton().CreateWidget(factory); if(newWidget == NULL) return false; if(! newWidget->Load(widgetNode)) { delete newWidget; return false; } SetWidget(newWidget); return pawsTreeNode::Load(node); }
void EC_WidgetCanvas::Setup(QWidget *widget, const QList<uint> &submeshes, int refresh_per_second) { if (framework->IsHeadless()) return; SetWidget(widget); SetSubmeshes(submeshes); SetRefreshRate(refresh_per_second); }
void EC_WidgetCanvas::ComponentRemoved(IComponent *component, AttributeChange::Type change) { if (framework->IsHeadless()) return; if (component == this) { Stop(); RestoreOriginalMeshMaterials(); SetWidget(0); submeshes_.clear(); } }
int WgTableRow::AddWidget( WgWidget * pWidget ) { // Look for the last empty cell int cell = m_nCells; while( cell > 0 && m_pCells[cell-1].Widget() == 0 ) cell--; // SetWidget( pWidget, cell ); return cell; }
/* MakeEditText - make an edit text or rich edit text control */ static xlValue MakeEditText(xlValue obj,int type) { xlValue hscrollp,vscrollp,autohscrollp,autovscrollp; xlValue label,multilinep,justify,borderp; WidgetPosition pos; FrameWidget *parent; Widget *widget; DWORD style; HWND wnd; /* parse the arguments */ parent = GetArgFrameWidget(); xlGetKeyArg(k_label,xlNil,&label); xlGetKeyArg(k_hscrollp,xlFalse,&hscrollp); xlGetKeyArg(k_vscrollp,xlFalse,&vscrollp); xlGetKeyArg(k_autohscrollp,xlFalse,&autohscrollp); xlGetKeyArg(k_autovscrollp,xlFalse,&autovscrollp); xlGetKeyArg(k_multilinep,xlFalse,&multilinep); xlGetKeyArg(k_justify,s_left,&justify); xlGetKeyArg(k_borderp,xlTrue,&borderp); GetWidgetPosition(&pos); /* setup the style */ style = WS_CHILD | WS_VISIBLE | ES_NOHIDESEL; if (type == wtEditText) style |= DS_LOCALEDIT; if (hscrollp != xlFalse) style |= WS_HSCROLL; if (vscrollp != xlFalse) style |= WS_VSCROLL; if (autohscrollp != xlFalse) style |= ES_AUTOHSCROLL; if (autovscrollp != xlFalse) style |= ES_AUTOVSCROLL; if (multilinep != xlFalse) style |= ES_MULTILINE; if (justify == s_left) style |= ES_LEFT; else if (justify == s_right) style |= ES_RIGHT; else if (justify == s_center) style |= ES_CENTER; else xlError("expecting 'left, 'right or 'center",justify); if (borderp != xlFalse) style |= WS_BORDER; /* allocate the widget data structure */ if (!(widget = MakeWidget(parent,type,sizeof(Widget)))) return xlNil; widget->position = pos; /* make the button */ wnd = CreateWindow(type == wtEditText ? "edit" : "RichEdit", xlStringP(label) ? xlGetString(label) : "Edit Text", style, pos.x, /* horizontal position */ pos.y, /* vertical position */ pos.width, /* width */ pos.height, /* height */ GetParentWnd(parent), (HMENU)widget->childID, hInstance, NULL); /* make sure the widget was created */ if ((widget->wnd = wnd) == NULL) { FreeWidget(widget); return xlNil; } /* store the widget data structure pointer */ SetWindowLong(wnd,GWL_USERDATA,(long)widget); /* setup to filter messages */ widget->wndProc = (WNDPROC)SetWindowLong(widget->wnd,GWL_WNDPROC,(LONG)TextFilter); /* set the font */ SendMessage(wnd,WM_SETFONT,(WPARAM)GetStockObject(ANSI_FIXED_FONT),0); /* return the widget object */ SetWidget(obj,widget); return obj; }
void JWidgetRef::Init() { SetWidget( m_Widget.c_str() ); } // JWidgetRef::Init