一、Init
void Init(HWND hWnd, LPCTSTR pstrName = NULL);初始化界面元素,清除所有的图片、字体、……总之就是一切恢复到原始状态了
二、Invalidate
void Invalidate(); void Invalidate(RECT& rcItem);刷新界面,刷新某个区域
三、pos与size
关于界面位置与尺寸
POINT GetMousePos() const; SIZE GetClientSize() const; SIZE GetInitSize(); void SetInitSize(int cx, int cy); RECT& GetSizeBox(); void SetSizeBox(RECT& rcSizeBox); RECT& GetCaptionRect(); void SetCaptionRect(RECT& rcCaption); SIZE GetRoundCorner() const; void SetRoundCorner(int cx, int cy); SIZE GetMinInfo() const; void SetMinInfo(int cx, int cy); SIZE GetMaxInfo() const; void SetMaxInfo(int cx, int cy);
关于字体
TFontInfo* GetDefaultFontInfo(); void SetDefaultFont(LPCTSTR pStrFontName, int nSize, bool bBold, bool bUnderline, bool bItalic, bool bShared = false); DWORD GetCustomFontCount(bool bShared = false) const; HFONT AddFont(int id, LPCTSTR pStrFontName, int nSize, bool bBold, bool bUnderline, bool bItalic, bool bShared = false); HFONT GetFont(int id); HFONT GetFont(LPCTSTR pStrFontName, int nSize, bool bBold, bool bUnderline, bool bItalic); int GetFontIndex(HFONT hFont, bool bShared = false); int GetFontIndex(LPCTSTR pStrFontName, int nSize, bool bBold, bool bUnderline, bool bItalic, bool bShared = false); void RemoveFont(HFONT hFont, bool bShared = false); void RemoveFont(int id, bool bShared = false); void RemoveAllFonts(bool bShared = false); TFontInfo* GetFontInfo(int id); TFontInfo* GetFontInfo(HFONT hFont);
关于图片
const TImageInfo* GetImage(LPCTSTR bitmap); const TImageInfo* GetImageEx(LPCTSTR bitmap, LPCTSTR type = NULL, DWORD mask = 0, bool bUseHSL = false); const TImageInfo* AddImage(LPCTSTR bitmap, LPCTSTR type = NULL, DWORD mask = 0, bool bUseHSL = false, bool bShared = false); const TImageInfo* AddImage(LPCTSTR bitmap, HBITMAP hBitmap, int iWidth, int iHeight, bool bAlpha, bool bShared = false); void RemoveImage(LPCTSTR bitmap, bool bShared = false); void RemoveAllImages(bool bShared = false); static void ReloadSharedImages(); void ReloadImages();
CControlUI* GetFocus() const; void SetFocus(CControlUI* pControl, bool bFocusWnd=true); void SetFocusNeeded(CControlUI* pControl);
bool SetTimer(CControlUI* pControl, UINT nTimerID, UINT uElapse); bool KillTimer(CControlUI* pControl, UINT nTimerID); void KillTimer(CControlUI* pControl); void RemoveAllTimers();
CControlUI* GetRoot() const; CControlUI* FindControl(POINT pt) const; CControlUI* FindControl(LPCTSTR pstrName) const; CControlUI* FindSubControlByPoint(CControlUI* pParent, POINT pt) const; CControlUI* FindSubControlByName(CControlUI* pParent, LPCTSTR pstrName) const; CControlUI* FindSubControlByClass(CControlUI* pParent, LPCTSTR pstrClass, int iIndex = 0); CDuiPtrArray* FindSubControlsByClass(CControlUI* pParent, LPCTSTR pstrClass);
bool AttachDialog(CControlUI* pControl); bool InitControls(CControlUI* pControl, CControlUI* pParent = NULL); bool RenameControl(CControlUI* pControl, LPCTSTR pstrName); void ReapObjects(CControlUI* pControl);
static HINSTANCE GetInstance(); static CDuiString GetInstancePath(); static CDuiString GetCurrentPath(); static HINSTANCE GetResourceDll(); static const CDuiString& GetResourcePath(); static const CDuiString& GetResourceZip(); static bool IsCachedResourceZip(); static HANDLE GetResourceZipHandle(); static void SetInstance(HINSTANCE hInst); static void SetCurrentPath(LPCTSTR pStrPath); static void SetResourceDll(HINSTANCE hInst); static void SetResourcePath(LPCTSTR pStrPath); static void SetResourceZip(LPVOID pVoid, unsigned int len); static void SetResourceZip(LPCTSTR pstrZip, bool bCachedResourceZip = false); static bool GetHSL(short* H, short* S, short* L); static void SetHSL(bool bUseHSL, short H, short S, short L); // H:0~360, S:0~200, L:0~200 static void ReloadSkin(); static CPaintManagerUI* GetPaintManager(LPCTSTR pstrName); static CDuiPtrArray* GetPaintManagers(); static bool LoadPlugin(LPCTSTR pstrModuleName); static CDuiPtrArray* GetPlugins();