?? mybar.cpp
字號:
// mybar.cpp : implementation file
//
#include "stdafx.h"
#include "My1.h"
#include "mybar.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// mybar
mybar::mybar()
{
}
void mybar::OnUpdateCmdUI(CFrameWnd *pTarget, BOOL bDisableIfNoHndler)
{
UpdateDialogControls(pTarget, bDisableIfNoHndler);
}
mybar::~mybar()
{
}
void mybar::SetFlag(int flag1)
{
flag=flag1;
}
BEGIN_MESSAGE_MAP(mybar, CSizingControlBar)
//{{AFX_MSG_MAP(mybar)
ON_WM_CREATE()
ON_WM_SIZE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// mybar message handlers
int mybar::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CSizingControlBar::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Add your specialized creation code here
if(!flag) m_Output.Create(ES_LEFT | ES_NOHIDESEL |WS_CHILD | WS_VISIBLE
| WS_TABSTOP | ES_MULTILINE | ES_AUTOVSCROLL
| ES_AUTOHSCROLL | ES_AUTOVSCROLL | WS_THICKFRAME| WS_BORDER
| ES_WANTRETURN | WS_VSCROLL,
CRect(2, 2, 750, 90),this,1000);
else{
m_Function.Create(WS_VISIBLE | WS_TABSTOP | WS_CHILD | WS_BORDER
| TVS_HASBUTTONS | TVS_LINESATROOT | TVS_HASLINES
| TVS_DISABLEDRAGDROP|TVS_EDITLABELS|TVS_TRACKSELECT ,
CRect( 10, 10, 180, 320), this, 1001);
CFont *font = CFont::FromHandle((HFONT)::GetStockObject(DEFAULT_GUI_FONT));
m_Function.SetFont(font);
HTREEITEM root = m_Function.InsertItem("Wordspace",0,0);
HTREEITEM subroot1=m_Function.InsertItem("VarDeclare",1,1,root);
HTREEITEM subroot2=m_Function.InsertItem("ConstDeclare",1,1,root);
//HTREEITEM subroot3=m_Function.InsertItem("CMy1App",1,1,root);
//HTREEITEM subroot4=m_Function.InsertItem("CMy1Doc",1,1,root);
//HTREEITEM subroot5=m_Function.InsertItem("CMy1View",1,1,root);
//HTREEITEM subroot6=m_Function.InsertItem("COutput",1,1,root);
//m_Function.InsertItem("CFunction()",1,1,subroot1);
//m_Function.InsertItem("~CFunction()",1,1,subroot1);
//m_Function.InsertItem("AssertValid()",1,1,subroot2);
//m_Function.InsertItem("CMainFrame()",1,1,subroot2);
//m_Function.InsertItem("~CMainFrame()",1,1,subroot2);
//m_Function.InsertItem("Dump(CDumpContext)",1,1,subroot2);
//m_Function.InsertItem("OnCreate(LPCREATESTRUCT lpCreateStruct)",1,1,subroot2);
//m_Function.InsertItem("CMy1App()",1,1,subroot3);
//m_Function.InsertItem("CMy1Doc()",1,1,subroot4);
//m_Function.InsertItem("AssertValid()",1,1,subroot5);
//m_Function.InsertItem("CMy1View()",1,1,subroot5);
//m_Function.InsertItem("~CMy1View()",1,1,subroot5);
//m_Function.InsertItem("Dump()",1,1,subroot5);
//m_Function.InsertItem("GetDocument()",1,1,subroot5);
///m_Function.InsertItem("OnDraw(CDC *pDC)",1,1,subroot5);
//m_Function.InsertItem("PreCreateWindow(CREATESTRUCT &cs)",1,1,subroot5);
m_Function.SelectItem(root);
m_Function.Expand(root, TVE_EXPAND);
}
return 0;
}
void mybar::OnSize(UINT nType, int cx, int cy)
{
CSizingControlBar::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
CRect rc;
GetClientRect(&rc);
if(flag)
m_Function.MoveWindow(&rc);
else{
m_Output.MoveWindow(&rc);
///m_Output.SetWindowText("sda");
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -