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
|
|
|
|
2003-08-09 12:38:21 +00:00
|
|
|
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
1998-05-20 14:01:55 +00:00
|
|
|
#pragma interface "statusbr.h"
|
|
|
|
#endif
|
|
|
|
|
1999-01-04 13:52:06 +00:00
|
|
|
#include "wx/pen.h"
|
|
|
|
#include "wx/font.h"
|
2000-02-05 18:18:28 +00:00
|
|
|
#include "wx/statusbr.h"
|
2003-07-19 22:01:14 +00:00
|
|
|
#include "wx/arrstr.h"
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-04-14 11:55:35 +00:00
|
|
|
WXDLLEXPORT_DATA(extern const wxChar*) wxPanelNameStr;
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2000-02-05 01:57:38 +00:00
|
|
|
class WXDLLEXPORT wxStatusBarGeneric : public wxStatusBarBase
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
|
|
|
public:
|
2002-09-04 13:16:46 +00:00
|
|
|
wxStatusBarGeneric() { Init(); }
|
2000-02-05 01:57:38 +00:00
|
|
|
wxStatusBarGeneric(wxWindow *parent,
|
2003-03-21 02:58:55 +00:00
|
|
|
wxWindowID winid,
|
2000-02-05 01:57:38 +00:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
2004-03-07 17:28:36 +00:00
|
|
|
long style = wxFULL_REPAINT_ON_RESIZE,
|
2000-02-05 01:57:38 +00:00
|
|
|
const wxString& name = wxPanelNameStr)
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
2002-09-04 13:16:46 +00:00
|
|
|
Init();
|
|
|
|
|
2003-03-21 02:58:55 +00:00
|
|
|
Create(parent, winid, pos, size, style, name);
|
1998-05-20 14:01:55 +00:00
|
|
|
}
|
2000-02-05 01:57:38 +00:00
|
|
|
wxStatusBarGeneric(wxWindow *parent,
|
2003-03-21 02:58:55 +00:00
|
|
|
wxWindowID winid,
|
2002-09-04 13:16:46 +00:00
|
|
|
long style,
|
|
|
|
const wxString& name = wxPanelNameStr)
|
2000-02-05 01:57:38 +00:00
|
|
|
{
|
2002-09-04 13:16:46 +00:00
|
|
|
Init();
|
|
|
|
|
2003-03-21 02:58:55 +00:00
|
|
|
Create(parent, winid, style, name);
|
2000-02-05 01:57:38 +00:00
|
|
|
}
|
|
|
|
|
2002-09-04 13:16:46 +00:00
|
|
|
virtual ~wxStatusBarGeneric();
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2003-03-21 02:58:55 +00:00
|
|
|
bool Create(wxWindow *parent, wxWindowID winid,
|
2000-02-05 01:57:38 +00:00
|
|
|
const wxPoint& WXUNUSED(pos) = wxDefaultPosition,
|
|
|
|
const wxSize& WXUNUSED(size) = wxDefaultSize,
|
2004-03-07 17:28:36 +00:00
|
|
|
long style = wxFULL_REPAINT_ON_RESIZE,
|
2000-02-05 01:57:38 +00:00
|
|
|
const wxString& name = wxPanelNameStr)
|
|
|
|
{
|
2003-03-21 02:58:55 +00:00
|
|
|
return Create(parent, winid, style, name);
|
2000-02-05 01:57:38 +00:00
|
|
|
}
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2003-03-21 02:58:55 +00:00
|
|
|
bool Create(wxWindow *parent, wxWindowID winid,
|
2001-05-02 19:48:15 +00:00
|
|
|
long style,
|
2000-02-05 01:57:38 +00:00
|
|
|
const wxString& name = wxPanelNameStr);
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
// Create status line
|
2000-02-05 01:57:38 +00:00
|
|
|
virtual void SetFieldsCount(int number = 1,
|
|
|
|
const int *widths = (const int *) NULL);
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
// Set status line text
|
1998-07-04 15:17:59 +00:00
|
|
|
virtual void SetStatusText(const wxString& text, int number = 0);
|
|
|
|
virtual wxString GetStatusText(int number = 0) const;
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
// Set status line widths
|
1998-07-08 22:09:37 +00:00
|
|
|
virtual void SetStatusWidths(int n, const int widths_field[]);
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
// Get the position and size of the field's internal bounding rectangle
|
1998-12-03 10:13:41 +00:00
|
|
|
virtual bool GetFieldRect(int i, wxRect& rect) const;
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2000-02-05 01:57:38 +00:00
|
|
|
// sets the minimal vertical size of the status bar
|
|
|
|
virtual void SetMinHeight(int height);
|
|
|
|
|
|
|
|
virtual int GetBorderX() const { return m_borderX; }
|
|
|
|
virtual int GetBorderY() const { return m_borderY; }
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
// Implementation
|
|
|
|
|
2000-02-05 01:57:38 +00:00
|
|
|
virtual void DrawFieldText(wxDC& dc, int i);
|
|
|
|
virtual void DrawField(wxDC& dc, int i);
|
|
|
|
|
|
|
|
void SetBorderX(int x);
|
|
|
|
void SetBorderY(int y);
|
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
void OnPaint(wxPaintEvent& event);
|
2004-06-17 16:22:36 +00:00
|
|
|
|
2002-12-04 14:11:26 +00:00
|
|
|
void OnLeftDown(wxMouseEvent& event);
|
|
|
|
void OnRightDown(wxMouseEvent& event);
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1998-07-08 22:09:37 +00:00
|
|
|
virtual void InitColours();
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
// Responds to colour changes
|
|
|
|
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
|
|
|
|
|
|
|
protected:
|
2002-09-04 13:16:46 +00:00
|
|
|
// common part of all ctors
|
|
|
|
void Init();
|
|
|
|
|
2002-06-30 23:53:58 +00:00
|
|
|
wxArrayString m_statusStrings;
|
2002-09-04 13:16:46 +00:00
|
|
|
|
2002-12-04 14:11:26 +00:00
|
|
|
// the last known width of the client rect (used to rebuild cache)
|
|
|
|
int m_lastClientWidth;
|
2002-09-04 13:16:46 +00:00
|
|
|
// the widths of the status bar panes in pixels
|
|
|
|
wxArrayInt m_widthsAbs;
|
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
int m_borderX;
|
|
|
|
int m_borderY;
|
|
|
|
wxPen m_mediumShadowPen;
|
|
|
|
wxPen m_hilightPen;
|
|
|
|
|
2004-04-07 21:48:24 +00:00
|
|
|
virtual wxSize DoGetBestSize() const;
|
|
|
|
|
2000-02-05 01:57:38 +00:00
|
|
|
private:
|
1998-05-20 14:01:55 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
2003-07-22 01:42:41 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxStatusBarGeneric)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
2000-02-05 01:57:38 +00:00
|
|
|
// _WX_GENERIC_STATUSBR_H_
|