wxStaticBitmap, wxStaticBox and wxPanel don't accept keyboard focus now
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1539 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
aeafc35493
commit
06b5713445
@ -21,27 +21,28 @@
|
||||
WXDLLEXPORT_DATA(extern const char*) wxPanelNameStr;
|
||||
|
||||
|
||||
class WXDLLEXPORT wxPanel: public wxWindow
|
||||
class WXDLLEXPORT wxPanel : public wxWindow
|
||||
{
|
||||
public:
|
||||
wxPanel();
|
||||
|
||||
// Old-style constructor (no default values for coordinates to avoid ambiguity
|
||||
// with the new one)
|
||||
inline wxPanel(wxWindow *parent,
|
||||
int x, int y, int width, int height,
|
||||
long style = wxTAB_TRAVERSAL | wxNO_BORDER,
|
||||
const wxString& name = wxPanelNameStr)
|
||||
wxPanel(wxWindow *parent,
|
||||
int x, int y, int width, int height,
|
||||
long style = wxTAB_TRAVERSAL | wxNO_BORDER,
|
||||
const wxString& name = wxPanelNameStr)
|
||||
{
|
||||
Create(parent, -1, wxPoint(x, y), wxSize(width, height), style, name);
|
||||
}
|
||||
|
||||
// Constructor
|
||||
inline wxPanel(wxWindow *parent, wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxTAB_TRAVERSAL | wxNO_BORDER,
|
||||
const wxString& name = wxPanelNameStr)
|
||||
wxPanel(wxWindow *parent,
|
||||
wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxTAB_TRAVERSAL | wxNO_BORDER,
|
||||
const wxString& name = wxPanelNameStr)
|
||||
{
|
||||
Create(parent, id, pos, size, style, name);
|
||||
}
|
||||
@ -61,10 +62,14 @@ public:
|
||||
|
||||
// Process a keyboard navigation message (Tab traversal)
|
||||
void OnNavigationKey(wxNavigationKeyEvent& event);
|
||||
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxPanel)
|
||||
DECLARE_EVENT_TABLE()
|
||||
// override base class virtuals
|
||||
// we don't want focus for ourselves
|
||||
virtual bool AcceptsFocus() const { return FALSE; }
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxPanel)
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -13,57 +13,60 @@
|
||||
#define _WX_STATBMP_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "statbmp.h"
|
||||
#pragma interface "statbmp.h"
|
||||
#endif
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxStaticBitmapNameStr;
|
||||
|
||||
class WXDLLEXPORT wxStaticBitmap: public wxControl
|
||||
class WXDLLEXPORT wxStaticBitmap : public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxStaticBitmap)
|
||||
public:
|
||||
inline wxStaticBitmap(void) { }
|
||||
DECLARE_DYNAMIC_CLASS(wxStaticBitmap)
|
||||
|
||||
inline wxStaticBitmap(wxWindow *parent, wxWindowID id,
|
||||
const wxBitmap& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxStaticBitmapNameStr)
|
||||
{
|
||||
Create(parent, id, label, pos, size, style, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxBitmap& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxStaticBitmapNameStr);
|
||||
|
||||
virtual void SetBitmap(const wxBitmap& bitmap);
|
||||
|
||||
virtual void Command(wxCommandEvent& WXUNUSED(event)) {};
|
||||
virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) {};
|
||||
|
||||
void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
||||
void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
|
||||
{ wxWindow::SetSize(rect, sizeFlags); }
|
||||
void SetSize(const wxSize& size) { wxWindow::SetSize(size); }
|
||||
|
||||
inline wxBitmap& GetBitmap(void) const { return (wxBitmap&) m_messageBitmap; }
|
||||
|
||||
// overriden base class virtuals
|
||||
virtual bool AcceptsFocus() const { return FALSE; }
|
||||
|
||||
// Implementation
|
||||
virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *item);
|
||||
virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
protected:
|
||||
wxBitmap m_messageBitmap;
|
||||
public:
|
||||
wxStaticBitmap() { }
|
||||
|
||||
wxStaticBitmap(wxWindow *parent, wxWindowID id,
|
||||
const wxBitmap& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxStaticBitmapNameStr)
|
||||
{
|
||||
Create(parent, id, label, pos, size, style, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxBitmap& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxStaticBitmapNameStr);
|
||||
|
||||
virtual void SetBitmap(const wxBitmap& bitmap);
|
||||
|
||||
virtual void Command(wxCommandEvent& WXUNUSED(event)) { }
|
||||
virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) { }
|
||||
|
||||
void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
||||
void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
|
||||
{ wxWindow::SetSize(rect, sizeFlags); }
|
||||
void SetSize(const wxSize& size)
|
||||
{ wxWindow::SetSize(size); }
|
||||
|
||||
wxBitmap& GetBitmap(void) const { return (wxBitmap&) m_messageBitmap; }
|
||||
|
||||
// overriden base class virtuals
|
||||
virtual bool AcceptsFocus() const { return FALSE; }
|
||||
|
||||
// Implementation
|
||||
virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *item);
|
||||
virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
protected:
|
||||
wxBitmap m_messageBitmap;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -21,45 +21,52 @@
|
||||
WXDLLEXPORT_DATA(extern const char*) wxStaticBoxNameStr;
|
||||
|
||||
// Group box
|
||||
class WXDLLEXPORT wxStaticBox: public wxControl
|
||||
class WXDLLEXPORT wxStaticBox : public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxStaticBox)
|
||||
DECLARE_DYNAMIC_CLASS(wxStaticBox)
|
||||
|
||||
public:
|
||||
wxStaticBox() {}
|
||||
|
||||
public:
|
||||
inline wxStaticBox(void) {}
|
||||
inline wxStaticBox(wxWindow *parent, wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxStaticBoxNameStr)
|
||||
{
|
||||
Create(parent, id, label, pos, size, style, name);
|
||||
}
|
||||
wxStaticBox(wxWindow *parent, wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxStaticBoxNameStr)
|
||||
{
|
||||
Create(parent, id, label, pos, size, style, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxStaticBoxNameStr);
|
||||
|
||||
virtual void Command(wxCommandEvent& WXUNUSED(event)) { }
|
||||
virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) { }
|
||||
|
||||
void OnEraseBackground(wxEraseEvent& event);
|
||||
|
||||
virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
||||
void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
|
||||
{ wxWindow::SetSize(rect, sizeFlags); }
|
||||
void SetSize(const wxSize& size)
|
||||
{ wxWindow::SetSize(size); }
|
||||
void SetLabel(const wxString& label);
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxStaticBoxNameStr);
|
||||
|
||||
virtual void Command(wxCommandEvent& WXUNUSED(event)) {};
|
||||
virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) {};
|
||||
|
||||
void OnEraseBackground(wxEraseEvent& event);
|
||||
|
||||
virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
||||
void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
|
||||
{ wxWindow::SetSize(rect, sizeFlags); }
|
||||
void SetSize(const wxSize& size) { wxWindow::SetSize(size); }
|
||||
void SetLabel(const wxString& label);
|
||||
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
|
||||
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
|
||||
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
// overriden base class virtuals
|
||||
virtual bool AcceptsFocus() const { return FALSE; }
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user