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
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// 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_
|
|
|
|
|
2003-08-09 08:38:21 -04:00
|
|
|
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
2001-10-14 17:38:58 -04:00
|
|
|
#pragma interface "univstatusbr.h"
|
|
|
|
#endif
|
|
|
|
|
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
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxStatusBar: a window near the bottom of the frame used for status info
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxStatusBarUniv : public wxStatusBarBase,
|
|
|
|
public wxInputConsumer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxStatusBarUniv() { Init(); }
|
|
|
|
|
|
|
|
wxStatusBarUniv(wxWindow *parent,
|
2004-08-10 09:08:43 -04:00
|
|
|
wxWindowID id = wxID_ANY,
|
2001-10-14 17:38:58 -04:00
|
|
|
long style = 0,
|
|
|
|
const wxString& name = wxPanelNameStr)
|
|
|
|
{
|
|
|
|
Init();
|
|
|
|
|
|
|
|
(void)Create(parent, id, style, name);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Create(wxWindow *parent,
|
2004-08-10 09:08:43 -04:00
|
|
|
wxWindowID id = wxID_ANY,
|
2001-10-14 17:38:58 -04:00
|
|
|
long style = 0,
|
|
|
|
const wxString& name = wxPanelNameStr);
|
|
|
|
|
|
|
|
// set field count/widths
|
|
|
|
virtual void SetFieldsCount(int number = 1, const int *widths = NULL);
|
|
|
|
virtual void SetStatusWidths(int n, const int widths[]);
|
|
|
|
|
|
|
|
// get/set the text of the given field
|
|
|
|
virtual void SetStatusText(const wxString& text, int number = 0);
|
|
|
|
virtual wxString GetStatusText(int number = 0) const;
|
|
|
|
|
|
|
|
// Get the position and size of the field's internal bounding rectangle
|
|
|
|
virtual bool GetFieldRect(int i, wxRect& rect) const;
|
|
|
|
|
|
|
|
// sets the minimal vertical size of the status bar
|
|
|
|
virtual void SetMinHeight(int height);
|
|
|
|
|
|
|
|
// get the dimensions of the horizontal and vertical borders
|
|
|
|
virtual int GetBorderX() const;
|
|
|
|
virtual int GetBorderY() const;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
// recalculate the field widths
|
|
|
|
void OnSize(wxSizeEvent& event);
|
|
|
|
|
|
|
|
// draw the statusbar
|
|
|
|
virtual void DoDraw(wxControlRenderer *renderer);
|
|
|
|
|
|
|
|
// wxInputConsumer pure virtual
|
|
|
|
virtual wxWindow *GetInputWindow() const
|
|
|
|
{ return wxConstCast(this, wxStatusBar); }
|
|
|
|
|
|
|
|
// tell them about our preferred height
|
|
|
|
virtual wxSize DoGetBestSize() const;
|
|
|
|
|
|
|
|
// override DoSetSize() to prevent the status bar height from changing
|
|
|
|
virtual void DoSetSize(int x, int y,
|
|
|
|
int width, int height,
|
|
|
|
int sizeFlags = wxSIZE_AUTO);
|
|
|
|
|
|
|
|
// 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
|
|
|
// refresh the given field
|
|
|
|
void RefreshField(int i);
|
|
|
|
|
|
|
|
// common part of all ctors
|
|
|
|
void Init();
|
|
|
|
|
|
|
|
private:
|
|
|
|
// the status fields strings
|
|
|
|
wxArrayString m_statusText;
|
|
|
|
|
|
|
|
// the absolute status fields widths
|
|
|
|
wxArrayInt m_widthsAbs;
|
|
|
|
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxStatusBarUniv)
|
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
WX_DECLARE_INPUT_CONSUMER()
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _WX_UNIV_STATUSBR_H_
|
|
|
|
|