⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mainfrm.cpp

📁 用bcg库编写的java IDE 源码
💻 CPP
📖 第 1 页 / 共 4 页
字号:
}

void CMainFrame::OnFolderSettings() 
{
	
}

void CMainFrame::OnUpdateFolderSettings(CCmdUI* pCmdUI) 
{
	
}

void CMainFrame::OnFileOpenex() 
{

}

void CMainFrame::OnUpdateFileOpenex(CCmdUI* pCmdUI) 
{
}


void CMainFrame::OnFileProp() 
{
	
}

void CMainFrame::OnUpdateFileProp(CCmdUI* pCmdUI) 
{
	
}

void CMainFrame::OnFileSettings() 
{
	
}

void CMainFrame::OnUpdateFileSettings(CCmdUI* pCmdUI) 
{
	
}

#include "EditorOptionPage.h"
#include "TabOptionPage.h"
#include "DebugOptionPage.h"
#include "BuildOptionPage.h"
#include "WorkSpcOptionPage.h"
#include "FormatOptionPage.h"

void CMainFrame::OnToolOptions() 
{
   //m_pwndOptions->ShowWindow(SW_SHOW);
   /*{
	 CRect rect;
	 GetClientRect(&rect);
     int nleft = (rect.Width()/2)-220;
	 int ntop  = (rect.Height()/2)-160;
	 CRect rc(nleft,ntop,nleft+440,ntop+320);
	 m_pwndOptions->MoveWindow(&rc);
   }*/
	//m_pwndOptions->DoModal();

	CSAPrefsDialog dlgOptions;

    CEditorOptionPage  dlgEditor;
	CTabOptionPage     dlgTab;
	CDebugOptionPage   dlgDebug;
	CBuildOptionPage   dlgBuild;
	CWorkSpcOptionPage dlgWorkSpc;
	CFormatOptionPage  dlgFormat;


	dlgOptions.AddPage(dlgEditor,"Editor");
	dlgOptions.AddPage(dlgTab,"Tabs");
	dlgOptions.AddPage(dlgDebug,"Debug");
	dlgOptions.AddPage(dlgBuild,"Build");
	dlgOptions.AddPage(dlgWorkSpc,"Workspace");
	dlgOptions.AddPage(dlgFormat,"Format");


	dlgOptions.SetTitle("Prefrences");
	dlgOptions.SetConstantText("Prefs");

	dlgOptions.DoModal();
}




void CMainFrame::ChooseStatusBar (BOOL bActivate)
{
  if(m_bActivated != bActivate)
  {
      if (bActivate)//1
        m_wndStatusBar.SetIndicators (indicators1, sizeof (indicators1) / sizeof (UINT));
      else
        m_wndStatusBar.SetIndicators (indicators, sizeof (indicators) / sizeof (UINT));
      m_bActivated = bActivate;
  }
}


