123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- // 这段 MFC 示例源代码演示如何使用 MFC Microsoft Office Fluent 用户界面
- // (“Fluent UI”)。该示例仅供参考,
- // 用以补充《Microsoft 基础类参考》和
- // MFC C++ 库软件随附的相关电子文档。
- // 复制、使用或分发 Fluent UI 的许可条款是单独提供的。
- // 若要了解有关 Fluent UI 许可计划的详细信息,请访问
- // https://go.microsoft.com/fwlink/?LinkId=238214.
- //
- // 版权所有(C) Microsoft Corporation
- // 保留所有权利。
- #include <map>
- #pragma once
- class CUpgradeBar : public CMFCToolBar
- {
- public:
- virtual void OnUpdateCmdUI(CFrameWnd* /*pTarget*/, BOOL bDisableIfNoHndler)
- {
- CMFCToolBar::OnUpdateCmdUI((CFrameWnd*) GetOwner(), bDisableIfNoHndler);
- }
- virtual BOOL AllowShowOnList() const { return FALSE; }
- };
- class CMyEditBrowseCtrl:public CMFCEditBrowseCtrl
- {
- public:
- CMyEditBrowseCtrl() {};
- ~CMyEditBrowseCtrl() {};
- virtual void OnBrowse(){
- CString TempPathName;
- CFileDialog dlg(TRUE, NULL, NULL, NULL, m_strFileFilter, NULL, 0, TRUE);
- (dlg.m_ofn).lpstrTitle = _T("打开文件");
- dlg.DoModal();
- /*if (dlg.DoModal() == IDOK)
- {
- TempPathName = dlg.GetPathName();
- SetWindowText(TempPathName);
- }
- else
- return;*/
- TempPathName = dlg.GetPathName();
- SetWindowText(TempPathName);
- }
- private:
- protected:
- //DECLARE_MESSAGE_MAP()
- };
- class CUpgradeWnd : public CDockablePane
- {
- // 构造
- public:
- CUpgradeWnd() noexcept;
- void AdjustLayout();
- // 特性
- public:
- protected:
- CFont m_fntPropList;
- // 路径编辑框;
- CStatic m_text_path;
- CMFCEditBrowseCtrl m_edit_path;
- //CEdit m_edit_path;
- // 升级按钮;
- CMFCButton m_btnUpgrade;
- // ftp用户名;
- CStatic m_text_user;
- CEdit m_ftp_user;
- // ftp密码;
- CStatic m_text_password;
- CEdit m_ftp_password;
- // 是否记住ftp账号密码;
- CButton m_check_remember;
- // 提示语
- CStatic m_text_notify;
- // 实现
- public:
- virtual ~CUpgradeWnd();
- // 去掉关闭按钮;但组合多个pane时无效;
- virtual BOOL CanBeClosed() const { return FALSE; };
- // 禁止拖动Pane;
- virtual BOOL FloatPane(CRect rectFloat, AFX_DOCK_METHOD dockMethod = DM_UNKNOWN, bool bShow = true) { return FALSE; }
- // 禁用停靠,双击底部无效(不会停靠)
- //virtual BOOL CanFloat() const { return FALSE; };
- // 禁用大小;//崩溃;
- //virtual BOOL IsResizable() const {return FALSE;}
- protected:
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg void OnSize(UINT nType, int cx, int cy);
- // 控件事件;
- afx_msg void OnUpgradeBtnClick();
- afx_msg void OnUpdateBtnUpgrade(CCmdUI* pCmdUI);
- afx_msg void OnCheckRememberFtpClick();
- afx_msg void OnUpdateCheckRememberFtp(CCmdUI* pCmdUI);
- afx_msg void OnEnChangeEdit();
- BOOL _bIsFtpPath = FALSE;
- afx_msg void OnUpdateFtpUser(CCmdUI* pCmdUI);
- afx_msg void OnUpdateFtpPassword(CCmdUI* pCmdUI);
- DECLARE_MESSAGE_MAP()
- void SetStaticFont();
- void SetCtrlStyle();
- int m_nCtrlHeight;
- public:
- afx_msg void OnPaint();
- // 重载(禁用面板自带菜单)
- afx_msg void OnContextMenu(CWnd* /*pWnd*/, CPoint /*point*/);
- afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
- };
|