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

📄 wxswidgetfactory.h

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

#include <map>
#include "widget.h"

class wxsWidgetFactory
{
	public:
	
        /** Ctor */
		wxsWidgetFactory();
		
		/** Dctor */
		virtual ~wxsWidgetFactory();
	
        /** Getting singleton object */
        static inline wxsWidgetFactory* Get() { return Singleton; }
		
        /** Returning info for widget with given name */
        virtual const wxsWidgetInfo* GetInfo(const wxString& Name);
        
        /** Creating widget with given name */
        virtual wxsWidget* Generate(const wxString& Name,wxsWindowRes* Res);
        
        /** Destroying given widget */
        virtual void Kill(wxsWidget* Widget);
        
        /** Getting first widget */
        virtual const wxsWidgetInfo* GetFirstInfo();
        
        /** Getting next info */
        virtual const wxsWidgetInfo* GetNextInfo();
        
        /** Registring manager inside this factory */
        virtual void RegisterManager(wxsWidgetManager* Manager);
        
	private:
	
        /* Structure comparing strings, used in map */
        struct ltstr
        {
            bool operator()(const wxString* s1, const wxString* s2) const
            {
                return *s1 < *s2;
            }
        };
        
        /** Map used to handle all types of widgets */
        typedef std::map<const wxString*,const wxsWidgetInfo*,ltstr> WidgetsMapT;
        
        /** Iterator for map */
        typedef WidgetsMapT::iterator WidgetsMapI;
        
        /** Map for widgets */
        WidgetsMapT Widgets;
        
        /** Internal iterator */
        WidgetsMapI Iterator;
        
        /* Singleton object */
        static wxsWidgetFactory* Singleton;
};

#endif // WXSWIDGETFACTORY_H

⌨️ 快捷键说明

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