void CMainFrame::FullScreenOn()
{
	// available only if there is an active doc
	CMDIChildWnd *pChild = MDIGetActive();
	if (!pChild)
    return;
	// m_bToolBarWasVisible = m_wndToolBar.IsWindowVisible () != FALSE;
  // if (m_bToolBarWasVisible)
	//   m_wndToolBar.ShowWindow (SW_HIDE);
	m_bStatusBarWasVisible = m_wndStatusBar.IsWindowVisible () != FALSE;
  if (m_bStatusBarWasVisible)
	  m_wndStatusBar.ShowWindow (SW_HIDE);
	// first create the new toolbar
	// this will contain the full-screen off button
	m_pwndFullScreenBar = new CToolBar;
	m_pwndFullScreenBar->Create (this);
	m_pwndFullScreenBar->LoadToolBar(IDR_FULLSCREEN);
	m_pwndFullScreenBar->SetBarStyle (m_pwndFullScreenBar->GetBarStyle() |
		CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
	// to look better:
	m_pwndFullScreenBar->ModifyStyle (0, TBSTYLE_FLAT);
	m_pwndFullScreenBar->EnableDocking (0);
	// place the full-screen off button somewhere:
	CPoint pt(600, 440);
	FloatControlBar (m_pwndFullScreenBar, pt);
	// remove the caption of the mainWnd:
	LONG style =:: GetWindowLong (m_hWnd, GWL_STYLE);
	m_bMax = style & WS_MAXIMIZE ? true : false;
	if (m_bMax)
    ShowWindow (SW_RESTORE);
	// now save the old positions of the main and child windows
	GetWindowRect (&m_mainRect);
	style &= ~(WS_CAPTION|WS_MAXIMIZE);
	::SetWindowLong (m_hWnd, GWL_STYLE, style);
	int screenx = GetSystemMetrics (SM_CXSCREEN);
	int screeny = GetSystemMetrics (SM_CYSCREEN);
	// resize:
	SetWindowPos (NULL, -4, -4, screenx + 8, screeny + 8, SWP_NOZORDER);
	style = ::GetWindowLong (pChild->m_hWnd, GWL_STYLE);
	m_bChildMax = style & WS_MAXIMIZE ? true : false;
	// note here: m_bMainMax is not needed since m_hWnd only
	// changed its caption...
	// and maximize the child window
	// it will remove its caption, too.
	pChild->ShowWindow (SW_SHOWMAXIMIZED);
	RecalcLayout ();
	m_bFullScreen = true;
}

void CMainFrame::FullScreenOff()
{
	// You can use SaveBarState() in OnClose(),
	// so remove the newly added toolbar entirely
	// in order SaveBarState() not
	// to save its state. That is why I used dynamic
	// allocation
	delete m_pwndFullScreenBar;
	LONG style = ::GetWindowLong (m_hWnd, GWL_STYLE);
	style |= WS_CAPTION;
	::SetWindowLong (m_hWnd, GWL_STYLE, style);
	// if (m_bToolBarWasVisible)
	//	m_wndToolBar.ShowWindow (SW_SHOW);
	if (m_bStatusBarWasVisible)
		m_wndStatusBar.ShowWindow (SW_SHOW);
	MoveWindow (&m_mainRect);
	RecalcLayout ();
	if (m_bMax)
    ShowWindow (SW_SHOWMAXIMIZED);
	CMDIChildWnd *pChild = MDIGetActive ();
	// pchild can be NULL if the USER closed all the
	// childs during Full Screen Mode:
	if(pChild)
    {
		  if(m_bChildMax)
			  MDIMaximize (pChild);
		  else
        MDIRestore (pChild);
	  }
	m_bFullScreen = false;
}

int CMainFrame::MDIGetCount()
{
  ASSERT (::IsWindow (m_hWnd));
  int nCount = 0;
  CWnd * pWnd = GetWindow (GW_CHILD);
  ASSERT (pWnd);
  pWnd = pWnd->GetWindow (GW_CHILD);
  while (pWnd)
  {
    nCount++;
    pWnd = pWnd->GetWindow (GW_HWNDNEXT);
  }
  return nCount;
}

//Alarm flashing until the window became focus
void CMainFrame::FlashUntilFocus ()
{
  m_bGotFocus = FALSE;

  BOOL bInvert = FALSE;
  while (!m_bGotFocus)
  {		
    FlashWindow (bInvert);
    bInvert= !bInvert;
    Sleep (500);
    if (GetFocus() == this)
	    break;
  }		
  FlashWindow(FALSE);
}

void CMainFrame::OnSetFocus(CWnd* pOldWnd) 
{
  CBaseFrameWnd::OnSetFocus (pOldWnd);	
  m_bGotFocus = TRUE;
}

LONG CMainFrame::OnOpenHere (WPARAM wParam, LPARAM lParam)
{
  if(FileExist((LPCTSTR) lParam))
  {
      theApp.OpenDocumentFile ((LPCTSTR) lParam);
  }
  return 0;
}
#include "DebugInterface.h"

void CMainFrame::OnBroadCastMsg(WPARAM wParam, LPARAM lParam)
{
  int msg = wParam;
  //CString str;
  //str.Format("%d msg",msg);
  //MessageBox(str);
  DebugMsgProc(wParam,(void*)lParam);
}

void CMainFrame::OnBuildStartDebugGo() 
{
//	MessageBox("go");
}

void CMainFrame::OnUpdateBuildStartDebugGo(CCmdUI* pCmdUI) 
{
//	pCmdUI->Enable(FALSE);
}

void CMainFrame::OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu) 
{




	/**
   if(nIndex == 0)
   {
	 int nCount = pPopupMenu->GetMenuItemCount();
	 for(int I=0; I<nCount; I++)
	 {
	   CMenu *pSubMenu = pPopupMenu->GetSubMenu(I);
	   if(pSubMenu != NULL)
	   {
         if(pSubMenu->GetMenuItemCount()>0)
		 {
           if(pSubMenu->GetMenuItemID(0) == ID_FILE_MRU_FILE1)
		   {
			   //pSubMenu->DeleteMenu(0,MF_BYPOSITION);

                CRecentFileList* pMRUFiles =  theApp.getMRUlist();
				TCHAR szCurDir [_MAX_PATH];
				::GetCurrentDirectory (_MAX_PATH, szCurDir);

				int nCurDir = lstrlen (szCurDir);
				ASSERT (nCurDir >= 0);

				szCurDir [nCurDir] = _T('\\');
				szCurDir [++ nCurDir] = _T('\0');

				//---------------
				// Add MRU files:
				//---------------
				int iNumOfFiles = 0;	// Actual added to menu
				for (int i = 0; i < pMRUFiles->GetSize (); i ++)
				{
					CString strName;

					if (pMRUFiles->GetDisplayName (strName, i, 
						szCurDir, nCurDir))
					{
						//---------------------
						// Add shortcut number:
						//---------------------
						CString strItem;
						strItem.Format (_T("&%d %s"), ++iNumOfFiles, strName);


						pSubMenu->InsertMenu(i,MF_BYPOSITION,ID_FILE_MRU_FILE1+i,
							strName
							);
					}
				}

			 break;
		   }
		 }
	   }
	 }
   }
   else
   **/
   CBaseFrameWnd::OnInitMenuPopup(pPopupMenu, nIndex, bSysMenu);    
}

void CMainFrame::OnDropDown(WPARAM wParam, LPARAM lParam)
{
   //MessageBox("debug");
}

BOOL CMainFrame::PreTranslateMessage(MSG* pMsg) 
{
    return CBaseFrameWnd::PreTranslateMessage(pMsg);
}

#include "BasicToolHeaderPage.h"
#include "DevToolJavacPage.h"
#include "CoreToolJavaw.h"
#include "CoreToolAppletviewer.h"
#include "CoreToolJavah.h"
#include "CoreToolJavap.h"
#include "CoreToolJavaDoc.h"
#include "CoreToolExCheck.h"


#include "InternationalizationHeaderPage.h"
#include "Native2Ascii.h"


#include "RmiToolHeaderPage.h"
#include "RmiToolRmic.h"
#include "RmiToolSerialVer.h"
#include "RmiToolRegistry.h"
#include "RmiToolRmid.h"

#include "SecurityToolHeaderPage.h"
#include "SecurityToolKeytool.h"
#include "SecurityToolJarSigner.h"
#include "SecurityToolPolicy.h"

#include "RmiIIopToolHeaderPage.h"
#include "IDLtoJavaCompiler.h"
#include "IDL_RMI_IIOP_ToolOrbd.h"
#include "IDL_RMI_IIOP_Servertool.h"
#include "IDL_Rmi_IIOP_tnameServ.h"

#include "PluginToolHeaderPage.h"
#include "PluginToolUnregBean.h"

#include "JavaApiToolDlg.h"
void CMainFrame::OnSdkSystem() 
{
  CSAPrefsDialog          dlgSDKSystem;


  //basic tools
  CBasicToolHeaderPage    dlgBasicHeader;
  CDevToolJavacPage       dlgJavac;
  CCoreToolJavaw          dlgJavaw;
  CCoreToolAppletviewer   dlgAppletViewer;
  CCoreToolJavah          dlgJavah;
  CCoreToolJavap          dlgJavap;
  CCoreToolJavaDoc        dlgJavaDoc;
  CCoreToolExtCheck       dlgExtCheck;

  //add
  dlgSDKSystem.AddPage(dlgBasicHeader,"Basic Tools");
  dlgSDKSystem.AddPage(dlgJavac,"Compiler",&dlgBasicHeader);
  dlgSDKSystem.AddPage(dlgJavaw,"Launcher",&dlgBasicHeader);
  dlgSDKSystem.AddPage(dlgAppletViewer,"Applet Viewer",&dlgBasicHeader);
  dlgSDKSystem.AddPage(dlgJavah,"C Header Stub Generator",&dlgBasicHeader);
  dlgSDKSystem.AddPage(dlgJavap,"ClassFile Disassembler",&dlgBasicHeader);
  dlgSDKSystem.AddPage(dlgJavaDoc,"Java API document Generator",&dlgBasicHeader);
  dlgSDKSystem.AddPage(dlgExtCheck,"Jar conflict detector",&dlgBasicHeader);

  //rmi  tools
  CRmiToolHeaderPage      dlgRmiHeader;
  CRmiToolRmic            dlgRmi;
  CRmiToolSerialVer       dlgSerialVer;
  CRmiToolRegistry        dlgRegistry;
  CRmiToolRmid            dlgRmid;

  //add
  dlgSDKSystem.AddPage(dlgRmiHeader,"Rmi");
  dlgSDKSystem.AddPage(dlgRmi,"remote Object Stub and Skeleton Generator",&dlgRmiHeader);
  dlgSDKSystem.AddPage(dlgRegistry,"Remote object registry service",&dlgRmiHeader);
  dlgSDKSystem.AddPage(dlgRmid,"RMI activation system daemon",&dlgRmiHeader);
  dlgSDKSystem.AddPage(dlgSerialVer,"get class serialVersionUID",&dlgRmiHeader);

  //internationalization tools
  CInternationalizationHeaderPage dlgInterHeader;
  CNative2Ascii           dlgNative2ascii;

  //add
  dlgSDKSystem.AddPage(dlgInterHeader,"Internationalization");
  dlgSDKSystem.AddPage(dlgNative2ascii,"Convert text to Unicode Latin-1",&dlgInterHeader);


  //security tools
  CSecurityToolHeaderPage dlgSecurityHeader;
  CSecurityToolKeytool    dlgSecurityKeyTool;
  CSecurityToolJarSigner  dlgSecurityJarSigner;
  CSecurityToolPolicy     dlgSecurityPolicy;

  //add
  dlgSDKSystem.AddPage(dlgSecurityHeader,"Security Tools");
  dlgSDKSystem.AddPage(dlgSecurityKeyTool,"Manage keystores and certificates",&dlgSecurityHeader);
  dlgSDKSystem.AddPage(dlgSecurityJarSigner,"Generate and verify JAR signatures",&dlgSecurityHeader);
  dlgSDKSystem.AddPage(dlgSecurityPolicy,"Launch Policy Tool",&dlgSecurityHeader);


  //Java IDL and RMI-IIOP Tools
  CRmiIIopToolHeaderPage  dlgIDL_IIOP_header;
  CIDLtoJavaCompiler      dlgIDLj;
  CIDL_RMI_IIOP_ToolOrbd  dlgOrbd;
  CIDL_Rmi_IIOP_tnameServ dlgNameServ;

  //add
  dlgSDKSystem.AddPage(dlgIDL_IIOP_header,"Java IDL and RMI-IIOP Tools");
  dlgSDKSystem.AddPage(dlgIDLj,"Generate .java to OMG IDL interface  map",&dlgIDL_IIOP_header);
  dlgSDKSystem.AddPage(dlgOrbd,"Locate and invoke persistent objects",&dlgIDL_IIOP_header);
  dlgSDKSystem.AddPage(dlgNameServ,"Naming service",&dlgIDL_IIOP_header);

  //plugin tools
  CPluginToolHeaderPage   dlgPluginHeader;
  CPluginToolUnregBean    dlgUnregBean;

  //add
  dlgSDKSystem.AddPage(dlgPluginHeader,"Utilities for use in conjunction with the Java Plug-inTM product");
  dlgSDKSystem.AddPage(dlgUnregBean,"Unregister Component",&dlgPluginHeader);
  
  //java api stuff
  CJavaApiToolDlg         dlgApiTool;
  dlgSDKSystem.AddPage(dlgApiTool,"Java Api Utilities");
  
  dlgSDKSystem.SetTitle("SDK System");
  dlgSDKSystem.SetConstantText("Settings");
   

  //dlgSDKSystem.SetMaxPageSize(CSize(484,265));
  dlgSDKSystem.DoModal();
	
}

void CMainFrame::OnUpdateSdkSystem(CCmdUI* pCmdUI) 
{
 
}


void CMainFrame::OnSelchangeClass()
{
  CWorkSpaceBar::OnSelchangeClass();
}


void CMainFrame::OnSelchangeFunction()
{
ASSERT(FALSE);
}

void CMainFrame::CloseWorkSpace()
{
   OnFileCloseworkspace();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -