Добавил:
Studfiles2
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Программы для выполнения лаб 1 и 2 / KALMAN / SOURCE / SOURCE / OWNRBTTN
.CPP/* Project first
Copyright © 1997 by US. All Rights Reserved.
SUBSYSTEM: first.exe Application
FILE: ownrbttn.cpp
AUTHOR: US
OVERVIEW
========
Source file for implementation of TOwnerButton (TControl).
*/
#include <owl\owlpch.h>
#pragma hdrstop
#include "ownrbttn.h"
//#include <stdio.h>
//{{TOwnerButton Implementation}}
TOwnerButton::TOwnerButton (TWindow* parent, int id, const char far* title, int x, int y, int w, int h, TModule* module):
TControl(parent, id, title, x, y, w, h, module)
{
// INSERT>> Your constructor code here.
}
TOwnerButton::TOwnerButton (TWindow* parent, int resourceId, TModule* module) :
TControl(parent, resourceId, module)
{
}
TOwnerButton::~TOwnerButton ()
{
Destroy();
// INSERT>> Your destructor code here.
}
void TOwnerButton::ODADrawEntire (DRAWITEMSTRUCT far& drawInfo)
{
TDC btnDC(drawInfo.hDC);
TMemoryDC memDC(btnDC);
TBitmap bitmap(GetModule()->GetInstance(), drawInfo.CtlID + 1000 +
(drawInfo.itemState&ODS_DISABLED ? 3 :
drawInfo.itemState&ODS_SELECTED ? 2 :
drawInfo.itemState&ODS_FOCUS ? 1 : 0));
memDC.SelectObject(bitmap);
btnDC.BitBlt(TRect(drawInfo.rcItem), memDC, TPoint(0, 0), SRCCOPY);
memDC.RestoreObjects();
/* if (drawInfo.CtlID == 26002)
{
char msg[20];
sprintf(msg, "%X, %X", drawInfo.itemState, drawInfo.itemAction);
// ::MessageBox(0, msg, "Monitor", MB_OK);
Parent->SetWindowText(msg);
} */
}
void TOwnerButton::ODAFocus (DRAWITEMSTRUCT far& drawInfo)
{
ODADrawEntire(drawInfo);
}
void TOwnerButton::ODASelect (DRAWITEMSTRUCT far& drawInfo)
{
ODADrawEntire(drawInfo);
}
Соседние файлы в папке SOURCE