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