The Code : (WNDCONTROL.CPP) , adding __WIKI
// WndBase.cpp: implementation of the CWndBase class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "defineSound.h"
#include "defineText.h"
#include "AppDefine.h" // ¿©±â¼* ÀÌ°É ¿Ö includeÇÏÁö?
#include "clipboard.h"
// °æ°í!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!
// ÀÌ Å¬·¹½º´Â ±âº» À©µµ º£À̽º ÄÜÅä·ÑÀÌ´Ù. ÀÌ ÄÜÆ®·ÑÀ» °³Á¶Çϱâ À§ÇØ ¸ÅÀÎÇÁ·¹ÀÓÀÇ Æã¼ÇÀ» ºÎ¸¥´Ù°Å³ª
// ¾ÖÇ÷§ ´ÜÀ§¿¡ Á¢±ÙÀ» ½ÃµµÇÏ´Â ÇàÀ§´Â ¾ö°ÝÈ÷ ±ÝÁöÇÔ!!! ÀÌ¹Ì ¸îºÎºÐ ±×·¯ÇÑ Çà°¢ÀÌ ¹ß»ýÇßÀ¸¹Ç·Î
// ÀÛ¼ºÀÚ´Â ¼öÁ¤Çϱ⠹ٶ÷!!!! ±âº» À©µµ ÄÚµù¿¡¼* À©µµÀÇ ÄÜÆ®·Ñ ¹Ú½º³ª ¸®½ºÆ® ¹Ú½º°¡ ¸¾¿¡ ¾Èµç´Ù°í
// API ÀÚü¸¦ ¼öÁ¤ÇÏ´Â ÇàÀ§´Â ºÒ°¡´ÉÇÏ´Ù. À©µµ¿¡¼*´Â Äݹé, ÈÅ. ¿À¹ö¶óÀÌµå °°Àº ¹æ½ÄÀ¸·Î ±â´É¿¡ º¯ÇüÀ» °¡ÇÑ´Ù.
// ¿©±â¼*´Â Ŭ·¹½º¸¦ °è½Â¹Þ¾Æ ¿À¹ö¶óÀ̵åÇÏ¿© ÀçÀÛ¼ºÇÏ´Â ¹æ¹ýÀÌ Àû´çÇÏ´Ù.
#if __VER >= 15 // __GUILD_HOUSE
#include "GuildHouse.h"
#include "WndGuildHouse.h"
#endif
#ifdef __WIKI
#include "WndWiki.h"
#endif
------ Second Code -----
//m_dwListBoxStyle = dwListBoxStyle;
CWndBase::Create( dwListBoxStyle | WBS_CHILD, rect, pParentWnd, nID );
}
void CWndListBox::LoadListBoxScript(LPCTSTR lpFileName)
{
CScanner scanner;
if(scanner.Load(lpFileName) == FALSE)
return;
scanner.GetToken(); // keyword
do {
InterpriteScript(scanner,m_listItemArray);
scanner.GetToken(); // keyword
} while(scanner.tok != FINISHED);
}
void CWndListBox::InterpriteScript(CScanner& scanner,CPtrArray& ptrArray)
{
do {
LPLISTITEM lpListItem = new LISTITEM;
lpListItem->m_strWord = scanner.Token;
ptrArray.Add(lpListItem);
scanner.GetToken();
} while(*scanner.token != '}' && scanner.tok != FINISHED);
if(scanner.tok == FINISHED)
return;
scanner.GetToken();
}
void CWndListBox::OnInitialUpdate()
{
CRect rect = GetWindowRect();
m_wndScrollBar.Create( WBS_DOCKING | WBS_VERT, rect, this, 1000 );
m_wndScrollBar.SetVisible( IsWndStyle( WBS_VSCROLL ) );
}
void CWndListBox::OnDraw(C2DRender* p2DRender)
{
CWndBase* pWnd = GetParentWnd();
#ifdef __WIKI
if( pWnd->GetWndId() == APP_WIKI )
{
CWndWiki *pWndWiki = (CWndWiki*)pWnd;
m_nFontHeight = 40;
CPoint pt(10,3);
vector<ItemProp*> *pVecItems = pWndWiki->GetItemList();
CRect rectClient = GetClientRect();
int nPage = rectClient.Height() / m_nFontHeight;
m_wndScrollBar.SetScrollRange( 0, pVecItems->size() );
m_wndScrollBar.SetScrollPage( nPage );
for( unsigned i = (unsigned)m_wndScrollBar.GetScrollPos(); i < (unsigned)(pVecItems->size()); ++i )
{
if( i > (unsigned)(nPage + m_wndScrollBar.GetScrollPos()) )
break;
ItemProp *pProp = pVecItems->at(i);
CString strBuf;
p2DRender->RenderLine(CPoint(-2,pt.y+37),CPoint(rectClient.right,pt.y+37),0xFF77 6655);
if( i == m_nCurSelect )
{
CRect DrawRect = CRect(0,pt.y-2,rectClient.right,pt.y+36);
p2DRender->RenderFillRect(DrawRect,0xFF022202);
p2DRender->RenderRect(DrawRect,0xFF077707);
}
if( strlen( pProp->szIcon) )
{
CTexture *pIcon = CWndBase::m_textureMng.AddTexture(p2DRender->m_pd3dDevice, MakePath(DIR_ITEM,pProp->szIcon),0xffff00ff);
pIcon->Render(p2DRender,pt);
}
CRect rectToolTip(pt.x,pt.y,pt.x+35,pt.y+35);
if( rectToolTip.PtInRect(m_ptMouse) )
{
CPoint pt2 = m_ptMouse;
ClientToScreen(&pt2);
ClientToScreen(&rectToolTip);
CItemElem Item;
Item.m_dwItemId = pProp->dwID;
g_WndMng.PutToolTip_Item(&Item,pt2,&rectToolTip,AP P_WIKI);
}
pt.x += 40;
pt.y += 10;
p2DRender->TextOut(pt.x,pt.y,pProp->szName);
pt.x += 250;
if( pProp->dwItemJob < MAX_JOB )
p2DRender->TextOut(pt.x,pt.y,prj.m_aJob[pProp->dwItemJob].szName);
pt.x += 150;
int nLevel = (pProp->dwLimitLevel1 == NULL_ID ? 1 : pProp->dwLimitLevel1);
strBuf.Format("%d",nLevel);
p2DRender->TextOut(pt.x,pt.y,strBuf);
pt.x = 10;
pt.y += m_nFontHeight - 10;
}
}else
#endif // __WIKI
m_nFontHeight = GetFontHeight() + m_nLineSpace;
{
CPoint pt(3,3);
pt.y -= m_nFontHeight * m_wndScrollBar.GetScrollPos();
PaintListBox(p2DRender,pt,m_listItemArray);
int nPage = GetClientRect().Height() / m_nFontHeight;
int nRange = m_listItemArray.GetSize();
if( IsWndStyle( WBS_VSCROLL ) )
{
m_wndScrollBar.SetVisible( TRUE );
m_wndScrollBar.SetScrollRange( 0, nRange );
m_wndScrollBar.SetScrollPage( nPage );
}
else
m_wndScrollBar.SetVisible( FALSE );
}
}
void CWndListBox::PaintListBox(C2DRender* p2DRender,CPoint& pt,CPtrArray& ptrArray)
{
LPLISTITEM pListItem;
for(int i = 0; i < ptrArray.GetSize(); i++)
{
pListItem = (LPLISTITEM)ptrArray.GetAt(i);
#if __VER >= 15 // __IMPROVE_QUEST_INTERFACE
if( pListItem->m_bIsVisible == FALSE )
continue;
int nScrollBarWidth = IsWndStyle( WBS_VSCROLL ) ? m_wndScrollBar.GetClientRect().Width() : 0;
CSize size = p2DRender->m_pFont->GetTextExtent_EditString( pListItem->m_strWord );
pListItem->m_rect.left = pt.x;
pListItem->m_rect.top = pt.y;
pListItem->m_rect.right = pt.x + m_rectWindow.Width() - nScrollBarWidth;
pListItem->m_rect.bottom = pt.y + m_nFontHeight;
if( pListItem->m_bIsValid == TRUE )
{
if( i == m_nCurSelect )
pListItem->m_strWord.SetColor( m_nSelectColor );
else
{
CPoint point = GetMousePoint();
if( pListItem->m_rect.PtInRect( point ) == TRUE )
pListItem->m_strWord.SetColor( m_dwOnMouseColor );
else
pListItem->m_strWord.SetColor( m_nFontColor );
}
}
else
pListItem->m_strWord.SetColor( m_dwInvalidColor );
p2DRender->TextOut_EditString( m_nLeftMargin + pt.x, pt.y, pListItem->m_strWord );
pt.y += m_nFontHeight;
#else // __IMPROVE_QUEST_INTERFACE
Errors :
c:\Users\wiki\fly\steo\flyffsource\Source\_Interfa ce\WndControl.cpp(4886) : error C2653: 'IRALog' : is not a class or namespace name
c:\Users\wiki\fly\steo\flyffsource\Source\_Interfa ce\WndControl.cpp(4886) : error C2227: left of '->Debug' must point to class/struct/union
type is ''unknown-type''
c:\Users\wiki\fly\steo\flyffsource\Source\_Interfa ce\WndControl.cpp(4886) : error C3861: 'GetInstance': identifier not found, even with argument-dependent lookup