wxPseudoTransparentFrame Class Reference

List of all members.

Public Member Functions

 wxPseudoTransparentFrame (wxWindow *parent=NULL, wxWindowID id=wxID_ANY, const wxString &title=wxEmptyString, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE, const wxString &name=wxT("frame"))
virtual bool SetTransparent (wxByte alpha)
void OnPaint (wxPaintEvent &WXUNUSED(event))
void OnWindowCreate (wxWindowCreateEvent &WXUNUSED(event))

Private Attributes

int m_Amount
int m_MaxWidth
int m_MaxHeight
bool m_CanSetShape
wxRegion m_Region

Detailed Description

Definition at line 57 of file framemanager.cpp.


Constructor & Destructor Documentation

wxPseudoTransparentFrame::wxPseudoTransparentFrame wxWindow *  parent = NULL,
wxWindowID  id = wxID_ANY,
const wxString &  title = wxEmptyString,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = wxDEFAULT_FRAME_STYLE,
const wxString &  name = wxT("frame")
[inline]
 

Definition at line 60 of file framemanager.cpp.

00067                     : wxFrame(parent, id, title, pos, size, style | wxFRAME_SHAPED, name)
00068     {
00069         SetBackgroundStyle(wxBG_STYLE_CUSTOM);
00070         m_Amount=0;
00071         m_MaxWidth=0;
00072         m_MaxHeight=0;
00073 #ifdef __WXGTK__
00074         m_CanSetShape = false; // have to wait for window create event on GTK
00075 #else
00076         m_CanSetShape = true;
00077 #endif
00078         SetTransparent(0);
00079     }


Member Function Documentation

void wxPseudoTransparentFrame::OnPaint wxPaintEvent &  WXUNUSED(event)  )  [inline]
 

Definition at line 114 of file framemanager.cpp.

00115     {
00116         wxPaintDC dc(this);
00117 
00118         dc.SetBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_ACTIVECAPTION));
00119         dc.SetPen(*wxTRANSPARENT_PEN);
00120 
00121         wxRegionIterator upd(GetUpdateRegion()); // get the update rect list
00122 
00123         while (upd)
00124         {
00125             wxRect rect(upd.GetRect());
00126             dc.DrawRectangle(rect.x, rect.y, rect.width, rect.height);
00127 
00128             upd++;
00129         }
00130     }

void wxPseudoTransparentFrame::OnWindowCreate wxWindowCreateEvent &  WXUNUSED(event)  )  [inline]
 

Definition at line 133 of file framemanager.cpp.

00133 {m_CanSetShape=true; SetTransparent(0);}

virtual bool wxPseudoTransparentFrame::SetTransparent wxByte  alpha  )  [inline, virtual]
 

Definition at line 81 of file framemanager.cpp.

00082     {
00083         if (m_CanSetShape)
00084         {
00085             int w=100; // some defaults
00086             int h=100;
00087             GetClientSize(&w, &h);
00088             if ((alpha != m_Amount) || (m_MaxWidth<w) | (m_MaxHeight<h))
00089             {
00090                 // Make the region at least double the height and width so we don't have
00091                 // to rebuild if the size changes.
00092                 m_MaxWidth=w*2;
00093                 m_MaxHeight=h*2;
00094                 m_Amount = alpha;
00095                 m_Region.Clear();
00096 //                m_Region.Union(0, 0, 1, m_MaxWidth);
00097                 if (m_Amount)
00098                 {
00099                     for (int y=0; y<m_MaxHeight; y++)
00100                     {
00101                         // Reverse the order of the bottom 4 bits
00102                         int j=((y&8)?1:0)|((y&4)?2:0)|((y&2)?4:0)|((y&1)?8:0);
00103                         if ((j*16+8)<m_Amount)
00104                             m_Region.Union(0, y, m_MaxWidth, 1);
00105                     }
00106                 }
00107                 SetShape(m_Region);
00108                 Refresh();
00109             }
00110         }
00111         return true;
00112     }


Member Data Documentation

int wxPseudoTransparentFrame::m_Amount [private]
 

Definition at line 137 of file framemanager.cpp.

bool wxPseudoTransparentFrame::m_CanSetShape [private]
 

Definition at line 140 of file framemanager.cpp.

int wxPseudoTransparentFrame::m_MaxHeight [private]
 

Definition at line 139 of file framemanager.cpp.

int wxPseudoTransparentFrame::m_MaxWidth [private]
 

Definition at line 138 of file framemanager.cpp.

wxRegion wxPseudoTransparentFrame::m_Region [private]
 

Definition at line 142 of file framemanager.cpp.


The documentation for this class was generated from the following file:
Generated on Sat Nov 10 04:03:19 2007 for Camelot by  doxygen 1.4.4