xj qian
2024-12-06 024d43bd2ed9745999ecd2fad560d6e97e1395ed
update
已修改2个文件
70 ■■■■ 文件已修改
jrj/ext-jrj/ext-jrj.vcxproj 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jrj/xframe/devloper/XDevEditCode.cpp 66 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jrj/ext-jrj/ext-jrj.vcxproj
@@ -1172,8 +1172,8 @@
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
    </ClCompile>
    <ClCompile Include="..\xframe\devloper\XDevEditCode.cpp">
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
    </ClCompile>
    <ClCompile Include="..\xframe\devloper\XDevEditDbmap.cpp">
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
jrj/xframe/devloper/XDevEditCode.cpp
@@ -4,12 +4,16 @@
#include <wobject/xaserverarg.hpp>
#include <xcontrol/xtreeview.hpp>
#include <xcontrol/xlayersheet.hpp>
#include <xcontrol/xtreeview.hpp>
#include <xcontrol/xlayersheet.hpp>
#include <xcontrol/xsedit.hpp>
#include "XDevEditPage.hpp"
using xml = KXMLDOMDocument;
class export XDevEditCode : public xwin
class export XDevEditCode : public XDevEditPage
{
    public:
    XDevEditCode(void* implPtr, HWND hWnd) :xwin(implPtr, hWnd),mle_output(nullptr) {}
    XDevEditCode(void* implPtr, HWND hWnd) :XDevEditPage(implPtr, hWnd){}
public:
    static XDevEditCode* CreateInstance(void* implPtr, void* hWnd)
    {
@@ -18,17 +22,17 @@
    }
private:    //
    xnode    m_agentNode;    //Agent Condition
    string    m_agentCond;    //Agent Node
    xstring    m_agentCond;    //Agent Node
    int SetAgent()
    {
        /*
        string xfNodeAgentArea  = "agentarea";
        xstring xfNodeAgentArea  = L"agentarea";
        xnode anode = GetAgentNode(xfNodeAgentArea);
        var xframeElement =  GetElement();
        var agent = xframeElement.selectSingleNode("agent/"+xfNodeAgentArea+"[1]/*");
        var agent = xframeElement.selectSingleNode(L"agent/"+xfNodeAgentArea+L"[1]/*");
        if(agent)
        {
            string s = agent.xml;
            xstring s = agent.xml;
            m_agentNode =  SetAgentNodeContent (anode,s);
        }
        */
@@ -36,7 +40,7 @@
    }
    //焦点激活处理函数
    int OnSetFocus(ref TEvent evt,int param)
    int OnSetFocus(TEvent* evt, LPARAM param)
    {
        SetAgent();
@@ -45,18 +49,18 @@
    }
    //命令发布函数
    int OnCmdDispatch(string comdid)
    int OnCmdDispatch(xstring comdid)
    {
        if (comdid == "xmFileSaveEx")
        if (comdid == L"xmFileSaveEx")
        {
            xsedit xc = this.GetControl("codecontent");
            xsedit xc = GetControl(L"codecontent");
            int hCursor = xutil::SetCursorWait();
            HCURSOR hCursor = xutil::SetCursorWait();
            string code;
            xstring code;
            //save tpp content
            xc.GetContent(code);
            this.SaveContent(code);
            SaveContent(code);
            //
            xutil::RestoreCursor(hCursor);
@@ -66,40 +70,42 @@
    }
    //命令处理事件
    int OnXCommand(ref TXCommandEvent evt,int param)
    int OnXCommand(TEvent* evt,LPARAM param)
    {
        return OnCmdDispatch(evt.pStrID);
        return OnCmdDispatch(evt->xcommand.pStrID);
    }
    int OnAttachEvent()
    {
        //绑定工具条点击事件
        AttachEvent("WM_XCOMMAND",OnXCommand);
        AttachEvent(L"WM_XCOMMAND",(FEvent)&XDevEditCode::OnXCommand);
        //获取焦点事件,用于重置工具条
        AttachEvent("WM_SETFOCUS",OnSetFocus);
        AttachEvent(L"WM_SETFOCUS", (FEvent)&XDevEditCode::OnSetFocus);
        return 1;
    }
    int LoadData()
    {
        if (!this.GetParam()) return 1;
        if (!GetWinParam()) return 1;
        xwin w = GetFrameWindow();
        xtree tv_folder = w.GetControl("DevExplorer");
        int hItem = this.GetParam();
        IXMLDOMElement e = tv_folder.GetItemData(hItem);
        string caption = e.getAttribute("caption");
        xtreeview tv_folder = w.GetControl(L"DevExplorer");
        HTREEITEM hItem = (HTREEITEM)GetWinParam();
        KXMLDOMElement e = tv_folder.GetItemData(hItem);
        xstring caption = e.getAttribute(L"caption");
        xsedit xc = this.GetControl("codecontent");
        string code = this.GetData();
        if (code == "")code == " ";
       if (caption.find(".vl",0) >= 0 || caption.find(".vm",0) >= 0 || caption.find(".vf",0) >= 0 || caption.find("voc",0) >= 0 || caption.find("vc",0) >= 0)
        xsedit xc = GetControl(L"codecontent");
        xstring code = GetData();
        if (code == L"")code == L" ";
       if (caption.find(L".vl",0) >= 0 || caption.find(L".vm",0) >= 0 || caption.find(L".vf",0) >= 0 || caption.find(L"voc",0) >= 0 || caption.find(L"vc",0) >= 0)
      {
          xc.LoadContent(code,".vl");
          xc.LoadContent(code,L".vl");
       }
       else if (caption.find(".scm",0) >= 0)
          xc.LoadContent(code,".scm");
       else if (caption.find(L".scm",0) >= 0)
          xc.LoadContent(code,L".scm");
       else
          xc.LoadContent(code,".cpp");
          xc.LoadContent(code,L".cpp");
        return 1;
    }