⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wxsresource.h

📁 非常好用的可移植的多平台C/C++源代码编辑器
💻 H
字号:
#ifndef WXSRESOURCE_H
#define WXSRESOURCE_H

#include "wxseditor.h"
#include "wxsglobals.h"
#include <wx/treectrl.h>

class wxsProject;
class wxSmith;

class wxsResource: public wxObject
{
	public:
	
        /** Ctor */
		wxsResource(wxsProject* Project,int EditMode);
		
		/** Dctor */
		virtual ~wxsResource();
		
		/** Getting current project */
		inline wxsProject* GetProject() { return Project; }
		
        /** Function opening this resource in eeditor window,
         *  if editor window already exists, it must be activated
         */
        void EditOpen();
        
        /** Function closing editor window, if window is closed, no action
         *  should be performed
         */
        void EditClose();
        
        /** Function returning currently openeditor, NULL if there's no one */
        inline wxsEditor* GetEditor() { return Editor; }
        
        /** Ckecking if this resource ecan be Previewed */
        virtual bool CanPreview() { return false; }
        
        /** This function should show preview in modal */
        virtual void ShowPreview() { }

        /** Getting resource name */
        virtual const wxString& GetResourceName() = 0;
        
        /** Notifying resource about content change */
        virtual void NotifyChange() { }
        
        /** Getting current edit mode */
        inline int GetEditMode() { return (int)EditMode & ~(int)wxsResBroken; }
        
        /** Setting Edit mode */
        inline void SetEditMode(int Mode) { EditMode = Mode; }

        /** Checking if this resource is broken */
        inline bool IsResBroken() { return (EditMode & wxsResBroken) != 0; }
        
        /** Changing broken flag */
        inline void SetResBroken(bool Broken) { EditMode = GetEditMode() | Broken ? wxsResBroken : 0; }
        
        /** Grtting current tree item in resource browser */
        inline wxTreeItemId GetTreeItemId() { return ItemId; }
		
    protected:
    
        /** Function which should create editor window.
         *
         *  Editor window shouldn't be created when call to this function is made
         */
        virtual wxsEditor* CreateEditor() = 0;
        
        /** Function notifying that editor has just been closed */
        virtual void EditorClosed() {}
        
        /** Function setting tree item in resource browser */
        inline void SetTreeItemId(wxTreeItemId Id) { ItemId = Id; }
        
    private:
    
        void EditorSaysHeIsClosing();
        friend class wxsEditor;
    
        wxsEditor* Editor;
        wxsProject* Project;
        int EditMode;
        wxTreeItemId ItemId;
        
};

#endif // WXSRESOURCE_H

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -