CBGDDKernelBitmapItem Class Reference

#include <bitmapgriddropdown.h>

Inheritance diagram for CBGDDKernelBitmapItem:

CBGDDCachedItem CBGDDItemInfo CGridComboUserData List of all members.

Public Member Functions

 CBGDDKernelBitmapItem (KernelBitmap *pKernelBitmap, BOOL bAutodelete=TRUE, String_256 strLabel=String_256(), BOOL bStretch=TRUE)
virtual ~CBGDDKernelBitmapItem ()

Protected Member Functions

virtual wxBitmap * RenderItemToBitmap (wxSize szBitmap) const

Protected Attributes

KernelBitmapm_pKernelBitmap
BOOL m_bDeleteKernelBitmap
BOOL m_bStretch

Detailed Description

Class : CBGDDKernelBitmapItem Base Class : public CBGDDCachedItem Author : Mikhail Tatarnikov Description : Item for displaying a KernelBitmap. Pure Virtual : None Known Issues : None Usage Notes : None Override Notes: None

Definition at line 232 of file bitmapgriddropdown.h.


Constructor & Destructor Documentation

CBGDDKernelBitmapItem::CBGDDKernelBitmapItem KernelBitmap pKernelBitmap,
BOOL  bAutodelete = TRUE,
String_256  strLabel = String_256(),
BOOL  bStretch = TRUE
 

Definition at line 413 of file bitmapgriddropdown.cpp.

00415     : CBGDDCachedItem(strLabel)
00416 {
00417     m_pKernelBitmap       = pKernelBitmap;
00418     m_bDeleteKernelBitmap = bAutodelete;
00419     m_bStretch            = bStretch;
00420 }

CBGDDKernelBitmapItem::~CBGDDKernelBitmapItem  )  [virtual]
 

Definition at line 422 of file bitmapgriddropdown.cpp.

00423 {
00424     if (m_bDeleteKernelBitmap)
00425         delete m_pKernelBitmap;
00426 }


Member Function Documentation

wxBitmap * CBGDDKernelBitmapItem::RenderItemToBitmap wxSize  szBitmap  )  const [protected, virtual]
 

Function : CBGDDKernelBitmapItem::GetWxBitmap Author : Mikhail Tatarnikov Purpose : Gets the wxBitmap representation of the currently stored KernelBitmap Returns : wxBitmap* - the required version of the KernelBitmap. Exceptions: Parameters: [in] wxSize szBitmap - the size of representation. Notes : Since the KernelBitmap stored in the item can be of considerable size, we have to speed up the drawing (and scaling). It's done by caching the bitmap representations.

Reimplemented from CBGDDCachedItem.

Definition at line 441 of file bitmapgriddropdown.cpp.

00442 {
00443     // NOTE: the maximum size of bitmap allowed by BitmapDragInformation is 180*??? pixels!!
00444     wxMemoryDC dcMem;
00445     wxBitmap* pBitmap = new wxBitmap(szBitmap.x, szBitmap.y);
00446     dcMem.SelectObject(*pBitmap);
00447     dcMem.SetUserScale(1.0, 1.0);
00448 
00449     wxSize szDragBitmap = szBitmap;
00450     if (!m_bStretch)
00451         szDragBitmap = wxSize(m_pKernelBitmap->GetWidth(), m_pKernelBitmap->GetHeight());
00452 
00453     BitmapDragInformation oDragBitmap(m_pKernelBitmap, szDragBitmap.x, szDragBitmap.y, 0, 0);
00454     oDragBitmap.OnDrawSolidDrag(wxPoint(0, 0), &dcMem);
00455 
00456     dcMem.SelectObject(wxNullBitmap);
00457 
00458     return pBitmap;
00459 }


Member Data Documentation

BOOL CBGDDKernelBitmapItem::m_bDeleteKernelBitmap [protected]
 

Definition at line 245 of file bitmapgriddropdown.h.

BOOL CBGDDKernelBitmapItem::m_bStretch [protected]
 

Definition at line 246 of file bitmapgriddropdown.h.

KernelBitmap* CBGDDKernelBitmapItem::m_pKernelBitmap [protected]
 

Definition at line 244 of file bitmapgriddropdown.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:51:55 2007 for Camelot by  doxygen 1.4.4