function CreateGauge () g={} g.dlg = nil g.gauge = iupgauge{} g.gauge.value = "0.0" g.gauge.size = "HALFx17" return g end function StartGaugeDlg(title) g={} g.dlg = nil g.gauge = iupgauge{} fr1 = iupframe{ iuphbox{iupfill{}, g.gauge, iupfill{}, NULL}} g.dlg = iupdialog{fr1} size = "250x17" g.dlg.title = title g.dlg.resize = IUP_NO g.dlg.maxbox = IUP_NO g.dlg.minbox = IUP_NO g.gauge.value = "0.0" g.gauge.size = size return g end -- ----------------------- ShowGauge --------------------------------- -- This function show dialog with gauge element. Your parameter -- is object of ElemGauge struct. function ShowGauge (g) if (g.dlg == nil) then return end g.dlg:showxy(IUP_CENTER,IUP_CENTER) end -- ----------------------- UpdateGauge --------------------------------- -- This function update gauge element. Your parameters are -- the ElemGauge struct, the real number (0.0 - 1.0) and -- label of dialog. function UpdateGauge(g,p) if (g.dlg == nil and g.gauge == nil) then return end if (p > 1.00) then p = 1.00 end s = p g.gauge.value = s end -- ----------------------- FinishGauge --------------------------------- -- This function finish dialog with gauge element. Your parameter -- is the object of ElemGauge struct. function FinishGauge(g) if (g.dlg == nil) then return end IupHide (g.dlg) IupDestroy (g.dlg) end