LoadingWindow::SetIcon

This commit is contained in:
Glenn Maynard
2005-02-07 08:57:13 +00:00
parent cd7b71ebd7
commit ca3e1ef9ff
3 changed files with 27 additions and 8 deletions
@@ -3,6 +3,7 @@
#ifndef LOADING_WINDOW_H
#define LOADING_WINDOW_H
struct RageSurface;
class LoadingWindow
{
public:
@@ -11,6 +12,7 @@ public:
virtual void Paint() = 0;
virtual void SetText(CString str) { }
virtual void SetIcon( const RageSurface *pIcon ) { }
};
#endif
@@ -4,6 +4,7 @@
#include "LoadingWindow_Win32.h"
#include "RageFileManager.h"
#include "archutils/win32/WindowsResources.h"
#include "archutils/win32/WindowIcon.h"
#include <windows.h>
#include "RageSurface_Load.h"
#include "RageSurface.h"
@@ -70,8 +71,19 @@ BOOL CALLBACK LoadingWindow_Win32::WndProc( HWND hWnd, UINT msg, WPARAM wParam,
return FALSE;
}
void LoadingWindow_Win32::SetIcon( const RageSurface *pIcon )
{
if( m_hIcon != NULL )
DestroyIcon( m_hIcon );
m_hIcon = IconFromSurface( pIcon );
if( m_hIcon != NULL )
SetClassLong( hwnd, GCL_HICON, (LONG) m_hIcon );
}
LoadingWindow_Win32::LoadingWindow_Win32()
{
m_hIcon = NULL;
hwnd = CreateDialog(handle.Get(), MAKEINTRESOURCE(IDD_LOADING_DIALOG), NULL, WndProc);
for( unsigned i = 0; i < 3; ++i )
text[i] = "ABC"; /* always set on first call */
@@ -83,6 +95,8 @@ LoadingWindow_Win32::~LoadingWindow_Win32()
{
if( hwnd )
DestroyWindow( hwnd );
if( m_hIcon != NULL )
DestroyIcon( m_hIcon );
}
void LoadingWindow_Win32::Paint()
@@ -7,20 +7,23 @@
#include <windows.h>
#include "../../archutils/Win32/AppInstance.h"
class LoadingWindow_Win32: public LoadingWindow {
AppInstance handle;
HWND hwnd;
CString text[3];
static BOOL CALLBACK WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
class LoadingWindow_Win32: public LoadingWindow
{
public:
LoadingWindow_Win32();
~LoadingWindow_Win32();
void SetText(CString str);
void Paint();
void SetIcon( const RageSurface *pIcon );
private:
AppInstance handle;
HWND hwnd;
CString text[3];
HICON m_hIcon;
static BOOL CALLBACK WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
};
#define HAVE_LOADING_WINDOW_WIN32