|
Lines 70-76
Link Here
|
| 70 |
|
70 |
|
| 71 |
if( (pObjFactory->nInventor == DlgInventor) && |
71 |
if( (pObjFactory->nInventor == DlgInventor) && |
| 72 |
(pObjFactory->nIdentifier >= OBJ_DLG_PUSHBUTTON) && |
72 |
(pObjFactory->nIdentifier >= OBJ_DLG_PUSHBUTTON) && |
| 73 |
(pObjFactory->nIdentifier <= OBJ_DLG_TREECONTROL) ) |
73 |
(pObjFactory->nIdentifier <= OBJ_DLG_HYPERLINKCONTROL) ) |
| 74 |
{ |
74 |
{ |
| 75 |
switch( pObjFactory->nIdentifier ) |
75 |
switch( pObjFactory->nIdentifier ) |
| 76 |
{ |
76 |
{ |
|
Lines 184-259
Link Here
|
| 184 |
pObjFactory->pNewObj = new DlgEdObj( ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlFileControlModel") , xDialogSFact ); |
184 |
pObjFactory->pNewObj = new DlgEdObj( ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlFileControlModel") , xDialogSFact ); |
| 185 |
break; |
185 |
break; |
| 186 |
case OBJ_DLG_TREECONTROL: |
186 |
case OBJ_DLG_TREECONTROL: |
| 187 |
DlgEdObj* pNew = new DlgEdObj( ::rtl::OUString::createFromAscii("com.sun.star.awt.tree.TreeControlModel") , xDialogSFact ); |
187 |
pObjFactory->pNewObj = new DlgEdObj( ::rtl::OUString::createFromAscii("com.sun.star.awt.tree.TreeControlModel") , xDialogSFact ); |
| 188 |
pObjFactory->pNewObj = pNew; |
|
|
| 189 |
/* |
| 190 |
try |
| 191 |
{ |
| 192 |
uno::Reference< beans::XPropertySet > xPSet(pNew->GetUnoControlModel(), uno::UNO_QUERY); |
| 193 |
if (xPSet.is()) |
| 194 |
{ |
| 195 |
// first create a data model for our tree control |
| 196 |
Reference< XComponentContext > xComponentContext; |
| 197 |
|
| 198 |
Reference< XPropertySet > xPropSet( xInterface, UNO_QUERY ); |
| 199 |
xPropSet->getPropertyValue( OUString::createFromAscii("DefaultContext") ) >>= xComponentContext; |
| 200 |
|
| 201 |
// gets the service manager from the office |
| 202 |
Reference< XMultiComponentFactory > xMultiComponentFactoryServer( xComponentContext->getServiceManager() ); |
| 203 |
|
| 204 |
|
| 205 |
// gets the TreeDataModel |
| 206 |
Reference< XMutableTreeDataModel > xTreeDataModel; |
| 207 |
|
| 208 |
xTreeDataModel = Reference< XMutableTreeDataModel >( |
| 209 |
xMultiComponentFactoryServer->createInstanceWithContext( |
| 210 |
OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.tree.MutableTreeDataModel" ) ), xComponentContext ), UNO_QUERY_THROW ); |
| 211 |
|
| 212 |
// now fill it with some sample data |
| 213 |
const OUString sRoot( RTL_CONSTASCII_USTRINGPARAM( "Root" ) ); |
| 214 |
|
| 215 |
Reference< XMutableTreeNode > xNode( mxTreeDataModel->createNode( sRoot, false ), UNO_QUERY_THROW ); |
| 216 |
xNode->setDataValue( sRoot ); |
| 217 |
xNode->setExpandedGraphicURL( OUString( RTL_CONSTASCII_USTRINGPARAM( "private:graphicrepository/sd/res/triangle_down.png" ) ) ); |
| 218 |
xNode->setCollapsedGraphicURL( OUString( RTL_CONSTASCII_USTRINGPARAM( "private:graphicrepository/sd/res/triangle_right.png" ) ) ); |
| 219 |
|
| 220 |
const OUString sNode_1( RTL_CONSTASCII_USTRINGPARAM( "Node_1" ) ); |
| 221 |
|
| 222 |
Reference< XMutableTreeNode > xChildNode_1( mxTreeDataModel->createNode( sNode_1, true ), UNO_QUERY_THROW ); |
| 223 |
xChildNode_1->setDataValue( sNode_1 ); |
| 224 |
xChildNode_1->setExpandedGraphicURL( OUString( RTL_CONSTASCII_USTRINGPARAM( "private:graphicrepository/sd/res/triangle_down.png" ) ) ); |
| 225 |
xChildNode_1->setCollapsedGraphicURL( OUString( RTL_CONSTASCII_USTRINGPARAM( "private:graphicrepository/sd/res/triangle_right.png" ) ) ); |
| 226 |
|
| 227 |
xNode->appendChild( xChildNode_1 ); |
| 228 |
|
| 229 |
const OUString sNode_1_1( RTL_CONSTASCII_USTRINGPARAM( "Node_1_1" ) ); |
| 230 |
|
| 231 |
Reference< XMutableTreeNode > xChildNode_1_1( mxTreeDataModel->createNode( sNode_1_1, false ), UNO_QUERY_THROW ); |
| 232 |
xChildNode_1_1->setDataValue( sNode_1_1 ); |
| 233 |
xChildNode_1_1->setExpandedGraphicURL( OUString( RTL_CONSTASCII_USTRINGPARAM( "private:graphicrepository/sd/res/triangle_down.png" ) ) ); |
| 234 |
xChildNode_1_1->setCollapsedGraphicURL( OUString( RTL_CONSTASCII_USTRINGPARAM( "private:graphicrepository/sd/res/triangle_right.png" ) ) ); |
| 235 |
|
| 236 |
xChildNode_1->appendChild( xChildNode_1_1 ); |
| 237 |
|
| 238 |
const OUString sNode_1_1( RTL_CONSTASCII_USTRINGPARAM( "Node_2" ) ); |
| 239 |
|
| 240 |
Reference< XMutableTreeNode > xChildNode_2( mxTreeDataModel->createNode( sNode_2, false ), UNO_QUERY_THROW ); |
| 241 |
xChildNode_2->setDataValue( sNode_2 ); |
| 242 |
xChildNode_2->setNodeGraphicURL( OUString( RTL_CONSTASCII_USTRINGPARAM("private:graphicrepository/sw/imglst/nc20010.png") ) ); |
| 243 |
xNode->appendChild( xChildNode_2 ); |
| 244 |
|
| 245 |
xTreeDataModel->setRoot( xNode ); |
| 246 |
|
| 247 |
|
| 248 |
const OUString sDataModel( RTL_CONSTASCII_USTRINGPARAM( "DataModel" ) ); |
| 249 |
|
| 250 |
xPSet->setPropertyValue( sDataModel, xTreeDataModel ); |
| 251 |
} |
| 252 |
} |
| 253 |
catch(...) |
| 254 |
{ |
| 255 |
}*/ |
| 256 |
break; |
188 |
break; |
|
|
189 |
case OBJ_DLG_HYPERLINKCONTROL: |
| 190 |
pObjFactory->pNewObj = new DlgEdObj( ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlFixedHyperlinkModel"), xDialogSFact ); |
| 191 |
break; |
| 257 |
} |
192 |
} |
| 258 |
} |
193 |
} |
| 259 |
|
194 |
|