wxCamDrawControl Class Reference

A base class for controls using the CamDrawProvider to paint themselves Notes: In the OIL See Also:. More...

#include <drawctl.h>

List of all members.

Public Member Functions

BOOL Create (wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxValidator &validator=wxDefaultValidator, wxCamDrawControlStyle cacstyle=wxCDCS_DEFAULT, wxString opdesc=wxString(_T("")))
 Initialize the control.
void Init ()
 wxCamDrawControl ()
 wxCamDrawControl (wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxValidator &validator=wxDefaultValidator, wxCamDrawControlStyle cacstyle=wxCDCS_DEFAULT, wxString opdesc=wxString(_T("")))
 ~wxCamDrawControl ()
void OnPaint (wxPaintEvent &event)
 Paints the control.
void OnSize (wxSizeEvent &event)
 Handles resizing of a control.
void OnMouseEvent (wxMouseEvent &event)
 Handles mouse events.
void OnInvoke (wxCamDrawControlEvent &event)
 Handles deferred invoke events.
virtual void Freeze ()
virtual void Thaw ()
virtual void SetStyle (wxCamDrawControlStyle style)
virtual wxCamDrawControlStyle GetStyle ()
wxString GetOpDesc ()

Protected Member Functions

void Invoke ()
 Does the work of the button being pressed.

Protected Attributes

wxCamDrawControlStyle m_CamDrawControlStyle
wxString m_OpDesc
INT32 m_Frozen


Detailed Description

A base class for controls using the CamDrawProvider to paint themselves Notes: In the OIL See Also:.

Author:
Alex_Bligh <alex@alex.org.uk>
Date:
19/12/2005
This class is specificly written so it will provided cached vector-drawn art.

Definition at line 160 of file drawctl.h.


Constructor & Destructor Documentation

wxCamDrawControl::wxCamDrawControl  )  [inline]
 

Definition at line 179 of file drawctl.h.

00179 { Init(); }

wxCamDrawControl::wxCamDrawControl wxWindow *  parent,
wxWindowID  id,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = 0,
const wxValidator &  validator = wxDefaultValidator,
wxCamDrawControlStyle  cacstyle = wxCDCS_DEFAULT,
wxString  opdesc = wxString(_T(""))
[inline]
 

Definition at line 180 of file drawctl.h.

00181                                : Correct*/ long style = 0, const wxValidator& validator = wxDefaultValidator,
00182                      wxCamDrawControlStyle cacstyle = wxCDCS_DEFAULT,
00183                      wxString opdesc = wxString(_T("")))
00184                     {
00185                         Init();
00186                         ControlList::Get()->NewControl(this);
00187                         Create(parent, id, pos, size, style, validator, cacstyle, opdesc);
00188                     }

wxCamDrawControl::~wxCamDrawControl  )  [inline]
 

Definition at line 189 of file drawctl.h.

00189 {  }


Member Function Documentation

BOOL wxCamDrawControl::Create wxWindow *  parent,
wxWindowID  id,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = 0,
const wxValidator &  validator = wxDefaultValidator,
wxCamDrawControlStyle  cacstyle = wxCDCS_DEFAULT,
wxString  opdesc = wxString(_T(""))
 

Initialize the control.

Author:
Alex_Bligh <alex@alex.org.uk>
Date:
30/12/2005
Parameters:
parent - parent window [INPUTS] id - id to use pos - position size - size style - style validator - validator (up to here, all the same as wxControl) cacstyle - the style of CamDrawControl to use, i.e. the flags passed opdesc - the opdescriptor to use, OR the empty string
None [OUTPUTS]
Returns:
TRUE if succeeded, FALSE if fails

Errors: via wxMessageBox

See also:
-

Definition at line 151 of file drawctl.cpp.

00152                                : Correct*/ long style, const wxValidator& validator,
00153                      wxCamDrawControlStyle cacstyle,
00154                      wxString opdesc)
00155 {
00156     if (!wxControl::Create(parent, id, pos, size, style, validator))
00157         return FALSE;
00158 
00159     m_CamDrawControlStyle = cacstyle;
00160     m_OpDesc = opdesc;
00161     return TRUE;
00162 }

virtual void wxCamDrawControl::Freeze  )  [inline, virtual]
 

Definition at line 197 of file drawctl.h.

00197 {m_Frozen++;}

wxString wxCamDrawControl::GetOpDesc  )  [inline]
 

Definition at line 203 of file drawctl.h.

00203 {return m_OpDesc;}

virtual wxCamDrawControlStyle wxCamDrawControl::GetStyle  )  [inline, virtual]
 

Definition at line 201 of file drawctl.h.

