X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FvtkKWBlackBoxDialog.cxx;h=ccc9fe47be023563036559af174986917fd1a31d;hb=ce4491d66577c9daf930cb8744e738e4b7220fe7;hp=d7ca41b2046b55d5ccc524b1610f901bd1790525;hpb=310a70fea52f768e60d0a844e6ef84f13e4babd4;p=bbtk.git diff --git a/kernel/src/vtkKWBlackBoxDialog.cxx b/kernel/src/vtkKWBlackBoxDialog.cxx index d7ca41b..ccc9fe4 100644 --- a/kernel/src/vtkKWBlackBoxDialog.cxx +++ b/kernel/src/vtkKWBlackBoxDialog.cxx @@ -1,3 +1,30 @@ +/* + # --------------------------------------------------------------------- + # + # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image + # pour la SantÈ) + # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton + # Previous Authors : Laurent Guigues, Jean-Pierre Roux + # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil + # + # This software is governed by the CeCILL-B license under French law and + # abiding by the rules of distribution of free software. You can use, + # modify and/ or redistribute the software under the terms of the CeCILL-B + # license as circulated by CEA, CNRS and INRIA at the following URL + # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html + # or in the file LICENSE.txt. + # + # As a counterpart to the access to the source code and rights to copy, + # modify and redistribute granted by the license, users are provided only + # with a limited warranty and the software's author, the holder of the + # economic rights, and the successive licensors have only limited + # liability. + # + # The fact that you are presently reading this means that you have had + # knowledge of the CeCILL-B license and that you accept its terms. + # ------------------------------------------------------------------------ */ + + #ifdef USE_KWWIDGETS #include "vtkKWBlackBoxDialog.h" @@ -70,20 +97,85 @@ //------------------------------------------------------------------------- vtkStandardNewMacro( vtkKWBlackBoxDialog ); - vtkCxxRevisionMacro( vtkKWBlackBoxDialog, "$Revision: 1.1 $"); + vtkCxxRevisionMacro( vtkKWBlackBoxDialog, "$Revision: 1.4 $"); //------------------------------------------------------------------------- //========================================================================= - vtkKWBlackBoxDialog::vtkKWBlackBoxDialog() - : mShown(false) +vtkKWBlackBoxDialog::vtkKWBlackBoxDialog() + : mShown(false) +{ + bbtkDebugMessage("kw",9,"vtkKWBlackBoxDialog::vtkKWBlackBoxDialog()" + <mFrame = vtkKWFrame::New(); +} +//========================================================================= + //========================================================================= + vtkKWBlackBoxDialog::~vtkKWBlackBoxDialog() { - bbtkDebugMessage("kw",9,"vtkKWBlackBoxDialog::vtkKWBlackBoxDialog()" - <mFrame->Delete(); + bbHide(); + bbtk::KW::DecNbWindowsAlive(); + if (!mBox.expired()) + { + mBox.lock()->bbSetWindow(0); + } } //========================================================================= + +//========================================================================= +void vtkKWBlackBoxDialog::CreateWidget() +{ + bbtkDebugMessage("kw",5,"vtkKWBlackBoxDialog::CreateWidget() [" + <bbGetFullName()<<"]"<IsCreated()) + { + vtkErrorMacro("vtkKWBlackBoxDialog already created"); + return; + } + + this->Superclass::CreateWidget(); + this->SetTitle((bbGetBlackBox()->bbGetInputWinTitle()+" - bbtk (c) CREATIS").c_str()); + + this->mFrame->SetParent(this); + this->mFrame->Create(); + this->mFrame->SetWidth ( bbGetBlackBox()->bbGetInputWinWidth() ); + this->mFrame->SetHeight ( bbGetBlackBox()->bbGetInputWinHeight() ); + + this->Script("pack %s -side top -expand true", + this->mFrame->GetWidgetName()); +} +//========================================================================= + +/* +//========================================================================= +void vtkKWBlackBoxDialog::Pack() +{ + this->Script("pack %s -side top -expand true", + this->mFrame->GetWidgetName()); +} +//========================================================================= +*/ + //========================================================================= + void vtkKWBlackBoxDialog::Cancel() + { + bbtkDebugMessage("kw",9,"vtkKWBlackBoxDialog::Cancel()"<Delete(); + + // this->Withdraw(); + bbHide(); + this->Done = vtkKWDialog::StatusCanceled; + // std::cout << "REFS= "<GetReferenceCount()<Delete(); - - // this->Withdraw(); - bbHide(); - this->Done = vtkKWDialog::StatusCanceled; - // std::cout << "REFS= "<GetReferenceCount()<bbSetWindow(0); - } - } - //========================================================================= /* @@ -159,7 +223,7 @@ //------------------------------------------------------------------------- vtkStandardNewMacro( vtkKWBlackBoxFrame ); - vtkCxxRevisionMacro(vtkKWBlackBoxFrame, "$Revision: 1.1 $"); + vtkCxxRevisionMacro(vtkKWBlackBoxFrame, "$Revision: 1.4 $"); //------------------------------------------------------------------------- //========================================================================= vtkKWBlackBoxFrame::vtkKWBlackBoxFrame()