<commit_before>/*!
 * \file dcxmdialog.cpp
 * \brief blah
 *
 * blah
 *
 * \author <NAME> ( clickhere at scriptsdb dot org )
 * \version 1.0
 *
 * \b Revisions
 *
 *  ScriptsDB.org - 2006
 */

#include "dcxmdialog.h"
#include "dcxdialog.h"

/*!
 * \brief Constructor
 *
 * \param cHwnd Attached Dialog Handle
 * \param ID Control ID
 * \param p_Dialog Parent DcxDialog Object
 * \param rc Window Rectangle
 * \param styles Window Style Tokenized List
 */

DcxMDialog::DcxMDialog( HWND cHwnd, UINT ID, DcxDialog * p_Dialog, RECT * rc, TString & styles ) : DcxControl( ID, p_Dialog ) {

  LONG Styles = 0, ExStyles = 0;
  BOOL bNoTheme = FALSE;
  this->parseControlStyles( styles, &Styles, &ExStyles, &bNoTheme );

  this->m_Hwnd = cHwnd;
  this->m_OrigParentHwnd = GetParent( this->m_Hwnd );

  this->m_OrigStyles = this->removeStyle( WS_CAPTION|DS_FIXEDSYS|DS_SETFONT|DS_3DLOOK|DS_MODALFRAME|
    WS_POPUP|WS_SYSMENU|WS_MINIMIZEBOX|WS_MAXIMIZEBOX|WS_THICKFRAME );

  this->m_OrigExStyles = this->removeExStyle( WS_EX_CONTROLPARENT );

  this->addStyle( WS_CHILD );

  SetParent( this->m_Hwnd, p_Dialog->getHwnd( ) );
  SetWindowPos( this->m_Hwnd, NULL, rc->left, rc->top, rc->right-rc->left, rc->bottom-rc->top, NULL );
  ShowWindow( this->m_Hwnd, SW_SHOWNOACTIVATE );
  UpdateWindow( this->m_Hwnd );

  this->m_OrigID = SetWindowLong( this->m_Hwnd, GWL_ID, ID );

  this->registreDefaultWindowProc( );
  SetProp( this->m_Hwnd, "dcx_cthis", (HANDLE) this );
}

/*!
 * \brief Constructor
 *
 * \param cHwnd Attached dialog Handle
 * \param pHwnd Parent Window
 * \param ID Control ID
 * \param p_Dialog Parent DcxDialog Object
 * \param rc Window Rectangle
 * \param styles Window Style Tokenized List
 */

DcxMDialog::DcxMDialog( HWND cHwnd, HWND pHwnd, UINT ID, DcxDialog * p_Dialog, RECT * rc, TString & styles ) : DcxControl( ID, p_Dialog ) {

  LONG Styles = 0, ExStyles = 0;
  BOOL bNoTheme = FALSE;
  this->parseControlStyles( styles, &Styles, &ExStyles, &bNoTheme );

  this->m_Hwnd = cHwnd;
  this->m_OrigParentHwnd = GetParent( this->m_Hwnd );

  this->m_OrigStyles = this->removeStyle( WS_CAPTION|DS_FIXEDSYS|DS_SETFONT|DS_3DLOOK|DS_MODALFRAME|
    WS_POPUP|WS_SYSMENU|WS_MINIMIZEBOX|WS_MAXIMIZEBOX|WS_THICKFRAME );

  this->m_OrigExStyles = this->removeExStyle( WS_EX_CONTROLPARENT );

  this->addStyle( WS_CHILD );

  SetParent( this->m_Hwnd, pHwnd );
  SetWindowPos( this->m_Hwnd, NULL, rc->left, rc->top, rc->right-rc->left, rc->bottom-rc->top, NULL );
  ShowWindow( this->m_Hwnd, SW_SHOWNOACTIVATE );
  UpdateWindow( this->m_Hwnd );

  this->m_OrigID = SetWindowLong( this->m_Hwnd, GWL_ID, ID );

  this->registreDefaultWindowProc( );
  SetProp( this->m_Hwnd, "dcx_cthis", (HANDLE) this );
}

/*!
 * \brief Destructor
 *
 * blah
 */

