/* SimpleGauge Demo Copyright by Ralph Wermke in 1997 */ /* The usage is very simple. Take a look at the tags below. PLA_SimpleGauge_Max [ISG] - set maximum PLA_SimpleGauge_Current [ISG] - current value PLA_SimpleGauge_Horizontal [I.G] - (BOOL) set FALSE for vertical PLA_SimpleGauge_Percent [..G] - current percent value PLA_SimpleGauge_ShowText [I..] - set TRUE to display percentage PLA_SimpleGauge_Disabled [ISG] - makes the gauge ghosted */ OPT PREPROCESS MODULE 'tools/EasyGUI','tools/exceptions','tools/installhook', 'utility/tagitem','utility/hooks', 'easyplugins/simplegauge' DEF gh PROC main() HANDLE DEF mp:PTR TO simplegauge, mp2:PTR TO simplegauge NEW mp.simplegauge([PLA_SimpleGauge_ShowText, TRUE, PLA_SimpleGauge_Max, 1500, PLA_SimpleGauge_Current, 500, TAG_DONE]) NEW mp2.simplegauge([PLA_SimpleGauge_Horizontal, FALSE, PLA_SimpleGauge_ShowText, TRUE, PLA_SimpleGauge_Max, 1500, TAG_DONE]) mp.set(PLA_SimpleGauge_Max, 5000) mp.set(PLA_SimpleGauge_Current, 2500) easyguiA('SimpleGauge Test', [ROWS, [COLS, [BUTTON, {ignore}, 'Aaa'], [PLUGIN, {ignore}, mp] ], [BEVEL, [COLS, [PLUGIN, {ignore}, mp2], [ROWS, [SPACE], [EQCOLS, [SBUTTON, {setmax}, '500', [mp,mp2,500]], [SBUTTON, {setmax}, '1000', [mp,mp2,1000]], [SBUTTON, {setmax}, '1500', [mp,mp2,1500]], [SLIDE, {scroll}, NIL, FALSE, 0, 1500, 0, 2, '', [mp,mp2]] ], [SBUTTON, {dis}, 'Toggle', [mp,mp2]] ] ] ] ], [EG_GHVAR,{gh}, TAG_DONE]) EXCEPT END mp report_exception() ENDPROC PROC ignore(info, mp:PTR TO simplegauge) IS EMPTY PROC setmax(l:PTR TO LONG, info) DEF mp:PTR TO simplegauge, mp2:PTR TO simplegauge mp:=l[0]; mp2:=l[1] mp.set(PLA_SimpleGauge_Max, l[2]) mp2.set(PLA_SimpleGauge_Max, l[2]) ENDPROC PROC scroll(l:PTR TO LONG, info, x) DEF mp:PTR TO simplegauge, mp2:PTR TO simplegauge mp:=l[0]; mp2:=l[1] mp.set(PLA_SimpleGauge_Current, x) mp2.set(PLA_SimpleGauge_Current, x) PrintF('Max=\d Current=\d Percent=\d\n', mp.get(PLA_SimpleGauge_Max), mp.get(PLA_SimpleGauge_Current), mp.get(PLA_SimpleGauge_Percent) ) ENDPROC PROC dis(l:PTR TO LONG, info) DEF mp:PTR TO simplegauge, mp2:PTR TO simplegauge mp:=l[0]; mp2:=l[1] mp.set(PLA_SimpleGauge_Disabled, Not(mp.get(PLA_SimpleGauge_Disabled))) mp2.set(PLA_SimpleGauge_Disabled, Not(mp2.get(PLA_SimpleGauge_Disabled))) ENDPROC