Program: bbtk
Module: $RCSfile: bbtkMessageManager.cxx,v $
Language: C++
- Date: $Date: 2008/12/08 12:54:27 $
- Version: $Revision: 1.14 $
+ Date: $Date: 2009/05/19 10:19:23 $
+ Version: $Revision: 1.15 $
=========================================================================*/
/* ---------------------------------------------------------------------
mMessageLevel[key] = 0;
mMessageHelp[key] = "Data related messages";
if (mMaxMessageLength<key.length()) mMaxMessageLength = key.length();
- key = "wx";
+ key = "widget";
mMessageLevel[key] = 0;
mMessageHelp[key] = "Widgets related messages";
if (mMaxMessageLength<key.length()) mMaxMessageLength = key.length();
+ key = "wx";
+ mMessageLevel[key] = 0;
+ mMessageHelp[key] = "wxWidgets related messages";
+ if (mMaxMessageLength<key.length()) mMaxMessageLength = key.length();
+ key = "qt";
+ mMessageLevel[key] = 0;
+ mMessageHelp[key] = "Qt related messages";
+ if (mMaxMessageLength<key.length()) mMaxMessageLength = key.length();
key = "gui";
mMessageLevel[key] = 0;
mMessageHelp[key] = "Graphical user interface related messages";
Program: bbtk
Module: $RCSfile: bbtkPackage.h,v $
Language: C++
- Date: $Date: 2009/01/13 08:45:27 $
- Version: $Revision: 1.12 $
+ Date: $Date: 2009/05/19 10:19:23 $
+ Version: $Revision: 1.13 $
=========================================================================*/
/* ---------------------------------------------------------------------
const std::string& pkgname,
const std::string& path);
+ /// NOTE : All the static methods below for package destruction
+ /// are not member because they can cause the package death
+ /// and thus close the dynamic library from which it has been loaded.
+ /// If the dynamic lib which provides a function is closed while
+ /// in the function: imagine the crash !
+ /// The principal method is Release
+
/// UnLoads the package dynamic library
/// (if any and if the package is released)
/// If doit == false then does not do it but just
/// "Releases" the package
/// Signals the package that it can free its descriptors
- /// if they are no more used and frees and unloads the package
+ /// if they are no more used
+ /// then frees and unloads the package
/// if it is no more used (released)
/// Note : Any non-weak pointer on the package must have been freed
static void Release(Package::WeakPointer p);
exec();
// Show(false);
//SetReturnCode( wxDialog::ShowModal() );
- bbClose();
+ bbDestroy();
}
//=========================================================================
//=========================================================================
//=========================================================================
- void QtBlackBoxDialog::bbClose()
+ void QtBlackBoxDialog::bbDestroy()
{
- bbtkDebugMessage("qt",9,"QtBlackBoxDialog::bbClose()"<<std::endl);
+ bbtkDebugMessage("qt",9,"QtBlackBoxDialog::bbDestroy()"<<std::endl);
+ Parent::bbDestroy();
//wxDialog::Destroy();
+
}
//=========================================================================
~QtBlackBoxDialog();
void bbShow();
void bbHide();
- void bbClose();
+ void bbDestroy();
bool bbIsDialog() { return true; }
};
//=========================================================================
Program: bbtk
Module: $RCSfile: bbtkWidgetBlackBox.txx,v $
Language: C++
- Date: $Date: 2009/05/14 14:43:34 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2009/05/19 10:19:23 $
+ Version: $Revision: 1.4 $
=========================================================================*/
/* ---------------------------------------------------------------------
void WidgetBlackBox<T>::bbUserFinalizeProcessing()
{
bbtkDebugMessage("widget",9,"==> WidgetBlackBox::bbUserFinalizeProcessing() ["<<bbGetFullName()<<"]"<<std::endl);
- if (bbGetWindow()) {
- bbGetWindow()->bbClose();
- bbSetWindow(0);
- }
+ if (bbGetWindow())
+ {
+ if (GetUseCount()==0)
+ {
+ if (bbGetWindow()->bbIsShown()) DecNbWindowsShown();
+ DecNbWindowsAlive();
+ }
+ bbGetWindow()->bbDestroy();
+ bbSetWindow(0);
+ }
bbtkDebugMessage("widget",9,"<== WidgetBlackBox::bbUserFinalizeProcessing() ["<<bbGetFullName()<<"]"<<std::endl);
}
//=========================================================================
bbtkDebugMessageInc("widget",1,"=> WidgetBlackBox::bbCloseWindow() ["
<<bbGetFullName()<<"]"<<std::endl);
- if (bbGetWindow()!=0) bbGetWindow()->bbClose();
+ if (bbGetWindow()!=0) bbGetWindow()->bbDestroy();
bbtkDebugMessageDec("widget",2,"<= WidgetBlackBox::bbCloseWindow() ["
<<bbGetFullName()<<"]"<<std::endl);
Program: bbtk
Module: $RCSfile: bbtkWidgetBlackBoxWindow.h,v $
Language: C++
- Date: $Date: 2009/04/08 07:56:11 $
- Version: $Revision: 1.1 $
+ Date: $Date: 2009/05/19 10:19:23 $
+ Version: $Revision: 1.2 $
========================================================================*/
virtual ~WidgetBlackBoxWindow();
virtual void bbShow();
virtual void bbHide();
- virtual void bbClose();
+ virtual void bbDestroy();
bool bbIsShown() { return mShown; }
virtual WidgetBlackBoxPointer bbGetBlackBox() { return mBox.lock(); }
//virtual wxDialog* bbGetDialog() { return 0; }
Program: bbtk
Module: $RCSfile: bbtkWidgetBlackBoxWindow.txx,v $
Language: C++
- Date: $Date: 2009/04/08 07:56:11 $
- Version: $Revision: 1.1 $
+ Date: $Date: 2009/05/19 10:19:23 $
+ Version: $Revision: 1.2 $
=========================================================================*/
/* ---------------------------------------------------------------------
"WidgetBlackBoxWindow::~WidgetBlackBoxWindow() "
<<this<<std::endl);
bbHide();
- mBox.lock()->DecNbWindowsAlive();
if (!mBox.expired())
{
+ mBox.lock()->DecNbWindowsAlive();
mBox.lock()->bbSetWindow(0);
}
}
template <class W>
void WidgetBlackBoxWindow<W>::bbHide()
{
- if (!bbIsShown()) return;
+ if ((!bbIsShown())||(mBox.expired())) return;
bbtkDebugMessage("widget",9,"WidgetBlackBoxWindow::bbHide() ["
<<mBox.lock()->bbGetName()<<"]"<<std::endl);
mBox.lock()->DecNbWindowsShown();
//=========================================================================
template <class W>
- void WidgetBlackBoxWindow<W>::bbClose()
+ void WidgetBlackBoxWindow<W>::bbDestroy()
{
- bbtkDebugMessage("widget",9,"WidgetBlackBoxWindow::bbClose() ["
+ if (mBox.expired()) return;
+ bbtkDebugMessage("widget",9,"WidgetBlackBoxWindow::bbDestroy() ["
<<mBox.lock()->bbGetName()<<"]"<<std::endl);
+ bbHide();
+ mBox.lock()->DecNbWindowsAlive();
+ mBox.lock()->bbSetWindow(0);
}
//=========================================================================
Program: bbtk
Module: $RCSfile: bbtkWx.cxx,v $
Language: C++
- Date: $Date: 2009/04/08 07:56:11 $
- Version: $Revision: 1.13 $
+ Date: $Date: 2009/05/19 10:19:23 $
+ Version: $Revision: 1.14 $
=========================================================================*/
/* ---------------------------------------------------------------------
_T("TOP BBTK FRAME (YOU SHOULD NOT SEE ME !!)"));
top->Hide();
- Wx::SetTopWindow(top);
+ //if (mgTopWindowParent==0)
+ Wx::SetTopWindow(top);
}
//=========================================================================
void Wx::DestroyTopWindowIfNeeded()
{
if ( (mgNbWindowsAlive==0) &&
- (mgAutoDestroyTopWindow) )
+ (mgAutoDestroyTopWindow) &&
+ (mgTopWindow != 0))
{
bbtkDebugMessage("wx",1," --> Destructing bbtk top window"<<std::endl);
mgTopWindow->Close();
bbtkDebugMessage("wx",2,"* Number of windows shown = "<<mgNbWindowsShown
<<std::endl);
- DestroyTopWindowIfNeeded();
+ // DestroyTopWindowIfNeeded();
// BBTKWXSIG
mgWxSignal();
bbtkDebugMessage("wx",2,
"Wx::BusyCursor::BusyCursor() : creating new cursor"
<<std::endl);
- mCursor = new wxBusyCursor;
+ //mCursor = new wxBusyCursor;
}
}
Wx::BusyCursor::~BusyCursor()
{
if (mCursor)
{
- delete mCursor;
+ //delete mCursor;
bbtkDebugMessage("wx",2,
"Wx::BusyCursor::~BusyCursor() : deleting cursor"<<std::endl);
}
Program: bbtk
Module: $RCSfile: bbtkWxBlackBox.cxx,v $
Language: C++
- Date: $Date: 2009/05/14 14:43:34 $
- Version: $Revision: 1.39 $
+ Date: $Date: 2009/05/19 10:19:23 $
+ Version: $Revision: 1.40 $
=========================================================================*/
/* ---------------------------------------------------------------------
Parent::bbShow();
Show(false);
SetReturnCode( wxDialog::ShowModal() );
- bbClose();
+ bbDestroy();
}
//=========================================================================
//=========================================================================
//=========================================================================
- void WxBlackBoxDialog::bbClose()
+ void WxBlackBoxDialog::bbDestroy()
{
- bbtkDebugMessage("wx",9,"WxBlackBoxDialog::bbClose()"<<std::endl);
+ bbtkDebugMessage("wx",9,"WxBlackBoxDialog::bbDestroy()"<<std::endl);
wxDialog::Destroy();
}
//=========================================================================
//=========================================================================
WxBlackBoxDialog::~WxBlackBoxDialog()
{
+ bbtkDebugMessage("wx",9,"WxBlackBoxDialog::~WxBlackBoxDialog()"
+ <<std::endl);
}
//=========================================================================
//=========================================================================
WxBlackBoxFrame::~WxBlackBoxFrame()
{
+ bbtkDebugMessage("wx",9,"WxBlackBoxFrame::~WxBlackBoxFrame()"
+ <<std::endl);
}
//=========================================================================
//=========================================================================
//=========================================================================
- void WxBlackBoxFrame::bbClose()
+ void WxBlackBoxFrame::bbDestroy()
{
- bbtkDebugMessage("wx",9,"WxBlackBoxFrame::bbClose()"<<std::endl);
- wxFrame::Close();
+ bbtkDebugMessage("wx",9,"WxBlackBoxFrame::bbDestroy()"<<std::endl);
+ wxFrame::Destroy();
}
//=========================================================================
//=========================================================================
WxBlackBoxWidgetEventHandler::~WxBlackBoxWidgetEventHandler()
{
+ bbtkDebugMessage("wx",9,
+ "WxBlackBoxWidgetEventHandler::~WxBlackBoxWidgetEventHandler() ["
+ <<std::endl);
+
+
+ Disconnect ( mWindow->GetId() );
+
if (mBox.expired()) return;
bbtkDebugMessage("wx",9,
"WxBlackBoxWidgetEventHandler::~WxBlackBoxWidgetEventHandler() ["
<<mBox.lock()->bbGetFullName()<<"]"<<std::endl);
- mBox.lock()->bbSetWidgetEventHandler(0);
+
+ mBox.lock()->bbSetWidgetEventHandler(0);
}
//=========================================================================
//=========================================================================
void WxBlackBoxWidgetEventHandler::OnWindowDestroy(wxWindowDestroyEvent&)
{
+ bbtkDebugMessage("wx",9,"WxBlackBoxWidgetEventHandler::OnWindowDestroy() []"<<std::endl);
if (mBox.expired()) return;
- bbtkDebugMessage("wx",9,"WxBlackBoxWidgetEventHandler::OnWindowDestroy() ["
+ bbtkDebugMessage("wx",9,"WxBlackBoxWidgetEventHandler::OnWindowDestroy() alive ["
<<mBox.lock()->bbGetFullName()<<"]"<<std::endl);
mBox.lock()->bbSetOutputWidget(0);
- // LGSIGNAL
- // mBox.lock()->bbSetModifiedStatus();
}
//=========================================================================
//=========================================================================
void WxBlackBox::bbUserFinalizeProcessing()
{
+ bbtkDebugMessage("wx",9,"WxBlackBox::bbUserFinalizeProcessing()"<<std::endl);
+ if (bbGetWidgetEventHandler()!=0)
+ {
+ bbtkDebugMessage("wx",9,"Deleting Widget Event Handler"<<std::endl);
+ delete bbGetWidgetEventHandler();
+ }
+
}
//==================================================================
Program: bbtk
Module: $RCSfile: bbtkWxBlackBox.h,v $
Language: C++
- Date: $Date: 2009/05/14 14:43:34 $
- Version: $Revision: 1.27 $
+ Date: $Date: 2009/05/19 10:19:23 $
+ Version: $Revision: 1.28 $
========================================================================*/
~WxBlackBoxDialog();
void bbShow();
void bbHide();
- void bbClose();
+ void bbDestroy();
bool IsDialog() { return true; }
bool IsFrame() { return false; }
wxDialog* bbGetDialog() { return this; }
~WxBlackBoxFrame();
void bbShow();
void bbHide();
- void bbClose();
+ void bbDestroy();
bool IsDialog() { return false; }
bool IsFrame() { return true; }
wxFrame* bbGetFrame() { return this; }