Add ForeignPlug widget
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:
Родитель
4fbaff92dc
Коммит
946c24405c
|
@ -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>
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Загрузка…
Ссылка в новой задаче