MGUI::XMLFORM_DATA Class Reference

Class used to pass data back and forth between programs and MGUI::DLG_XML and MGUI::LAYOUT_PANE_XML. More...

#include <mgui/xmldata.h>

Inheritance diagram for MGUI::XMLFORM_DATA:
Inheritance graph
[legend]

List of all members.

Public Types

enum  PROPERTY { PROPERTY_Value = 0, PROPERTY_Min, PROPERTY_Max }

Public Member Functions

 XMLFORM_DATA (const XMLFORM_DATA &)
 XMLFORM_DATA (const XMLNODE *InitialValues)
 XMLFORM_DATA ()
XMLNODEGetRecordNode () const
bool GetValue (const char *id, COLOR &value) const
bool GetValue (const char *id, bool &value) const
bool GetValue (const char *id, INT32 &value, XMLFORM_DATA::PROPERTY property=PROPERTY_Value) const
bool GetValue (const char *id, double &value, XMLFORM_DATA::PROPERTY property=PROPERTY_Value) const
bool GetValue (const char *id, MISTRING &value) const
void SetValue (const char *id, const COLOR &value)
void SetValue (const char *id, bool value)
void SetValue (const char *id, double value, XMLFORM_DATA::PROPERTY property=PROPERTY_Value)
void SetValue (const char *id, const MISTRING &value)

Detailed Description

Class used to pass data back and forth between programs and MGUI::DLG_XML and MGUI::LAYOUT_PANE_XML.

The actual form data is stored in an XML document which looks something like this...

   <?xml version="1.0" encoding="utf-8"?>
   <struct>
      <member id="FirstName">John</member>
      <member id="LastName">Doe</member>
      <member id="Age" value="45"/>
   </struct>

Although I may settle on placing the value always in a "value" attribute instead of as the content of the <member> tag, or always in the contents of the member tag as a CDATA section

Data storage:

Toggle Buttons: Toggle buttons are treated as numeric fields with 1 or 0 as the only possible values. You can use the XMLNODE Get/Set property methods which take and return bool to retrieve this.


Member Enumeration Documentation

Enumerator:
PROPERTY_Value 

The "value" attribute.

PROPERTY_Min 
PROPERTY_Max 

Constructor & Destructor Documentation

MGUI::XMLFORM_DATA::XMLFORM_DATA (  ) 

Default constructor.

MGUI::XMLFORM_DATA::XMLFORM_DATA ( const XMLNODE InitialValues  ) 

Constructor.

Copies initial values from the given node

MGUI::XMLFORM_DATA::XMLFORM_DATA ( const XMLFORM_DATA  ) 

Copy constructor.


Member Function Documentation

XMLNODE* MGUI::XMLFORM_DATA::GetRecordNode (  )  const [inline]

Returns the main record node.

bool MGUI::XMLFORM_DATA::GetValue ( const char *  id,
COLOR value 
) const

Retrieve the value of a single control (INT32).

Returns:
false if the id wasn't found, true if it was
Parameters:
id ID of the control to get value of
value Value returned
bool MGUI::XMLFORM_DATA::GetValue ( const char *  id,
bool &  value 
) const

Retrieve the value of a single control (INT32).

Returns:
false if the id wasn't found, true if it was
Parameters:
id ID of the control to get value of
value Value returned
bool MGUI::XMLFORM_DATA::GetValue ( const char *  id,
INT32 value,
XMLFORM_DATA::PROPERTY  property = PROPERTY_Value 
) const

Retrieve the value of a single control (INT32) Some controls have more than one value.

For example, a range control would have a PROPERTY_Min and a PROPERTY_Max. Currently, only numeric controls can have more than one property

Returns:
false if the id wasn't found, true if it was
Parameters:
id ID of the control to get value of
value Value returned
bool MGUI::XMLFORM_DATA::GetValue ( const char *  id,
double &  value,
XMLFORM_DATA::PROPERTY  property = PROPERTY_Value 
) const

Retrieve the value of a single control (double) Some controls have more than one value.

For example, a range control would have a PROPERTY_Min and a PROPERTY_Max. Currently, only numeric controls can have more than one property

Returns:
false if the id wasn't found, true if it was
Parameters:
id ID of the control to get value of
value Value returned
bool MGUI::XMLFORM_DATA::GetValue ( const char *  id,
MISTRING value 
) const

Retrieve the value of a single control (MISTRING) Always stores strings as the <member> tag's contents.

Returns:
false if the id wasn't found, true if it was
Parameters:
id ID of the control to get value of
value Value returned
void MGUI::XMLFORM_DATA::SetValue ( const char *  id,
const COLOR value 
)

Set the value of a single control (COLOR).

Parameters:
id ID of the control to get value of
value value to set
void MGUI::XMLFORM_DATA::SetValue ( const char *  id,
bool  value 
)

Set the value of a single control (bool).

Parameters:
id ID of the control to get value of
value Value to set
void MGUI::XMLFORM_DATA::SetValue ( const char *  id,
double  value,
XMLFORM_DATA::PROPERTY  property = PROPERTY_Value 
)

Set the value of a single control (double).

Parameters:
id ID of the control to get value of
value Value to set
void MGUI::XMLFORM_DATA::SetValue ( const char *  id,
const MISTRING value 
)

Set the value of a single control (MISTRING).

Parameters:
id ID of the control to get value of
value Value to set

The documentation for this class was generated from the following file:

Generated on Sun Oct 7 21:36:23 2012 for TNTsdk 2012 by  doxygen 1.6.1