Fix: moved col containing old data

This commit is contained in:
Crom (Thibaut CHARLES) 2014-11-19 14:11:53 +01:00
parent 736b14fc2d
commit c71aa68bc7

View File

@ -236,7 +236,8 @@ void Save(ref TreeView tree){
do{ do{
file.write(store.getValueInt(it, 0)); file.write(store.getValueInt(it, 0));
foreach(i ; 1..store.getNColumns()){ foreach(i ; 1..store.getNColumns()){
file.write("\t\"",store.getValueString(it, i),"\""); int storecol = cast(int)(tree.getColumn(i).getData("colnumber"));
file.write("\t\"", store.getValueString(it, storecol), "\"");
} }
file.write("\n"); file.write("\n");
}while(store.iterNext(it)); }while(store.iterNext(it));
@ -349,9 +350,11 @@ auto ref SetupColumn(TreeView tree, string sName, size_t index){
auto col = new TreeViewColumn(sName, cr, "text", cast(int)index); auto col = new TreeViewColumn(sName, cr, "text", cast(int)index);
col.setData("colnumber", cast(void*)cast(int)index);
col.setResizable(true); col.setResizable(true);
col.setMinWidth(10); col.setMinWidth(10);
col.setClickable(true); col.setClickable(true);
col.setReorderable(true);
col.addOnClicked((TreeViewColumn col){ col.addOnClicked((TreeViewColumn col){
import gtk.Dialog; import gtk.Dialog;
auto dlg = new Dialog("Rename column", window, GtkDialogFlags.MODAL, ["Cancel","Rename"], [ResponseType.CANCEL, ResponseType.OK]); auto dlg = new Dialog("Rename column", window, GtkDialogFlags.MODAL, ["Cancel","Rename"], [ResponseType.CANCEL, ResponseType.OK]);