![]() UJML Language Reference |
The _x_closeBag() function closes a property bag and returns a boolean value indicating success or failure.
boolean _x_closeBag(string bagName)
|
Parameters |
Description |
|
bagName |
The name of a property bag to close |
The _x_closeBag() function returns a boolean value of true indicating success or false indicating failure.
This function removes a property bag from device memory. See Property Bag Functions. The property bag must have been previously loaded into device memory. See _x_loadBag() function. Once closed the property bag will no longer be accessible by property bag functions until it is loaded again.
The following example shows how to get values from a property bag. It is part of the visualelements.ujml sample.
if (_x_loadBag("&BAG_NAME;"))
{
mSingleLineText =
_x_getBagString("&BAG_NAME;", &BAG_LABEL_TEXT;, mDefaultLabelText);
mMultiLineText =
_x_getBagString("&BAG_NAME;", &BAG_MULTI_LABEL_TEXT;, mDefaultMultiLabelText);
mFontStyleBold =
_x_getBagBoolean("&BAG_NAME;", &BAG_FONT_STYLE_BOLD;, false);
mFontStyleItalic =
_x_getBagBoolean("&BAG_NAME;", &BAG_FONT_STYLE_ITALIC;, false);
mFontStyleUnderlined =
_x_getBagBoolean("&BAG_NAME;", &BAG_FONT_STYLE_UNDERLINED;, false);
mFontStyleOutlined =
_x_getBagBoolean("&BAG_NAME;", &BAG_FONT_STYLE_OUTLINED;, false);
mFontSize =
_x_getBagInt("&BAG_NAME;", &BAG_FONT_SIZE;, &DEFAULT_FONT_SIZE;);
mFontFace =
_x_getBagInt("&BAG_NAME;", &BAG_FONT_FACE;, &DEFAULT_FONT_FACE;);
mForeColor =
_x_getBagInt("&BAG_NAME;", &BAG_FORE_COLOR;, &DEFAULT_FORE_COLOR;);
mBackColor =
_x_getBagInt("&BAG_NAME;", &BAG_BACK_COLOR;, &DEFAULT_BACK_COLOR;);
mOpacity =
_x_getBagInt("&BAG_NAME;", &BAG_OPACITY;, &DEFAULT_OPACITY;);
_x_closeBag("&BAG_NAME;");
}
else
{
&SET_SHARED_VARIABLE_DEFAULTS;
}
The following example shows how to set values into a property bag. It is part of the visualelements.ujml sample.
if (_x_loadBag("&BAG_NAME;"))
{
_x_setBagString("&BAG_NAME;", &BAG_LABEL_TEXT;, mSingleLineText);
_x_setBagString("&BAG_NAME;", &BAG_MULTI_LABEL_TEXT;, mMultiLineText);
_x_setBagBoolean("&BAG_NAME;", &BAG_FONT_STYLE_BOLD;, mFontStyleBold);
_x_setBagBoolean("&BAG_NAME;", &BAG_FONT_STYLE_ITALIC;, mFontStyleItalic);
_x_setBagBoolean("&BAG_NAME;", &BAG_FONT_STYLE_UNDERLINED;, mFontStyleUnderlined);
_x_setBagBoolean("&BAG_NAME;", &BAG_FONT_STYLE_OUTLINED;, mFontStyleOutlined);
_x_setBagInt("&BAG_NAME;", &BAG_FONT_FACE;, mFontFace);
_x_setBagInt("&BAG_NAME;", &BAG_FONT_SIZE;, mFontSize);
_x_setBagInt("&BAG_NAME;", &BAG_FORE_COLOR;, mForeColor);
_x_setBagInt("&BAG_NAME;", &BAG_BACK_COLOR;, mBackColor);
_x_setBagInt("&BAG_NAME;", &BAG_OPACITY;, mOpacity);
_x_storeBag("&BAG_NAME;");
_x_closeBag("&BAG_NAME;");
}|
Copyright (c) 2000-2007 UIEvolution, Inc. All rights reserved.
|
|
What do you think about this topic? Send feedback!
|