本文整理汇总了C++中PProperty::GetValueAsString方法的典型用法代码示例。如果您正苦于以下问题:C++ PProperty::GetValueAsString方法的具体用法?C++ PProperty::GetValueAsString怎么用?C++ PProperty::GetValueAsString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PProperty
的用法示例。
在下文中一共展示了PProperty::GetValueAsString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetPropertyAsString
wxString ObjectBase::GetPropertyAsString (const wxString& pname)
{
PProperty property = GetProperty( pname );
if (property)
return property->GetValueAsString();
else
return wxString();
}
示例2: SetupWindow
void VisualEditor::SetupWindow( PObjectBase obj, wxWindow* window )
{
// All of the properties of the wxWindow object are applied in this function
// Position
/* Position does nothing in wxFB - this is pointless
wxPoint pos;
PProperty ppos = obj->GetProperty( wxT("pos") );
if ( ppos )
{
pos = TypeConv::StringToPoint( ppos->GetValue() );
}
*/
// Size
wxSize size = obj->GetPropertyAsSize( wxT("size") );
if ( size != wxDefaultSize )
{
window->SetSize( size );
}
// Minimum size
wxSize minsize = obj->GetPropertyAsSize( wxT("minimum_size") );
if ( minsize != wxDefaultSize )
{
window->SetMinSize( minsize );
}
// Maximum size
wxSize maxsize = obj->GetPropertyAsSize( wxT("maximum_size") );
if ( maxsize != wxDefaultSize )
{
window->SetMaxSize( maxsize );
}
// Font
PProperty pfont = obj->GetProperty( wxT("font") );
if ( pfont && !pfont->GetValue().empty() )
{
window->SetFont( TypeConv::StringToFont( pfont->GetValue() ) );
}
// Foreground
PProperty pfg_colour = obj->GetProperty( wxT("fg") );
if ( pfg_colour && !pfg_colour->GetValue().empty() )
{
window->SetForegroundColour( TypeConv::StringToColour( pfg_colour->GetValue() ) );
}
// Background
PProperty pbg_colour = obj->GetProperty( wxT("bg") );
if ( pbg_colour && !pbg_colour->GetValue().empty() )
{
window->SetBackgroundColour( TypeConv::StringToColour( pbg_colour->GetValue() ) );
}
// Extra Style
PProperty pextra_style = obj->GetProperty( wxT("window_extra_style") );
if ( pextra_style )
{
window->SetExtraStyle( TypeConv::StringToInt( pextra_style->GetValue() ) );
}
// Enabled
PProperty penabled = obj->GetProperty( wxT("enabled") );
if ( penabled )
{
window->Enable( ( penabled->GetValueAsInteger() !=0 ) );
}
// Hidden
PProperty phidden = obj->GetProperty( wxT("hidden") );
if ( phidden )
{
window->Show( !phidden->GetValueAsInteger() );
}
// Tooltip
PProperty ptooltip = obj->GetProperty( wxT("tooltip") );
if ( ptooltip )
{
window->SetToolTip( ptooltip->GetValueAsString() );
}
}
示例3: GenerateCode
bool PHPCodeGenerator::GenerateCode( PObjectBase project )
{
if (!project)
{
wxLogError(wxT("There is no project to generate code"));
return false;
}
m_i18n = false;
PProperty i18nProperty = project->GetProperty( wxT("internationalize") );
if (i18nProperty && i18nProperty->GetValueAsInteger())
m_i18n = true;
m_disconnectEvents = ( project->GetPropertyAsInteger( wxT("disconnect_php_events") ) != 0 );
m_source->Clear();
// Insert php preamble
wxString code = GetCode( project, wxT("php_preamble") );
if ( !code.empty() )
{
m_source->WriteLn( code );
m_source->WriteLn( wxEmptyString );
}
code = (
wxT("/*\n")
wxT(" * PHP code generated with wxFormBuilder (version ") wxT(__DATE__) wxT(")\n")
wxT(" * http://www.wxformbuilder.org/\n")
wxT(" *\n")
wxT(" * PLEASE DO *NOT* EDIT THIS FILE!\n")
wxT(" */\n") );
m_source->WriteLn( code );
PProperty propFile = project->GetProperty( wxT("file") );
if (!propFile)
{
wxLogError( wxT("Missing \"file\" property on Project Object") );
return false;
}
wxString file = propFile->GetValue();
if ( file.empty() )
{
file = wxT("noname");
}
// Generate the subclass sets
std::set< wxString > subclasses;
std::vector< wxString > headerIncludes;
GenSubclassSets( project, &subclasses, &headerIncludes );
// Generating in the .h header file those include from components dependencies.
std::set< wxString > templates;
GenIncludes(project, &headerIncludes, &templates );
// Write the include lines
std::vector<wxString>::iterator include_it;
for ( include_it = headerIncludes.begin(); include_it != headerIncludes.end(); ++include_it )
{
m_source->WriteLn( *include_it );
}
if ( !headerIncludes.empty() )
{
m_source->WriteLn( wxT("") );
}
// Write internationalization support
if( m_i18n )
{
//PHP gettext already implements this function
//m_source->WriteLn( wxT("function _(){ /*TODO: Implement this function on wxPHP*/ }") );
//m_source->WriteLn( wxT("") );
}
// Generating "defines" for macros
GenDefines( project );
wxString eventHandlerPostfix;
PProperty eventKindProp = project->GetProperty( wxT("skip_php_events") );
if( eventKindProp->GetValueAsInteger() )
{
eventHandlerPostfix = wxT("$event->Skip();");
}
else
eventHandlerPostfix = wxT("");
PProperty disconnectMode = project->GetProperty( wxT("disconnect_mode") );
m_disconnecMode = disconnectMode->GetValueAsString();
for ( unsigned int i = 0; i < project->GetChildCount(); i++ )
{
PObjectBase child = project->GetChild( i );
EventVector events;
FindEventHandlers( child, events );
//.........这里部分代码省略.........
示例4: SetupWindow
void VisualEditor::SetupWindow( PObjectBase obj, wxWindow* window )
{
// All of the properties of the wxWindow object are applied in this function
// Position
/* Position does nothing in wxFB - this is pointless
wxPoint pos;
PProperty ppos = obj->GetProperty( wxT("pos") );
if ( ppos )
{
pos = TypeConv::StringToPoint( ppos->GetValue() );
}
*/
// Size
wxSize size = obj->GetPropertyAsSize( wxT("size") );
if ( size != wxDefaultSize )
{
window->SetSize( size );
}
// Minimum size
wxSize minsize = obj->GetPropertyAsSize( wxT("minimum_size") );
if ( minsize != wxDefaultSize )
{
window->SetMinSize( minsize );
}
// Maximum size
wxSize maxsize = obj->GetPropertyAsSize( wxT("maximum_size") );
if ( maxsize != wxDefaultSize )
{
window->SetMaxSize( maxsize );
}
// Font
PProperty pfont = obj->GetProperty( wxT("font") );
if ( pfont && !pfont->GetValue().empty() )
{
window->SetFont( TypeConv::StringToFont( pfont->GetValue() ) );
}
// Foreground
PProperty pfg_colour = obj->GetProperty( wxT("fg") );
if ( pfg_colour && !pfg_colour->GetValue().empty() )
{
window->SetForegroundColour( TypeConv::StringToColour( pfg_colour->GetValue() ) );
}
// Background
PProperty pbg_colour = obj->GetProperty( wxT("bg") );
if ( pbg_colour && !pbg_colour->GetValue().empty() )
{
window->SetBackgroundColour( TypeConv::StringToColour( pbg_colour->GetValue() ) );
}
// Extra Style
PProperty pextra_style = obj->GetProperty( wxT("window_extra_style") );
if ( pextra_style )
{
window->SetExtraStyle( TypeConv::StringToInt( pextra_style->GetValue() ) );
}
// Enabled
PProperty penabled = obj->GetProperty( wxT("enabled") );
if ( penabled )
{
window->Enable( ( penabled->GetValueAsInteger() !=0 ) );
}
// Hidden
PProperty phidden = obj->GetProperty( wxT("hidden") );
if ( phidden )
{
window->Show( !phidden->GetValueAsInteger() );
}
// Tooltip
PProperty ptooltip = obj->GetProperty( wxT("tooltip") );
if ( ptooltip )
{
window->SetToolTip( ptooltip->GetValueAsString() );
}
//AUI
wxString tname = obj->GetObjectInfo()->GetObjectType()->GetName();
if( m_auimgr && ( tname == wxT("widget") ||
tname == wxT("expanded_widget") ||
tname == wxT("container") ||
tname == wxT("notebook") ||
tname == wxT("auinotebook") ||
tname == wxT("choicebook") ||
tname == wxT("treelistctrl") ||
tname == wxT("splitter") ) )
{
if( obj->GetParent()->GetObjectTypeName() == wxT("form") )
{
SetupAui(obj, window);
}
}
//.........这里部分代码省略.........
示例5: GenConstruction
//.........这里部分代码省略.........
type == wxT("menu") ||
type == wxT("submenu") ||
type == wxT("toolbar") ||
type == wxT("ribbonbar") ||
type == wxT("listbook") ||
type == wxT("simplebook") ||
type == wxT("notebook") ||
type == wxT("auinotebook") ||
type == wxT("treelistctrl") ||
type == wxT("flatnotebook") ||
type == wxT("wizard")
)
{
wxString afterAddChild = GetCode( obj, wxT("after_addchild") );
if ( !afterAddChild.empty() )
{
m_source->WriteLn( afterAddChild );
}
m_source->WriteLn();
}
}
else if ( info->IsSubclassOf( wxT("sizeritembase") ) )
{
// The child must be added to the sizer having in mind the
// child object type (there are 3 different routines)
GenConstruction( obj->GetChild(0), false );
PObjectInfo childInfo = obj->GetChild(0)->GetObjectInfo();
wxString temp_name;
if ( childInfo->IsSubclassOf( wxT("wxWindow") ) || wxT("CustomControl") == childInfo->GetClassName() )
{
temp_name = wxT("window_add");
}
else if ( childInfo->IsSubclassOf( wxT("sizer") ) )
{
temp_name = wxT("sizer_add");
}
else if ( childInfo->GetClassName() == wxT("spacer") )
{
temp_name = wxT("spacer_add");
}
else
{
LogDebug( wxT("SizerItem child is not a Spacer and is not a subclass of wxWindow or of sizer.") );
return;
}
m_source->WriteLn( GetCode( obj, temp_name ) );
}
else if ( type == wxT("notebookpage") ||
type == wxT("flatnotebookpage") ||
type == wxT("listbookpage") ||
type == wxT("simplebookpage") ||
type == wxT("choicebookpage") ||
type == wxT("auinotebookpage")
)
{
GenConstruction( obj->GetChild( 0 ), false );
m_source->WriteLn( GetCode( obj, wxT("page_add") ) );
GenSettings( obj->GetObjectInfo(), obj );
}
else if ( type == wxT("treelistctrlcolumn") )
{
m_source->WriteLn( GetCode( obj, wxT("column_add") ) );
GenSettings( obj->GetObjectInfo(), obj );
}
else if ( type == wxT("tool") )
{
// If loading bitmap from ICON resource, and size is not set, set size to toolbars bitmapsize
// So hacky, yet so useful ...
wxSize toolbarsize = obj->GetParent()->GetPropertyAsSize( _("bitmapsize") );
if ( wxDefaultSize != toolbarsize )
{
PProperty prop = obj->GetProperty( _("bitmap") );
if ( prop )
{
wxString oldVal = prop->GetValueAsString();
wxString path, source;
wxSize toolsize;
TypeConv::ParseBitmapWithResource( oldVal, &path, &source, &toolsize );
if ( wxT("Load From Icon Resource") == source && wxDefaultSize == toolsize )
{
prop->SetValue( wxString::Format( wxT("%s; %s [%i; %i]"), path.c_str(), source.c_str(), toolbarsize.GetWidth(), toolbarsize.GetHeight() ) );
m_source->WriteLn( GetCode( obj, wxT("construction") ) );
prop->SetValue( oldVal );
return;
}
}
}
m_source->WriteLn( GetCode( obj, wxT("construction") ) );
}
else
{
// Generate the children
for ( unsigned int i = 0; i < obj->GetChildCount(); i++ )
{
GenConstruction( obj->GetChild( i ), false );
}
}
}