00201 { return m_CamDrawControlStyle;}

void wxCamDrawControl::Init void   )  [inline]
 

Definition at line 172 of file drawctl.h.

00172                 {
00173                     m_CamDrawControlStyle=wxCDCS_DEFAULT;
00174                     m_OpDesc=wxString(_T(""));
00175                     m_Frozen=0;
00176                 }

void wxCamDrawControl::Invoke  )  [protected]
 

Does the work of the button being pressed.

Author:
Alex_Bligh <alex@alex.org.uk>
Date:
30/12/2005
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-
We send ourselves our COMMAND event (which DialogManager picks up) and invoke the op descriptor attached ourselves.

Definition at line 301 of file drawctl.cpp.

00302 {
00303     if (!IsEnabled())
00304     {
00305         return; // Don't even send messages if the control is greyed
00306     }
00307 
00308     wxCommandEvent ButtonEvent(wxEVT_COMMAND_BUTTON_CLICKED, GetId());
00309     ProcessEvent(ButtonEvent);
00310     // If it's attached to an OpDescriptor, we invoke it.
00311 //  ControlList::Get()->Invoke(this);
00312 }

void wxCamDrawControl::OnInvoke wxCamDrawControlEvent event  ) 
 

Handles deferred invoke events.

Author:
Alex_Bligh <alex@alex.org.uk>
Date:
30/12/2005
Parameters:
event - the event [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-
We do not process these immediately because otherwise the application does not have a chance to redraw between undo etc. Instead we send a deferred message back to ourselves

Definition at line 277 of file drawctl.cpp.

00278 {
00279     Invoke();
00280 }

void wxCamDrawControl::OnMouseEvent wxMouseEvent &  event  ) 
 

Handles mouse events.

Author:
Alex_Bligh <alex@alex.org.uk>
Date:
30/12/2005
Parameters:
event - the event [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 236 of file drawctl.cpp.

00237 {
00238     // Irritatingly wxMouseEvent does not propagate to the parent, but we expect it to.
00239     // so we have to fake it (sigh)
00240     // event.Skip(); // pretend we did not handle it, so it falls through to the dialog
00241 
00242     if ( !(GetExtraStyle() & wxWS_EX_BLOCK_EVENTS) )
00243     {
00244         wxWindow * pParent = GetParent();
00245         if (pParent && !pParent->IsBeingDeleted())
00246         {
00247             wxEvtHandler *pHandler = pParent->GetEventHandler();
00248             if (pHandler && pHandler->IsKindOf(CLASSINFO(DialogEventHandler))) // Only propagate to our own dialogs
00249             {
00250                 pHandler->ProcessEvent(event);
00251             }
00252         }
00253     }
00254 }

void wxCamDrawControl::OnPaint wxPaintEvent &  event  ) 
 

Paints the control.

Author:
Alex_Bligh <alex@alex.org.uk>
Date:
30/12/2005
Parameters:
event - the event [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 181 of file drawctl.cpp.

00182 {
00183     if (!m_Frozen)
00184     {
00185         wxCamDialogEvent RedrawEvent(wxEVT_CAMDIALOG_REDRAW, GetId());
00186         wxWindow * pParent=GetParent();
00187         if (pParent)
00188             pParent->GetEventHandler()->ProcessEvent(RedrawEvent);  
00189     }
00190 }

void wxCamDrawControl::OnSize wxSizeEvent &  event  ) 
 

Handles resizing of a control.

Author:
Alex_Bligh <alex@alex.org.uk>
Date:
30/12/2005
Parameters:
event - the event [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-
This is passed to the containing window's event handler for information

Definition at line 210 of file drawctl.cpp.

00211 {
00212     wxWindow * pParent=GetParent();
00213     if (pParent)
00214         pParent->GetEventHandler()->ProcessEvent(event);    
00215 
00216     event.Skip();   // Pretend we didn't handle it
00217 }

virtual void wxCamDrawControl::SetStyle wxCamDrawControlStyle  style  )  [inline, virtual]
 

Definition at line 200 of file drawctl.h.

00200 { m_CamDrawControlStyle=style; }

virtual void wxCamDrawControl::Thaw  )  [inline, virtual]
 

Definition at line 198 of file drawctl.h.

00198 {if (m_Frozen) m_Frozen--;}


Member Data Documentation

wxCamDrawControlStyle wxCamDrawControl::m_CamDrawControlStyle [protected]
 

Definition at line 206 of file drawctl.h.

INT32 wxCamDrawControl::m_Frozen [protected]
 

Definition at line 210 of file drawctl.h.

wxString wxCamDrawControl::m_OpDesc [protected]
 

Definition at line 208 of file drawctl.h.


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