c++图形界面开发_在界面用显示时间的步骤

c++图形界面开发_在界面用显示时间的步骤BCGControlBarLibraryProfessionalEdition installation:整个库的源代码安装在\BCGCBPro目录下面.可执行文件(*.dll)安装在\Bin(forVisualStudio6.0)或\Bin7(forVisualStudio.NET)下面。请在你的源代码中做如下的改变:·                    

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE稳定放心使用

BCGControlBarLibrary Professional Edition installation:

整个库的源代码安装在<installdir>\BCGCBPro目录下面.可执行文件(*.dll)安装在 <install dir>\Bin (for VisualStudio 6.0) <installdir>\Bin7 (for VisualStudio.NET)下面。

请在你的源代码中做如下的改变:

·                            在应用程序的Include路径中加入BCGCBPro目录,具体添加办法如下:vs2005下面打开菜单工具的Option项,选择项目解决方案vc++目录,然后将包含文件<installdir>\BCGCBPro添加进去。

·                            确信在你的应用程序的 InitInstance() 方法中调用了AfxOleInit()

·                            stdafx.h中加入下面的包含文件:

#include “BCGCBProInc.h”

·                            使你的应用程序派生自:CBCGPWorkspace

classCMyApp : publicCWinApp,
                        
publicCBCGPWorkspace

·                            第一步,你需要定义一个在注册表里保存个性化数据的项并且鼠标,键盘和上下文菜单都需要。为了实现这一点,CMyApp::InitInstance set registry entry and initializecustomization managers:

SetRegistryBase (_T(“Settings“));

// Initialize customization managers:
InitMouseManager();
InitContextMenuManager();
InitKeyboardManager();

·                            如果你决定使你的鼠标和菜单具有个性化,你需要 “attach”一个需要的视图初始化鼠标和菜单的个性化管理。重载 CBCGPWorkspace::PreLoadState方法:

classCMyApp ….
{


virtual voidPreLoadState();

};

voidCMyApp::PreLoadState()
{

   
// Associate mouse event with specific view(s):
    GetMouseManager()->AddView (iIdTestView, _T(“Test view“), IDR_VIEW);

   // Initialize context menus:
    GetContextMenuManager()->AddMenu (_T(“Test menu“), idMenu); 
}

·                            把框架文件中的基类CMDIFrameWnd 改为 CBCGPMDIFrameWnd(in case of SDI application change CFrameWnd to CBCGPFrameWnd)

·                            将子框架的基类 CMDIChildWnd 改为  CBCGPMDIChildWnd

·                             CToolbar 改为 CBCGPToolBar并且加入一个embedded menu bar 在你的CMainFrame类中:

CBCGPMenuBar    m_wndMenuBar;   // New menu bar
CBCGToolBar      m_wndToolBar;     // Application toolbar

·                            CMainFrame::OnCreate()方法中加入下面几行以实现菜单的功能:

// Create menu bar (replaces the standard menu):
if (!m_wndMenuBar.Create (this))
{

      TRACE0(“Failed to create menubar\n”);
      return -1;     
// fail to create
}

m_wndMenuBar.SetBarStyle (m_wndMenuBar.GetBarStyle() |
                                          CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);

·                            加入以下代码以实现ca:

m_wndMenuBar.EnableDocking (CBRS_ALIGN_ANY);
DockControlBar (&m_wndMenuBar);

Important:在你的应用程序中,你可以使用多个CBCGPToolBar .所用工具条的图像将自动合并到一张位图上 .但是只有一个CBCGPMenuBar 对象可以使用.
 

为了具有自定义工具条和菜单条, 请做如下改变:

·                            加入 toolbar/menucustomization command (for example, View| Customize…)

·                            Implement OnViewCustomize method. The codewill look something like this:

void CMainFrame::OnViewCustomize()
{

 // Create a customize toolbars dialog:
 CBCGPToolbarCustomize* pDlgCust = new CBCGToolbarCustomize (this,
TRUE
);

 // Add predefined toolbars:
 pDlgCust->AddToolBar (“Main”, IDR_MAINFRAME);
 ….

 // Add user-defined commands:
 pDlgCust->AddButton (“User”, CBCGPToolbarButton (ID_USER_TOOL1, 1, “User Tool 1”, TRUE));
 pDlgCust->AddButton (“User”, CBCGToolbarButton (ID_USER_TOOL2, 2, “User Tool 2”, TRUE));
 pDlgCust->AddButton (“User”, CBCGToolbarButton (ID_USER_TOOL3, 3, “User Tool 3”, TRUE));
 ….

 pDlgCust->SetUserCategory (“User”);

 // Enable Create/Delete of the user-defined toolbars:
 pDlgCust->EnableUserDefinedToolbars ();

 pDlgCust->Create ();
}

为了能具有 MicrosofteOffice 2000 的菜单风格:

·                            Define your own basic commands set (usuallyin CMainFrame::OnCreate()):

CList<UINT, UINT> lstBasicCoomads;
 

lstBasicCoomads.AddTail (ID_FILE_NEW);
lstBasicCoomads.AddTail (ID_FILE_OPEN);
lstBasicCoomads.AddTail (ID_FILE_SAVE);

……
lstBasicCoomads.AddTail (ID_APP_ABOUT);

CBCGPToolBar::SetBasicCommands (lstBasicCoomads);

·                            这些命令将使得这些菜单能保持常见.

使菜单项是否具有阴影的风格:

CBCGPMenuBar::EnableMenuShadows (BOOL bEnable = TRUE)

Note: pleasedon’t use menu shadows if your views content may be dynamically changed whenthe popup menu is shown (e.g., views shows animation, HTML page). In this casemenu shadow “is remember” the previous view image.

在运行时改变菜单的字体:

