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