2001-10-14 17:38:58 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/univ/statusbr.h
|
|
|
|
// Purpose: wxStatusBarUniv: wxStatusBar for wxUniversal declaration
|
|
|
|
// Author: Vadim Zeitlin
|
|
|
|
// Modified by:
|
|
|
|
// Created: 14.10.01
|
|
|
|
// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
2001-10-14 17:38:58 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_UNIV_STATUSBR_H_
|
|
|
|
#define _WX_UNIV_STATUSBR_H_
|
|
|
|
|
2001-10-15 18:45:37 -04:00
|
|
|
#include "wx/univ/inpcons.h"
|
2003-07-21 06:01:56 -04:00
|
|
|
#include "wx/arrstr.h"
|
2001-10-15 18:45:37 -04:00
|
|
|
|
2001-10-14 17:38:58 -04:00
|
|
|
// ----------------------------------------------------------------------------
|
2008-12-31 07:28:05 -05:00
|
|
|
// wxStatusBarUniv: a window near the bottom of the frame used for status info
|
2001-10-14 17:38:58 -04:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2010-11-22 07:51:05 -05:00
|
|
|
class WXDLLIMPEXP_CORE wxStatusBarUniv : public wxStatusBarBase
|
2001-10-14 17:38:58 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxStatusBarUniv() { Init(); }
|
|
|
|
|
|
|
|
wxStatusBarUniv(wxWindow *parent,
|
2004-08-10 09:08:43 -04:00
|
|
|
wxWindowID id = wxID_ANY,
|
2009-04-25 08:59:09 -04:00
|
|
|
long style = wxSTB_DEFAULT_STYLE,
|
2019-10-22 06:34:29 -04:00
|
|
|
const wxString& name = wxASCII_STR(wxPanelNameStr))
|
2001-10-14 17:38:58 -04:00
|
|
|
{
|
|
|
|
Init();
|
|
|
|
|
|
|
|
(void)Create(parent, id, style, name);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Create(wxWindow *parent,
|
2004-08-10 09:08:43 -04:00
|
|
|
wxWindowID id = wxID_ANY,
|
2009-04-25 08:59:09 -04:00
|
|
|
long style = wxSTB_DEFAULT_STYLE,
|
2019-10-22 06:34:29 -04:00
|
|
|
const wxString& name = wxASCII_STR(wxPanelNameStr));
|
2001-10-14 17:38:58 -04:00
|
|
|
|
2009-08-05 20:01:43 -04:00
|
|
|
// implement base class methods
|
2014-03-29 20:02:23 -04:00
|
|
|
virtual void SetFieldsCount(int number = 1, const int *widths = NULL) wxOVERRIDE;
|
|
|
|
virtual void SetStatusWidths(int n, const int widths[]) wxOVERRIDE;
|
2001-10-14 17:38:58 -04:00
|
|
|
|
2014-03-29 20:02:23 -04:00
|
|
|
virtual bool GetFieldRect(int i, wxRect& rect) const wxOVERRIDE;
|
|
|
|
virtual void SetMinHeight(int height) wxOVERRIDE;
|
2001-10-14 17:38:58 -04:00
|
|
|
|
2014-03-29 20:02:23 -04:00
|
|
|
virtual int GetBorderX() const wxOVERRIDE;
|
|
|
|
virtual int GetBorderY() const wxOVERRIDE;
|
2001-10-14 17:38:58 -04:00
|
|
|
|
2006-02-08 16:47:09 -05:00
|
|
|
// wxInputConsumer pure virtual
|
2014-03-29 20:02:23 -04:00
|
|
|
virtual wxWindow *GetInputWindow() const wxOVERRIDE
|
2008-11-01 22:39:52 -04:00
|
|
|
{ return const_cast<wxStatusBar*>(this); }
|
2006-02-08 16:47:09 -05:00
|
|
|
|
2001-10-14 17:38:58 -04:00
|
|
|
protected:
|
2014-03-29 20:02:23 -04:00
|
|
|
virtual void DoUpdateStatusText(int i) wxOVERRIDE;
|
2009-08-05 20:01:43 -04:00
|
|
|
|
2001-10-14 17:38:58 -04:00
|
|
|
// recalculate the field widths
|
|
|
|
void OnSize(wxSizeEvent& event);
|
|
|
|
|
|
|
|
// draw the statusbar
|
2014-03-29 20:02:23 -04:00
|
|
|
virtual void DoDraw(wxControlRenderer *renderer) wxOVERRIDE;
|
2001-10-14 17:38:58 -04:00
|
|
|
|
|
|
|
// tell them about our preferred height
|
2014-03-29 20:02:23 -04:00
|
|
|
virtual wxSize DoGetBestSize() const wxOVERRIDE;
|
2001-10-14 17:38:58 -04:00
|
|
|
|
|
|
|
// override DoSetSize() to prevent the status bar height from changing
|
|
|
|
virtual void DoSetSize(int x, int y,
|
|
|
|
int width, int height,
|
2014-03-29 20:02:23 -04:00
|
|
|
int sizeFlags = wxSIZE_AUTO) wxOVERRIDE;
|
2001-10-14 17:38:58 -04:00
|
|
|
|
|
|
|
// get the (fixed) status bar height
|
|
|
|
wxCoord GetHeight() const;
|
|
|
|
|
|
|
|
// get the rectangle containing all the fields and the border between them
|
|
|
|
//
|
|
|
|
// also updates m_widthsAbs if necessary
|
|
|
|
wxRect GetTotalFieldRect(wxCoord *borderBetweenFields);
|
|
|
|
|
2002-03-15 10:10:13 -05:00
|
|
|
// get the rect for this field without ani side effects (see code)
|
2002-03-15 07:41:13 -05:00
|
|
|
wxRect DoGetFieldRect(int n) const;
|
|
|
|
|
2001-10-14 17:38:58 -04:00
|
|
|
// common part of all ctors
|
|
|
|
void Init();
|
|
|
|
|
|
|
|
private:
|
2008-12-31 07:28:05 -05:00
|
|
|
// the current status fields strings
|
2009-02-08 19:33:19 -05:00
|
|
|
//wxArrayString m_statusText;
|
2001-10-14 17:38:58 -04:00
|
|
|
|
|
|
|
// the absolute status fields widths
|
|
|
|
wxArrayInt m_widthsAbs;
|
|
|
|
|
2015-04-23 07:49:01 -04:00
|
|
|
wxDECLARE_DYNAMIC_CLASS(wxStatusBarUniv);
|
|
|
|
wxDECLARE_EVENT_TABLE();
|
2001-10-14 17:38:58 -04:00
|
|
|
WX_DECLARE_INPUT_CONSUMER()
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _WX_UNIV_STATUSBR_H_
|
|
|
|
|