X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=src%2Fctsim.cpp;h=a2212e8e0cb3304e821fbe15901511de35f1ae58;hb=95f440605a411c94ff2563c91cb0f51acf78c518;hp=5ce0a24829919a6679606d937913f853ce92105a;hpb=23a88a68dc4365314d21b832740bfaf24831c643;p=ctsim.git diff --git a/src/ctsim.cpp b/src/ctsim.cpp index 5ce0a24..a2212e8 100644 --- a/src/ctsim.cpp +++ b/src/ctsim.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: ctsim.cpp,v 1.34 2001/01/18 18:09:35 kevin Exp $ +** $Id: ctsim.cpp,v 1.36 2001/01/18 23:34:01 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -69,7 +69,7 @@ #endif #endif -static const char* rcsindent = "$Id: ctsim.cpp,v 1.34 2001/01/18 18:09:35 kevin Exp $"; +static const char* rcsindent = "$Id: ctsim.cpp,v 1.36 2001/01/18 23:34:01 kevin Exp $"; struct option CTSimApp::ctsimOptions[] = { @@ -160,15 +160,7 @@ CTSimApp::OnInit() if (! m_pFrame->getHelpController().Initialize("ctsim")) ::wxMessageBox ("Cannot initialize the help system", "Error"); - wxAcceleratorEntry accelEntries[5]; - accelEntries[0].Set (wxACCEL_CTRL, (int) 'O', wxID_OPEN); - accelEntries[1].Set (wxACCEL_CTRL, (int) 'T', MAINMENU_HELP_TOPICS); - accelEntries[2].Set (wxACCEL_CTRL, (int) 'P', MAINMENU_FILE_CREATE_PHANTOM); - accelEntries[3].Set (wxACCEL_CTRL, (int) 'F', MAINMENU_FILE_CREATE_FILTER); - accelEntries[4].Set (wxACCEL_NORMAL, WXK_F1, MAINMENU_HELP_CONTENTS); - wxAcceleratorTable accelTable (5, accelEntries); - m_pFrame->SetAcceleratorTable (accelTable); - + return true; } @@ -316,6 +308,16 @@ MainFrame::MainFrame(wxDocManager *manager, wxFrame *frame, wxWindowID id, const m_dDefaultFilterInputScale = 1.; m_dDefaultFilterOutputScale = 1.; + wxAcceleratorEntry accelEntries[14]; + accelEntries[0].Set (wxACCEL_CTRL, static_cast('O'), wxID_OPEN); + accelEntries[1].Set (wxACCEL_CTRL, static_cast('H'), MAINMENU_HELP_TOPICS); + accelEntries[2].Set (wxACCEL_CTRL, static_cast('P'), MAINMENU_FILE_CREATE_PHANTOM); + accelEntries[3].Set (wxACCEL_CTRL, static_cast('F'), MAINMENU_FILE_CREATE_FILTER); + accelEntries[4].Set (wxACCEL_NORMAL, WXK_F1, MAINMENU_HELP_CONTENTS); + for (i = 0; i < 10; i++) + accelEntries[i+4].Set (wxACCEL_CTRL, static_cast('0'+i), MAINMENU_WINDOW_BASE+i); + wxAcceleratorTable accelTable (16, accelEntries); + SetAcceleratorTable (accelTable); } void @@ -452,6 +454,10 @@ MainFrame::OnUpdateUI (wxUpdateUIEvent& rEvent) while (iPos < MAX_WINDOW_MENUITEMS && pNode != NULL) { wxDocument* pDoc = static_cast(pNode->GetData()); wxString strFilename = pDoc->GetFilename(); + if (iPos < 10) { + strFilename += "\tCtrl-"; + strFilename += static_cast('0' + iPos); + } static_cast(m_apWindowMenuItems[iPos])->SetName (strFilename); m_apWindowMenuData[iPos] = pDoc; m_pWindowMenu->Enable (MAINMENU_WINDOW_BASE+iPos, true);