/* * Copyright 2006-2010, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Author: * Andras Sevcsik */ #include "defines.h" #include "PasteOMaticIcon.h" #include #include #include #include #include PasteOMaticIcon::PasteOMaticIcon() : BView(BRect(0, 0, 48, 48), "fIcon", B_FOLLOW_LEFT | B_FOLLOW_V_CENTER, B_WILL_DRAW) { fBitmapDefault = BTranslationUtils::GetBitmapFile(PATH_DEFAULT_ICON); fBitmapSuccess = BTranslationUtils::GetBitmapFile(PATH_SUCCESS_ICON); fBitmapFail = BTranslationUtils::GetBitmapFile(PATH_FAIL_ICON); fBitmap = fBitmapDefault; SetDrawingMode(B_OP_OVER); SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); } PasteOMaticIcon::~PasteOMaticIcon() { delete fBitmapDefault; delete fBitmapSuccess; delete fBitmapFail; } void PasteOMaticIcon::SetDefault() { fBitmap = fBitmapDefault; Invalidate(); } void PasteOMaticIcon::SetSuccess() { fBitmap = fBitmapSuccess; Invalidate(); } void PasteOMaticIcon::SetFail() { fBitmap = fBitmapFail; Invalidate(); } void PasteOMaticIcon::Draw(BRect rect) { DrawBitmap(fBitmap, BPoint(0, 0)); }