wxNavigationEnabled< W > Class Template Reference | wxWidgets

| Version: 3.2.11

Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
wxNavigationEnabled< W > Class Template Reference

`#include </cygdrive/c/Users/Hamis/Cygwin-packaging/wxWidgets3.2/wxWidgets3.2-3.2.11-1.x86_64/src/wxWidgets-3.2.11/interface/wx/containr.h>`

Inheritance diagram for wxNavigationEnabled< W >:
[legend]

## Detailed Description

template<class W>
class wxNavigationEnabled< W >

A helper class implementing TAB navigation among the window children.

This class contains the functionality needed to correctly implement TAB navigation among the children of the window. Its exact contents is not important and is intentionally not documented as the only way to use this class is to inherit from it instead of inheriting from the usual base class directly. For example, if some class needs to inherit from wxControl but contains multiple sub-windows and needs to support keyboard navigation, it is enough to declare it in the following way:

class MyControlWithSubChildren :
public wxNavigationEnabled<wxControl>
{
public:
// Default constructor is implemented in the same way as always.
MyControlWithSubChildren() { }
// Non-default constructor can't use wxControl ctor any more as
// wxControl is not its direct base class, but it can use Create().
MyControlWithSubChildren(wxWindow *parent, wxWindowID winid)
{
wxControl::Create(parent, winid);
// More creation code...
}
// Everything else as usual ...
};
wxControl::Create
bool Create(wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxControlNameStr)
wxWindow
wxWindow is the base class for all windows and represents any visible object on screen.
Definition window.h:346
wxWindowID
int wxWindowID
The type of unique identifiers (ID) used for wxWindow-derived classes.
Definition windowid.h:11

##

Library: wxCore

Since
  2.9.3

## Public Types
typedef W | BaseWindowClass
| The name of the real base window class that this class derives from.

## Public Member Functions
| wxNavigationEnabled ()
| Default constructor.

## Member Typedef Documentation

## ◆ BaseWindowClass

template<class W>

typedef W wxNavigationEnabled< W >::BaseWindowClass

The name of the real base window class that this class derives from.

## Constructor & Destructor Documentation

## ◆ wxNavigationEnabled()

template<class W>

wxNavigationEnabled< W >::wxNavigationEnabled | ( |  | ) |

Default constructor.

This class provides only the default constructor as it's not possible, in general, to provide all the constructors of the real base class BaseWindowClass.

This is however not usually a problem for wxWindow-derived classes as, by convention, they always define a Create() method such that calling it on an object initialized using the default constructor is equivalent to using a non-default constructor directly. So the classes inheriting from wxNavigationEnabled<W> should simply call W::Create() in their constructors.