Dashboard > NeL > ... > NeLDocumentation > SimpleSheet
SimpleSheet
Added by Matt Raykowski, last edited by Matt Raykowski on Dec 11, 2006
Labels: 
(None)


UNDER CONSTRUCTION

For 'simple' loading of sheets, you need to do the following

Steps

  • 1 - have added the search path for the sheets you want to load.
  • 2 - you alse need to have the required DFN and TYP files in you serach path.
  • 3 - create a georges form loader.
    NLGEORGES::UFormLoader *formLoader = NLGEORGES::UFormLoader::createLoader();

( NB : this loader can be used to load many sheeta, so keep it )

  • 4 - load a form
    NLMISC::CSmartPtr<NLGEORGES::UForm> form = formLoader->loadForm ('"the_sheet_file.sheet_type");

sheet_type is the extension of the sheet file. It must match with the dfn name for example 'foo.dfn' will allow loading of '*.foo' sheets.

In other words, when loadForm is passed 'bar.foo' as sn input file, it will try to find the 'foo.dfn' format file. If it doesn't find it, the loading fail.

Now you have the 'form' you can acces data using the form interface by gaining acces to the root element of the form using.

const NLGEORGES::UFormElm &formElm = form->getRootNode()

then you can access data like this

bool myBool;
formElm.getValueByName( myBool,  "a_name.a_sub_part.a_data_as_boolean" );

( NB : you have the equivalent setValuByName to set the value in an element )

look at UFormElem for a list of accessors

( NB : the interface is not complete to do all editing (I don't know how to set an array size for example ) )

Site running on a free Atlassian Confluence Open Source Project License granted to Open NeL (Open Nevrax Library, community branch of NeL). Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.4 Build:#809 Jun 12, 2007) - Bug/feature request - Contact Administrators