Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk/XBMC@586 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
- Loading branch information
yamp
committed
Jan 22, 2004
1 parent
5461a75
commit 890c92d
Showing
15 changed files
with
245 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
#include "GUIDialogFileStacking.h" | ||
#include "guiWindowManager.h" | ||
#include "localizeStrings.h" | ||
|
||
CGUIDialogFileStacking::CGUIDialogFileStacking(void) | ||
:CGUIDialog(0) | ||
{ | ||
m_iSelectedFile=-1; | ||
m_iNumberOfFiles=0; | ||
} | ||
|
||
CGUIDialogFileStacking::~CGUIDialogFileStacking(void) | ||
{ | ||
} | ||
void CGUIDialogFileStacking::OnAction(const CAction &action) | ||
{ | ||
if (action.wID == ACTION_CLOSE_DIALOG || action.wID == ACTION_PREVIOUS_MENU) | ||
{ | ||
Close(); | ||
return; | ||
} | ||
CGUIWindow::OnAction(action); | ||
} | ||
|
||
bool CGUIDialogFileStacking::OnMessage(CGUIMessage& message) | ||
{ | ||
switch ( message.GetMessage() ) | ||
{ | ||
case GUI_MSG_WINDOW_INIT: | ||
{ | ||
CGUIDialog::OnMessage(message); | ||
m_iSelectedFile=-1; | ||
m_iFrames=0; | ||
|
||
// enable the CD's | ||
for (int i=1; i <= m_iNumberOfFiles; ++i) | ||
{ | ||
CONTROL_ENABLE(GetID(),i); | ||
SET_CONTROL_VISIBLE(GetID(),i); | ||
} | ||
|
||
// disable CD's we dont use | ||
for (int i=m_iNumberOfFiles+1; i <= 5; ++i) | ||
{ | ||
SET_CONTROL_HIDDEN(GetID(), i); | ||
CONTROL_DISABLE(GetID(), i); | ||
} | ||
return true; | ||
} | ||
break; | ||
|
||
case GUI_MSG_CLICKED: | ||
{ | ||
m_iSelectedFile=message.GetSenderId(); | ||
Close(); | ||
return true; | ||
} | ||
break; | ||
} | ||
return CGUIDialog::OnMessage(message); | ||
} | ||
|
||
int CGUIDialogFileStacking::GetSelectedFile() const | ||
{ | ||
return m_iSelectedFile; | ||
} | ||
void CGUIDialogFileStacking::SetNumberOfFiles(int iFiles) | ||
{ | ||
m_iNumberOfFiles=iFiles; | ||
} | ||
|
||
|
||
void CGUIDialogFileStacking::Render() | ||
{ | ||
if (m_iFrames <=25) | ||
{ | ||
// slide in... | ||
int dwScreenWidth=g_graphicsContext.GetWidth(); | ||
for (int i=1; i <= m_iNumberOfFiles; ++i) | ||
{ | ||
CGUIControl* pControl=(CGUIControl*)GetControl(i); | ||
DWORD dwEndPos = dwScreenWidth - ((m_iNumberOfFiles-i)*32)-140; | ||
DWORD dwStartPos = dwScreenWidth; | ||
float fStep= (float)(dwStartPos - dwEndPos); | ||
fStep/=25.0f; | ||
fStep*=(float)m_iFrames; | ||
DWORD dwPosX = (DWORD) ( ((float)dwStartPos)-fStep ); | ||
pControl->SetPosition( dwPosX, pControl->GetYPosition() ); | ||
} | ||
m_iFrames++; | ||
} | ||
CGUIDialog::Render(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#pragma once | ||
#include "guidialog.h" | ||
|
||
class CGUIDialogFileStacking : | ||
public CGUIDialog | ||
{ | ||
public: | ||
CGUIDialogFileStacking(void); | ||
virtual ~CGUIDialogFileStacking(void); | ||
virtual bool OnMessage(CGUIMessage& message); | ||
virtual void OnAction(const CAction &action); | ||
|
||
int GetSelectedFile() const; | ||
void SetNumberOfFiles(int iFiles); | ||
virtual void Render(); | ||
protected: | ||
int m_iSelectedFile; | ||
int m_iNumberOfFiles; | ||
int m_iFrames; | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.