]>
git.saurik.com Git - wxWidgets.git/blob - src/common/ctrlcmn.cpp
   1 ///////////////////////////////////////////////////////////////////////////// 
   3 // Purpose:     wxControl common interface 
   4 // Author:      Vadim Zeitlin 
   8 // Copyright:   (c) wxWindows team 
   9 // Licence:     wxWindows license 
  10 ///////////////////////////////////////////////////////////////////////////// 
  12 // ============================================================================ 
  14 // ============================================================================ 
  16 // ---------------------------------------------------------------------------- 
  18 // ---------------------------------------------------------------------------- 
  21     #pragma implementation "controlbase.h" 
  24 // For compilers that support precompilation, includes "wx.h". 
  25 #include "wx/wxprec.h" 
  32     #include "wx/control.h" 
  36 // ============================================================================ 
  38 // ============================================================================ 
  40 bool wxControlBase::CreateControl(wxWindowBase 
*parent
, 
  46                                   const wxValidator
& validator
, 
  50     // even if it's possible to create controls without parents in some port, 
  51     // it should surely be discouraged because it doesn't work at all under 
  53     wxCHECK_MSG( parent
, FALSE
, wxT("all controls must have parents") ); 
  55     if ( !CreateBase(parent
, id
, pos
, size
, style
, validator
, name
) ) 
  58     parent
->AddChild(this); 
  63 // inherit colour and font settings from the parent window 
  64 void wxControlBase::InheritAttributes() 
  66     SetBackgroundColour(GetParent()->GetBackgroundColour()); 
  67     SetForegroundColour(GetParent()->GetForegroundColour()); 
  68     SetFont(GetParent()->GetFont()); 
  71 void wxControlBase::Command(wxCommandEvent
& event
) 
  73     (void)ProcessEvent(event
);