00001 00002 // exotkGUI_GUI.cxx 00004 // Copyright (C) 2001 Stephane Routelous 00005 // 00006 // This file is part of exoTK. 00007 // 00008 // exoTK is free software; you can redistribute it and/or modify 00009 // it under the terms of the GNU General Public License as published by 00010 // the Free Software Foundation; either version 2 of the License, or 00011 // (at your option) any later version. 00012 // 00013 // exoTK is distributed in the hope that it will be useful, 00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 // GNU General Public License for more details. 00017 // 00018 // You should have received a copy of the GNU General Public License 00019 // along with exoTK; if not, write to the Free Software 00020 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00022 00028 #include <exotkGUI_GUI.hxx> 00029 #ifndef _Standard_DefineHandle_HeaderFile 00030 #include <Standard_DefineHandle.hxx> 00031 #endif 00032 #ifndef _exotkTrace_HeaderFile 00033 #include <exotkTrace.hxx> 00034 #endif 00035 00036 // 00037 IMPLEMENT_STANDARD_HANDLE(exotkGUI_GUI, MMgt_TShared) 00038 IMPLEMENT_STANDARD_RTTI(exotkGUI_GUI, MMgt_TShared) 00039 // 00040 // Foreach ancestors, we add a IMPLEMENT_STANDARD_SUPERTYPE and 00041 // a IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY macro. 00042 // We must respect the order: from the direct ancestor class 00043 // to the base class. 00044 // 00045 00046 IMPLEMENT_STANDARD_TYPE(exotkGUI_GUI) 00047 IMPLEMENT_STANDARD_SUPERTYPE(MMgt_TShared) 00048 IMPLEMENT_STANDARD_SUPERTYPE(Standard_Transient) 00049 IMPLEMENT_STANDARD_SUPERTYPE_ARRAY() 00050 IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(MMgt_TShared) 00051 IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(Standard_Transient) 00052 IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END() 00053 IMPLEMENT_STANDARD_TYPE_END(exotkGUI_GUI) 00054 00055 00056 //================================================================================== 00057 // Function name : exotkGUI_GUI::exotkGUI_GUI 00058 //================================================================================== 00059 // Written by : Stephane Routelous - 2001-11-06 16:08:58 00060 // Description : 00061 // Return type : 00062 //================================================================================== 00063 exotkGUI_GUI::exotkGUI_GUI() 00064 :myProgressBoxTitle("Progress..."),myProgressBoxPosition(0),myBeginRange(0),myEndRange(100) 00065 { 00066 } 00067 00068 00069 //================================================================================== 00070 // Function name : exotkGUI_GUI::~exotkGUI_GUI 00071 //================================================================================== 00072 // Written by : Stephane Routelous - 2001-11-06 16:09:01 00073 // Description : 00074 // Return type : 00075 //================================================================================== 00076 exotkGUI_GUI::~exotkGUI_GUI() 00077 { 00078 } 00079 00080 //================================================================================== 00081 // Function name : exotkGUI_GUI::SetPtr 00082 //================================================================================== 00083 // Written by : Stephane Routelous - 2001-11-06 16:09:07 00084 // Description : 00085 // Return type : void 00086 //================================================================================== 00087 // Argument : void* anHandle 00088 void exotkGUI_GUI::SetPtr(void* anHandle) 00089 { 00090 myHandle = anHandle; 00091 } 00092 00093 //================================================================================== 00094 // Function name : exotkGUI_GUI::Ptr 00095 //================================================================================== 00096 // Written by : Stephane Routelous - 2001-11-06 16:09:05 00097 // Description : 00098 // Return type : void* 00099 //================================================================================== 00100 void* exotkGUI_GUI::Ptr() 00101 { 00102 return myHandle; 00103 } 00104 00105 //================================================================================== 00106 // Function name : exotkGUI_GUI::UnSetPtr 00107 //================================================================================== 00108 // Written by : Stephane Routelous - 2001-11-06 16:09:04 00109 // Description : 00110 // Return type : void 00111 //================================================================================== 00112 void exotkGUI_GUI::UnSetPtr() 00113 { 00114 myHandle = NULL; 00115 } 00116 00117 00118 //================================================================================== 00119 // Function name : exotkGUI_GUI::SetProgressBoxTitle 00120 //================================================================================== 00121 // Written by : Stephane Routelous - 2001-12-29 00:44:37 00122 // Description : 00123 // Return type : void 00124 //================================================================================== 00125 // Argument : const TCollection_AsciiString& aTitle 00126 void exotkGUI_GUI::SetProgressBoxTitle(const TCollection_AsciiString& aTitle) 00127 { 00128 myProgressBoxTitle = aTitle; 00129 } 00130 00131 //================================================================================== 00132 // Function name : exotkGUI_GUI::SetProgressBoxText 00133 //================================================================================== 00134 // Written by : Stephane Routelous - 2001-12-29 00:44:38 00135 // Description : 00136 // Return type : void 00137 //================================================================================== 00138 // Argument : const TCollection_AsciiString& aText 00139 void exotkGUI_GUI::SetProgressBoxText(const TCollection_AsciiString& aText) 00140 { 00141 myProgressBoxText = aText; 00142 } 00143 00144 //================================================================================== 00145 // Function name : exotkGUI_GUI::ProgressBoxText 00146 //================================================================================== 00147 // Written by : Stephane Routelous - 2002-01-10 15:36:38 00148 // Description : 00149 // Return type : TCollection_AsciiString 00150 //================================================================================== 00151 TCollection_AsciiString exotkGUI_GUI::ProgressBoxText() 00152 { 00153 return myProgressBoxText; 00154 } 00155 //================================================================================== 00156 // Function name : exotkGUI_GUI::ProgressBoxPosition 00157 //================================================================================== 00158 // Written by : Stephane Routelous - 2001-12-29 00:44:41 00159 // Description : 00160 // Return type : Standard_Integer 00161 //================================================================================== 00162 Standard_Integer exotkGUI_GUI::ProgressBoxPosition() 00163 { 00164 return myProgressBoxPosition; 00165 } 00166 00167 //================================================================================== 00168 // Function name : exotkGUI_GUI::SetProgressBoxPosition 00169 //================================================================================== 00170 // Written by : Stephane Routelous - 2001-12-29 00:44:40 00171 // Description : 00172 // Return type : Standard_Integer 00173 //================================================================================== 00174 // Argument : const Standard_Integer aPosition 00175 Standard_Integer exotkGUI_GUI::SetProgressBoxPosition(const Standard_Integer aPosition) 00176 { 00177 Standard_Integer theOldPosition = myProgressBoxPosition; 00178 myProgressBoxPosition = ( aPosition * (myEndRange - myBeginRange ) )/ 100+ myBeginRange; 00179 return theOldPosition; 00180 } 00181 00182 void exotkGUI_GUI::SetProgressBoxRange(const Standard_Integer aBegin, const Standard_Integer anEnd) 00183 { 00184 if ( anEnd > aBegin ) 00185 { 00186 myBeginRange = aBegin; 00187 myEndRange = anEnd; 00188 } 00189 } 00190 void exotkGUI_GUI::ProgressBoxRange(Standard_Integer& aBegin,Standard_Integer& anEnd) 00191 { 00192 aBegin = myBeginRange; 00193 anEnd = myEndRange; 00194 } 00195 void exotkGUI_GUI::HideProgressBox() 00196 { 00197 HideWaitCursor(); 00198 } 00199 void exotkGUI_GUI::ShowProgressBox() 00200 { 00201 ShowWaitCursor(); 00202 }
1.2.12 written by Dimitri van Heesch,
© 1997-2001