Erasing Log data

His Dad [04-17-15 - 00:32]
Erasing Log data
Filename
HistOffline.lua
en.lua
diff --git a/HistOffline.lua b/HistOffline.lua
index b08e4ee..da66815 100644
--- a/HistOffline.lua
+++ b/HistOffline.lua
@@ -343,28 +343,44 @@ end
 -- Now create the Log panel


-local logtable =iup.matrix{numcol=1, numcol_visible=1,  numlin=5}
-	logtable:setcell(0,0, L.TStamp)
+local logtable =iup.matrix{numcol=1, numcol_visible=1,  numlin=0}
+	logtable:setcell(0,1, L.TStamp)
 	iup.SetAttribute(logtable,  "WIDTH0", 100)
 	iup.SetAttribute(logtable,  "WIDTH1", 150)


-local log_keys={}
-for i,j in ipairs (log_data) do
--- logtable:setcell( i,1, L.TStamp)
-
+function Load_Log()
+	local Line=0
+	logtable.numlin = Line
+	for i,j in ipairs (log_data) do
+		Line= Line +1
+		logtable.numlin = Line
+		logtable:setcell( Line,1, j)
+	end
 end

+-- Load the log first time
+Load_Log()

+btn_eraselog=iup.button{title=L.EraseButton, FGCOLOR = "#FF0080"}


 local log_box=iup.vbox {
 	["tabtitle"] =L.LogTab,
 	iup.label{title="LogLabel",expand="HORIZONTAL"},
 	logtable,
+	iup.label{SEPARATOR="HORIZONTAL"},	-- Bottom Area
+	iup.hbox {
+		btn_eraselog,
+		iup.label{title = L.EraseWarning},
+		iup.fill{}
+	},
 	iup.fill{}
 }
-
+function btn_eraselog:action()
+	log_data = {}
+	Load_Log()
+end
 -- Add to end of Characters
 iup.Append(Chartabs, log_box)

diff --git a/en.lua b/en.lua
index 2460676..a15b774 100644
--- a/en.lua
+++ b/en.lua
@@ -36,7 +36,9 @@ Area_names = {
 		VetLab = "All are V1-V12 except City of Ash which is V13-V14",
 		LogTab = "System Log",
 		TStamp = "Time Stamp" ,
-		title = "History For  "
+		title = "History For  ",
+		EraseButton = "Erase Log",
+		EraseWarning = "Do not Erase while a Character is logged in."
 	}