1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2000-02-05 01:57:38 +00:00
|
|
|
// Name: wx/generic/statusbr.h
|
|
|
|
// Purpose: wxStatusBarGeneric class
|
1998-05-20 14:01:55 +00:00
|
|
|
// Author: Julian Smart
|
2000-02-05 01:57:38 +00:00
|
|
|
// Modified by: VZ at 05.02.00 to derive from wxStatusBarBase
|
1998-05-20 14:01:55 +00:00
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
2003-03-17 10:34:04 +00:00
|
|
|
// Copyright: (c) Julian Smart
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2000-02-05 01:57:38 +00:00
|
|
|
#ifndef _WX_GENERIC_STATUSBR_H_
|
|
|
|
#define _WX_GENERIC_STATUSBR_H_
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2006-09-13 19:10:31 +00:00
|
|
|
#include "wx/defs.h"
|
|
|
|
|
|
|
|
#if wxUSE_STATUSBAR
|
|
|
|
|
1999-01-04 13:52:06 +00:00
|
|
|
#include "wx/pen.h"
|
2003-07-19 22:01:14 +00:00
|
|
|
#include "wx/arrstr.h"
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2008-12-31 12:28:05 +00:00
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxStatusBarGeneric
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2008-03-26 15:06:00 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxStatusBarGeneric : public wxStatusBarBase
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
|
|
|
public:
|
2006-06-09 09:51:39 +00:00
|
|
|
wxStatusBarGeneric() { Init(); }
|
|
|
|
wxStatusBarGeneric(wxWindow *parent,
|
2006-09-06 17:36:22 +00:00
|
|
|
wxWindowID winid = wxID_ANY,
|
2009-04-25 12:59:09 +00:00
|
|
|
long style = wxSTB_DEFAULT_STYLE,
|
2006-09-06 17:36:22 +00:00
|
|
|
const wxString& name = wxStatusBarNameStr)
|
2006-06-09 09:51:39 +00:00
|
|
|
{
|
|
|
|
Init();
|
2002-09-04 13:16:46 +00:00
|
|
|
|
2006-06-09 09:51:39 +00:00
|
|
|
Create(parent, winid, style, name);
|
|
|
|
}
|
2000-02-05 01:57:38 +00:00
|
|
|
|
2006-06-09 09:51:39 +00:00
|
|
|
virtual ~wxStatusBarGeneric();
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2006-09-06 17:36:22 +00:00
|
|
|
bool Create(wxWindow *parent, wxWindowID winid = wxID_ANY,
|
2009-04-25 12:59:09 +00:00
|
|
|
long style = wxSTB_DEFAULT_STYLE,
|
2006-09-06 17:36:22 +00:00
|
|
|
const wxString& name = wxStatusBarNameStr);
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2009-08-06 00:01:43 +00:00
|
|
|
// implement base class methods
|
2006-06-09 09:51:39 +00:00
|
|
|
virtual void SetStatusWidths(int n, const int widths_field[]);
|
|
|
|
virtual bool GetFieldRect(int i, wxRect& rect) const;
|
|
|
|
virtual void SetMinHeight(int height);
|
2000-02-05 01:57:38 +00:00
|
|
|
|
2006-06-09 09:51:39 +00:00
|
|
|
virtual int GetBorderX() const { return m_borderX; }
|
|
|
|
virtual int GetBorderY() const { return m_borderY; }
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2009-02-08 13:30:40 +00:00
|
|
|
|
2009-04-21 11:10:44 +00:00
|
|
|
// implementation only (not part of wxStatusBar public API):
|
|
|
|
|
|
|
|
int GetFieldFromPoint(const wxPoint& point) const;
|
|
|
|
|
2009-08-06 00:01:43 +00:00
|
|
|
protected:
|
|
|
|
virtual void DoUpdateStatusText(int number);
|
2000-02-05 01:57:38 +00:00
|
|
|
|
2009-08-06 00:01:43 +00:00
|
|
|
// event handlers
|
2006-06-09 09:51:39 +00:00
|
|
|
void OnPaint(wxPaintEvent& event);
|
2009-02-08 19:17:07 +00:00
|
|
|
void OnSize(wxSizeEvent& event);
|
2004-06-17 16:22:36 +00:00
|
|
|
|
2006-06-09 09:51:39 +00:00
|
|
|
void OnLeftDown(wxMouseEvent& event);
|
|
|
|
void OnRightDown(wxMouseEvent& event);
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2006-06-09 09:51:39 +00:00
|
|
|
// Responds to colour changes
|
|
|
|
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2009-02-08 19:17:07 +00:00
|
|
|
protected:
|
|
|
|
|
|
|
|
virtual void DrawFieldText(wxDC& dc, const wxRect& rc, int i, int textHeight);
|
|
|
|
virtual void DrawField(wxDC& dc, int i, int textHeight);
|
|
|
|
|
|
|
|
void SetBorderX(int x);
|
|
|
|
void SetBorderY(int y);
|
|
|
|
|
|
|
|
virtual void InitColours();
|
|
|
|
|
2007-11-18 23:31:48 +00:00
|
|
|
// true if the status bar shows the size grip: for this it must have
|
2009-04-25 12:59:09 +00:00
|
|
|
// wxSTB_SIZEGRIP style and the window it is attached to must be resizeable
|
2007-11-18 23:31:48 +00:00
|
|
|
// and not maximized
|
|
|
|
bool ShowsSizeGrip() const;
|
|
|
|
|
2009-02-08 13:30:40 +00:00
|
|
|
// returns the position and the size of the size grip
|
|
|
|
wxRect GetSizeGripRect() const;
|
|
|
|
|
2006-06-09 09:51:39 +00:00
|
|
|
// common part of all ctors
|
|
|
|
void Init();
|
2002-09-04 13:16:46 +00:00
|
|
|
|
2009-02-08 19:17:07 +00:00
|
|
|
// the last known height of the client rect
|
|
|
|
int m_lastClientHeight;
|
2008-12-31 12:28:05 +00:00
|
|
|
|
|
|
|
// the absolute widths of the status bar panes in pixels
|
2006-06-09 09:51:39 +00:00
|
|
|
wxArrayInt m_widthsAbs;
|
2002-09-04 13:16:46 +00:00
|
|
|
|
2006-06-09 09:51:39 +00:00
|
|
|
int m_borderX;
|
|
|
|
int m_borderY;
|
2009-04-21 11:10:44 +00:00
|
|
|
|
2006-06-09 09:51:39 +00:00
|
|
|
wxPen m_mediumShadowPen;
|
|
|
|
wxPen m_hilightPen;
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2006-06-09 09:51:39 +00:00
|
|
|
virtual wxSize DoGetBestSize() const;
|
2004-04-07 21:48:24 +00:00
|
|
|
|
2000-02-05 01:57:38 +00:00
|
|
|
private:
|
2006-06-09 09:51:39 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxStatusBarGeneric)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
2006-09-13 19:10:31 +00:00
|
|
|
#endif // wxUSE_STATUSBAR
|
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
#endif
|
2000-02-05 01:57:38 +00:00
|
|
|
// _WX_GENERIC_STATUSBR_H_
|