khanat-opennel-code/code/ryzom/tools/leveldesign/georges_dll/settings_dialog.cpp
StudioEtrange 91e6b23d3f ** PCH Support for NMake with VS2012
NMAKE-VS2012 Error LNK2011
while NMAKE-VS2010 does not complain
we need to link the pch.obj file
see http://msdn.microsoft.com/en-us/library/3ay26wa2(v=vs.110).aspx

** PCH Support for Ninja
Ninja need to add property
        OBJECT_DEPENDS for using PCH
        OBJECT_OUTPUTS for create PCH
see http://public.kitware.com/pipermail/cmake-developers/2012-March/003653.html
2013-09-05 17:18:01 +02:00

161 lines
4.2 KiB
C++

// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// settings_dialog.cpp : implementation file
//
#include "stdafx.h"
#include "georges_edit.h"
#include "settings_dialog.h"
using namespace NLMISC;
/////////////////////////////////////////////////////////////////////////////
// CSettingsDialog dialog
CSettingsDialog::CSettingsDialog(CWnd* pParent /*=NULL*/)
: CDialog(CSettingsDialog::IDD, pParent)
{
//{{AFX_DATA_INIT(CSettingsDialog)
RootSearchPath = _T("");
RememberListSize = 0;
DefaultDfn = _T("");
DefaultType = _T("");
TypeDfnSubDirectory = _T("");
MaxUndo = 0;
StartExpanded = TRUE;
Georges4CVS = TRUE;
//}}AFX_DATA_INIT
}
void CSettingsDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CSettingsDialog)
DDX_Text(pDX, IDC_ROOT_SEARCH_PATH, RootSearchPath);
DDX_Text(pDX, IDC_REMEMBER_LIST_SIZE, RememberListSize);
DDX_Text(pDX, IDC_DEFAULT_DFN, DefaultDfn);
DDX_Text(pDX, IDC_DEFAULT_TYPE, DefaultType);
DDX_Text(pDX, IDC_TYP_DFN_PATH, TypeDfnSubDirectory);
DDX_Text(pDX, IDC_MAX_UNDO, MaxUndo);
DDX_Check(pDX, IDC_START_EXPANDED, StartExpanded);
DDX_Check(pDX, IDC_GEORGES_4_CVS, Georges4CVS);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CSettingsDialog, CDialog)
//{{AFX_MSG_MAP(CSettingsDialog)
ON_EN_CHANGE(IDC_ROOT_SEARCH_PATH, OnChangeRootSearchPath)
ON_BN_CLICKED(IDC_BROWSE, OnBrowse)
ON_EN_CHANGE(IDC_REMEMBER_LIST_SIZE, OnChangeRememberListSize)
ON_EN_CHANGE(IDC_DEFAULT_DFN, OnChangeDefaultDfn)
ON_EN_CHANGE(IDC_DEFAULT_TYPE, OnChangeDefaultType)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSettingsDialog message handlers
void CSettingsDialog::OnChangeRootSearchPath()
{
}
BOOL CSettingsDialog::OnInitDialog()
{
CDialog::OnInitDialog();
// Reset flags
RootSearchPath = "\\";
// Get the config file path
theApp.loadCfg ();
RootSearchPath = theApp.RootSearchPath.c_str();
TypeDfnSubDirectory = theApp.TypeDfnSubDirectory.c_str();
RememberListSize = theApp.RememberListSize;
MaxUndo = theApp.MaxUndo;
DefaultDfn = theApp.DefaultDfn.c_str ();
DefaultType = theApp.DefaultType.c_str ();
StartExpanded = theApp.StartExpanded;
Georges4CVS = theApp.Georges4CVS;
UpdateData (FALSE);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CSettingsDialog::OnOK()
{
UpdateData ();
// Make a config file
theApp.RootSearchPath = RootSearchPath;
theApp.TypeDfnSubDirectory = TypeDfnSubDirectory;
theApp.RememberListSize = RememberListSize;
theApp.StartExpanded = StartExpanded ? TRUE : FALSE;
theApp.Georges4CVS = Georges4CVS ? TRUE : FALSE;
theApp.MaxUndo = MaxUndo;
theApp.DefaultDfn = DefaultDfn;
theApp.DefaultType = DefaultType;
theApp.saveCfg ();
theApp.initCfg ();
CDialog::OnOK();
}
void CSettingsDialog::OnBrowse()
{
UpdateData ();
// Select a directory.
char path[MAX_PATH];
// Build the struct
BROWSEINFO info;
memset (&info, 0, sizeof (BROWSEINFO));
info.lpszTitle="Select the root search directory";
info.ulFlags=BIF_RETURNONLYFSDIRS;
// Select the path
LPITEMIDLIST list;
if (list=SHBrowseForFolder (&info))
{
// Convert item into path string
BOOL bRet=SHGetPathFromIDList(list, path);
if (bRet)
{
// Set the path
RootSearchPath = path;
}
}
UpdateData (FALSE);
}
void CSettingsDialog::OnChangeRememberListSize()
{
}
void CSettingsDialog::OnChangeDefaultDfn()
{
}
void CSettingsDialog::OnChangeDefaultType()
{
}