2005-03-16 11:18:31 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: statbox.h
|
|
|
|
// Purpose: wxStaticBox base header
|
2005-05-04 14:57:50 -04:00
|
|
|
// Author: Julian Smart
|
2005-03-16 11:18:31 -05:00
|
|
|
// Modified by:
|
|
|
|
// Created:
|
2005-05-04 14:57:50 -04:00
|
|
|
// Copyright: (c) Julian Smart
|
2005-03-16 11:18:31 -05:00
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-14 20:23:28 -04:00
|
|
|
#ifndef _WX_STATBOX_H_BASE_
|
|
|
|
#define _WX_STATBOX_H_BASE_
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2005-03-16 11:18:31 -05:00
|
|
|
#include "wx/defs.h"
|
|
|
|
|
2001-06-26 16:59:19 -04:00
|
|
|
#if wxUSE_STATBOX
|
|
|
|
|
|
|
|
#include "wx/control.h"
|
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
extern WXDLLIMPEXP_DATA_CORE(const char) wxStaticBoxNameStr[];
|
2001-06-26 16:59:19 -04:00
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxStaticBox: a grouping box with a label
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxStaticBoxBase : public wxControl
|
2001-06-26 16:59:19 -04:00
|
|
|
{
|
|
|
|
public:
|
2003-07-21 20:24:07 -04:00
|
|
|
wxStaticBoxBase() { }
|
|
|
|
|
2001-06-26 16:59:19 -04:00
|
|
|
// overriden base class virtuals
|
2004-03-04 12:03:55 -05:00
|
|
|
virtual bool AcceptsFocus() const { return false; }
|
2005-01-07 11:54:09 -05:00
|
|
|
virtual bool HasTransparentBackground() { return true; }
|
2003-07-21 20:24:07 -04:00
|
|
|
|
2005-03-07 18:37:15 -05:00
|
|
|
// implementation only: this is used by wxStaticBoxSizer to account for the
|
|
|
|
// need for extra space taken by the static box
|
|
|
|
//
|
|
|
|
// the top border is the margin at the top (where the title is),
|
|
|
|
// borderOther is the margin on all other sides
|
|
|
|
virtual void GetBordersForSizer(int *borderTop, int *borderOther) const
|
|
|
|
{
|
2005-04-03 16:22:21 -04:00
|
|
|
const int BORDER = 5; // FIXME: hardcoded value
|
2005-03-07 18:37:15 -05:00
|
|
|
|
|
|
|
*borderTop = GetLabel().empty() ? BORDER : GetCharHeight();
|
|
|
|
*borderOther = BORDER;
|
|
|
|
}
|
|
|
|
|
2007-12-20 01:08:00 -05:00
|
|
|
protected:
|
2007-11-13 07:10:34 -05:00
|
|
|
// choose the default border for this window
|
|
|
|
virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
|
|
|
|
|
2009-02-08 06:45:59 -05:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxStaticBoxBase);
|
2001-06-26 16:59:19 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#if defined(__WXUNIVERSAL__)
|
2005-01-07 11:54:09 -05:00
|
|
|
#include "wx/univ/statbox.h"
|
2001-06-26 16:59:19 -04:00
|
|
|
#elif defined(__WXMSW__)
|
2005-01-07 11:54:09 -05:00
|
|
|
#include "wx/msw/statbox.h"
|
1998-07-10 10:15:17 -04:00
|
|
|
#elif defined(__WXMOTIF__)
|
2005-01-07 11:54:09 -05:00
|
|
|
#include "wx/motif/statbox.h"
|
2006-01-22 22:27:34 -05:00
|
|
|
#elif defined(__WXGTK20__)
|
2005-01-07 11:54:09 -05:00
|
|
|
#include "wx/gtk/statbox.h"
|
2006-01-22 22:27:34 -05:00
|
|
|
#elif defined(__WXGTK__)
|
|
|
|
#include "wx/gtk1/statbox.h"
|
1998-08-14 20:23:28 -04:00
|
|
|
#elif defined(__WXMAC__)
|
2008-06-11 15:17:41 -04:00
|
|
|
#include "wx/osx/statbox.h"
|
2003-03-22 01:18:36 -05:00
|
|
|
#elif defined(__WXCOCOA__)
|
2005-01-07 11:54:09 -05:00
|
|
|
#include "wx/cocoa/statbox.h"
|
1999-07-27 23:38:12 -04:00
|
|
|
#elif defined(__WXPM__)
|
2005-01-07 11:54:09 -05:00
|
|
|
#include "wx/os2/statbox.h"
|
1998-05-20 10:01:55 -04:00
|
|
|
#endif
|
|
|
|
|
2001-06-26 16:59:19 -04:00
|
|
|
#endif // wxUSE_STATBOX
|
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
#endif
|
1998-08-14 20:23:28 -04:00
|
|
|
// _WX_STATBOX_H_BASE_
|