26#include <wx/statusbr.h>
28#include <wx/stattext.h>
36#include <wx/dcclient.h>
38#define FIELD_OFFSET_BGJOB_TEXT 0
39#define FIELD_OFFSET_BGJOB_GAUGE 1
40#define FIELD_OFFSET_BGJOB_CANCEL 2
41#define FIELD_OFFSET_NOTIFICATION_BUTTON 3
45 wxStatusBar( parent, id ),
46 m_normalFieldsCount( aNumberFields )
52 const int ExtraFields = 5;
54 const int ExtraFields = 4;
56 SetFieldsCount( aNumberFields + ExtraFields );
58 int* widths =
new int[aNumberFields + ExtraFields];
60 for(
int i = 0; i < aNumberFields; i++ )
70 widths[aNumberFields + ExtraFields - 1] = 10;
73 SetStatusWidths( aNumberFields + ExtraFields, widths );
77 int* styles =
new int[aNumberFields + ExtraFields];
79 for(
int i = 0; i < aNumberFields + ExtraFields; i++ )
80 styles[i] = wxSB_FLAT;
82 SetStatusStyles( aNumberFields + ExtraFields, styles );
88 wxGA_HORIZONTAL | wxGA_SMOOTH );
94 wxDefaultSize, wxBU_EXACTFIT );
126 pos.x += r.GetWidth();
138 pos.x += r.GetWidth();
155 int w = r.GetWidth();
156 int h = r.GetHeight();
218 cnt = wxString::Format(
"%d", aCount );
232 wxString etext = aText;
236 if( GetFieldRect( aFieldId, fieldRect ) )
237 width = fieldRect.GetWidth();
241 wxClientDC dc(
this );
245 etext = wxControl::Ellipsize( etext, dc, wxELLIPSIZE_MIDDLE, width - margin );
248 SetStatusText( etext, aFieldId );
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap)
void ShowList(wxWindow *aParent, wxPoint aPos)
Shows the background job list.
BITMAP_BUTTON * m_notificationsButton
void SetBackgroundStatusText(const wxString &aTxt)
Set the status text that displays next to the progress bar.
void onBackgroundProgressClick(wxMouseEvent &aEvent)
void onSize(wxSizeEvent &aEvent)
void SetBackgroundProgress(int aAmount)
Set the current progress of the progress bar.
wxGauge * m_backgroundProgressBar
wxButton * m_backgroundStopButton
void SetEllipsedTextField(const wxString &aText, int aFieldId)
Set the text in a field using wxELLIPSIZE_MIDDLE option to adjust the text size to the field size.
void HideBackgroundProgressBar()
Hide the background progress bar.
void onNotificationsIconClick(wxCommandEvent &aEvent)
void SetBackgroundProgressMax(int aAmount)
Set the max progress of the progress bar.
KISTATUSBAR(int aNumberFields, wxWindow *parent, wxWindowID id)
wxStaticText * m_backgroundTxt
void ShowBackgroundProgressBar(bool aCancellable=false)
Show the background progress bar.
void SetNotificationCount(int aCount)
Set the notification count on the notifications button.
void ShowList(wxWindow *aParent, wxPoint aPos)
Show the notification list.
virtual BACKGROUND_JOBS_MONITOR & GetBackgroundJobMonitor() const
virtual NOTIFICATIONS_MANAGER & GetNotificationsManager() const
#define FIELD_OFFSET_BGJOB_TEXT
#define FIELD_OFFSET_BGJOB_GAUGE
#define FIELD_OFFSET_NOTIFICATION_BUTTON
#define FIELD_OFFSET_BGJOB_CANCEL
KICOMMON_API wxSize GetTextSize(const wxString &aSingleLine, wxWindow *aWindow)
Return the size of aSingleLine of text when it is rendered in aWindow using whatever font is currentl...
void Refresh()
Update the board display after modifying it by a python script (note: it is automatically called by a...
PGM_BASE & Pgm()
The global program "get" accessor.
Functions to provide common constants and other functions to assist in making a consistent UI.