/**
/* Copyright (c) 2003by Marco Welti
/*
/* This document is bound by the QT Public License
/* (http://www.trolltech.com/licenses/qpl.html).
/* See License.txt for more information.
/*
/*
/*
/* ALL RIGHTS RESERVED.
/*
/* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
/* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
/* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
/* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
/* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
/* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
/* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
/* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
/* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
/* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/*
/***********************************************************************/
#include <stdafx.h>
#include <resource.h>
#include "AppearancePropertyPanel.h"
#include <Renderer/UIProperties.h>
#include <Utilities/Properties.h>
#include <Utilities/stl_ext.h>
using namespace std;
/////////////////////////////////////////////////////////////////////////////
// AppearancePropertyPanel dialog
AppearancePropertyPanel::AppearancePropertyPanel(CWnd* pParent /*=NULL*/)
: COptionPage(AppearancePropertyPanel::IDD, (UINT)0)
{
//{{AFX_DATA_INIT(AppearancePropertyPanel)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
mShowReturnTypes = PropertiesManager::instance().getProperty(Browsers::SHOW_RETURNTYPES, "1") == "1";
mCloseTagBrowsersOnReturn = PropertiesManager::instance().getProperty(Browsers::CLOSE_ON_RETURN, "1") == "1";
mRaiseOnMouseHoover = PropertiesManager::instance().getProperty(Browsers::RAISE_ON_MOUSE_HOOVER, "1") == "1";
mHideOnMouseExit = PropertiesManager::instance().getProperty(Browsers::HIDE_ON_MOUSE_EXIT, "1") == "1";
}
void AppearancePropertyPanel::DoDataExchange(CDataExchange* pDX)
{
COptionPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(AppearancePropertyPanel)
DDX_Check(pDX, IDC_SHOW_RETURN_TYPES, mShowReturnTypes);
DDX_Check(pDX, IDC_CLOSE_ON_RETURN, mCloseTagBrowsersOnReturn);
DDX_Check(pDX, IDC_AUTO_RAISE, mRaiseOnMouseHoover);
DDX_Check(pDX, IDC_HIDE, mHideOnMouseExit);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(AppearancePropertyPanel, CDialog)
//{{AFX_MSG_MAP(AppearancePropertyPanel)
ON_BN_CLICKED(IDC_SHOW_RETURN_TYPES, onPropertyChanged)
ON_BN_CLICKED(IDC_CLOSE_ON_RETURN, onPropertyChanged)
ON_BN_CLICKED(IDC_AUTO_RAISE, onPropertyChanged)
ON_BN_CLICKED(IDC_HIDE, onPropertyChanged)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
BOOL AppearancePropertyPanel::OnApply()
{
if(m_hWnd) {
UpdateData(TRUE);
PropertiesManager::instance().setProperty(Browsers::SHOW_RETURNTYPES, lexical_cast<string>(mShowReturnTypes));
PropertiesManager::instance().setProperty(Browsers::CLOSE_ON_RETURN, lexical_cast<string>(mCloseTagBrowsersOnReturn));
PropertiesManager::instance().setProperty(Browsers::RAISE_ON_MOUSE_HOOVER, lexical_cast<string>(mRaiseOnMouseHoover));
PropertiesManager::instance().setProperty(Browsers::HIDE_ON_MOUSE_EXIT, lexical_cast<string>(mHideOnMouseExit));
PropertiesManager::instance().dump();
}
return COptionPage::OnApply();
}
void AppearancePropertyPanel::onPropertyChanged()
{
SetModified();
}