Changeset 90 for trunk/orca/qt
- Timestamp:
- 03/14/06 20:39:22 (3 years ago)
- Location:
- trunk/orca/qt
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/orca/qt/qorca.cpp
r86 r90 31 31 #include "cbparse.h" 32 32 33 #ifdef DIR_WATCHER34 #include <DirWatcher.h>35 #endif36 37 33 38 34 struct LayoutInfo … … 107 103 108 104 109 int WIDPool::add( Q Widget* ptr, int type )105 int WIDPool::add( QObject* ptr, int type ) 110 106 { 111 107 int index; … … 118 114 119 115 rec.type = type; 120 rec. widget = ptr;116 rec.object = ptr; 121 117 122 118 --_freeCount; … … 127 123 REC rec; 128 124 rec.type = type; 129 rec. widget = ptr;125 rec.object = ptr; 130 126 _records.push_back( rec ); 131 127 } … … 142 138 rec.type = _freeIndex; 143 139 _freeIndex = id; 144 rec. widget = 0;140 rec.object = 0; 145 141 146 142 ++_freeCount; … … 153 149 { 154 150 REC* rec = &_records[ id ]; 155 if( rec-> widget )151 if( rec->object ) 156 152 return rec; 157 153 } … … 849 845 if( rec ) 850 846 { 851 delete rec-> widget;847 delete rec->object; 852 848 } 853 849 orResultNONE; … … 913 909 WIDPool::REC* rec = qEnv.pool.record( a1->integer ); 914 910 if( rec ) 915 rec->widget->setEnabled( true ); 911 { 912 QWidget* widget = qobject_cast<QWidget*>( rec->object ); 913 if( widget ) 914 widget->setEnabled( true ); 915 } 916 916 } 917 917 … … 921 921 WIDPool::REC* rec = qEnv.pool.record( a1->integer ); 922 922 if( rec ) 923 rec->widget->setEnabled( false ); 923 { 924 QWidget* widget = qobject_cast<QWidget*>( rec->object ); 925 if( widget ) 926 widget->setEnabled( false ); 927 } 924 928 } 925 929 … … 1133 1137 QMessageBox::information( 0, cp1, cp2 ); 1134 1138 } 1135 1136 1137 //----------------------------------------------------------------------------1138 1139 1140 #ifndef DIR_WATCHER1141 void QOrcaApp::fileChanged( DirWatcher* ) {}1142 #endif1143 1139 1144 1140 … … 1169 1165 "set-widget-value: native [wid [integer!] val]\n" 1170 1166 "append-text: native [wid [integer!] val]\n" 1171 "watch-dir: native [dir [string! file!] handler [block!]]\n"1172 1167 "message: native [title [string!] msg [string!] /warn]\n" 1173 1168 "layout-rules: [\n" … … 1239 1234 orNative( (void*) appendTextNative, "append-text" ); 1240 1235 orNative( (void*) messageNative, "message" ); 1241 #ifdef DIR_WATCHER1242 extern void watchDirNative( OValue* );1243 extern void spawnNative( OValue* );1244 orNative( (void*) watchDirNative, "watch-dir" );1245 orNative( (void*) spawnNative, "spawn" );1246 #endif1247 1236 1248 1237 { … … 1289 1278 delete (*it).widget; 1290 1279 } 1291 #ifdef DIR_WATCHER1292 else if( (*it).type == WT_Watcher )1293 {1294 delete ((DirWatcher*) (*it).widget);1295 }1296 #endif1297 1280 1298 1281 // Assuming all other widgets are deleted from WT_Dialog & -
trunk/orca/qt/qorca.h
r42 r90 61 61 { 62 62 int type; 63 QWidget* widget; 63 union 64 { 65 QObject* object; 66 QWidget* widget; 67 }; 64 68 }; 65 69 66 70 WIDPool() : _freeCount(0), _freeIndex(-1) {} 67 71 68 int add( Q Widget*, int type );72 int add( QObject*, int type ); 69 73 void remove( int id ); 70 74 REC* record( int id ); … … 106 110 107 111 108 class DirWatcher;109 110 112 class QOrcaApp : public QApplication 111 113 { … … 115 117 116 118 QOrcaApp( int argc, char** argv ); 117 118 protected slots:119 120 void fileChanged( DirWatcher* );121 119 }; 122 120