CBCGPMenuBar::SetMenuFont (LPLOGFONT lpLogFont, BOOL bHorz = TRUE);

使工具条具有”pager”(customization) button just call:

m_wndToolBar.EnableCustomizeButton (TRUE, id_of_customize_command,
_T(“Customize…”));

使工具条的按钮下具有文字:

m_wndToolBar.EnableTextLabels (BOOL bEnable = TRUE);

使用户能自定义工具:

·                            Add a new menu item: ID_TOOLS_ENTRY. Thisitem will be automatically replaced by the actual tools list

·                            Add the following items to the STRINGresource:
 

1.                                                   ID_TOOL1    “Activatesuser-defined tool\nUser Tool”

2.                                                   ID_TOOL2    “Activatesuser-defined tool\nUser Tool”
….

3.                                                   ID_TOOLx    “Activatesuser-defined tool\nUser Tool”
 

·                            In application’s InitInstance() call:
 

EnableUserTools (ID_TOOLS_ENTRY, ID_TOOL1,    ID_TOOLx);

·                            A new “Tools” page will be addedto the customization dialog

To enable dynamic”tear-off” (“detachable”) menus:

·                            Reserve some items in the STRING resourcetable. These IDs will be used as control bars IDs

1.                                                   ID_TEAR_OFF1   “<dummy>”

2.                                                   ID_TEAR_OFF2   “<dummy>”

3.                                                   …….

4.                                                   ID_TEAR_OFFx   “<dummy>”

·                            For each “tear-off” popup menu,change the “Break” property to “Bar” (MF_MENUBARBREAK)

·                            In application’s InitInstance() call: 

EnableTearOffMenus (_T(“RegBase”, ID_TEAR_OFF1, ID_TEAR_OFFx);

To enable static”tear-off” (“detachable”) menus:

·                            Reserve an item in the STRING resourcetable. This ID should be differ from dynamic tear-off ID (see above)
ID_TEAR_OFF_BAR    “<dummy>”
 

·                            In the main frame OnShowPopupMenu, enable”tear-off” for the specific menu button:
 

pMenuButton->SetTearOff (ID_TEAR_OFF_BAR);

To ensure, that allBCGPControlBar allocations are freed properly:

·                            Add the following call into yourapplication’s ExitInstance() :

::BCGCBProCleanUp ();

 

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/184436.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • java全局变量引起的并发问题「建议收藏」

    java全局变量引起的并发问题「建议收藏」最近刚完成了一个短彩信群发平台的开发工作,系统采用springmvc+hibernate+jdbctemplate+mysql架构。其中遇见许多问题,闲暇之余记录下来以避免在后续项目中再犯同样的错误。先看下面小段代码,一个controller,一个service。       controller.java代码:    ……..    @Autowired

    2022年8月21日
    8
  • pycharm远程连接服务器及同步

    pycharm远程连接服务器及同步文章目录 pycharm 远程连接服务器及同步 ref 概述实际步骤其他设置注意推荐使用方式 nohup 命令 pycharm 远程连接服务器及同步 refpycharm 连接 ssh 笔记 Pycharm 运行服务器环境设置 python 开发环境的配置 Linux pycharm pyenv 概述用到服务器的地方大概有 建立 ssh 终端连接 一个服务器可以新建一个 sshsession 建立 SFTP 连接同步文件 一个服务器可以新建一个 deployment 建立 ssh 远程环境 一个远程环境可以新建一个 sshin

    2025年9月27日
    4
  • macbookpro安装anaconda_mac下python编程软件

    macbookpro安装anaconda_mac下python编程软件参考:https://www.cnblogs.com/xrblog/p/11839393.html安装Anaconda从官网下载,这里选择的是Python3.7版本的图形化安装包 安装后,在命令行中输入conda–version,如果安装成功,会显示版本号 但我并没有显示,所以根据Anaconda之Python环境配置(Mac版)配置了环境变量: 首先,找到Anaconda的安装路径下bin文件的位置,我的路径是/opt/anaconda3/bin (再记录一下,

    2022年8月29日
    3
  • 微信朋友圈奢侈品代购背后:圈子营销光明正大卖“假货”

    微信朋友圈奢侈品代购背后:圈子营销光明正大卖“假货”30岁的张华,一天是这样开始的:睁眼、拿起床头的手机,刷看自己的微信或微博。她自己的微信“朋友圈”更新的速度比往常多了许多,里面大多是一些名牌皮包、衣服的图片信息。记者随机采访了几名手机用户,发现大多数人的微信“朋友圈”里都有人在做这样的微信生意,集中在国际名牌LV、香奈儿、卡地亚等奢侈品,他们自称为“奢侈品代购”。这是一种新的电商“朋友销售模式”?还是暗藏的“假货A货圈”?“奢侈品”代购背后是怎

    2022年5月14日
    50
  • ubuntu18.04安装gcc详细步骤(附问题集)[通俗易懂]

    ubuntu18.04安装gcc详细步骤(附问题集)[通俗易懂]首先是下载gcc包,可以在GCC的官方网站http://gcc.gnu.org/下载到各个版本。目前最高版本是gcc-8.2.0。一、在安装gcc前,需要先安装MPFR、GMP和MPCGCC编译需要mpfr和mpc(–>gmp、–>mpfr)库的支持,依次安装这几个库,其中mpfr可直接安装,安装mpc依赖mpfr和gmp库(对版本有要求,建议安装最新版本)…

    2022年5月9日
    301
  • 【Linux + Makefile】十分钟教你学会Makefile的FORCE「建议收藏」

    【Linux + Makefile】十分钟教你学会Makefile的FORCE「建议收藏」Makefile有种FORCE的写法,你了解过它的原理和用途吗?

    2022年6月12日
    34

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号