1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2000-02-04 20:57:38 -05:00
|
|
|
// Name: wx/generic/statusbr.h
|
|
|
|
// Purpose: wxStatusBarGeneric class
|
1998-05-20 10:01:55 -04:00
|
|
|
// Author: Julian Smart
|
2000-02-04 20:57:38 -05:00
|
|
|
// Modified by: VZ at 05.02.00 to derive from wxStatusBarBase
|
1998-05-20 10:01:55 -04:00
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
2003-03-17 05:34:04 -05:00
|
|
|
// Copyright: (c) Julian Smart
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2000-02-04 20:57:38 -05:00
|
|
|
#ifndef _WX_GENERIC_STATUSBR_H_
|
|
|
|
#define _WX_GENERIC_STATUSBR_H_
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2006-09-13 15:10:31 -04:00
|
|
|
#include "wx/defs.h"
|
|
|
|
|
|
|
|
#if wxUSE_STATUSBAR
|
|
|
|
|
1999-01-04 08:52:06 -05:00
|
|
|
#include "wx/pen.h"
|
2003-07-19 18:01:14 -04:00
|
|
|
#include "wx/arrstr.h"
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2008-12-31 07:28:05 -05:00
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxStatusBarGeneric
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxStatusBarGeneric : public wxStatusBarBase
|
1998-05-20 10:01:55 -04:00
|
|
|
{
|
|
|
|
public:
|
2006-06-09 05:51:39 -04:00
|
|
|
wxStatusBarGeneric() { Init(); }
|
|
|
|
wxStatusBarGeneric(wxWindow *parent,
|
2006-09-06 13:36:22 -04:00
|
|
|
wxWindowID winid = wxID_ANY,
|
|
|
|
long style = wxST_SIZEGRIP,
|
|
|
|
const wxString& name = wxStatusBarNameStr)
|
2006-06-09 05:51:39 -04:00
|
|
|
{
|
|
|
|
Init();
|
2002-09-04 09:16:46 -04:00
|
|
|
|
2006-06-09 05:51:39 -04:00
|
|
|
Create(parent, winid, style, name);
|
|
|
|
}
|
2000-02-04 20:57:38 -05:00
|
|
|
|
2006-06-09 05:51:39 -04:00
|
|
|
virtual ~wxStatusBarGeneric();
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2006-09-06 13:36:22 -04:00
|
|
|
bool Create(wxWindow *parent, wxWindowID winid = wxID_ANY,
|
|
|
|
long style = wxST_SIZEGRIP,
|
|
|
|
const wxString& name = wxStatusBarNameStr);
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2006-06-09 05:51:39 -04:00
|
|
|
// Create status line
|
|
|
|
virtual void SetFieldsCount(int number = 1,
|
|
|
|
const int *widths = (const int *) NULL);
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2006-06-09 05:51:39 -04:00
|
|
|
// Set status line text
|
|
|
|
virtual void SetStatusText(const wxString& text, int number = 0);
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2006-06-09 05:51:39 -04:00
|
|
|
// Set status line widths
|
|
|
|
virtual void SetStatusWidths(int n, const int widths_field[]);
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2006-06-09 05:51:39 -04:00
|
|
|
// Get the position and size of the field's internal bounding rectangle
|
|
|
|
virtual bool GetFieldRect(int i, wxRect& rect) const;
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2006-06-09 05:51:39 -04:00
|
|
|
// sets the minimal vertical size of the status bar
|
|
|
|
virtual void SetMinHeight(int height);
|
2000-02-04 20:57:38 -05:00
|
|
|
|
2006-06-09 05:51:39 -04:00
|
|
|
virtual int GetBorderX() const { return m_borderX; }
|
|
|
|
virtual int GetBorderY() const { return m_borderY; }
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2009-02-08 08:30:40 -05:00
|
|
|
|
2009-02-08 14:17:07 -05:00
|
|
|
protected: // event handlers
|
2000-02-04 20:57:38 -05:00
|
|
|
|
2006-06-09 05:51:39 -04:00
|
|
|
void OnPaint(wxPaintEvent& event);
|
2009-02-08 14:17:07 -05:00
|
|
|
void OnSize(wxSizeEvent& event);
|
2004-06-17 12:22:36 -04:00
|
|
|
|
2006-06-09 05:51:39 -04:00
|
|
|
void OnLeftDown(wxMouseEvent& event);
|
|
|
|
void OnRightDown(wxMouseEvent& event);
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2006-06-09 05:51:39 -04:00
|
|
|
// Responds to colour changes
|
|
|
|
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2009-02-08 14:17:07 -05: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 18:31:48 -05:00
|
|
|
// true if the status bar shows the size grip: for this it must have
|
|
|
|
// wxST_SIZEGRIP style and the window it is attached to must be resizeable
|
|
|
|
// and not maximized
|
|
|
|
bool ShowsSizeGrip() const;
|
|
|
|
|
2009-02-08 08:30:40 -05:00
|
|
|
// returns the position and the size of the size grip
|
|
|
|
wxRect GetSizeGripRect() const;
|
|
|
|
|
2006-06-09 05:51:39 -04:00
|
|
|
// common part of all ctors
|
|
|
|
void Init();
|
2002-09-04 09:16:46 -04:00
|
|
|
|
2009-02-08 14:17:07 -05:00
|
|
|
// the last known height of the client rect
|
|
|
|
int m_lastClientHeight;
|
2008-12-31 07:28:05 -05:00
|
|
|
|
|
|
|
// the absolute widths of the status bar panes in pixels
|
2006-06-09 05:51:39 -04:00
|
|
|
wxArrayInt m_widthsAbs;
|
2002-09-04 09:16:46 -04:00
|
|
|
|
2006-06-09 05:51:39 -04:00
|
|
|
int m_borderX;
|
|
|
|
int m_borderY;
|
|
|
|
wxPen m_mediumShadowPen;
|
|
|
|
wxPen m_hilightPen;
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2006-06-09 05:51:39 -04:00
|
|
|
virtual wxSize DoGetBestSize() const;
|
2004-04-07 17:48:24 -04:00
|
|
|
|
2000-02-04 20:57:38 -05:00
|
|
|
private:
|
2006-06-09 05:51:39 -04:00
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxStatusBarGeneric)
|
1998-05-20 10:01:55 -04:00
|
|
|
};
|
|
|
|
|
2006-09-13 15:10:31 -04:00
|
|
|
#endif // wxUSE_STATUSBAR
|
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
#endif
|
2000-02-04 20:57:38 -05:00
|
|
|
// _WX_GENERIC_STATUSBR_H_
|