博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
SDI程序中,如何在主框架上切换不同的视图
阅读量:4212 次
发布时间:2019-05-26

本文共 2494 字,大约阅读时间需要 8 分钟。

long CMainFrame::OnOutbarNotify(WPARAM wParam, LPARAM lParam)

{

switch (wParam)

{

case NM_OB_ITEMCLICK:

// cast the lParam to an integer to get the clicked item

{

int flag=wndBar.GetFolderData(); if(flag==0)//判断是否为第一个Folder

{

int index = (int) lParam;

if(index==0)       //响应第一个按钮

{

wndSplitter.DeleteView(0,1);

wndSplitter.CreateView(0,1,RUNTIME_CLASS(CTestView),CSize(0,70),NULL); 

wndSplitter.RecalcLayout();


if(index==1)       //响应第二个按钮

{

wndSplitter.DeleteView(0,1);

           wndSplitter.CreateView(0,1,RUNTIME_CLASS(CTestView2),CSize(0,70),NULL);

                     wndSplitter.RecalcLayout();

}

if(index==2)       //响应第三个按钮

{

wndSplitter.DeleteView(0,1);

                     wndSplitter.CreateView(0,1,RUNTIME_CLASS(CTestView3),CSize(0,70),NULL);

                     wndSplitter.RecalcLayout();

}

}

else if(flag==1)//判断是否为第二个Folder

{

int index = (int) lParam;

if(index==0)       //响应第一个按钮

{

wndSplitter.DeleteView(0,1);

wndSplitter.CreateView(0,1,RUNTIME_CLASS(CTestView4),CSize(0,70),NULL);

                     wndSplitter.RecalcLayout();

}

if(index==1)

{

wndSplitter.DeleteView(0,1);

wndSplitter.CreateView(0,1,RUNTIME_CLASS(CTestView5),CSize(0,70),NULL);

                     wndSplitter.RecalcLayout();

}

if(index==2)

{

wndSplitter.DeleteView(0,1);

wndSplitter.CreateView(0,1,RUNTIME_CLASS(CTestView6),CSize(0,70),NULL);

                     wndSplitter.RecalcLayout();

}

if(index==3)

{

wndSplitter.DeleteView(0,1);

wndSplitter.CreateView(0,1,RUNTIME_CLASS(CTestView7),CSize(0,70),NULL);

                     wndSplitter.RecalcLayout();

}

}

else if(flag==2)//判断是否为第三个Folder

{

int index = (int) lParam;

if(index==0)       //响应第一个按钮

{

wndSplitter.DeleteView(0,1);

wndSplitter.CreateView(0,1,RUNTIME_CLASS(CTestView8),CSize(0,70),NULL);

                     wndSplitter.RecalcLayout();

}

}

}

return 0;


case NM_OB_ONLABELENDEDIT:

// cast the lParam to an OUTBAR_INFO * struct; it will contain info about the edited item

// return 1 to do the change and 0 to cancel it

{

OUTBAR_INFO * pOI = (OUTBAR_INFO *) lParam;

TRACE2("Editing item %d, new text:%s\n", pOI->index, pOI->cText);

}

return 1;


case NM_OB_ONGROUPENDEDIT:

// cast the lParam to an OUTBAR_INFO * struct; it will contain info about the edited folder

// return 1 to do the change and 0 to cancel it

{

OUTBAR_INFO * pOI = (OUTBAR_INFO *) lParam;

TRACE2("Editing folder %d, new text:%s\n", pOI->index, pOI->cText);

}

return 1;


case NM_OB_DRAGITEM:

// cast the lParam to an OUTBAR_INFO * struct; it will contain info about the dragged items

// return 1 to do the change and 0 to cancel it

{

OUTBAR_INFO * pOI = (OUTBAR_INFO *) lParam;

TRACE2("Drag item %d at position %d\n", pOI->iDragFrom, pOI->iDragTo);

}

return 1;

}

return 0;

}

转载地址:http://kikmi.baihongyu.com/

你可能感兴趣的文章
论文浅尝 | GMNN: Graph Markov Neural Networks
查看>>
廖雪峰Python教程 学习笔记3 hello.py
查看>>
从内核看epoll的实现(基于5.9.9)
查看>>
python与正则表达式
查看>>
安装.Net Framework 4.7.2时出现“不受信任提供程序信任的根证书中终止”的解决方法
查看>>
input type=“button“与input type=“submit“的区别
查看>>
解决Github代码下载慢问题!
查看>>
1.idea中Maven创建项目及2.对idea中生命周期的理解3.pom文件夹下groupId、artifactId含义
查看>>
LeetCode-栈|双指针-42. 接雨水
查看>>
stdin,stdout,stderr详解
查看>>
Linux文件和设备编程
查看>>
文件描述符
查看>>
终端驱动程序:几个简单例子
查看>>
登录linux密码验证很慢的解决办法
查看>>
fcntl函数总结
查看>>
HTML条件注释
查看>>
Putty远程服务器的SSH经验
查看>>
内核态与用户态
查看>>
使用mingw(fedora)移植virt-viewer
查看>>
趣链 BitXHub跨链平台 (4)跨链网关“初介绍”
查看>>