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
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
2001-06-26 16:59:19 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
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
|
2006-01-16 09:59:55 -05:00
|
|
|
extern WXDLLEXPORT_DATA(const wxChar) wxStaticTextNameStr[];
|
1999-06-28 17:39:49 -04: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 16:59:19 -04:00
|
|
|
// overriden base class virtuals
|
2004-03-04 12:03:55 -05:00
|
|
|
virtual bool AcceptsFocus() const { return false; }
|
2001-06-26 16:59:19 -04:00
|
|
|
|
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() )
|
|
|
|
{
|
2004-09-22 10:38:52 -04:00
|
|
|
if ( size.x == wxDefaultCoord )
|
1999-06-28 17:39:49 -04:00
|
|
|
sizeReal.x = GetDefaultSize();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-09-22 10:38:52 -04:00
|
|
|
if ( size.y == wxDefaultCoord )
|
1999-06-28 17:39:49 -04:00
|
|
|
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"
|
2006-01-22 22:27:34 -05:00
|
|
|
#elif defined(__WXGTK20__)
|
1999-06-28 17:39:49 -04:00
|
|
|
#include "wx/gtk/statline.h"
|
2006-01-22 22:27:34 -05:00
|
|
|
#elif defined(__WXGTK__)
|
|
|
|
#include "wx/gtk1/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_
|