Add XRC handler for wxActivityIndicator control.

The only attribute for this control is a boolean "running" which can be set to
start the indicator on load.

Update the schema, documentation and the XRC sample.
This commit is contained in:
Vadim Zeitlin
2015-03-18 16:10:31 +01:00
parent 3f84cb17ca
commit d2ddb2c7c0
22 changed files with 409 additions and 111 deletions

View File

@@ -0,0 +1,52 @@
/////////////////////////////////////////////////////////////////////////////
// Name: src/xrc/xh_activityindicator.cpp
// Purpose: Implementation of wxActivityIndicator XRC handler.
// Author: Vadim Zeitlin
// Created: 2015-03-18
// Copyright: (c) 2015 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#if wxUSE_XRC && wxUSE_ACTIVITYINDICATOR
#include "wx/xrc/xh_activityindicator.h"
#include "wx/activityindicator.h"
IMPLEMENT_DYNAMIC_CLASS(wxActivityIndicatorXmlHandler, wxXmlResourceHandler)
wxActivityIndicatorXmlHandler::wxActivityIndicatorXmlHandler()
{
AddWindowStyles();
}
wxObject *wxActivityIndicatorXmlHandler::DoCreateResource()
{
XRC_MAKE_INSTANCE(ctrl, wxActivityIndicator)
ctrl->Create(m_parentAsWindow,
GetID(),
GetPosition(), GetSize(),
GetStyle(),
GetName());
SetupWindow(ctrl);
if ( GetBool(wxS("running")) )
ctrl->Start();
return ctrl;
}
bool wxActivityIndicatorXmlHandler::CanHandle(wxXmlNode *node)
{
return IsOfClass(node, wxS("wxActivityIndicator"));
}
#endif // wxUSE_XRC && wxUSE_ACTIVITYINDICATOR