DcxMDialog::~DcxMDialog( ) {

  //mIRCError( "releasing dialog" );
  if ( GetParent( this->m_Hwnd ) == this->m_OrigParentHwnd ) 
    return;

  this->unregistreDefaultWindowProc( );

  BOOL bHide = IsWindowVisible( this->m_Hwnd );
  if ( !bHide )
    ShowWindow( this->m_Hwnd, SW_HIDE );

  SetWindowLong( this->m_Hwnd, GWL_ID, this->m_ID );
  SetParent( this->m_Hwnd, this->m_OrigParentHwnd );
  this->setStyle( this->m_OrigStyles );
  this->setExStyle( this->m_OrigExStyles );
<commit_msg>- fixed a bug with deleting a docked dialog (thanks HAPM)<commit_after>/*!
 * \file dcxmdialog.cpp
 * \brief blah
 *
 * blah
 *
 * \author <NAME> ( clickhere at scriptsdb dot org )
 * \version 1.0
 *
 * \b Revisions
 *
 *  ScriptsDB.org - 2006
 */

#include "dcxmdialog.h"
#include "dcxdialog.h"

/*!
 * \brief Constructor
 *
 * \param cHwnd Attached Dialog Handle
 * \param ID Control ID
 * \param p_Dialog Parent DcxDialog Object
 * \param rc Window Rectangle
 * \param styles Window Style Tokenized List
 */

DcxMDialog::DcxMDialog( HWND cHwnd, UINT ID, DcxDialog * p_Dialog, RECT * rc, TString & styles ) : DcxControl( ID, p_Dialog ) {

  LONG Styles = 0, ExStyles = 0;
  BOOL bNoTheme = FALSE;
  this->parseControlStyles( styles, &Styles, &ExStyles, &bNoTheme );

  this->m_Hwnd = cHwnd;
  this->m_OrigParentHwnd = GetParent( this->m_Hwnd );

  this->m_OrigStyles = this->removeStyle( WS_CAPTION|DS_FIXEDSYS|DS_SETFONT|DS_3DLOOK|DS_MODALFRAME|
    WS_POPUP|WS_SYSMENU|WS_MINIMIZEBOX|WS_MAXIMIZEBOX|WS_THICKFRAME );

  this->m_OrigExStyles = this->removeExStyle( WS_EX_CONTROLPARENT );

  this->addStyle( WS_CHILD );

  SetParent( this->m_Hwnd, p_Dialog->getHwnd( ) );
  SetWindowPos( this->m_Hwnd, NULL, rc->left, rc->top, rc->right-rc->left, rc->bottom-rc->top, NULL );
  ShowWindow( this->m_Hwnd, SW_SHOWNOACTIVATE );
  UpdateWindow( this->m_Hwnd );

  this->m_OrigID = SetWindowLong( this->m_Hwnd, GWL_ID, ID );

  this->registreDefaultWindowProc( );
  SetProp( this->m_Hwnd, "dcx_cthis", (HANDLE) this );
}

/*!
 * \brief Constructor
 *
 * \param cHwnd Attached dialog Handle
 * \param pHwnd Parent Window
 * \param ID Control ID
 * \param p_Dialog Parent DcxDialog Object
 * \param rc Window Rectangle
 * \param styles Window Style Tokenized List
 */

DcxMDialog::DcxMDialog( HWND cHwnd, HWND pHwnd, UINT ID, DcxDialog * p_Dialog, RECT * rc, TString & styles ) : DcxControl( ID, p_Dialog ) {

  LONG Styles = 0, ExStyles = 0;
  BOOL bNoTheme = FALSE;
  this->parseControlStyles( styles, &Styles, &ExStyles, &bNoTheme );

  this->m_Hwnd = cHwnd;
  this->m_OrigParentHwnd = GetParent( this->m_Hwnd );

  this->m_OrigStyles = this->removeStyle( WS_CAPTION|DS_FIXEDSYS|DS_SETFONT|DS_3DLOOK|DS_MODALFRAME|
    WS_POPUP|WS_SYSMENU|WS_MINIMIZEBOX|WS_MAXIMIZEBOX|WS_THICKFRAME );

  this->m_OrigExStyles = this->removeExStyle( WS_EX_CONTROLPARENT );

  this->addStyle( WS_CHILD );

  SetParent( this->m_Hwnd, pHwnd );
  SetWindowPos( this->m_Hwnd, NULL, rc->left, rc->top, rc->right-rc->left, rc->bottom-rc->top, NULL );
  ShowWindow( this->m_Hwnd, SW_SHOWNOACTIVATE );
  UpdateWindow( this->m_Hwnd );

  this->m_OrigID = SetWindowLong( this->m_Hwnd, GWL_ID, ID );

  this->registreDefaultWindowProc( );
  SetProp( this->m_Hwnd, "dcx_cthis", (HANDLE) this );
}

/*!
 * \brief Destructor
 *
 * blah
 */

DcxMDialog::~DcxMDialog( ) {

  //mIRCError( "releasing dialog" );
  //if ( GetParent( this->m_Hwnd ) == this->m_OrigParentHwnd ) 
   // return;

  this->unregistreDefaultWindowProc( );

  BOOL bHide = IsWindowVisible( this->m_Hwnd );
  if ( !bHide )
    ShowWindow( this->m_Hwnd, SW_HIDE );

  SetWindowLong( this->m_Hwnd, GWL_ID, this->m_ID );
  SetParent( this->m_Hwnd, this->m_OrigParentHwnd );
  this->setStyle( this->m_OrigStyles );
  this->setExStyle( this->m_OrigExStyles );

{'fraction_non_alphanumeric': 0.1404718137254902, 'fraction_numerical': 0.003676470588235294, 'mean_word_length': 4.214856230031949, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 125, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4854510', 'n_tokens_mistral': 2716, 'n_tokens_neox': 2607, 'n_words': 510}