;+ ;NAME: ; thm_ui_progobj__define ;PURPOSE: ; defines an object to pass through into file_retrieve and ; file_http_copy that allows updates to the thm_gui progress widget ;METHODS DEFINED IN THIS CLASS: ; set = sets the parameter (only one, the gui widget id) ; get = returns the parameter ; update = if called, this updates the thm_gui progress widget, with ; the input text ; checkcancel = Currently does nothing, but will eventually allow the ; user to cancel a download. ;HISTORY: ; 15-may-2007, jmm, jimm@ssl.berkeley.edu ; ; $LastChangedBy$ ; $LastChangedDate$ ; $LastChangedRevision$ ; $URL$ ;- Function thm_ui_progobj__define::init, _extra = _extra self -> set, _extra = _extra Return, 1 End Pro thm_ui_progobj::cleanup self -> set, id = -1 Return End Function thm_ui_progobj::get, gui_id = gui_id, _extra = _extra If(keyword_set(gui_id)) Then Begin Return, self.gui_id Endif Else Return, gui_id End Pro thm_ui_progobj::set, gui_id = gui_id, _extra = _extra If(keyword_set(gui_id)) Then Begin self.gui_id = long(gui_id[0]) Endif Return End Function thm_ui_progobj::checkcancel, ioerror = ioerror, _extra = _extra ;This currently does nothing return, 0b End Pro thm_ui_progobj::update, percent, text = text, history_too = history_too, $ nocomment = nocomment, _extra = _extra If(is_string(text)) Then Begin gui_id = self -> get(/gui_id) If(gui_id Ne -1) Then Begin thm_ui_update_progress, gui_id, text If(keyword_set(history_too)) Then Begin If(keyword_set(nocomment)) Then thm_ui_update_history, gui_id, text $ Else thm_ui_update_history, gui_id, ';'+text Endif Endif Endif Return End Pro thm_ui_progobj__define self = {thm_ui_progobj, gui_id:0l} Return End