// COPYRIGHT (c) 2003-2016 RDC Tools International // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; version 2 // of the License. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program; (See the GPL.txt file in the Help directory) if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Use Windows.pkg Use cProgressBar.pkg Global_Variable Handle ghoWorkingMessagePanel Object oWorkingMessagePanel is a ToolPanel Move Self to ghoWorkingMessagePanel Set Label to "Information" Set Size to 41 137 Set Locate_Mode to CENTER_ON_PARENT Set Popup_State to True Object oWorkingMessage is a Textbox Set Label to "Working..." Set Location to 8 7 Set Size to 12 121 Set Auto_Size_State to False Set Justification_Mode to JMode_Center Set FontWeight to fw_Bold End_Object Object oProgressBar is a cProgressBar Set Size to 10 121 Set Location to 24 7 Set pbSmooth to False Set piPosition to 0 Property Integer piAdvancedPercentage 0 Property Boolean pbAutoAdvance True Procedure DoPercentageAdvanceBy Integer iAdvanceBy Integer iPos Integer iMax Integer iOld Integer iNew Get private_piPosition to iPos Get piMaximum to iMax Get piAdvancedPercentage to iOld Move (((iPos+iAdvanceBy)*100)/iMax) to iNew If (iNew>iOld) Begin Set piAdvancedPercentage to iNew Set piPosition to (iPos+iAdvanceBy) End Else Begin Set private_piPosition to (iPos+iAdvanceBy) End End_Procedure End_Object Object oIdleHandler is a cIdleHandler Set pbEnabled to False Procedure OnIdle Handle ho Boolean bActiveState bAutoAdvance Delegate Get Active_State to bActiveState Move (oProgressBar(Self)) to ho Get pbAutoAdvance of ho to bAutoAdvance If (bActiveState = True and bAutoAdvance = True) Begin Send DoPercentageAdvanceBy of ho 1 End End_Procedure End_Object End_Object Procedure StartWorkingMessage Global String sTxt String sText Send Close_Panel of ghoWorkingMessagePanel Send Popup of ghoWorkingMessagePanel If (Active_State(ghoWorkingMessagePanel)) Begin Set pbEnabled of (oIdleHandler(ghoWorkingMessagePanel)) to True If (num_arguments <> 0) Begin Move sTxt to sText End If (sText = "") Begin Move "Working..." to sText End Set Label of (oWorkingMessage(ghoWorkingMessagePanel)) to sText End End_Procedure Procedure StopWorkingMessage Global Set pbEnabled of (oIdleHandler(ghoWorkingMessagePanel)) to False Send Close_Panel of ghoWorkingMessagePanel End_Procedure Procedure DoAdvanceProgressBar //Send DoAdvanceBy of (oProgressBar(ghoWorkingMessagePanel)) 1 Send DoPercentageAdvanceBy of (oProgressBar(ghoWorkingMessagePanel)) 1 End_Procedure Procedure Set piProgressBarSize Integer iSize Set piAdvancedPercentage of (oProgressBar(ghoWorkingMessagePanel)) to 0 Set piPosition of (oProgressBar(ghoWorkingMessagePanel)) to 0 Set piMaximum of (oProgressBar(ghoWorkingMessagePanel)) to iSize End_Procedure