save grid data Topic is solved
save grid data
how do i save grid data to a text file.
help would be greatly appreciated.
-
- Super wx Problem Solver
- Posts: 401
- Joined: Wed Sep 21, 2005 8:17 am
- Location: Rostov-on-Don, Southern Russia
Re: save grid data
I suppose the most suitable solution is XML-file.
wxWidgets has three classes for it:
1. wxXmlDocument
2. wxXmlNode
3. wxXmlProperty (wxXmlAttribute)
wxWidgets has three classes for it:
1. wxXmlDocument
2. wxXmlNode
3. wxXmlProperty (wxXmlAttribute)
Win XP HE SP3, Vista
Xubuntu 12.04 LTS
wxWidgets-2.9.5
wxWidgets-3.0.0
Xubuntu 12.04 LTS
wxWidgets-2.9.5
wxWidgets-3.0.0
Re: save grid data
In addition to what Mojo said, please tell us if there is any specific format that you need, csv is also regularly used for grids
"Keyboard not detected. Press F1 to continue"
-- Windows
-- Windows
Re: save grid data
i would input float values on each cell and need to output the bit values of each float consecutively to a text file.
Re: save grid data
wxGrid::GetCellValue() or use your own wxGridTable and myGridTable::GetValueasDouble()i would input float values on each cell
Are you thinking of writting the bytes used for internal representation of the float?and need to output the bit values of each float consecutively to a text file.
If so:
wxFile::Write(buffer, count)
Re: save grid data
Hi guys,
im a newbie would be able to give a simple example on how to use the syntax for wxgridtable thanks.
im a newbie would be able to give a simple example on how to use the syntax for wxgridtable thanks.
Re: save grid data
Well when using wxWidgets you're supposed to know how to call methods, so I'm not sure what you are having problems with
something like (this saves only a few cells, you will need to write that as a loop, and also decide which file format you want)
something like (this saves only a few cells, you will need to write that as a loop, and also decide which file format you want)
Code: Select all
wxTextFile file( wxT("/path/to/my_file.txt") );
file.Open();
file.AddLine( grid->GetCellValue(0,0) + wxT(", ") + grid->GetCellValue(0,1) + wxT(", ") + grid->GetCellValue(0,2) );
file.AddLine( grid->GetCellValue(1,0) + wxT(", ") + grid->GetCellValue(1,1) + wxT(", ") + grid->GetCellValue(1,2) );
file.AddLine( grid->GetCellValue(2,0) + wxT(", ") + grid->GetCellValue(2,1) + wxT(", ") + grid->GetCellValue(2,2) );
file.Write();
file.Close();
"Keyboard not detected. Press F1 to continue"
-- Windows
-- Windows