2001-06-26 20:59:19 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/statline.h
|
|
|
|
// Purpose: wxStaticLine class interface
|
|
|
|
// Author: Vadim Zeitlin
|
|
|
|
// Created: 28.06.99
|
|
|
|
// Version: $Id$
|
|
|
|
// Copyright: (c) 1999 Vadim Zeitlin
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
2001-06-26 20:59:19 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1999-05-05 21:42:48 +00:00
|
|
|
#ifndef _WX_STATLINE_H_BASE_
|
|
|
|
#define _WX_STATLINE_H_BASE_
|
|
|
|
|
1999-06-28 21:39:49 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// headers
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// this defines wxUSE_STATLINE
|
|
|
|
#include "wx/defs.h"
|
|
|
|
|
|
|
|
#if wxUSE_STATLINE
|
|
|
|
|
|
|
|
// the base class declaration
|
|
|
|
#include "wx/control.h"
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// global variables
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// the default name for objects of class wxStaticLine
|
2005-01-21 18:48:22 +00:00
|
|
|
extern WXDLLEXPORT_DATA(const wxChar*) wxStaticTextNameStr;
|
1999-06-28 21:39:49 +00:00
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxStaticLine - a line in a dialog
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxStaticLineBase : public wxControl
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// constructor
|
|
|
|
wxStaticLineBase() { }
|
|
|
|
|
|
|
|
// is the line vertical?
|
|
|
|
bool IsVertical() const { return (GetWindowStyle() & wxLI_VERTICAL) != 0; }
|
|
|
|
|
|
|
|
// get the default size for the "lesser" dimension of the static line
|
|
|
|
static int GetDefaultSize() { return 2; }
|
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
// overriden base class virtuals
|
2004-03-04 17:03:55 +00:00
|
|
|
virtual bool AcceptsFocus() const { return false; }
|
2001-06-26 20:59:19 +00:00
|
|
|
|
1999-06-28 21:39:49 +00:00
|
|
|
protected:
|
|
|
|
// set the right size for the right dimension
|
2001-06-26 20:59:19 +00:00
|
|
|
wxSize AdjustSize(const wxSize& size) const
|
1999-06-28 21:39:49 +00:00
|
|
|
{
|
|
|
|
wxSize sizeReal(size);
|
|
|
|
if ( IsVertical() )
|
|
|
|
{
|
2004-09-22 14:38:52 +00:00
|
|
|
if ( size.x == wxDefaultCoord )
|
1999-06-28 21:39:49 +00:00
|
|
|
sizeReal.x = GetDefaultSize();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-09-22 14:38:52 +00:00
|
|
|
if ( size.y == wxDefaultCoord )
|
1999-06-28 21:39:49 +00:00
|
|
|
sizeReal.y = GetDefaultSize();
|
|
|
|
}
|
|
|
|
|
|
|
|
return sizeReal;
|
|
|
|
}
|
2001-06-26 20:59:19 +00:00
|
|
|
|
|
|
|
virtual wxSize DoGetBestSize() const
|
|
|
|
{
|
|
|
|
return AdjustSize(wxDefaultSize);
|
|
|
|
}
|
2003-07-22 00:24:07 +00:00
|
|
|
|
|
|
|
DECLARE_NO_COPY_CLASS(wxStaticLineBase)
|
1999-06-28 21:39:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// now include the actual class declaration
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
#if defined(__WXUNIVERSAL__)
|
|
|
|
#include "wx/univ/statline.h"
|
|
|
|
#elif defined(__WXMSW__)
|
1999-06-28 21:39:49 +00:00
|
|
|
#include "wx/msw/statline.h"
|
1999-05-05 21:42:48 +00:00
|
|
|
#elif defined(__WXGTK__)
|
1999-06-28 21:39:49 +00:00
|
|
|
#include "wx/gtk/statline.h"
|
1999-07-28 03:38:12 +00:00
|
|
|
#elif defined(__WXPM__)
|
|
|
|
#include "wx/os2/statline.h"
|
1999-11-10 11:32:00 +00:00
|
|
|
#elif defined(__WXMAC__)
|
|
|
|
#include "wx/mac/statline.h"
|
2003-03-22 06:18:36 +00:00
|
|
|
#elif defined(__WXCOCOA__)
|
|
|
|
#include "wx/cocoa/statline.h"
|
1999-06-28 21:39:49 +00:00
|
|
|
#else // use generic implementation for all other platforms
|
|
|
|
#include "wx/generic/statline.h"
|
1999-05-05 21:42:48 +00:00
|
|
|
#endif
|
|
|
|
|
1999-06-28 21:39:49 +00:00
|
|
|
#endif // wxUSE_STATLINE
|
|
|
|
|
1999-05-05 21:42:48 +00:00
|
|
|
#endif
|
|
|
|
// _WX_STATLINE_H_BASE_
|