Hello
I have a TableHeaderComponent which is serialized to a file as this string:
Below code checks if the table.dat exists, if it exists it restores the header, if it does not exist it loads the default setttings. But in actual, it does not show the header columns altough it finds and reads the table.dat file.
Do i miss something?
juce::String path = File::getCurrentWorkingDirectory().getParentDirectory().getFullPathName();
path += "\\table.dat";
juce::File f(path);
if (f.existsAsFile())
{
TableHeaderComponent& headerComponent = table_.getHeader ();
juce::FileInputStream fis(f);
juce::String tableStr = fis.readString();
headerComponent.restoreFromString(tableStr);
headerComponent.repaint();
headerComponent.resized();
table_.setHeader(&headerComponent);
}
else
{
AddDefaultColumns ();
table_.getHeader ().setSortColumnId (TradeTableColumn::Column::COLUMN_ID, false);
}