1998-05-20 10:12:05 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
1999-12-15 14:47:54 -05:00
|
|
|
// Name: wx/msw/tbarmsw.h
|
|
|
|
// Purpose: wxToolBar for Win16
|
1998-05-20 10:12:05 -04:00
|
|
|
// Author: Julian Smart
|
1999-12-15 14:47:54 -05:00
|
|
|
// Modified by: 13.12.99 by VZ during toolbar classes reorganization
|
1998-05-20 10:12:05 -04:00
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
1998-08-07 19:52:45 -04:00
|
|
|
// Copyright: (c) Julian Smart
|
|
|
|
// Licence: wxWindows licence
|
1998-05-20 10:12:05 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-07 19:52:45 -04:00
|
|
|
#ifndef _WX_TBARMSW_H_
|
|
|
|
#define _WX_TBARMSW_H_
|
1998-05-20 10:12:05 -04:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface "tbarmsw.h"
|
|
|
|
#endif
|
|
|
|
|
1999-12-16 16:29:54 -05:00
|
|
|
#if wxUSE_TOOLBAR
|
1999-06-08 06:08:05 -04:00
|
|
|
|
1998-05-20 10:12:05 -04:00
|
|
|
#include "wx/tbarbase.h"
|
|
|
|
|
1999-06-10 14:12:13 -04:00
|
|
|
WXDLLEXPORT_DATA(extern const wxChar*) wxButtonBarNameStr;
|
1998-05-20 10:12:05 -04:00
|
|
|
|
1998-07-27 05:47:57 -04:00
|
|
|
class WXDLLEXPORT wxMemoryDC;
|
|
|
|
|
1999-12-15 14:47:54 -05:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxToolBar for Win16
|
|
|
|
// ----------------------------------------------------------------------------
|
1998-05-20 10:12:05 -04:00
|
|
|
|
1999-12-15 14:47:54 -05:00
|
|
|
class WXDLLEXPORT wxToolBar : public wxToolBarBase
|
1998-05-20 10:12:05 -04:00
|
|
|
{
|
|
|
|
public:
|
1999-12-15 14:47:54 -05:00
|
|
|
// construction
|
|
|
|
wxToolBar() { Init(); }
|
1999-11-16 16:31:40 -05:00
|
|
|
|
|
|
|
wxToolBar(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
1999-12-15 14:47:54 -05:00
|
|
|
long style = wxNO_BORDER|wxTB_HORIZONTAL,
|
|
|
|
const wxString& name = wxButtonBarNameStr)
|
1999-11-16 16:31:40 -05:00
|
|
|
{
|
1999-12-15 14:47:54 -05:00
|
|
|
Init();
|
|
|
|
|
|
|
|
Create(parent, id, pos, size, style, name);
|
1999-11-16 16:31:40 -05:00
|
|
|
}
|
|
|
|
|
1999-12-15 14:47:54 -05:00
|
|
|
bool Create(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxNO_BORDER|wxTB_HORIZONTAL,
|
|
|
|
const wxString& name = wxButtonBarNameStr);
|
|
|
|
|
|
|
|
~wxToolBar();
|
|
|
|
|
|
|
|
// implement/override base class (pure) virtuals
|
|
|
|
virtual wxToolBarToolBase *AddTool(int id,
|
|
|
|
const wxBitmap& bitmap,
|
|
|
|
const wxBitmap& pushedBitmap,
|
|
|
|
bool toggle,
|
|
|
|
wxCoord xPos,
|
|
|
|
wxCoord yPos = -1,
|
|
|
|
wxObject *clientData = NULL,
|
|
|
|
const wxString& helpString1 = wxEmptyString,
|
|
|
|
const wxString& helpString2 = wxEmptyString);
|
|
|
|
|
|
|
|
virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const;
|
|
|
|
|
|
|
|
virtual void SetToolBitmapSize(const wxSize& size);
|
|
|
|
virtual wxSize GetToolSize() const;
|
|
|
|
|
|
|
|
virtual bool Realize();
|
|
|
|
|
|
|
|
// implementation only from now on
|
|
|
|
// -------------------------------
|
|
|
|
|
|
|
|
// Handle wxWindows events
|
|
|
|
void OnPaint(wxPaintEvent& event);
|
|
|
|
void OnMouseEvent(wxMouseEvent& event);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void Init();
|
|
|
|
|
|
|
|
virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool);
|
|
|
|
virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool);
|
|
|
|
virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable);
|
|
|
|
virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle);
|
|
|
|
virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle);
|
|
|
|
|
|
|
|
virtual wxToolBarToolBase *CreateTool(int id,
|
|
|
|
const wxBitmap& bitmap1,
|
|
|
|
const wxBitmap& bitmap2,
|
|
|
|
bool toggle,
|
|
|
|
wxObject *clientData,
|
|
|
|
const wxString& shortHelpString,
|
|
|
|
const wxString& longHelpString);
|
|
|
|
virtual wxToolBarToolBase *CreateTool(wxControl *control);
|
|
|
|
|
|
|
|
void DoRedrawTool(wxToolBarToolBase *tool);
|
|
|
|
|
|
|
|
void DrawTool(wxDC& dc, wxToolBarToolBase *tool);
|
|
|
|
void DrawTool(wxDC& dc, wxToolBarToolBase *tool, int state);
|
|
|
|
|
|
|
|
void GetSysColors();
|
|
|
|
bool InitGlobalObjects();
|
|
|
|
void FreeGlobalObjects();
|
|
|
|
void PatB(WXHDC hdc,int x,int y,int dx,int dy, long rgb);
|
|
|
|
void CreateMask(WXHDC hDC, int xoffset, int yoffset, int dx, int dy);
|
|
|
|
void DrawBlankButton(WXHDC hdc, int x, int y, int dx, int dy, int state);
|
|
|
|
void DrawButton(WXHDC hdc, int x, int y, int dx, int dy,
|
1999-12-15 14:49:48 -05:00
|
|
|
wxToolBarToolBase *tool, int state);
|
1999-12-15 14:47:54 -05:00
|
|
|
WXHBITMAP CreateDitherBitmap();
|
|
|
|
bool CreateDitherBrush();
|
|
|
|
bool FreeDitherBrush();
|
|
|
|
WXHBITMAP CreateMappedBitmap(WXHINSTANCE hInstance, void *lpBitmapInfo);
|
|
|
|
WXHBITMAP CreateMappedBitmap(WXHINSTANCE hInstance, WXHBITMAP hBitmap);
|
|
|
|
|
|
|
|
int m_currentRowsOrColumns;
|
|
|
|
int m_pressedTool, m_currentTool;
|
|
|
|
|
|
|
|
wxCoord m_xPos, m_yPos;
|
|
|
|
wxCoord m_lastX, m_lastY;
|
|
|
|
|
|
|
|
WXHBRUSH m_hbrDither;
|
|
|
|
WXDWORD m_rgbFace;
|
|
|
|
WXDWORD m_rgbShadow;
|
|
|
|
WXDWORD m_rgbHilight;
|
|
|
|
WXDWORD m_rgbFrame;
|
|
|
|
|
|
|
|
//
|
|
|
|
// m_hdcMono is the DC that holds a mono bitmap, m_hbmMono
|
|
|
|
// that is used to create highlights
|
|
|
|
// of button faces.
|
|
|
|
// m_hbmDefault hold the default bitmap if there is one.
|
|
|
|
//
|
|
|
|
WXHDC m_hdcMono;
|
|
|
|
WXHBITMAP m_hbmMono;
|
|
|
|
WXHBITMAP m_hbmDefault;
|
|
|
|
|
1999-11-16 16:31:40 -05:00
|
|
|
private:
|
1999-12-15 14:47:54 -05:00
|
|
|
DECLARE_EVENT_TABLE()
|
1999-11-16 16:31:40 -05:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxToolBar)
|
|
|
|
};
|
|
|
|
|
1999-12-16 16:29:54 -05:00
|
|
|
#endif // wxUSE_TOOLBAR
|
1999-11-16 16:31:40 -05:00
|
|
|
|
1998-05-20 10:12:05 -04:00
|
|
|
#endif
|
1998-08-07 19:52:45 -04:00
|
|
|
// _WX_TBARMSW_H_
|