You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.2 KiB
44 lines
1.2 KiB
//----------------------------------------------------------------------------
|
|
// Laser Guard Ltd.
|
|
// Copyright © 2000-2002. All Rights Reserved.
|
|
// Version 1.0 23/04/2001
|
|
// Last modification: 08/10/2003
|
|
// Project Intruder Position Indicator
|
|
// SUBSYSTEM: Spinner
|
|
// FILE: Spinner.cpp
|
|
// AUTHOR: Belkovsky Joseph
|
|
// OVERVIEW
|
|
// ~~~~~~~~
|
|
// Source file for implemenation of class Spinner
|
|
//----------------------------------------------------------------------------
|
|
|
|
#include "stdafx.h"
|
|
#include "..\LgLib\Version.h"
|
|
|
|
#include "Spinner.h"
|
|
|
|
Spinner::Spinner(HWND hwnd, WORD resID)
|
|
: hwnd_(hwnd)
|
|
{
|
|
m_bStudyMode = TRUE;
|
|
|
|
HINSTANCE hthisInst = (HINSTANCE)GetWindowLong(hwnd_, GWL_HINSTANCE);
|
|
|
|
for(WORD idx = resID; idx < (resID + STEPS * 2 + 1); idx++)
|
|
hicons_[idx - resID] = (HICON)LoadImage(hthisInst, (LPCTSTR)idx,
|
|
IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR);
|
|
|
|
step( STEPS );
|
|
}
|
|
|
|
Spinner::~Spinner()
|
|
{
|
|
for(__int8 idx = 0; idx < STEPS * 2 + 1; idx++)
|
|
DestroyIcon(hicons_[idx]);
|
|
}
|
|
|
|
HICON Spinner::step(__int8 step) const
|
|
{
|
|
return (HICON)SendMessage(hwnd_, STM_SETICON,
|
|
(WPARAM)hicons_[ m_bStudyMode ? step + STEPS : step ], (LPARAM)0L);
|
|
}
|