LiFan
2025-02-13 03ef0b51103c735077c784c7df81ae2bcc1599ab
jrj/xframe/wobject/xwin.hpp
@@ -6,11 +6,14 @@
#include "win32/win.hpp"
#include "wobject/xnode.hpp"
#include "wobject/xurl.hpp"
#include "wobject/xpage.hpp"
#include "wobject/xnode.hpp"
using kwin=Hxsoft::XFrame::IXFWin;
using kcontrol = Hxsoft::XFrame::IXFControl;
using knode = Hxsoft::XFrame::IXNode;
#define export __declspec(dllexport)
#define DeclWinObject_(ty,pty) class __declspec(dllexport) ty :  public pty
#define CreateWinObject_(ty,pty) \
public:\
@@ -41,6 +44,8 @@
   }
public:
   xwin(void * impl, HWND hWnd):xview(impl,hWnd){}
   xwin(kwin* kw) :xview(kw ? kw : nullptr, kw ? kw->GetHWND() : 0) {}
   const xwin& operator =(kwin* kw) { this->SetNativePtr(kw ? kw : nullptr); this->SetHandle(kw ? kw->GetHWND() : 0); return *this; }
public:
   kwin* getKWin()
   {
@@ -120,6 +125,11 @@
   xnode SetAgentNode(xnode node,xnode val)
   {
      return xnode(getKWin()->SetAgentNodeContent((knode*)node.getNativePointer(), (knode*)val.getNativePointer()));
   }
   xnode GetXNode()
   {
      return xnode(getKWin()->GetXNode());
   }
   Hxsoft::XFrame::IXPage* GetXPage()
@@ -251,4 +261,18 @@
   {
      return getKWin()->SwitchLayer((LPTSTR)pStrLayerSheet, (LPTSTR)pStrLayerFrame);
   }
   xpage GetChildXPage(string name)
   {
      xnode tnode = GetXNode().GetNodeByName(name);
      if (!tnode) return 0;
      return tnode.GetXPage();
   }
   kwin* GetChildWin(string name)
   {
      xpage tpage = GetChildXPage(name);
      if (!tpage) return nullptr;
      return tpage.GetWin();
   }
};