使用soui开发的mbc,只支持windows版本
w1146869587
2022-01-24 0408576e9da10015ffa9da0079b8c985113ce4b3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#pragma once
 
#include <core/simplewnd.h>
#include <Scintilla.h>
 
 
// CScintillaWnd
class CScintillaWnd : public CSimpleWnd
{
public:
    static int InitScintilla(HINSTANCE hInst);
    static void UninitScintilla();
    static LPCTSTR GetScintillaWndClass();
 
    CScintillaWnd();
    virtual ~CScintillaWnd();
    BOOL Create (LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, HWND hParentWnd, UINT nID,HINSTANCE hInst);
    BOOL OpenFile(LPCTSTR lpFileName);
    BOOL SaveFile(LPCTSTR lpFileName);
 
    LPCTSTR GetOpenedFileName(){return m_strFileName;}
    void SetOpenedFileName(LPCTSTR pszFileName){m_strFileName=pszFileName;}
 
    LRESULT SendEditor(UINT Msg, WPARAM wParam=0, LPARAM lParam=0) {
        return ::SendMessage(m_hWnd, Msg, wParam, lParam);
    }
 
    void UpdateLineNumberWidth(void);
 
protected:
    // ÏÔʾÐкÅ
    void InitScintillaWnd(void);
    void SetAStyle(int style, COLORREF fore, COLORREF back = RGB(0xff,0xff,0xff), int size = 0, const char* face = NULL);
    // ÉèÖÃXMLµÄÓï·¨¹æÔò
    void SetXmlLexer();
    void GetRange(int start, int end, char* text);
 
    LRESULT OnNotify(int idCtrl, LPNMHDR pnmh);
 
    BEGIN_MSG_MAP_EX(CScintillaWnd)
        MSG_OCM_NOTIFY(OnNotify)
        CHAIN_MSG_MAP(CSimpleWnd)
        REFLECT_NOTIFICATIONS_EX();
    END_MSG_MAP()
 
    SStringT m_strFileName;
};