2001-06-26 16:59:19 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/statline.h
|
|
|
|
// Purpose: wxStaticLine class interface
|
|
|
|
// Author: Vadim Zeitlin
|
|
|
|
// Created: 28.06.99
|
|
|
|
// Version: $Id$
|
|
|
|
// Copyright: (c) 1999 Vadim Zeitlin
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1999-05-05 17:42:48 -04:00
|
|
|
#ifndef _WX_STATLINE_H_BASE_
|
|
|
|
#define _WX_STATLINE_H_BASE_
|
|
|
|
|
1999-06-28 17:39:49 -04: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
|
|
|
|
WXDLLEXPORT_DATA(extern const wxChar*) wxStaticTextNameStr;
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// 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 16:59:19 -04:00
|
|
|
// overriden base class virtuals
|
|
|
|
virtual bool AcceptsFocus() const { return FALSE; }
|
|
|
|
|
1999-06-28 17:39:49 -04:00
|
|
|
protected:
|
|
|
|
// set the right size for the right dimension
|
2001-06-26 16:59:19 -04:00
|
|
|
wxSize AdjustSize(const wxSize& size) const
|
1999-06-28 17:39:49 -04:00
|
|
|
{
|
|
|
|
wxSize sizeReal(size);
|
|
|
|
if ( IsVertical() )
|
|
|
|
{
|
|
|
|
if ( size.x == -1 )
|
|
|
|
sizeReal.x = GetDefaultSize();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ( size.y == -1 )
|
|
|
|
sizeReal.y = GetDefaultSize();
|
|
|
|
}
|
|
|
|
|
|
|
|
return sizeReal;
|
|
|
|
}
|
2001-06-26 16:59:19 -04:00
|
|
|
|
|
|
|
virtual wxSize DoGetBestSize() const
|
|
|
|
{
|
|
|
|
return AdjustSize(wxDefaultSize);
|
|
|
|
}
|
2003-07-21 20:24:07 -04:00
|
|
|
|
|
|
|
DECLARE_NO_COPY_CLASS(wxStaticLineBase)
|
1999-06-28 17:39:49 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// now include the actual class declaration
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2001-06-26 16:59:19 -04:00
|
|
|
#if defined(__WXUNIVERSAL__)
|
|
|
|
#include "wx/univ/statline.h"
|
|
|
|
#elif defined(__WXMSW__)
|
1999-06-28 17:39:49 -04:00
|
|
|
#include "wx/msw/statline.h"
|
1999-05-05 17:42:48 -04:00
|
|
|
#elif defined(__WXGTK__)
|
1999-06-28 17:39:49 -04:00
|
|
|
#include "wx/gtk/statline.h"
|
1999-07-27 23:38:12 -04:00
|
|
|
#elif defined(__WXPM__)
|
|
|
|
#include "wx/os2/statline.h"
|
1999-11-10 06:32:00 -05:00
|
|
|
#elif defined(__WXMAC__)
|
|
|
|
#include "wx/mac/statline.h"
|
2003-03-22 01:18:36 -05:00
|
|
|
#elif defined(__WXCOCOA__)
|
|
|
|
#include "wx/cocoa/statline.h"
|
1999-06-28 17:39:49 -04:00
|
|
|
#else // use generic implementation for all other platforms
|
|
|
|
#include "wx/generic/statline.h"
|
1999-05-05 17:42:48 -04:00
|
|
|
#endif
|
|
|
|
|
1999-06-28 17:39:49 -04:00
|
|
|
#endif // wxUSE_STATLINE
|
|
|
|
|
1999-05-05 17:42:48 -04:00
|
|
|
#endif
|
|
|
|
// _WX_STATLINE_H_BASE_
|