#include "stdafx.h" #include "SGameManager.h" #include "SMessage.h" //#include "SGameMessageUI.h" #include "KUIControlButton.h" #include "KUIControlPanel.h" #include "KUIControlStatic.h" #include "SUIJoinPanelWnd.h" // ** 길드원 가입 패널 ** SUIJoinPanelWnd::SUIJoinPanelWnd( SGameManager * pGameManager, KUIControlPanelManager * pPanelManager ): KUIControlPanel( pGameManager, pPanelManager ), m_pExtensionButton( NULL ), // 확장버튼. m_pBtnControl( NULL ) { } SUIJoinPanelWnd::~SUIJoinPanelWnd() { Release(); } // 메모리 해제. void SUIJoinPanelWnd::Release() { } //----------------------------- // Override // KUIControlPanel:: // 패널의 크기를 원본크기로 변경한다. 각 패널윈도우의 크기가 다르므로 재정의할것!!. void SUIJoinPanelWnd::ResizeOriginal() { KRect rtWnd = this->GetRect(); const KRect & rtTitlebar = GetChild( "trim_titlebar_open" )->GetRect(); rtWnd.bottom = rtWnd.top + rtTitlebar.GetHeight() - 1; // 윈도우 크기변경. KUIWnd::OnSizeChangeNofity( rtWnd ); // Panel 의 함수. KUIControlPanel::ResizeOriginal(); // 버튼 애니 변경. PanelExtend(); } bool SUIJoinPanelWnd::InitControls( KPoint kPos ) { // 2010.06.10. Epic7 Part1 에서는 사용하지않으므로 비활성처리. < 길드원 신청관리 버튼 > //m_pBtnControl = static_cast< KUIControlSimpleButton * >( GetChild( "button_invitation_02" ) ); m_pBtnControl = dynamicCast< KUIControlButton * >( GetChild( "button_invitation_02" ) ); m_pBtnControl->SetEnableColor( "<#ffffff>" ); m_pBtnControl->SetDisableColor( "<#a0a0a0>" ); m_pBtnControl->Disable(); //::MessageBox( NULL, m_pBtnControl->GetCaption(), "", MB_OK ); // **** // 확장 여부에따라 숨김, 보임 처리가 바뀌는 Wnd 를 배열에 추가한다. this->AddChangeVisibleWnd( GetChild( "select_list_cyan" ) ); // 확장버튼 컨트롤. m_pExtensionButton = dynamicCast< KUIControlSimpleButton * >( GetChild( "sub_open" ) ); //const KRect & rtOutLine = GetChild( "select_list_cyan_06" )->GetRect(); const KRect & rtTitlebar = GetChild( "trim_titlebar_open" )->GetRect(); KRect rtOriginal = this->GetRect(); // window의 크기. rtOriginal.bottom = rtOriginal.top + rtTitlebar.GetHeight(); // 초기설정.( 확대, 축소 크기지정 ) this->Initialize( rtOriginal, this->GetRect() ); kPos.x = rtOriginal.left; kPos.y = rtOriginal.top; // 활성화시 텍스트 컬러. dynamicCast< KUIControlStatic * >( GetChild( "guild_manage_menu" ) )->SetEnableColor( "<#ffffff>" ); return SUIWnd::InitControls( kPos ); } void SUIJoinPanelWnd::OnNotifyUIWindowOpen( bool bOpen, bool bLimitWnd) { if( bOpen ) { } else { // 길드원초대 팝업 닫기. m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_GUILD_SUB_MANAGE_INVITATION, false ) ); } } void SUIJoinPanelWnd::ProcMsgAtStatic( SGameMessage* pMsg ) { } void SUIJoinPanelWnd::PumpUpMessage( LPCSTR lpszControlID, DWORD nMessage, DWORD lparam, DWORD wparam ) { switch( nMessage ) { case KUI_MESSAGE::KBUTTON_CLICK : { // 확대축소 토글. if( !::_stricmp( lpszControlID, "sub_open" )|| !::_stricmp( lpszControlID, "trim_titlebar_open" ) ) { // 토글. this->ToggleExtend(); // 버튼 애니 변경. PanelExtend(); } // 길드원 초대. else if( !::_stricmp( lpszControlID, "button_invitation_01" ) ) { //----------------------- // 길드원초대 팝업 Wnd. // 이전에 열려있을 경우를 대비해서 닫는다. //m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_GUILD_SUB_MANAGE_INVITATION, false ) ); //m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_MOVE( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_GUILD_SUB_MANAGE_INVITATION, // 위치이동. // this->GetMultipurposePos().x, this->GetMultipurposePos().y ) ); //m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_GUILD_SUB_MANAGE_INVITATION, true ) ); // 팝업 Wnd 열기. m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_MOVE( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_GUILD_SUB_MANAGE_INVITATION, // 위치이동. this->GetMultipurposePos().x, this->GetMultipurposePos().y ) ); m_pGameManager->PostMsgAtDynamic( new SIMSG_TOGGLE_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_GUILD_SUB_MANAGE_INVITATION ) ); // 팝업 Wnd 열기. //m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_GUILD_SUB_MANAGE_INVITATION, true, true ) ); // modal } // 2010.06.10. Epic7 Part1 에서는 사용하지않으므로 주석처리. //// 길드원 신청관리. //else if( !::_stricmp( lpszControlID, "button_invitation_02" ) ) //{ // m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_GUILD_WNDMSG( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_GUILD_MAINWND, IMSG_UI_GUILD_APPLICANTTAB ) ); //} } break; } SUIWnd::PumpUpMessage( lpszControlID, nMessage, lparam, wparam ); } DWORD SUIJoinPanelWnd::OnMouseMessage(DWORD dwMessage, int x, int y) { return SUIWnd::OnMouseMessage(dwMessage, x, y); } // Panel 확대,축소 void SUIJoinPanelWnd::PanelExtend() { m_pExtensionButton->SetAniName( this->GetIsExtend() ? "common_button_titanium_sub_open" : "common_button_titanium_sub_close" ); } // Open 시 필요기능정의. void SUIJoinPanelWnd::CustomOpen() { // Panel 확대,축소 PanelExtend(); }