[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Eliot-dev] Changes to eliot/wxwin/mainframe.cc [antoine-1]
From: |
eliot-dev |
Subject: |
[Eliot-dev] Changes to eliot/wxwin/mainframe.cc [antoine-1] |
Date: |
Sun, 23 Oct 2005 16:59:38 -0400 |
Index: eliot/wxwin/mainframe.cc
diff -u eliot/wxwin/mainframe.cc:1.10.2.1 eliot/wxwin/mainframe.cc:1.10.2.2
--- eliot/wxwin/mainframe.cc:1.10.2.1 Sun Oct 23 17:10:47 2005
+++ eliot/wxwin/mainframe.cc Sun Oct 23 20:58:21 2005
@@ -17,8 +17,6 @@
/* along with this program; if not, write to the Free Software */
/* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-/* $Id: mainframe.cc,v 1.10.2.1 2005/10/23 17:10:47 afrab Exp $ */
-
/**
* \file mainframe.cc
* \brief Main frame for the Eliot GUI
@@ -42,6 +40,7 @@
#include "dic.h"
#include "game.h"
+#include "player.h"
#include "game_factory.h"
#include "configdb.h"
@@ -140,7 +139,7 @@
END_EVENT_TABLE()
// ****************
-//
+//
// ****************
MainFrame::MainFrame(wxPoint pos_, wxSize size_)
@@ -157,7 +156,7 @@
if (m_dic == NULL)
{
wxCommandEvent event;
- OnMenuConfGameDic(event);
+ OnMenuConfGameDic(event);
}
m_game = GameFactory::Instance()->createTraining(m_dic);
if (m_game)
@@ -216,7 +215,7 @@
}
// ****************
-//
+//
// ****************
MainFrame::~MainFrame()
@@ -229,7 +228,7 @@
GameFactory::Instance()->releaseGame(*m_game);
m_game = NULL;
}
-
+
if (m_dic)
{
Dic_destroy(m_dic);
@@ -237,7 +236,7 @@
}
// ****************
-//
+//
// ****************
void
@@ -320,7 +319,7 @@
}
// ****************
-//
+//
// ****************
void
@@ -363,7 +362,7 @@
}
// ****************
-//
+//
// ****************
void
@@ -378,7 +377,7 @@
wxICON_INFORMATION | wxOK);
return;
}
-
+
if (dialog.ShowModal() != wxID_OK)
{
return;
@@ -389,9 +388,9 @@
GameFactory::Instance()->releaseGame(*m_game);
m_game = NULL;
}
-
+
FILE* fin;
-
+
if ((fin = fopen(dialog.GetPath().mb_str(), "r")) == NULL)
{
txt << wxT("Impossible d'ouvrir") << dialog.GetPath();
@@ -402,20 +401,20 @@
m_game = Game::load(fin, m_dic);
fclose(fin);
-
+
if (m_game == NULL)
{
- wxMessageDialog msg(this,
- wxT("Erreur pendant la lecture de la partie"),
+ wxMessageDialog msg(this,
+ wxT("Erreur pendant la lecture de la partie"),
wxT("chargement de partie"));
msg.ShowModal();
return;
}
-
+
if (m_game->getHistory().getSize() == 0)
{
- wxMessageDialog msg(this,
- wxT("Erreur pendant la lecture de la partie"),
+ wxMessageDialog msg(this,
+ wxT("Erreur pendant la lecture de la partie"),
wxT("La partie est vide"));
msg.ShowModal();
return;
@@ -426,7 +425,7 @@
{
r = m_game->getCurrentPlayer().getCurrentRack().toString();
}
-
+
rack->SetValue(wxU(r.c_str()));
// update gfxboard and all frames
InitFrames();
@@ -439,7 +438,7 @@
}
// ****************
-//
+//
// ****************
void
@@ -464,7 +463,7 @@
}
// ****************
-//
+//
// ****************
void
@@ -607,7 +606,7 @@
{
switch (res)
{
- case 0: /* normal case */
+ case 0: /* normal case */
break;
case 1: msg << wxT("chargement: probleme d'ouverture de ") <<
dicpath << wxT("\n"); break;
case 2: msg << wxT("chargement: mauvais en-tete de
dictionnaire\n"); break;
@@ -758,19 +757,19 @@
debug("OnSetRack ");
switch ((id = event.GetId()))
{
- case Button_SetRack:
- mode = PlayedRack::RACK_ALL;
+ case Button_SetRack:
+ mode = PlayedRack::RACK_ALL;
debug("PlayedRack::RACK_ALL\n");
break;
- case Button_SetNew:
- mode = PlayedRack::RACK_NEW;
+ case Button_SetNew:
+ mode = PlayedRack::RACK_NEW;
debug("PlayedRack::RACK_NEW\n");
break;
- case Button_SetManual:
+ case Button_SetManual:
mode = PlayedRack::RACK_MANUAL;
debug("PlayedRack::RACK_MANUAL\n");
break;
- default:
+ default:
return;
}
SetRack(mode);
@@ -800,10 +799,10 @@
case Button_Play:
dir = 1;
break;
- case Button_PlayBack:
+ case Button_PlayBack:
dir = -1;
break;
- default:
+ default:
break;
}
Play(dir);
@@ -822,7 +821,7 @@
debug("m_game == NULL\n");
return;
}
-
+
for(int i=0 ; i < MAX_FRAME_ID; i++)
{
if (auxframes_ptr[i] != NULL)
@@ -831,7 +830,7 @@
delete auxframes_ptr[i];
}
}
-
+
auxframes_ptr[ ID_Frame_Verif ] = new VerifFrame (this, m_game->getDic());
auxframes_ptr[ ID_Frame_Search ] = new SearchFrame(this, m_game->getDic());
auxframes_ptr[ ID_Frame_Plus1 ] = new Plus1Frame (this, m_game);
@@ -843,7 +842,7 @@
#ifndef ENABLE_RESLIST_IN_MAIN
auxframes_ptr[ ID_Frame_Result ] = new ResultFrame(this, m_game);
#endif
-
+
for (int i = MIN_FRAME_ID; i < MAX_FRAME_ID; i++)
{
if (auxframes_ptr[i] != NULL)
@@ -920,13 +919,13 @@
}
// *********************************
-// ACTIONS
+// ACTIONS
// *********************************
-// Can come from a
+// Can come from a
// BUTTON ALL -> mode = Game::RACK_ALL, srack = empty
// BUTTON NEW -> mode = Game::RACK_NEW, srack = empty
-// TEXT_ENTER -> mode = Game::RACK_MANUAL, srack = letters
+// TEXT_ENTER -> mode = Game::RACK_MANUAL, srack = letters
// Play -> mode = Game::RACK_MANUAL, srack = letters
void
@@ -958,7 +957,7 @@
wxMessageBox(msg, wxT("Correction du tirage"), wxICON_INFORMATION |
wxOK);
break;
default:
- statusbar->SetStatusText(wxT("Le tirage a ete modifie
manuellement"), 0);
+ statusbar->SetStatusText(wxT("Le tirage a ete modifie
manuellement"), 0);
break;
}
@@ -1022,7 +1021,7 @@
}
// ****************
-//
+//
// ****************