[Sphere-axis-commits] CVS: Axis/S_Sphere52 venditemdlg.cpp,NONE,1.1 venditemdlg.h,NONE,1.1 weightedi
Brought to you by:
pesterle
From: Philip E. <pes...@us...> - 2003-07-03 18:10:20
|
Update of /cvsroot/sphere-axis/Axis/S_Sphere52 In directory sc8-pr-cvs1:/tmp/cvs-serv19614 Added Files: venditemdlg.cpp venditemdlg.h weighteditemdlg.cpp weighteditemdlg.h WOPEditDlg.cpp WOPEditDlg.h Log Message: no message --- NEW FILE: venditemdlg.cpp --- /* $Id: venditemdlg.cpp,v 1.1 2003/07/03 18:10:17 pesterle Exp $ ********************************************************************** * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * ********************************************************************** */ // VendItemDlg.cpp : implementation file // #include "stdafx.h" #include "Scripts.h" #include "VendItemDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CVendItemDlg dialog CVendItemDlg::CVendItemDlg(CWnd* pParent /*=NULL*/) : CDialog(CVendItemDlg::IDD, pParent) { //{{AFX_DATA_INIT(CVendItemDlg) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT m_csName = _T(""); m_csMinimum = _T(""); m_csMaximum = _T(""); m_csFrequency = _T(""); } void CVendItemDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CVendItemDlg) DDX_Control(pDX, IDC_VENDITEM_NAME, m_ceVendItemName); DDX_Control(pDX, IDC_VENDITEM_MIN, m_ceVendItemMin); DDX_Control(pDX, IDC_VENDITEM_MAX, m_ceVendItemMax); DDX_Control(pDX, IDC_VENDITEM_FREQ, m_ceVendItemFrequency); DDX_Control(pDX, IDC_VENDITEM_CHANCE, m_cbRandomChance); DDX_Control(pDX, IDOK, m_bOK); DDX_Control(pDX, IDCANCEL, m_bCancel); DDX_Control(pDX, IDC_EVIV_STATIC1, m_sStatic1); DDX_Control(pDX, IDC_EVIV_STATIC2, m_sStatic2); DDX_Control(pDX, IDC_EVIV_STATIC3, m_sStatic3); DDX_Control(pDX, IDC_EVIV_STATIC4, m_sStatic4); DDX_Control(pDX, IDC_EVIV_STATIC5, m_sStatic5); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CVendItemDlg, CDialog) //{{AFX_MSG_MAP(CVendItemDlg) ON_BN_CLICKED(IDC_VENDITEM_CHANCE, OnVenditemChance) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CVendItemDlg message handlers void CVendItemDlg::OnVenditemChance() { int iState = m_cbRandomChance.GetCheck(); if (iState == 0) m_ceVendItemFrequency.EnableWindow(false); else m_ceVendItemFrequency.EnableWindow(true); } void CVendItemDlg::OnOK() { if (m_cbRandomChance.GetCheck() == 0) m_csFrequency = _T(""); else m_ceVendItemFrequency.GetWindowText(m_csFrequency); CString csMin, csMax; m_ceVendItemMin.GetWindowText(csMin); m_ceVendItemMax.GetWindowText(csMax); int iMin, iMax; iMin = _tstoi(csMin); iMax = _tstoi(csMax); if (iMin <= iMax) { m_csMinimum = csMin; m_csMaximum = csMax; } else { m_csMinimum = csMax; m_csMaximum = csMin; } CDialog::OnOK(); } BOOL CVendItemDlg::OnInitDialog() { CWaitCursor hourglass; CDialog::OnInitDialog(); Localize(); m_csMinimum.TrimLeft(); m_csMinimum.TrimRight(); m_csMaximum.TrimLeft(); m_csMaximum.TrimRight(); m_ceVendItemName.SetWindowText(m_csName); m_ceVendItemMin.SetWindowText(m_csMinimum); m_ceVendItemMax.SetWindowText(m_csMaximum); if (m_csFrequency != _T("")) { m_cbRandomChance.SetCheck(1); m_ceVendItemFrequency.EnableWindow(true); m_ceVendItemFrequency.SetWindowText(m_csFrequency); } return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CVendItemDlg::Localize(void) { locale->LocalizeWindow(IDD, 0, NULL, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_VENDITEM_NAME, (CWnd*)&m_ceVendItemName, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_VENDITEM_MIN, (CWnd*)&m_ceVendItemMin, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_VENDITEM_MAX, (CWnd*)&m_ceVendItemMax, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_VENDITEM_FREQ, (CWnd*)&m_ceVendItemFrequency, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_VENDITEM_CHANCE, (CWnd*)&m_cbRandomChance, (CWnd*)this); locale->LocalizeWindow(IDD, IDOK, (CWnd*)&m_bOK, (CWnd*)this); locale->LocalizeWindow(IDD, IDCANCEL, (CWnd*)&m_bCancel, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_EVIV_STATIC1, (CWnd*)&m_sStatic1, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_EVIV_STATIC2, (CWnd*)&m_sStatic2, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_EVIV_STATIC3, (CWnd*)&m_sStatic3, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_EVIV_STATIC4, (CWnd*)&m_sStatic4, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_EVIV_STATIC5, (CWnd*)&m_sStatic5, (CWnd*)this); } --- NEW FILE: venditemdlg.h --- /* $Id: venditemdlg.h,v 1.1 2003/07/03 18:10:17 pesterle Exp $ ********************************************************************** * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * ********************************************************************** */ #if !defined(AFX_VENDITEMDLG_H__D641A8B1_E95A_11D2_A61F_004F4905E937__INCLUDED_) #define AFX_VENDITEMDLG_H__D641A8B1_E95A_11D2_A61F_004F4905E937__INCLUDED_ #if _MSC_VER >= 1000 #pragma once #endif // _MSC_VER >= 1000 // VendItemDlg.h : header file // ///////////////////////////////////////////////////////////////////////////// // CVendItemDlg dialog class CVendItemDlg : public CDialog { // Construction public: CString m_csName; CString m_csFrequency; CString m_csMaximum; CString m_csMinimum; CVendItemDlg(CWnd* pParent = NULL); // standard constructor // Dialog Data //{{AFX_DATA(CVendItemDlg) enum { IDD = IDD_VENDITEM_DLG }; CEdit m_ceVendItemName; CEdit m_ceVendItemMin; CEdit m_ceVendItemMax; CEdit m_ceVendItemFrequency; CButton m_cbRandomChance; CButton m_bOK; CButton m_bCancel; CStatic m_sStatic1; CStatic m_sStatic2; CStatic m_sStatic3; CStatic m_sStatic4; CStatic m_sStatic5; //}}AFX_DATA // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CVendItemDlg) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL // Implementation protected: // Generated message map functions //{{AFX_MSG(CVendItemDlg) afx_msg void OnVenditemChance(); virtual void OnOK(); virtual BOOL OnInitDialog(); //}}AFX_MSG DECLARE_MESSAGE_MAP() public: void Localize(void); }; //{{AFX_INSERT_LOCATION}} // Microsoft Developer Studio will insert additional declarations immediately before the previous line. #endif // !defined(AFX_VENDITEMDLG_H__D641A8B1_E95A_11D2_A61F_004F4905E937__INCLUDED_) --- NEW FILE: weighteditemdlg.cpp --- /* $Id: weighteditemdlg.cpp,v 1.1 2003/07/03 18:10:17 pesterle Exp $ ********************************************************************** * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * ********************************************************************** */ // WeightedItemDlg.cpp : implementation file // #include "stdafx.h" #include "Scripts.h" #include "WeightedItemDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CWeightedItemDlg dialog CWeightedItemDlg::CWeightedItemDlg(CWnd* pParent /*=NULL*/) : CDialog(CWeightedItemDlg::IDD, pParent) { //{{AFX_DATA_INIT(CWeightedItemDlg) //}}AFX_DATA_INIT } void CWeightedItemDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CWeightedItemDlg) DDX_Control(pDX, IDC_WEIGHTEDLIST, m_clcList); DDX_Control(pDX, IDC_WEIGHTEDITEMS, m_ccbItems); DDX_Control(pDX, IDC_ITEMWEIGHT, m_ceWeight); DDX_Control(pDX, IDC_ADDWEIGHTEDITEM, m_cbAdd); DDX_Control(pDX, IDOK, m_bOK); DDX_Control(pDX, IDCANCEL, m_bCancel); DDX_Control(pDX, IDC_WI_STATIC1, m_sStatic1); DDX_Control(pDX, IDC_WI_STATIC2, m_sStatic2); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CWeightedItemDlg, CDialog) //{{AFX_MSG_MAP(CWeightedItemDlg) ON_BN_CLICKED(IDC_ADDWEIGHTEDITEM, OnAddweighteditem) ON_NOTIFY(LVN_KEYDOWN, IDC_WEIGHTEDLIST, OnKeydownWeightedlist) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CWeightedItemDlg message handlers BOOL CWeightedItemDlg::OnInitDialog() { CWaitCursor hourglass; CDialog::OnInitDialog(); Localize(); FillItems(); m_ccbItems.AddString(_T(" NONE ")); m_clcList.InsertColumn(0, locale->String(IDS_GENERIC_ITEM), LVCFMT_LEFT, 200); m_clcList.InsertColumn(1, locale->String(IDS_GENERIC_WEIGHT), LVCFMT_LEFT, 50); // TODO: Add extra initialization here return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CWeightedItemDlg::OnOK() { m_csWeightString = _T("{"); for (int i = 0; i < m_clcList.GetItemCount(); i++) { CString csTmp = m_csWeightString; CString csItem = m_clcList.GetItemText(i, 0); if (csItem == _T(" NONE ")) csItem = _T("0 0"); CString csWeight = m_clcList.GetItemText(i, 1); m_csWeightString.Format(_T("%s %s %s"), csTmp, csItem, csWeight); } m_csWeightString += _T(" }"); CDialog::OnOK(); } void CWeightedItemDlg::OnAddweighteditem() { CString csItem; m_ccbItems.GetWindowText(csItem); if (csItem == _T("")) { AxisMessageBox(locale->String(IDS_ITEMGEN_NOSELECTION), MB_OK | MB_ICONEXCLAMATION); return; } CString csWeight; m_ceWeight.GetWindowText(csWeight); if (_tstoi(csWeight) == 0) { AxisMessageBox(locale->String(IDS_WIE_NOWEIGHT), MB_OK | MB_ICONEXCLAMATION); return; } int iIndex = m_clcList.InsertItem(m_clcList.GetItemCount(), csItem); m_clcList.SetItemText(iIndex, 1, csWeight); } void CWeightedItemDlg::FillItems() { CStdioFile csfGrayDefs; BOOL bStatus; CString csScpPath = GetScriptPath(); CString csFile; if ( csScpPath == _T("") ) csFile = DEFS_FILE; else csFile.Format(_T("%s%s"), csScpPath, DEFS_FILE); bStatus = csfGrayDefs.Open(csFile, CFile::modeRead | CFile::shareDenyNone); if (bStatus == 0) { CString csMessage; csMessage.Format(locale->String(IDS_SCRIPTS_CANTOPEN), csFile); AxisMessageBox(csMessage, MB_OK | MB_ICONEXCLAMATION); return; } CString csInput; bool bFoundSection = false; int iIndex = 0; while (bStatus) { bStatus = csfGrayDefs.ReadString(csInput); csInput.MakeLower(); if (bStatus) { if (csInput.Find(_T("[")) != -1) { // We have reached a new section if (csInput.Find(_T("[items_")) == -1) bFoundSection = FALSE; else bFoundSection = TRUE; } else { if (bFoundSection) { // Check for blank line or comment csInput = csInput.SpanExcluding(_T("//")); csInput.TrimLeft(); csInput.TrimRight(); CString csValue = csInput.Right(8); csValue.TrimLeft(); csInput = csInput.SpanExcluding(_T(" ")); if (csInput != _T("")) { m_ccbItems.AddString(csInput); } } } } } csfGrayDefs.Close(); } void CWeightedItemDlg::OnKeydownWeightedlist(NMHDR* pNMHDR, LRESULT* pResult) { LV_KEYDOWN* pLVKeyDown = (LV_KEYDOWN*)pNMHDR; if (pLVKeyDown->wVKey == VK_DELETE) { // Delete the selected items from the list control while (this->m_clcList.GetSelectedCount() > 0) { int iSel = this->m_clcList.GetNextItem(-1, LVNI_SELECTED); if (iSel != -1) this->m_clcList.DeleteItem(iSel); } } *pResult = 0; } void CWeightedItemDlg::Localize(void) { locale->LocalizeWindow(IDD, 0, NULL, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WEIGHTEDLIST, (CWnd*)&m_clcList, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WEIGHTEDITEMS, (CWnd*)&m_ccbItems, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_ITEMWEIGHT, (CWnd*)&m_ceWeight, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_ADDWEIGHTEDITEM, (CWnd*)&m_cbAdd, (CWnd*)this); locale->LocalizeWindow(IDD, IDOK, (CWnd*)&m_bOK, (CWnd*)this); locale->LocalizeWindow(IDD, IDCANCEL, (CWnd*)&m_bCancel, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WI_STATIC1, (CWnd*)&m_sStatic1, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WI_STATIC2, (CWnd*)&m_sStatic2, (CWnd*)this); } --- NEW FILE: weighteditemdlg.h --- /* $Id: weighteditemdlg.h,v 1.1 2003/07/03 18:10:17 pesterle Exp $ ********************************************************************** * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * ********************************************************************** */ #if !defined(AFX_WEIGHTEDITEMDLG_H__D641A8B6_E95A_11D2_A61F_004F4905E937__INCLUDED_) #define AFX_WEIGHTEDITEMDLG_H__D641A8B6_E95A_11D2_A61F_004F4905E937__INCLUDED_ #if _MSC_VER >= 1000 #pragma once #endif // _MSC_VER >= 1000 // WeightedItemDlg.h : header file // ///////////////////////////////////////////////////////////////////////////// // CWeightedItemDlg dialog class CWeightedItemDlg : public CDialog { // Construction public: CString m_csWeightString; CWeightedItemDlg(CWnd* pParent = NULL); // standard constructor // Dialog Data //{{AFX_DATA(CWeightedItemDlg) enum { IDD = IDD_WEIGHTED_ITEM_DLG }; CListCtrl m_clcList; CComboBox m_ccbItems; CEdit m_ceWeight; CButton m_cbAdd; CButton m_bOK; CButton m_bCancel; CStatic m_sStatic1; CStatic m_sStatic2; //}}AFX_DATA // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CWeightedItemDlg) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL // Implementation protected: // Generated message map functions //{{AFX_MSG(CWeightedItemDlg) virtual BOOL OnInitDialog(); virtual void OnOK(); afx_msg void OnAddweighteditem(); afx_msg void OnKeydownWeightedlist(NMHDR* pNMHDR, LRESULT* pResult); //}}AFX_MSG DECLARE_MESSAGE_MAP() private: void FillItems(); public: void Localize(void); }; //{{AFX_INSERT_LOCATION}} // Microsoft Developer Studio will insert additional declarations immediately before the previous line. #endif // !defined(AFX_WEIGHTEDITEMDLG_H__D641A8B6_E95A_11D2_A61F_004F4905E937__INCLUDED_) --- NEW FILE: WOPEditDlg.cpp --- /* $Id: WOPEditDlg.cpp,v 1.1 2003/07/03 18:10:17 pesterle Exp $ ********************************************************************** * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * ********************************************************************** */ // WOPEditDlg.cpp : implementation file // #include "stdafx.h" #include "Scripts.h" #include "WOPEditDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CWOPEditDlg dialog CWOPEditDlg::CWOPEditDlg(CWnd* pParent /*=NULL*/) : CDialog(CWOPEditDlg::IDD, pParent) { //{{AFX_DATA_INIT(CWOPEditDlg) m_cs1 = _T(""); m_cs10 = _T(""); m_cs11 = _T(""); m_cs12 = _T(""); m_cs13 = _T(""); m_cs14 = _T(""); m_cs15 = _T(""); m_cs16 = _T(""); m_cs17 = _T(""); m_cs18 = _T(""); m_cs19 = _T(""); m_cs2 = _T(""); m_cs20 = _T(""); m_cs21 = _T(""); m_cs22 = _T(""); m_cs23 = _T(""); m_cs24 = _T(""); m_cs25 = _T(""); m_cs26 = _T(""); m_cs3 = _T(""); m_cs4 = _T(""); m_cs5 = _T(""); m_cs6 = _T(""); m_cs7 = _T(""); m_cs8 = _T(""); m_cs9 = _T(""); //}}AFX_DATA_INIT } void CWOPEditDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CWOPEditDlg) DDX_Text(pDX, IDC_WOP1, m_cs1); DDX_Text(pDX, IDC_WOP10, m_cs10); DDX_Text(pDX, IDC_WOP11, m_cs11); DDX_Text(pDX, IDC_WOP12, m_cs12); DDX_Text(pDX, IDC_WOP13, m_cs13); DDX_Text(pDX, IDC_WOP14, m_cs14); DDX_Text(pDX, IDC_WOP15, m_cs15); DDX_Text(pDX, IDC_WOP16, m_cs16); DDX_Text(pDX, IDC_WOP17, m_cs17); DDX_Text(pDX, IDC_WOP18, m_cs18); DDX_Text(pDX, IDC_WOP19, m_cs19); DDX_Text(pDX, IDC_WOP2, m_cs2); DDX_Text(pDX, IDC_WOP20, m_cs20); DDX_Text(pDX, IDC_WOP21, m_cs21); DDX_Text(pDX, IDC_WOP22, m_cs22); DDX_Text(pDX, IDC_WOP23, m_cs23); DDX_Text(pDX, IDC_WOP24, m_cs24); DDX_Text(pDX, IDC_WOP25, m_cs25); DDX_Text(pDX, IDC_WOP26, m_cs26); DDX_Text(pDX, IDC_WOP3, m_cs3); DDX_Text(pDX, IDC_WOP4, m_cs4); DDX_Text(pDX, IDC_WOP5, m_cs5); DDX_Text(pDX, IDC_WOP6, m_cs6); DDX_Text(pDX, IDC_WOP7, m_cs7); DDX_Text(pDX, IDC_WOP8, m_cs8); DDX_Text(pDX, IDC_WOP9, m_cs9); DDX_Control(pDX, IDOK, m_bOK); DDX_Control(pDX, IDCANCEL, m_bCancel); DDX_Control(pDX, IDC_WOP1, m_e1); DDX_Control(pDX, IDC_WOP2, m_e2); DDX_Control(pDX, IDC_WOP3, m_e3); DDX_Control(pDX, IDC_WOP4, m_e4); DDX_Control(pDX, IDC_WOP5, m_e5); DDX_Control(pDX, IDC_WOP6, m_e6); DDX_Control(pDX, IDC_WOP7, m_e7); DDX_Control(pDX, IDC_WOP8, m_e8); DDX_Control(pDX, IDC_WOP9, m_e9); DDX_Control(pDX, IDC_WOP10, m_e10); DDX_Control(pDX, IDC_WOP11, m_e11); DDX_Control(pDX, IDC_WOP12, m_e12); DDX_Control(pDX, IDC_WOP13, m_e13); DDX_Control(pDX, IDC_WOP14, m_e14); DDX_Control(pDX, IDC_WOP15, m_e15); DDX_Control(pDX, IDC_WOP16, m_e16); DDX_Control(pDX, IDC_WOP17, m_e17); DDX_Control(pDX, IDC_WOP18, m_e18); DDX_Control(pDX, IDC_WOP19, m_e19); DDX_Control(pDX, IDC_WOP20, m_e20); DDX_Control(pDX, IDC_WOP21, m_e21); DDX_Control(pDX, IDC_WOP22, m_e22); DDX_Control(pDX, IDC_WOP23, m_e23); DDX_Control(pDX, IDC_WOP24, m_e24); DDX_Control(pDX, IDC_WOP25, m_e25); DDX_Control(pDX, IDC_WOP26, m_e26); DDX_Control(pDX, IDC_WOP_STATICA, m_s1); DDX_Control(pDX, IDC_WOP_STATICB, m_s2); DDX_Control(pDX, IDC_WOP_STATICC, m_s3); DDX_Control(pDX, IDC_WOP_STATICD, m_s4); DDX_Control(pDX, IDC_WOP_STATICE, m_s5); DDX_Control(pDX, IDC_WOP_STATICF, m_s6); DDX_Control(pDX, IDC_WOP_STATICG, m_s7); DDX_Control(pDX, IDC_WOP_STATICH, m_s8); DDX_Control(pDX, IDC_WOP_STATICI, m_s9); DDX_Control(pDX, IDC_WOP_STATICJ, m_s10); DDX_Control(pDX, IDC_WOP_STATICK, m_s11); DDX_Control(pDX, IDC_WOP_STATICL, m_s12); DDX_Control(pDX, IDC_WOP_STATICM, m_s13); DDX_Control(pDX, IDC_WOP_STATICN, m_s14); DDX_Control(pDX, IDC_WOP_STATICO, m_s15); DDX_Control(pDX, IDC_WOP_STATICP, m_s16); DDX_Control(pDX, IDC_WOP_STATICQ, m_s17); DDX_Control(pDX, IDC_WOP_STATICR, m_s18); DDX_Control(pDX, IDC_WOP_STATICS, m_s19); DDX_Control(pDX, IDC_WOP_STATICT, m_s20); DDX_Control(pDX, IDC_WOP_STATICU, m_s21); DDX_Control(pDX, IDC_WOP_STATICV, m_s22); DDX_Control(pDX, IDC_WOP_STATICW, m_s23); DDX_Control(pDX, IDC_WOP_STATICX, m_s24); DDX_Control(pDX, IDC_WOP_STATICY, m_s25); DDX_Control(pDX, IDC_WOP_STATICZ, m_s26); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CWOPEditDlg, CDialog) //{{AFX_MSG_MAP(CWOPEditDlg) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CWOPEditDlg message handlers BOOL CWOPEditDlg::OnInitDialog() { CWaitCursor hourglass; CDialog::OnInitDialog(); Localize(); Main->m_pScriptsOld->LoadTables(); for ( int i = 0; i < Main->m_pScriptsOld->m_tables.m_runes.GetSize(); i++ ) { CString csRune = Main->m_pScriptsOld->m_tables.m_runes.GetAt(i); switch(i + 1) { case 1: m_cs1 = csRune; break; case 2: m_cs2 = csRune; break; case 3: m_cs3 = csRune; break; case 4: m_cs4 = csRune; break; case 5: m_cs5 = csRune; break; case 6: m_cs6 = csRune; break; case 7: m_cs7 = csRune; break; case 8: m_cs8 = csRune; break; case 9: m_cs9 = csRune; break; case 10: m_cs10 = csRune; break; case 11: m_cs11 = csRune; break; case 12: m_cs12 = csRune; break; case 13: m_cs13 = csRune; break; case 14: m_cs14 = csRune; break; case 15: m_cs15 = csRune; break; case 16: m_cs16 = csRune; break; case 17: m_cs17 = csRune; break; case 18: m_cs18 = csRune; break; case 19: m_cs19 = csRune; break; case 20: m_cs20 = csRune; break; case 21: m_cs21 = csRune; break; case 22: m_cs22 = csRune; break; case 23: m_cs23 = csRune; break; case 24: m_cs24 = csRune; break; case 25: m_cs25 = csRune; break; case 26: m_cs26 = csRune; break; default: break; } } UpdateData(FALSE); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CWOPEditDlg::OnOK() { CWaitCursor hourglass; Main->m_pScriptsOld->m_tables.m_runes.RemoveAll(); for (int i = 1; i < 27; i++) { CString csRune = _T(""); switch(i) { case 1: csRune = m_cs1; break; case 2: csRune = m_cs2; break; case 3: csRune = m_cs3; break; case 4: csRune = m_cs4; break; case 5: csRune = m_cs5; break; case 6: csRune = m_cs6; break; case 7: csRune = m_cs7; break; case 8: csRune = m_cs8; break; case 9: csRune = m_cs9; break; case 10: csRune = m_cs10; break; case 11: csRune = m_cs11; break; case 12: csRune = m_cs12; break; case 13: csRune = m_cs13; break; case 14: csRune = m_cs14; break; case 15: csRune = m_cs15; break; case 16: csRune = m_cs16; break; case 17: csRune = m_cs17; break; case 18: csRune = m_cs18; break; case 19: csRune = m_cs19; break; case 20: csRune = m_cs20; break; case 21: csRune = m_cs21; break; case 22: csRune = m_cs22; break; case 23: csRune = m_cs23; break; case 24: csRune = m_cs24; break; case 25: csRune = m_cs25; break; case 26: csRune = m_cs26; break; } Main->m_pScriptsOld->m_tables.m_runes.InsertAt(i - 1, csRune); } if ( Main->m_pScriptsOld->m_tables.Write() ) CDialog::OnOK(); } void CWOPEditDlg::Localize(void) { locale->LocalizeWindow(IDD, 0, NULL, (CWnd*)this); locale->LocalizeWindow(IDD, IDOK, (CWnd*)&m_bOK, (CWnd*)this); locale->LocalizeWindow(IDD, IDCANCEL, (CWnd*)&m_bCancel, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP1, (CWnd*)&m_e1, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP2, (CWnd*)&m_e2, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP3, (CWnd*)&m_e3, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP4, (CWnd*)&m_e4, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP5, (CWnd*)&m_e5, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP6, (CWnd*)&m_e6, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP7, (CWnd*)&m_e7, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP8, (CWnd*)&m_e8, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP9, (CWnd*)&m_e9, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP10, (CWnd*)&m_e10, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP11, (CWnd*)&m_e11, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP12, (CWnd*)&m_e12, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP13, (CWnd*)&m_e13, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP14, (CWnd*)&m_e14, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP15, (CWnd*)&m_e15, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP16, (CWnd*)&m_e16, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP17, (CWnd*)&m_e17, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP18, (CWnd*)&m_e18, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP19, (CWnd*)&m_e19, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP20, (CWnd*)&m_e20, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP21, (CWnd*)&m_e21, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP22, (CWnd*)&m_e22, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP23, (CWnd*)&m_e23, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP24, (CWnd*)&m_e24, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP25, (CWnd*)&m_e25, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP26, (CWnd*)&m_e26, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP_STATICA, (CWnd*)&m_s1, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP_STATICB, (CWnd*)&m_s2, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP_STATICC, (CWnd*)&m_s3, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP_STATICD, (CWnd*)&m_s4, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP_STATICE, (CWnd*)&m_s5, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP_STATICF, (CWnd*)&m_s6, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP_STATICG, (CWnd*)&m_s7, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP_STATICH, (CWnd*)&m_s8, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP_STATICI, (CWnd*)&m_s9, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP_STATICJ, (CWnd*)&m_s10, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP_STATICK, (CWnd*)&m_s11, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP_STATICL, (CWnd*)&m_s12, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP_STATICM, (CWnd*)&m_s13, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP_STATICN, (CWnd*)&m_s14, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP_STATICO, (CWnd*)&m_s15, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP_STATICP, (CWnd*)&m_s16, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP_STATICQ, (CWnd*)&m_s17, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP_STATICR, (CWnd*)&m_s18, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP_STATICS, (CWnd*)&m_s19, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP_STATICT, (CWnd*)&m_s20, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP_STATICU, (CWnd*)&m_s21, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP_STATICV, (CWnd*)&m_s22, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP_STATICW, (CWnd*)&m_s23, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP_STATICX, (CWnd*)&m_s24, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP_STATICY, (CWnd*)&m_s25, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_WOP_STATICZ, (CWnd*)&m_s26, (CWnd*)this); } --- NEW FILE: WOPEditDlg.h --- /* $Id: WOPEditDlg.h,v 1.1 2003/07/03 18:10:17 pesterle Exp $ ********************************************************************** * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * ********************************************************************** */ #if !defined(AFX_WOPEDITDLG_H__5D6AFB64_2981_11D3_8723_00805FD91B8C__INCLUDED_) #define AFX_WOPEDITDLG_H__5D6AFB64_2981_11D3_8723_00805FD91B8C__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // WOPEditDlg.h : header file // ///////////////////////////////////////////////////////////////////////////// // CWOPEditDlg dialog class CWOPEditDlg : public CDialog { // Construction public: CWOPEditDlg(CWnd* pParent = NULL); // standard constructor // Dialog Data //{{AFX_DATA(CWOPEditDlg) enum { IDD = IDD_WOPEDITDLG }; CString m_cs1; CString m_cs10; CString m_cs11; CString m_cs12; CString m_cs13; CString m_cs14; CString m_cs15; CString m_cs16; CString m_cs17; CString m_cs18; CString m_cs19; CString m_cs2; CString m_cs20; CString m_cs21; CString m_cs22; CString m_cs23; CString m_cs24; CString m_cs25; CString m_cs26; CString m_cs3; CString m_cs4; CString m_cs5; CString m_cs6; CString m_cs7; CString m_cs8; CString m_cs9; CButton m_bOK; CButton m_bCancel; CEdit m_e1; CEdit m_e2; CEdit m_e3; CEdit m_e4; CEdit m_e5; CEdit m_e6; CEdit m_e7; CEdit m_e8; CEdit m_e9; CEdit m_e10; CEdit m_e11; CEdit m_e12; CEdit m_e13; CEdit m_e14; CEdit m_e15; CEdit m_e16; CEdit m_e17; CEdit m_e18; CEdit m_e19; CEdit m_e20; CEdit m_e21; CEdit m_e22; CEdit m_e23; CEdit m_e24; CEdit m_e25; CEdit m_e26; CStatic m_s1; CStatic m_s2; CStatic m_s3; CStatic m_s4; CStatic m_s5; CStatic m_s6; CStatic m_s7; CStatic m_s8; CStatic m_s9; CStatic m_s10; CStatic m_s11; CStatic m_s12; CStatic m_s13; CStatic m_s14; CStatic m_s15; CStatic m_s16; CStatic m_s17; CStatic m_s18; CStatic m_s19; CStatic m_s20; CStatic m_s21; CStatic m_s22; CStatic m_s23; CStatic m_s24; CStatic m_s25; CStatic m_s26; //}}AFX_DATA // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CWOPEditDlg) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL // Implementation protected: // Generated message map functions //{{AFX_MSG(CWOPEditDlg) virtual BOOL OnInitDialog(); virtual void OnOK(); //}}AFX_MSG DECLARE_MESSAGE_MAP() public: void Localize(void); }; //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_WOPEDITDLG_H__5D6AFB64_2981_11D3_8723_00805FD91B8C__INCLUDED_) |