Browse Source

kcApp.h/cpp Further time line ctl integration

master
kevin 12 years ago
parent
commit
7a322b8b4c
2 changed files with 25 additions and 15 deletions
  1. 20
    10
      src/kc/kcApp.cpp
  2. 5
    5
      src/kc/kcApp.h

+ 20
- 10
src/kc/kcApp.cpp View File

77
     _adlH(cmAdlNullHandle),_aiH(cmAiNullHandle),
77
     _adlH(cmAdlNullHandle),_aiH(cmAiNullHandle),
78
     _statIdx(0),_pageList(NULL),_ctlList(NULL),_prH(cmPrNullHandle),_prefsFn(NULL),
78
     _statIdx(0),_pageList(NULL),_ctlList(NULL),_prH(cmPrNullHandle),_prefsFn(NULL),
79
     _stopTimerFl(false),_jsH(cmJsonNullHandle),_newPageFl(true),_incrColW(0),_colW(0),_horzBordFl(false),_horzBord(0),
79
     _stopTimerFl(false),_jsH(cmJsonNullHandle),_newPageFl(true),_incrColW(0),_colW(0),_horzBordFl(false),_horzBord(0),
80
-    _closeCnt(0),_ssCnt(0),_ssArray(0),_ssPhase(0),_ssUpdateFl(false),_printqH(cmTsQueueNullHandle)
80
+    _closeCnt(0),_ssCnt(0),_ssArray(0),_ssPhase(0),_ssUpdateFl(false),_printqH(cmTsQueueNullHandle),
81
+    _tlCtl(NULL)
81
 {
82
 {
82
   // install a callback to cleanup when the app window closes
83
   // install a callback to cleanup when the app window closes
83
   // (the btn callbacks and _getApp() rely on a pointer to 'this' being found in kcApp.user_data())
84
   // (the btn callbacks and _getApp() rely on a pointer to 'this' being found in kcApp.user_data())
423
   if( mstrFl )
424
   if( mstrFl )
424
     mstr_grp->clear();
425
     mstr_grp->clear();
425
  
426
  
427
+  _tlCtl = NULL;
426
 }
428
 }
427
 
429
 
428
 
430
 
1222
 
1224
 
1223
   cp->u.tmln.tlctl = new tlCtl(&_ctx,this,NULL);
1225
   cp->u.tmln.tlctl = new tlCtl(&_ctx,this,NULL);
1224
 
1226
 
1227
+  // currently we only support one time-line control because
1228
+  // we have not yet implmenented a method of providing
1229
+  // timer callbacks to a list of UI controls
1230
+  assert( _tlCtl == NULL ); 
1231
+  _tlCtl = cp->u.tmln.tlctl;
1225
 
1232
 
1226
   Fl_Widget* wdgt = cp->u.tmln.tlctl->initTimeLineCtlr(_menu,x,y,w,h);
1233
   Fl_Widget* wdgt = cp->u.tmln.tlctl->initTimeLineCtlr(_menu,x,y,w,h);
1227
 
1234
 
1239
     {
1246
     {
1240
       switch(i)
1247
       switch(i)
1241
       {
1248
       {
1242
-        case kTmlnValArgIdx:
1249
+        case kTmlnSelArgIdx:
1243
           //tp->value( cmDsvStrcz(vp));
1250
           //tp->value( cmDsvStrcz(vp));
1244
           break;
1251
           break;
1245
 
1252
 
1246
-        case kTmlnLblArgIdx:
1247
-          {
1248
-            const char* lbl = cmDsvStrcz(vp);
1249
-          }
1250
-          break;
1251
 
1253
 
1252
         case kTmlnFileArgIdx:
1254
         case kTmlnFileArgIdx:
1253
           {
1255
           {
1907
     // to be diplayed in the console - all successive
1909
     // to be diplayed in the console - all successive
1908
     // times the return value from finalizePgm() is
1910
     // times the return value from finalizePgm() is
1909
     // ignored and the program is terminated.
1911
     // ignored and the program is terminated.
1912
+    /*
1910
     if( _closeCnt == 1 && cc==0)
1913
     if( _closeCnt == 1 && cc==0)
1911
     {
1914
     {
1912
       deactivate(); // send a strong hint that a problem occurred
1915
       deactivate(); // send a strong hint that a problem occurred
1913
       return;
1916
       return;
1914
     }
1917
     }
1915
-
1918
+    */
1916
 
1919
 
1917
     // When all windows are windows are closed then the app.
1920
     // When all windows are windows are closed then the app.
1918
     // will close - so hiding the application window
1921
     // will close - so hiding the application window
1949
     _checkPrintQueue();
1952
     _checkPrintQueue();
1950
 
1953
 
1951
   if( !_stopTimerFl )
1954
   if( !_stopTimerFl )
1955
+  {
1952
     _getEngMsg();
1956
     _getEngMsg();
1957
+    if( _tlCtl != NULL )
1958
+      _tlCtl->onIdle();
1959
+  }
1953
 
1960
 
1954
   if( _ssUpdateFl )
1961
   if( _ssUpdateFl )
1955
   {
1962
   {
2129
       break;
2136
       break;
2130
 
2137
 
2131
     case kTmlnTypeId:
2138
     case kTmlnTypeId:
2132
-      //instVarId = cp->u.text.varIdArray[ kTmlnValArgIdx ];
2133
-      //cmDsvSetStrz(&value,(cmChar_t*)cp->u.tmln.text->value());
2139
+      {
2140
+        instVarId = cp->u.text.varIdArray[ kTmlnSelArgIdx ];
2141
+        unsigned selMarkerId = cp->u.tmln.tlctl->timeLineSelectedMarkerId();
2142
+        cmDsvSetUInt(&value, selMarkerId );
2143
+      }
2134
       break;
2144
       break;
2135
 
2145
 
2136
     default:
2146
     default:

+ 5
- 5
src/kc/kcApp.h View File

137
     kMetrLblArgIdx = 3,
137
     kMetrLblArgIdx = 3,
138
     kMetrVarCnt    = 4,
138
     kMetrVarCnt    = 4,
139
 
139
 
140
-    kTmlnValArgIdx = 0,
141
-    kTmlnLblArgIdx = 1,
142
-    kTmlnFileArgIdx= 2,
143
-    kTmlnPathArgIdx= 3,
144
-    kTmlnVarCnt    = 4
140
+    kTmlnFileArgIdx= 0,
141
+    kTmlnPathArgIdx= 1,
142
+    kTmlnSelArgIdx = 2,
143
+    kTmlnVarCnt    = 3
145
 
144
 
146
   }; 
145
   }; 
147
 
146
 
303
   int             _ssPhase;
302
   int             _ssPhase;
304
   bool            _ssUpdateFl; 
303
   bool            _ssUpdateFl; 
305
   cmTsQueueH_t    _printqH; // thread-safe queue for controlling access to the output console from multiple threads
304
   cmTsQueueH_t    _printqH; // thread-safe queue for controlling access to the output console from multiple threads
305
+  tlCtl*          _tlCtl;
306
 
306
 
307
   void resize(int x, int y, int w, int h);
307
   void resize(int x, int y, int w, int h);
308
 
308
 

Loading…
Cancel
Save