2003-07-18 10:12:53 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/msw/wince/tbarwce.h
|
|
|
|
// Purpose: Windows CE wxToolBar class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 2003-07-12
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Julian Smart
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
2003-07-18 10:12:53 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_BARWCE_H_
|
|
|
|
#define _WX_BARWCE_H_
|
|
|
|
|
2003-08-09 08:38:21 -04:00
|
|
|
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
2003-07-18 10:12:53 -04:00
|
|
|
#pragma interface "tbarwce.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if wxUSE_TOOLBAR
|
|
|
|
|
|
|
|
#include "wx/dynarray.h"
|
|
|
|
|
2005-03-16 12:51:41 -05:00
|
|
|
// Smartphones don't have toolbars, so use a dummy class
|
|
|
|
#ifdef __SMARTPHONE__
|
|
|
|
|
2003-07-18 10:12:53 -04:00
|
|
|
class WXDLLEXPORT wxToolBar : public wxToolBarBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// ctors and dtor
|
2005-03-16 12:51:41 -05:00
|
|
|
wxToolBar() { }
|
2003-07-18 10:12:53 -04:00
|
|
|
|
|
|
|
wxToolBar(wxWindow *parent,
|
2005-03-16 12:51:41 -05:00
|
|
|
wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxNO_BORDER | wxTB_HORIZONTAL,
|
|
|
|
const wxString& name = wxToolBarNameStr)
|
|
|
|
{
|
|
|
|
Create(parent, id, pos, size, style, name);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Create(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxNO_BORDER | wxTB_HORIZONTAL,
|
|
|
|
const wxString& name = wxToolBarNameStr);
|
|
|
|
|
|
|
|
// override/implement base class virtuals
|
|
|
|
virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const;
|
|
|
|
virtual bool Realize() { return true; }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
// implement base class pure virtuals
|
|
|
|
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 wxString& label,
|
|
|
|
const wxBitmap& bmpNormal,
|
|
|
|
const wxBitmap& bmpDisabled,
|
|
|
|
wxItemKind kind,
|
|
|
|
wxObject *clientData,
|
|
|
|
const wxString& shortHelp,
|
|
|
|
const wxString& longHelp);
|
|
|
|
virtual wxToolBarToolBase *CreateTool(wxControl *control);
|
|
|
|
|
|
|
|
private:
|
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxToolBar)
|
|
|
|
DECLARE_NO_COPY_CLASS(wxToolBar)
|
|
|
|
};
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
// For __POCKETPC__
|
|
|
|
|
|
|
|
#include "wx/msw/tbar95.h"
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxToolMenuBar : public wxToolBar
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// ctors and dtor
|
|
|
|
wxToolMenuBar() { Init(); }
|
|
|
|
|
|
|
|
wxToolMenuBar(wxWindow *parent,
|
2003-07-18 10:12:53 -04:00
|
|
|
wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxNO_BORDER | wxTB_HORIZONTAL,
|
|
|
|
const wxString& name = wxToolBarNameStr,
|
|
|
|
wxMenuBar* menuBar = NULL)
|
|
|
|
{
|
|
|
|
Init();
|
|
|
|
|
|
|
|
Create(parent, id, pos, size, style, name, menuBar);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Create(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxNO_BORDER | wxTB_HORIZONTAL,
|
|
|
|
const wxString& name = wxToolBarNameStr,
|
|
|
|
wxMenuBar* menuBar = NULL);
|
|
|
|
|
2005-03-16 12:51:41 -05:00
|
|
|
virtual ~wxToolMenuBar();
|
2003-07-18 10:12:53 -04:00
|
|
|
|
|
|
|
// override/implement base class virtuals
|
|
|
|
virtual bool Realize();
|
|
|
|
|
|
|
|
// implementation only from now on
|
|
|
|
// -------------------------------
|
|
|
|
|
2005-03-19 14:51:51 -05:00
|
|
|
// Override in order to bypass wxToolBar's overridden function
|
|
|
|
virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
|
|
|
|
2003-07-18 10:12:53 -04:00
|
|
|
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
|
|
|
|
|
|
|
// Return HMENU for the menu associated with the commandbar
|
|
|
|
WXHMENU GetHMenu();
|
|
|
|
|
|
|
|
// Set the wxMenuBar associated with this commandbar
|
|
|
|
void SetMenuBar(wxMenuBar* menuBar) { m_menuBar = menuBar; }
|
|
|
|
|
|
|
|
// Returns the wxMenuBar associated with this commandbar
|
|
|
|
wxMenuBar* GetMenuBar() const { return m_menuBar; }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
// common part of all ctors
|
|
|
|
void Init();
|
|
|
|
|
|
|
|
// create the native toolbar control
|
|
|
|
bool MSWCreateToolbar(const wxPoint& pos, const wxSize& size, wxMenuBar* menuBar);
|
|
|
|
|
|
|
|
// recreate the control completely
|
|
|
|
void Recreate();
|
|
|
|
|
|
|
|
// implement base class pure virtuals
|
|
|
|
virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool);
|
|
|
|
virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool);
|
|
|
|
|
|
|
|
virtual wxToolBarToolBase *CreateTool(int id,
|
|
|
|
const wxString& label,
|
|
|
|
const wxBitmap& bmpNormal,
|
|
|
|
const wxBitmap& bmpDisabled,
|
|
|
|
wxItemKind kind,
|
|
|
|
wxObject *clientData,
|
|
|
|
const wxString& shortHelp,
|
|
|
|
const wxString& longHelp);
|
|
|
|
virtual wxToolBarToolBase *CreateTool(wxControl *control);
|
|
|
|
|
|
|
|
// The menubar associated with this toolbar
|
|
|
|
wxMenuBar* m_menuBar;
|
|
|
|
|
|
|
|
private:
|
|
|
|
DECLARE_EVENT_TABLE()
|
2005-03-16 12:51:41 -05:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxToolMenuBar)
|
|
|
|
DECLARE_NO_COPY_CLASS(wxToolMenuBar)
|
2003-07-18 10:12:53 -04:00
|
|
|
};
|
|
|
|
|
2005-03-16 12:51:41 -05:00
|
|
|
#endif
|
|
|
|
// __SMARTPHONE__
|
|
|
|
|
2003-07-18 10:12:53 -04:00
|
|
|
#endif // wxUSE_TOOLBAR
|
|
|
|
|
|
|
|
#endif
|
|
|
|
// _WX_BARWCE_H_
|