class LboxProgressBar : public LboxWintool

  コンストラクタ



  
// *********************************************************
// 拡張コンストラクタ
// *********************************************************
LboxProgressBar::LboxProgressBar( HWND hOwner, HWND hBase )
{
	BaseEdit = NULL;
	BaseEdit = new LboxEdit( hBase );
		
	BaseEdit->Hide( );
	BaseEdit->Disable();

	RECT rt;
	POINT pt;
	GetWindowRect( hBase, &rt );
	pt.x = rt.left;
	pt.y = rt.top;
	ScreenToClient( hOwner, &pt );

	int nW,nH;
	nW = BaseEdit->Width();
	nH = BaseEdit->Height();

	this->hWnd = 
		CreateWindowEx(
			0,
			PROGRESS_CLASS,
			(LPSTR)NULL,
			WS_CHILD |
			WS_VISIBLE,
			pt.x, pt.y, nW, nH,
			hOwner,
			NULL,
			LboxGetInstance( hOwner ),
			NULL
		);

}

LboxProgressBar::LboxProgressBar()
{
	BaseEdit = NULL;
	this->hWnd = NULL;
}

LboxProgressBar::~LboxProgressBar()
{
	if ( BaseEdit != NULL ) {
		delete BaseEdit;
	}
}
  



  SetRange



  
// *********************************************************
// 範囲設定
// 戻り値 : 無し
// *********************************************************
void LboxProgressBar::SetRange( DWORD nMin, DWORD nMax )
{
	if ( this->hWnd != NULL ) {
		SendMessage(
			this->hWnd,
			PBM_SETRANGE32,
			(WPARAM)nMin,
			(LPARAM)nMax
		);
	}
}
  



  SetStep

  
// *********************************************************
// 一回の増分に対する数値設定
// 戻り値 : 無し
// *********************************************************
void LboxProgressBar::SetStep( int nStep )
{
	if ( this->hWnd != NULL ) {
		SendMessage(
			this->hWnd,
			PBM_SETSTEP,
			(WPARAM)nStep,
			0L
		);
	}
}
  



  Next

  
// *********************************************************
// 増分を1ステップ増加
// 戻り値 : 無し
// *********************************************************
void LboxProgressBar::Next( void )
{
	if ( this->hWnd != NULL ) {
		SendMessage(
			this->hWnd,
			PBM_STEPIT,
			0L,
			0L
		);
	}
}
  



  SetPos

  
// *********************************************************
// 直接ポジション設定
// 戻り値 : 無し
// *********************************************************
void LboxProgressBar::SetPos( int nPos )
{
	if ( this->hWnd != NULL ) {
		SendMessage(
			this->hWnd,
			PBM_SETPOS,
			(WPARAM)nPos,
			0L
		);
	}
}
  



  SetBkcolor

  
// *********************************************************
// 背景色設定
// 戻り値 : 無し
// *********************************************************
void LboxProgressBar::SetBkcolor( int r, int g, int b )
{
	if ( this->hWnd != NULL ) {
		SendMessage(
			this->hWnd,
			PBM_SETBKCOLOR,
			0L,
			(LPARAM)(COLORREF)(RGB(r,g,b))
		);
	}
}
  



  SetBarcolor

  
// *********************************************************
// 増分色設定
// 戻り値 : 無し
// *********************************************************
void LboxProgressBar::SetBarcolor( int r, int g, int b )
{
	if ( this->hWnd != NULL ) {
		SendMessage(
			this->hWnd,
			PBM_SETBARCOLOR,
			0L,
			(LPARAM)(COLORREF)(RGB(r,g,b))
		);
	}
}
  










  infoboard   管理者用   
このエントリーをはてなブックマークに追加





フリーフォントWEBサービス
SQLの窓WEBサービス

SQLの窓フリーソフト

素材

一般WEBツールリンク

SQLの窓

フリーソフト

JSライブラリ