Table Of Contents

Previous topic

PaletteChangedEvent

Next topic

PaperSize

This Page

phoenix_title Panel

A panel is a window on which controls are placed.

It is usually placed within a frame. Its main feature over its parent class Window is code for handling child windows and TAB traversal. Since wxWidgets 2.9, there is support both for TAB traversal implemented by wxWidgets itself as well as native TAB traversal (such as for GTK 2.0).

events Events Emitted by this Class

Handlers bound for the following event types will receive a NavigationKeyEvent parameter.

  • EVT_NAVIGATION_KEY: Process a navigation key event.

Note

By default, a panel has the same colouring as a dialog.

Note

Tab traversal is implemented through an otherwise undocumented intermediate ControlContainer class from which any class can derive in addition to the normal Window base class. Please see /containr.h and /panel.h to find out how this is achieved. if not all characters are being intercepted by your OnKeyDown or OnChar handler, it may be because you are using the TAB_TRAVERSAL style, which grabs some keypresses for use by child controls.

See also

Dialog


class_hierarchy Inheritance Diagram

Inheritance diagram for class Panel

Inheritance diagram of Panel


method_summary Methods Summary

__init__ Default constructor.
AcceptsFocus This method is overridden from Window.AcceptsFocus and returns True only if there is no child window in the panel which can accept the focus.
Create Used for two-step panel construction.
InitDialog Sends a InitDialogEvent, which in turn transfers data to the dialog via validators.
Layout See Window.SetAutoLayout : when auto layout is on, this function gets called automatically when the window is resized.
SetFocus Overrides Window.SetFocus .
SetFocusIgnoringChildren In contrast to SetFocus (see above) this will set the focus to the panel even if there are child windows in the panel.

api Class API



class Panel(Window)

A panel is a window on which controls are placed.

Possible constructors:

Panel()

Panel(parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize,
      style=TAB_TRAVERSAL, name=PanelNameStr)

Methods



__init__(self, *args, **kw)

overload Overloaded Implementations:



__init__ (self)

Default constructor.



__init__ (self, parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=TAB_TRAVERSAL, name=PanelNameStr)

Constructor.

Parameters:
  • parent (Window) – The parent window.
  • id (int) – An identifier for the panel. ID_ANY is taken to mean a default.
  • pos (Point) – The panel position. The value DefaultPosition indicates a default position, chosen by either the windowing system or wxWidgets, depending on platform.
  • size (Size) – The panel size. The value DefaultSize indicates a default size, chosen by either the windowing system or wxWidgets, depending on platform.
  • style (long) – The window style. See Panel.
  • name (string) – Window name.

See also

Create





AcceptsFocus(self)

This method is overridden from Window.AcceptsFocus and returns True only if there is no child window in the panel which can accept the focus.

This is reevaluated each time a child window is added or removed from the panel.

Return type:bool


Create(self, parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=TAB_TRAVERSAL, name=PanelNameStr)

Used for two-step panel construction.

See Panel for details.

Parameters:
  • parent (Window) –
  • id (int) –
  • pos (Point) –
  • size (Size) –
  • style (long) –
  • name (string) –
Return type:

bool



InitDialog(self)

Sends a InitDialogEvent, which in turn transfers data to the dialog via validators.



Layout(self)

See Window.SetAutoLayout : when auto layout is on, this function gets called automatically when the window is resized.

Return type:bool


SetFocus(self)

Overrides Window.SetFocus .

This method uses the (undocumented) mix-in class ControlContainer which manages the focus and TAB logic for controls which usually have child controls.

In practice, if you call this method and the control has at least one child window, the focus will be given to the child window.



SetFocusIgnoringChildren(self)

In contrast to SetFocus (see above) this will set the focus to the panel even if there are child windows in the panel.

This is only rarely needed.