diff --git a/CrossBench/CrossBench.mk b/CrossBench/CrossBench.mk
index 27dd2ca..12fa393 100644
--- a/CrossBench/CrossBench.mk
+++ b/CrossBench/CrossBench.mk
@@ -13,7 +13,7 @@ CurrentFileName :=
CurrentFilePath :=
CurrentFileFullPath :=
User :=Aleksey Lobanov
-Date :=16/06/15
+Date :=17/06/15
CodeLitePath :="/home/alex/.codelite"
LinkerName :=/usr/bin/g++-4.8
SharedObjectLinkerName :=/usr/bin/g++-4.8 -shared -fPIC
diff --git a/src/crossexport.hpp b/src/crossexport.hpp
index 222ca49..5cb3095 100644
--- a/src/crossexport.hpp
+++ b/src/crossexport.hpp
@@ -5,10 +5,38 @@
#include "crossbasetypes.hpp"
-//wxTextFile::GetEOL()
+void fillCross(FilledCrossword &cross){
+ for ( size_t i = 0; i < cross.words.size(); ++i ) {
+ if ( cross.words.at(i).direct == true ) {
+ for (size_t j = 0; j < cross.words.at(i).len; ++j){
+ cross.grid.at(cross.words.at(i).x+j).at(cross.words.at(i).y) = cross.ans.at(i).at(j);
+ }
+ } else {
+ for (size_t j = 0; j < cross.words.at(i).len; ++j)
+ cross.grid.at(cross.words.at(i).x).at(cross.words.at(i).y+j) = cross.ans.at(i).at(j);
+ }
+ }
+}
-void exportToString(const FilledCrossword &cross, const bool prn_ans, wxString &str_out){
-
+void exportToString(const FilledCrossword &cross, const bool prn_ans,
+ wxString &str_out, wxChar space = wxT('-')){
+ FilledCrossword t_cross(cross);
+ if ( prn_ans && (t_cross.ans.size() != 0) ) {
+ fillCross(t_cross);
+ }
+ wxLogDebug(wxT("3"));
+ for (size_t i = 0; i < t_cross.grid.at(0).size(); ++i){
+ wxString cur_line;
+ for (size_t j = 0; j < t_cross.grid.size(); ++j){
+ if ( t_cross.grid.at(j).at(i) == CELL_BORDER )
+ cur_line += space;
+ else
+ cur_line += t_cross.grid.at(j).at(i);
+ }
+ cur_line += wxTextFile::GetEOL();
+
+ str_out += cur_line;
+ }
}
bool exportToFile(const FilledCrossword &cross, const bool prn_ans, const wxString path){
@@ -16,6 +44,7 @@ bool exportToFile(const FilledCrossword &cross, const bool prn_ans, const wxStri
if ( f.Exists() )
return false;
f.Create();
+ f.Open(path);
wxString cont;
exportToString(cross, prn_ans, cont);
f.AddLine(cont);
diff --git a/wxCrossGen/FormBuilderGUI.fbp b/wxCrossGen/FormBuilderGUI.fbp
index 174bf4f..5018954 100644
--- a/wxCrossGen/FormBuilderGUI.fbp
+++ b/wxCrossGen/FormBuilderGUI.fbp
@@ -147,7 +147,7 @@
0
1
- wxID_ANY
+ wxID_EXECUTE
wxITEM_NORMAL
&Generate
miGenerate
@@ -157,6 +157,21 @@
onGenerateClick
+