SkinUI5.0官方文档

SkinUI5.0官方文档


提示

<h4>效果图</h4> <p><img src="http://www.skinui.cn/doc/img/5.0/4/Toast.png" alt="提示" /></p> <ul> <li>调用以下接口显示提示:</li> </ul> <pre><code class="language-c">void Toast(const String&amp; strText, int nIcon = LEVEL_NONE, int nDuration = 2, int nDelay = 0, const CPoint&amp; ptLeftTop = CPoint());</code></pre> <h4>示例代码</h4> <ul> <li>h文件</li> </ul> <pre><code class="language-c">#pragma once class CDemoToastLayout : public CFlexLayout { public: enum { IDC_BUTTON_TOAST_NONE = 1000, IDC_BUTTON_TOAST_INFO = 1001, IDC_BUTTON_TOAST_SUCCESS = 1002, IDC_BUTTON_TOAST_ERROR = 1003, IDC_BUTTON_TOAST_WARN = 10014, }; public: CDemoToastLayout(CView* pParent); public: virtual void OnBuildFinish(); protected: void OnBtnClickedToast(UINT uNotifyCode, int nID, CView* pView); SKINUI_DECLARE_MESSAGE_MAP() SKINUI_DECLARE_DYNCREATE(CDemoToastLayout, CFlexLayout) };</code></pre> <ul> <li>cpp文件</li> </ul> <pre><code class="language-c">#include &lt;stdafx.h&gt; #include "DemoToastLayout.h" SKINUI_BEGIN_MESSAGE_MAP(CDemoToastLayout, CFlexLayout) ON_SKINUI_COMMAND_RANGE(IDC_BUTTON_TOAST_NONE, IDC_BUTTON_TOAST_WARN, OnBtnClickedToast) SKINUI_END_MESSAGE_MAP() CDemoToastLayout::CDemoToastLayout(CView* pParent) : CFlexLayout(pParent) { } void CDemoToastLayout::OnBuildFinish() { CFlexLayout::OnBuildFinish(); } void CDemoToastLayout::OnBtnClickedToast(UINT uNotifyCode, int nID, CView* pView) { String strText = _T("这是一个提示信息!"); int nIcon = nID - IDC_BUTTON_TOAST_NONE + LEVEL_NONE; int nDuration = 5; int nDelay = 0; GetOwner()-&gt;Toast(strText, nIcon, nDuration, nDelay); }</code></pre>

页面列表

ITEM_HTML