Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

/Go4GUI/TGo4ParaEdit.ui.h

Go to the documentation of this file.
00001 //---------------------------------------------------------------
00002 //        Go4 Release Package v2.10-5 (build 21005) 
00003 //                      03-Nov-2005
00004 //---------------------------------------------------------------
00005 //       The GSI Online Offline Object Oriented (Go4) Project
00006 //       Experiment Data Processing at DVEE department, GSI
00007 //---------------------------------------------------------------
00008 //
00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI
00010 //                    Planckstr. 1, 64291 Darmstadt, Germany
00011 //Contact:            http://go4.gsi.de
00012 //----------------------------------------------------------------
00013 //This software can be used under the license agreements as stated
00014 //in Go4License.txt file which is part of the distribution.
00015 //----------------------------------------------------------------
00016 /****************************************************************************
00017 ** ui.h extension file, included from the uic-generated form implementation.
00018 **
00019 ** If you wish to add, delete or rename slots use Qt Designer which will
00020 ** update this file, preserving your code. Create an init() slot in place of
00021 ** a constructor, and a destroy() slot in place of a destructor.
00022 *****************************************************************************/
00023 
00024 #include <iostream.h>
00025 
00026 void TGo4ParaEdit::init()
00027 {
00028     TGo4LockGuard glob;
00029     fxTGo4GUIRegistry = TGo4GUIRegistry::Instance();
00030     char SlotName[256];
00031     char Caption[256];
00032     snprintf(SlotName,255,"%s%s",name(),"_Slots" );
00033     snprintf(Caption,255,"%s%s","Edit Parameter: " , name());
00034     setCaption( trUtf8( Caption ) );
00035     PleaseUpdateLabel->setShown(false);
00037 
00038 fxFileMenu =0;
00039     fxControlMenu=0;
00040     fxMenuBar=0;
00041 //    fxFileMenu = new QPopupMenu( this );
00042 //    fiLoadID=fxFileMenu->insertItem("&Load Parameter...",  this, SLOT(openFile()), CTRL+Key_L );
00043 //    fiSaveID=fxFileMenu->insertItem("&Save Parameter...", this, SLOT(saveFile()), CTRL+Key_S );
00044 //    fxFileMenu->insertItem("&Cancel", this, SLOT(close()), CTRL+Key_C );
00045 //
00046 //    fxControlMenu = new QPopupMenu( this );
00047 //    fxControlMenu->insertItem("&Apply",  this, SLOT(ApplyClicked()), CTRL+Key_A );
00048 //    fiRefreshID=fxControlMenu->insertItem("&Refresh", this, SLOT(RefreshClicked()), CTRL+Key_R );
00049 //    fxControlMenu->insertItem("C&lear",  this, SLOT(clearTextFields()), CTRL+Key_L );
00050 //    fiNewID=fxControlMenu->insertItem("&New Parameter...", this, SLOT(NewEntry()), CTRL+Key_N);
00051 //
00052 //    fxMenuBar = new QMenuBar( this );
00053 //    fxMenuBar->insertItem( "&File", fxFileMenu );
00054 //    fxMenuBar->insertItem( "&Controls", fxControlMenu );
00055 //    adjustSize();
00056 //
00057     MenuDummy->setShown(false);
00058 //    fxStatusBar=new QStatusBar(StatusFrame);
00059 //    fxStatusBar->setSizeGripEnabled(false);
00060 //    StatusFrame->adjustSize();
00061     adjustSize();
00062 
00063     fxTGo4ParaEditSlots = (TGo4ParaEditSlots *) fxTGo4GUIRegistry->GetSlotClass(SlotName);
00064     if(fxTGo4ParaEditSlots  !=0) {
00065       fxTGo4ParaEditSlots->SetGUI(this);
00066     }else{
00067       fxTGo4ParaEditSlots = new TGo4ParaEditSlots (SlotName, "Slots Class for Qt GUI", this);
00068     }
00069    fxTGo4ParaEditStatus= dynamic_cast <TGo4ParaEditStatus *> (fxTGo4ParaEditSlots->GetStatus());
00070 }
00071 
00072 void TGo4ParaEdit::destroy()
00073 {
00074     TGo4LockGuard glob;
00075     fxTGo4GUIRegistry->UnRegisterClass(fxTGo4ParaEditSlots,fxTGo4ParaEditStatus);
00076     delete  fxTGo4ParaEditSlots;
00077 }
00078 
00079 void TGo4ParaEdit::closeEvent( QCloseEvent *ce )
00080 {
00081     TGo4LockGuard glob;
00082     ce->accept();
00083     fxTGo4ParaEditSlots->SetGUI(0);
00084     delete this;
00085 }
00086 
00087 void TGo4ParaEdit::clearTextFields()
00088 {
00089 TGo4LockGuard glob;
00090 int numrows=MemberTable->numRows();
00091 for(int row=0; row<numrows;++row)
00092     {
00093         MemberTable->setText(row,fiColValue,"");
00094         fxTGo4ParaEditStatus->SetParaMemVal(row,"");
00095     }
00096 if(fbEditorMode) ParameterName->clear();
00097 StatusMessage("Cleared.");
00098 PleaseUpdateLabel->setShown(true);
00099 }
00100 
00101 
00102 
00103 
00104 
00105 void TGo4ParaEdit::RefreshDisplay( TGo4ParaEditStatus * state )
00106 {
00107 // show the current settings in the status object state on display
00108 if(state==0) state=fxTGo4ParaEditStatus; // use internal state
00109 if(state==0)  return;
00110 TGo4LockGuard glob;
00111 // update names and table contents from status:
00112 ParameterName->setText(state->GetParaName());
00113 // prepare table dimension and set cells
00114 MemberTable->hide();
00115 int memnum=state->GetMemNumber();
00116 QHeader* header=MemberTable->horizontalHeader();
00117 header->setLabel(fiColType,"Type");
00118 header->setLabel(fiColName,"Name");
00119 header->setLabel(fiColValue,"Value");
00120 header->setLabel(fiColComment,"Comments");
00121 MemberTable->setNumRows(memnum);
00122 MemberTable->setColumnReadOnly(fiColType,true);
00123 MemberTable->setColumnReadOnly(fiColName,true);
00124 MemberTable->setColumnReadOnly(fiColComment,true);
00125 MemberTable->setLeftMargin(0);
00126 MemberTable->verticalHeader()->hide();
00127 for(int row=0; row<memnum;++row)
00128 {
00129     const char* type    = state->GetParaMemType(row);
00130     const char* name    = state->GetParaMember(row);
00131     const char* value   = state->GetParaMemVal(row);
00132     const char* comment = state->GetParaMemComment(row);
00133     MemberTable->setText(row,fiColType,    type);
00134     MemberTable->setText(row,fiColName,    name);
00135     MemberTable->setText(row,fiColValue,   value);
00136     MemberTable->setText(row,fiColComment, comment);
00137     if(strstr(value,"Unknown") || strstr(value,"Edit"))
00138         {
00139              // case of unknown type or type that has own editor:
00140              QTableItem* item=MemberTable->item(row,fiColValue);
00141              if(item) item->setEnabled(false);
00142         }
00143     if(!state->IsParaMemVisible(row))
00144         MemberTable->hideRow(row);
00145     else
00146         MemberTable->showRow(row);
00147 }
00148 MemberTable->show();
00149 PleaseUpdateLabel->setShown(false);
00150 polish();
00151 update();
00152 show();
00153 //showNormal();
00154 //adjustSize();
00155 raise();
00156 }
00157 
00158 
00159 
00160 
00161 
00162 void TGo4ParaEdit::ChangeParaName(const QString & s )
00163 {
00164     // note that we use implicit conversion of QString to const char*
00165     fxTGo4ParaEditStatus->SetParaName(s);
00166     PleaseUpdateLabel->setShown(true);
00167 }
00168 
00169 void TGo4ParaEdit::ChangeClassName(const QString & s )
00170 {
00171     fxTGo4ParaEditStatus->SetParaClass(s);
00172     RefreshDisplay(fxTGo4ParaEditStatus);
00173     PleaseUpdateLabel->setShown(true);
00174 }
00175 
00176 
00177 void TGo4ParaEdit::RefreshClicked()
00178 {
00179     fxTGo4ParaEditSlots->SendRefreshCommand();
00180     StatusMessage("Refreshed parameter from analysis.");
00181 }
00182 
00183 void TGo4ParaEdit::ApplyClicked()
00184 {
00185     fxTGo4ParaEditSlots->SendApplyCommand();
00186     StatusMessage("Applied parameter to analysis.");
00187     PleaseUpdateLabel->setShown(false);
00188 }
00189 
00190 
00191 
00192 void TGo4ParaEdit::NewEntry()
00193 {
00194     TGo4LockGuard Global;
00195     const Text_t* name="New Parameter";
00196     Text_t slotname[256];
00197     snprintf(slotname,256,"%s_Slots",name);
00198    TGo4ParaEdit* neditor=0;
00199     TGo4ParaEditSlots* nslots=0;
00200     nslots = dynamic_cast <TGo4ParaEditSlots *> (fxTGo4GUIRegistry->GetSlotClass(slotname));
00201    if (nslots ==0)
00202         {
00203       //cout <<"########## slot not found, creating new" << endl;
00204         neditor=new TGo4ParaEdit(fxTGo4GUIRegistry->GetCentralWindow(),
00205                                            name);
00206         }
00207     else
00208         {
00209         //cout <<"########## slot found "<< (int*) nslots << endl;
00210         neditor  = dynamic_cast <TGo4ParaEdit *> (fxTGo4GUIRegistry->GetGUIClass(nslots));
00211         if (neditor==0)
00212             {
00213                 //cout <<"########## gui not found, new "<< endl;
00214                 neditor=new TGo4ParaEdit(fxTGo4GUIRegistry->GetCentralWindow(),
00215                                            name);
00216             }
00217         else {} //if (neditor ==0)
00218          } //if (nslots ==0)
00219 
00220     neditor->SetNewParaMode(true);
00221     neditor->RefreshDisplay(0);
00222     neditor->polish();
00223     neditor->update();
00224     neditor->show();
00225 //    neditor->showNormal();
00226 //    neditor->adjustSize();
00227     neditor->raise();
00228 }
00229 
00230 void TGo4ParaEdit::ChangedTable( int row, int col )
00231 {
00232 TGo4LockGuard glob;
00233     QString txt= MemberTable->text( row, col );
00234     //cout <<"Got table text:" <<txt<< "for index "<<row<<" ,"<<col<<endl;
00235     switch(col)
00236     {
00237         case fiColValue:
00238             fxTGo4ParaEditStatus->SetParaMemVal(row,txt);
00239             break;
00240         case fiColType:
00241             // we do not allow to change type
00242             break;
00243         case fiColName:
00244             // we do not allow to change name of member
00245             break;
00246         default:
00247             // never come here
00248             cout <<"Change table received out of range column "<<col << endl;
00249             break;
00250     }
00251 PleaseUpdateLabel->setShown(true);
00252 }
00253 
00254 void TGo4ParaEdit::SetNewParaMode( bool on )
00255 {
00256 TGo4LockGuard glob;
00257 fbEditorMode=on;
00258 if(on)
00259     {
00260         // editor to create a new parameter
00261         ParameterClass->setEnabled(true);
00262         ParameterName->setEnabled(true);
00263         RefreshButton->setEnabled(false);
00264         NewButton->setEnabled(false);
00265         ApplyButton->setText("Apply");
00266 //        fxControlMenu->setItemEnabled(fiRefreshID,false);
00267 //        fxControlMenu->setItemEnabled(fiNewID,false);
00268 //        const QColor editorcolor(192,227,255); // rgb values
00269 //        setPaletteBackgroundColor(editorcolor);
00270         // setup class information from dictionary:
00271         fxTGo4ParaEditStatus->ResetParameterList();
00272         ParameterClass->clear();
00273         //ParameterClass->insertItem(fxTGo4ParaEditStatus->GetParaClass(),0);
00274         char* clname=0;
00275         int ix=0;
00276         int currentix=0;
00277         while((clname=const_cast<char*>(fxTGo4ParaEditStatus->NextParameterClass()))!=0)
00278         {
00279           //cout <<"inserted item "<<clname << endl;
00280           ParameterClass->insertItem(clname);
00281           if(!strcmp(clname,fxTGo4ParaEditStatus->GetParaClass()))
00282                         currentix=ix;
00283           ++ix;
00284         }
00285         ParameterClass->setCurrentItem(currentix);
00286     }
00287  else
00288     {
00289       // editor to change values of existing parameter
00290         ParameterClass->setEnabled(false);
00291         ParameterName->setEnabled(false);
00292         RefreshButton->setEnabled(true);
00293         NewButton->setEnabled(true);
00294         ApplyButton->setText("Apply");
00295 //        fxControlMenu->setItemEnabled(fiRefreshID,true);
00296 //        fxControlMenu->setItemEnabled(fiNewID,true);
00297         // only show currently existing class:
00298         ParameterClass->clear();
00299         ParameterClass->insertItem(fxTGo4ParaEditStatus->GetParaClass(),0);
00300 //        unsetPalette();
00301     }
00302 }
00303 
00304 void TGo4ParaEdit::TableDoubleClick( int row, int col )
00305 {
00306     //cout <<"Table double click" << endl;
00307     if(col!=fiColName) return;
00308     fiCurrentRow=row;
00309     if(IsArray(row))
00310         ExpandArray();
00311     else if(IsFitter(row))
00312         EditFitter();
00313     else ;
00314 }
00315 
00316 void TGo4ParaEdit::ContextMenu( int row, int col )
00317 {
00318     if(col!=fiColName) return;
00319     //cout <<"Context menu requested for "<<row<<" "<<col << endl;
00320     if(IsArray(row))
00321         {
00322             // menu for array members:
00323             TGo4LockGuard glob;
00324             fiCurrentRow=row;
00325             QPopupMenu* contextMenu = new QPopupMenu( this );
00326             Q_CHECK_PTR( contextMenu );
00327             QLabel *caption = new QLabel( "<font color=darkblue><u><b>"
00328                 "Array View</b></u></font>", this );
00329             caption->setAlignment( Qt::AlignCenter );
00330         //    QLineEdit* indices=new QLineEdit("0,0",0,0);
00331             contextMenu->insertItem( caption );
00332             contextMenu->insertItem( "+ \t(next index)",  this, SLOT(IncArrayIndex()));
00333             contextMenu->insertItem( "-- \t(prev index)", this, SLOT(DecArrayIndex()));
00334             contextMenu->insertItem( "Expand/Shrink", this, SLOT(ExpandArray() ));
00335 
00336         //    int indicesID=contextMenu->insertItem( indices );
00337         //     contextMenu->connectItem( indicesID, this, SLOT(showindices(Qstring& s)) );
00338             if(IsFitter(row))
00339                 {
00340                 // this case for array of fitter objects:
00341                 contextMenu->insertItem( "Edit...",  this, SLOT(EditFitter()));
00342                 contextMenu->insertItem( "Update from FitGUI workspace", this, SLOT(UpdateFitter()));
00343                 }
00344             contextMenu->exec( QCursor::pos() );
00345         //    char buffer [256];
00346         //    snprintf(buffer,256,"%s",indices->text().ascii());
00347             delete contextMenu;
00348         //    cout <<"Got text"<< buffer << endl;
00349 
00350         }
00351     else if(IsFitter(row))
00352         {
00353          // menu for fitters:
00354          TGo4LockGuard glob;
00355         fiCurrentRow=row;
00356         QPopupMenu* contextMenu = new QPopupMenu( this );
00357         Q_CHECK_PTR( contextMenu );
00358         QLabel *caption = new QLabel( "<font color=darkblue><u><b>"
00359             "Modify Fitter</b></u></font>", this );
00360         caption->setAlignment( Qt::AlignCenter );
00361         contextMenu->insertItem( caption );
00362         contextMenu->insertItem( "Edit...",  this, SLOT(EditFitter()));
00363         contextMenu->insertItem( "Update from FitGUI workspace", this, SLOT(UpdateFitter()));
00364         contextMenu->exec( QCursor::pos() );
00365         delete contextMenu;
00366         }
00367     else
00368         {
00369 
00370         }
00371 }
00372 
00373 void TGo4ParaEdit::IncArrayIndex()
00374 {
00375     //cout <<"Increment array index at row  "<<fiCurrentRow<< endl;
00376     TGo4LockGuard glob;
00377     int xoldindex=fxTGo4ParaEditStatus->GetParaMemArrIndex(fiCurrentRow);
00378     int yoldindex=fxTGo4ParaEditStatus->GetParaMemArrIndey(fiCurrentRow);
00379     int newrow=fiCurrentRow+1;
00380     if(fxTGo4ParaEditStatus->IsParaMemVisible(newrow)) return;
00381         // if newrow is already visible, array is expandend, do nothing
00382     int xnewindex=fxTGo4ParaEditStatus->GetParaMemArrIndex(newrow);
00383     int ynewindex=fxTGo4ParaEditStatus->GetParaMemArrIndey(newrow);
00384     // for 1d array, the yindices will be both-1
00385     if(xnewindex>xoldindex || ynewindex>yoldindex)
00386         {
00387          // check if the next row still keeps member of array
00388             MemberTable->hideRow(fiCurrentRow);
00389             fxTGo4ParaEditStatus->SetParaMemVisible(fiCurrentRow,false);
00390             MemberTable->showRow(newrow);
00391             fxTGo4ParaEditStatus->SetParaMemVisible(newrow,true);
00392             MemberTable->adjustColumn(fiColName);
00393             MemberTable->setCurrentCell(newrow,fiColValue);
00394         }
00395     else
00396         {
00397          // next row has smaller index: belongs to other aggregate, nop
00398         }
00399 }
00400 
00401 void TGo4ParaEdit::DecArrayIndex()
00402 {
00403     //cout <<"Decrement array index at row  "<<fiCurrentRow << endl;
00404     TGo4LockGuard glob;
00405     int xoldindex=fxTGo4ParaEditStatus->GetParaMemArrIndex(fiCurrentRow);
00406     int yoldindex=fxTGo4ParaEditStatus->GetParaMemArrIndey(fiCurrentRow);
00407     if(xoldindex<1 && yoldindex<1) return; // do not dec below lowest
00408     int newrow=fiCurrentRow-1;
00409     if(fxTGo4ParaEditStatus->IsParaMemVisible(newrow)) return;
00410         // if newrow is already visible, array is expandend, do nothing
00411     MemberTable->hideRow(fiCurrentRow);
00412     fxTGo4ParaEditStatus->SetParaMemVisible(fiCurrentRow,false);
00413     MemberTable->showRow(newrow);
00414     fxTGo4ParaEditStatus->SetParaMemVisible(newrow,true);
00415     MemberTable->adjustColumn(fiColName);
00416     MemberTable->setCurrentCell(newrow,fiColValue);
00417 }
00418 
00419 
00420 void TGo4ParaEdit::ExpandArray()
00421 {
00422    //cout <<"Expand array at row  "<<fiCurrentRow<< endl;
00423   // unfold or shrink array view:
00424     // search for name of the array without index
00425     TGo4LockGuard glob;
00426     int row=fiCurrentRow;
00427     const char* arfullname=fxTGo4ParaEditStatus->GetParaMember(row);
00428     char arname[256];
00429     char* arend=strstr(arfullname,"[");
00430     int arlen=arend-arfullname;
00431     snprintf(arname,arlen+1,"%s",arfullname);
00432     //cout <<"found arrayname "<<arname << endl;
00433     int memnum=fxTGo4ParaEditStatus->GetMemNumber();
00434     MemberTable->hide();
00435     for(int r=0; r<memnum;++r)
00436         {
00437             const char* memname=fxTGo4ParaEditStatus->GetParaMember(r);
00438             if(strstr(memname,arname))
00439                 {
00440                      if(fxTGo4ParaEditStatus->IsParaMemVisible(r))
00441                      {
00442                         MemberTable->hideRow(r);
00443                         fxTGo4ParaEditStatus->SetParaMemVisible(r,false);
00444                      }
00445                      else
00446                      {
00447                          MemberTable->showRow(r);
00448                          fxTGo4ParaEditStatus->SetParaMemVisible(r,true);
00449                      }
00450                 } // if(strstr)
00451         }// for
00452     // finally, show the current row in any case:
00453     MemberTable->showRow(row);
00454     fxTGo4ParaEditStatus->SetParaMemVisible(row,true);
00455     MemberTable->adjustColumn(fiColName);
00456     MemberTable->setCurrentCell(row,fiColValue);
00457     MemberTable->show();
00458     polish();
00459     update();
00460     //adjustSize();
00461     raise();
00462     show();
00463 
00464 }
00465 
00466 
00467 bool TGo4ParaEdit::IsArray(int row)
00468 {
00469     // check if displayed member at table row is of array/aggregate type
00470     int arrindex=fxTGo4ParaEditStatus->GetParaMemArrIndex(row);
00471     if(arrindex<0)
00472         return false; // do not act if entry is not an array
00473     else
00474         return true;
00475 }
00476 
00477 
00478 bool TGo4ParaEdit::IsFitter(int row)
00479 {
00480    const char* type=fxTGo4ParaEditStatus->GetParaMemType(row);
00481    if(type && !strcmp(type,"TGo4Fitter*"))
00482        return true;
00483    else
00484        return false;
00485 }
00486 
00487 
00488 
00489 
00490 void TGo4ParaEdit::openFile()
00491 {
00492 TGo4LockGuard glob;
00493 TGo4DiskFileBrowserSlots *filebrowserslots = dynamic_cast <TGo4DiskFileBrowserSlots *> (fxTGo4GUIRegistry->GetSlotClass("TGo4DiskFileBrowserSlots"));
00494 TObject* ob=0;
00495 const Text_t* filename;
00496 if(filebrowserslots)
00497     filename=filebrowserslots->LoadObject(&ob,ParameterName->text().stripWhiteSpace());
00498 else
00499     filename=0;
00500 fxTGo4ParaEditSlots->AddObject(dynamic_cast<TNamed*>(ob));
00501 //SetNewParaMode(false);
00502 RefreshDisplay(0);
00503 char buf[256];
00504 if(filename)
00505     snprintf(buf,256,"Loaded %s from %s",ParameterName->text().ascii(), filename);
00506 else
00507     snprintf(buf,256,"Failed to load %s",ParameterName->text().ascii());
00508 StatusMessage(buf);
00509 delete ob; // ob is clone of original file object. AddObject clones again, so we cleanup this one.
00510 }
00511 
00512 void TGo4ParaEdit::saveFile()
00513 {
00514 TGo4LockGuard glob;
00515 TGo4DiskFileBrowserSlots *filebrowserslots = dynamic_cast <TGo4DiskFileBrowserSlots *> (fxTGo4GUIRegistry->GetSlotClass("TGo4DiskFileBrowserSlots"));
00516 const Text_t* filename;
00517 if(filebrowserslots)
00518     filename=filebrowserslots->SaveObject(fxTGo4ParaEditStatus->GetParameter(),
00519                                     ParameterName->text().stripWhiteSpace().data());
00520 else
00521     filename=0;
00522 RefreshDisplay(0);
00523 char buf[256];
00524 if(filename)
00525     snprintf(buf,256,"Saved %s to file %s",ParameterName->text().stripWhiteSpace().data(), filename);
00526 else
00527     snprintf(buf,256,"Failed to save %s",ParameterName->text().stripWhiteSpace().data());
00528 StatusMessage(buf);
00529 }
00530 
00531 
00532 void TGo4ParaEdit::StatusMessage( const char * txt )
00533 {
00534 //TGo4LockGuard glob;
00535 //char buf[256];
00536 //snprintf(buf,256,"%s:%s",
00537 //QTime::currentTime().toString().ascii(),txt);
00538 //Statusline->setText(buf);
00539 QString text="Parameter Editor ";
00540 text.append(name());
00541 text.append(" :");
00542 text.append(txt);
00543 //fxStatusBar->message(text);
00544 TGo4MainWindow *MW= dynamic_cast<TGo4MainWindow *>(fxTGo4GUIRegistry->GetMainWindow());
00545 if(MW) MW->StatusMessage(text);
00546 }
00547 
00548 
00549 
00550 
00551 void TGo4ParaEdit::EditFitter()
00552 {
00553   TGo4LockGuard glob;
00554     int row=fiCurrentRow;
00555     long address=fxTGo4ParaEditStatus->GetMemberAddress(row);
00556     fxTGo4ParaEditStatus->SetFitPointerAddress(address);
00557     TGo4Fitter* fitter= fxTGo4ParaEditStatus->GetLastFitter();
00558     if(fitter)
00559         {
00560          TGo4MainWindow* mainwin=dynamic_cast <TGo4MainWindow *> (fxTGo4GUIRegistry->GetMainWindow());
00561             TGo4FitPanel*FitPanel=mainwin->FitPanelSlot();
00562             FitPanel->raise();
00563          FitPanel->show();
00564          FitPanel->ActivateByFitter(fitter); // this will clone fitter!
00565             char mess[256];
00566             snprintf(mess,256,"Started editing fitter %s (%s)",
00567                     fxTGo4ParaEditStatus->GetParaMember(row),
00568                     fitter->GetName());
00569             StatusMessage(mess);
00570         }
00571 }
00572 
00573 
00574 void TGo4ParaEdit::UpdateFitter()
00575 {
00576 
00577   TGo4LockGuard glob;
00578     int row=fiCurrentRow;
00579     long address=fxTGo4ParaEditStatus->GetMemberAddress(row);
00580     fxTGo4ParaEditStatus->SetFitPointerAddress(address);
00581         // this slot is invoked by context menu;
00582         // we alwas refer to currently selected member
00583     TGo4Fitter* fitter=0;
00584     TGo4FitPanelSlots* fitpanelslots=dynamic_cast <TGo4FitPanelSlots *> (fxTGo4GUIRegistry->GetSlotClass("TGo4FitPanelSlots"));
00585     if(fitpanelslots)
00586         fitter=fitpanelslots->GetFitter();
00587     if(fitter)
00588     {
00589         fxTGo4ParaEditStatus->UpdateLastFitter(fitter);
00590         char mess[256];
00591         snprintf(mess,256,"Member %s updated from fitter %s",
00592                 fxTGo4ParaEditStatus->GetParaMember(row),
00593                 fitter->GetName());
00594         StatusMessage(mess);
00595         PleaseUpdateLabel->setShown(true);
00596     }
00597 }
00598 
00599 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Tue Nov 8 10:56:01 2005 for Go4-v2.10-5 by doxygen1.2.15