KiCad PCB EDA Suite
EDA_INFOBAR_PANEL Class Reference

A wxPanel derived class that hold an infobar and another control. More...

#include <infobar.h>

Inheritance diagram for EDA_INFOBAR_PANEL:

Public Member Functions

 EDA_INFOBAR_PANEL (wxWindow *aParent, wxWindowID aId=wxID_ANY, const wxPoint &aPos=wxDefaultPosition, const wxSize &aSize=wxSize(-1,-1), long aStyle=wxTAB_TRAVERSAL, const wxString &aName=wxEmptyString)
 
void AddInfoBar (WX_INFOBAR *aInfoBar)
 Add the given infobar object to the panel. More...
 
void AddOtherItem (wxWindow *aOtherItem)
 Add the other item to the panel. More...
 

Protected Attributes

wxFlexGridSizer * m_mainSizer
 

Detailed Description

A wxPanel derived class that hold an infobar and another control.

The infobar is located at the top of the panel, and the other control is located below it.

This allows the infobar to be controlled nicely by an AUI manager, since adding the infobar on its own to the AUI manager produces artifacts when showing/hiding it due to the AUI pane layout.

Note that this implementation currently has issues on Windows with event processing inside the GAL canvas, see: https://gitlab.com/kicad/code/kicad/-/issues/4501

Definition at line 277 of file infobar.h.

Constructor & Destructor Documentation

◆ EDA_INFOBAR_PANEL()

EDA_INFOBAR_PANEL::EDA_INFOBAR_PANEL ( wxWindow *  aParent,
wxWindowID  aId = wxID_ANY,
const wxPoint &  aPos = wxDefaultPosition,
const wxSize &  aSize = wxSize( -1,-1 ),
long  aStyle = wxTAB_TRAVERSAL,
const wxString &  aName = wxEmptyString 
)

Definition at line 356 of file infobar.cpp.

358  : wxPanel( aParent, aId, aPos, aSize, aStyle, aName )
359 {
360  m_mainSizer = new wxFlexGridSizer( 1, 0, 0 );
361 
362  m_mainSizer->SetFlexibleDirection( wxBOTH );
363  m_mainSizer->AddGrowableCol( 0, 1 );
364 
365  SetSizer( m_mainSizer );
366 }
wxFlexGridSizer * m_mainSizer
Definition: infobar.h:303

References m_mainSizer.

Member Function Documentation

◆ AddInfoBar()

void EDA_INFOBAR_PANEL::AddInfoBar ( WX_INFOBAR aInfoBar)

Add the given infobar object to the panel.

Parameters
aInfoBaris the infobar to add

Definition at line 369 of file infobar.cpp.

370 {
371  wxASSERT( aInfoBar );
372 
373  aInfoBar->Reparent( this );
374  m_mainSizer->Add( aInfoBar, 1, wxEXPAND, 0 );
375  m_mainSizer->Layout();
376 }
wxFlexGridSizer * m_mainSizer
Definition: infobar.h:303

References m_mainSizer.

◆ AddOtherItem()

void EDA_INFOBAR_PANEL::AddOtherItem ( wxWindow *  aOtherItem)

Add the other item to the panel.

This item will expand to fill up the vertical space left.

Parameters
aOtherItemis the item to add

Definition at line 379 of file infobar.cpp.

380 {
381  wxASSERT( aOtherItem );
382 
383  aOtherItem->Reparent( this );
384  m_mainSizer->Add( aOtherItem, 1, wxEXPAND, 0 );
385 
386  m_mainSizer->AddGrowableRow( 1, 1 );
387  m_mainSizer->Layout();
388 }
wxFlexGridSizer * m_mainSizer
Definition: infobar.h:303

References m_mainSizer.

Member Data Documentation

◆ m_mainSizer

wxFlexGridSizer* EDA_INFOBAR_PANEL::m_mainSizer
protected

Definition at line 303 of file infobar.h.

Referenced by AddInfoBar(), AddOtherItem(), and EDA_INFOBAR_PANEL().


The documentation for this class was generated from the following files: