Click here to Skip to main content
15,893,904 members
Articles / Desktop Programming / MFC

A Java Language IDE

Rate me:
Please Sign up or sign in to vote.
4.33/5 (26 votes)
13 May 2004CPOL3 min read 80.6K   3.4K   41  
This is a partially implemented IDE for the Java platform.
// NewFilePage.cpp : implementation file
//

#include "stdafx.h"
#include "NewFilePage.h"
#include "FileNewDlg.h"
#include "VisualJava.h"

#include "WorkSpace.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CNewFilePage property page

IMPLEMENT_DYNCREATE(CNewFilePage, CPropertyPage)

CNewFilePage::CNewFilePage() : CPropertyPage(CNewFilePage::IDD)
{
	//{{AFX_DATA_INIT(CNewFilePage)
	m_szpFileName = _T("");
	m_szpFilePath = _T("");
	m_szpCurProject = _T("");
	//}}AFX_DATA_INIT
}

CNewFilePage::~CNewFilePage()
{
}

void CNewFilePage::DoDataExchange(CDataExchange* pDX)
{
	CPropertyPage::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CNewFilePage)
	DDX_Control(pDX, IDC_LIST_FILE_OPTIONS, m_wndFileOptions);
	DDX_Text(pDX, IDC_EDIT_NEW_FILENAME, m_szpFileName);
	DDX_Text(pDX, IDC_EDIT_FILE_DIR, m_szpFilePath);
	DDX_CBString(pDX, IDC_COMBO_PROJECTS, m_szpCurProject);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CNewFilePage, CPropertyPage)
	//{{AFX_MSG_MAP(CNewFilePage)
	ON_BN_CLICKED(IDC_BROWSE_TO, OnBrowseTo)
	ON_EN_CHANGE(IDC_EDIT_NEW_FILENAME,OnEditName)
    ON_EN_CHANGE(IDC_EDIT_FILE_DIR,OnEditDir)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CNewFilePage message handlers



BOOL CNewFilePage::OnInitDialog() 
{
	CPropertyPage::OnInitDialog();
	
	m_fileOptionImgs.Create(IDB_FILE_OPTIONS,16,1,RGB(255,0,0));
    m_wndFileOptions.SetImageList(&m_fileOptionImgs,LVSIL_SMALL);

	//file types support
	m_wndFileOptions.InsertItem(0,"Active Server Page",11);
	m_wndFileOptions.InsertItem(1,"Binary File",12);
	m_wndFileOptions.InsertItem(2,"Bitmap File",5);
	m_wndFileOptions.InsertItem(3,"C/C++ Header File",6);
	m_wndFileOptions.InsertItem(4,"C++ Source File",2);
	//m_wndFileOptions.InsertItem(5,"Cursor File",4);
	m_wndFileOptions.InsertItem(5,"HTML Page",7);
	m_wndFileOptions.InsertItem(6,"Icon File",1);
	m_wndFileOptions.InsertItem(7,"Java File",10);
	//m_wndFileOptions.InsertItem(9,"Macro File",3);
	//m_wndFileOptions.InsertItem(10,"Resource Template",9);
	m_wndFileOptions.InsertItem(8,"Text File",0);


    if(CVisualJavaApp::m_pCurWorkSpace != NULL)
	{
	   CComboBox *pCombo = (CComboBox*)GetDlgItem(IDC_COMBO_PROJECTS);
	   CVisualJavaApp::m_pCurWorkSpace->FillCombo(pCombo);
	}
	else
	{
       GetDlgItem(IDC_COMBO_PROJECTS)->EnableWindow(FALSE);
	   GetDlgItem(IDC_CHECK_ADDTO_PROJECT)->EnableWindow(FALSE);
	}
	m_szpFilePath = _T("C:\\My Documents\\");
	UpdateData(FALSE);
	m_szpBasePath = m_szpFilePath;
//	m_wndFileOptions.SetOutlineColor(RGB(210,210,255);
	m_wndBrowse.SubclassDlgItem(IDC_BROWSE_TO,this);
	return TRUE;  
}

void CNewFilePage::OnBrowseTo() 
{
	
}

BOOL CNewFilePage::OnSetActive()
{
	if(CFileNewDlg::m_pTemp != NULL)
	{
      CFileNewDlg* psheet = (CFileNewDlg*)GetParent();
	  psheet->RemovePage(CFileNewDlg::m_pTemp);
	  CFileNewDlg::m_pTemp = NULL;
	}
	return CPropertyPage::OnSetActive();
}


void CNewFilePage::OnEditName()
{
  UpdateData(TRUE);
}


void CNewFilePage::OnEditDir()
{
  UpdateData(TRUE);
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
United States United States
biography? I am not that old yet.

Comments and Discussions