This widget serves as a barrier between toolkit, only bridge toolkit (i.e. GtkMac) implements it with whatever specific mechanism they have to host a toolkit widget hierarchy into another toolkit widget hierarchy.

In practise that means the parent and the child of a ForeignPlug are from two different toolkits.
This commit is contained in:
Jeremie Laval 2012-07-26 15:41:23 +01:00
Родитель 4fbaff92dc
Коммит 946c24405c
3 изменённых файлов: 42 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,10 @@
using System;
namespace Xwt.Backends
{
public interface IForeignPlugBackend : IWidgetBackend
{
Xwt.Widget Embedded { get; set; }
}
}

Просмотреть файл

@ -301,6 +301,8 @@
<Compile Include="Xwt\DatePicker.cs" />
<Compile Include="Xwt.Backends\IDatePickerBackend.cs" />
<Compile Include="Xwt\Frame.cs" />
<Compile Include="Xwt\ForeignPlug.cs" />
<Compile Include="Xwt.Backends\IForeignPlugBackend.cs" />
<Compile Include="Xwt\Expander.cs" />
<Compile Include="Xwt.Backends\IExpandBackend.cs" />
</ItemGroup>

30
Xwt/Xwt/ForeignPlug.cs Normal file
Просмотреть файл

@ -0,0 +1,30 @@
using System;
using Xwt.Backends;
namespace Xwt
{
/* This widget can be used to embed Xwt widgets using a different backend than the main application
*/
public class ForeignPlug : Widget
{
public ForeignPlug ()
{
}
IForeignPlugBackend Backend {
get {
return (IForeignPlugBackend)BackendHost.Backend;
}
}
public Xwt.Widget Embedded {
get {
return Backend.Embedded;
}
set {
Backend.Embedded = value;
}
}
}
}