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];
78 for(
int i = 0; i < aNumberFields + ExtraFields; i++ )
79 styles[i] = wxSB_FLAT;
81 SetStatusStyles( aNumberFields + ExtraFields, styles );
87 wxGA_HORIZONTAL | wxGA_SMOOTH );
93 wxDefaultSize, wxBU_EXACTFIT );
125 pos.x += r.GetWidth();
137 pos.x += r.GetWidth();
154 int w = r.GetWidth();
155 int h = r.GetHeight();
216 cnt = wxString::Format(
"%d", aCount );
230 wxString etext = aText;
234 if( GetFieldRect( aFieldId, fieldRect ) )
235 width = fieldRect.GetWidth();
239 wxClientDC dc(
this );
242 etext = wxControl::Ellipsize( etext, dc, wxELLIPSIZE_MIDDLE, width - margin );
245 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)
Sets the status text that displays next to the progress bar.
void onBackgroundProgressClick(wxMouseEvent &aEvent)
void onSize(wxSizeEvent &aEvent)
void SetBackgroundProgress(int aAmount)
Sets 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 (un...
void HideBackgroundProgressBar()
Hides the background progress bar.
void onNotificationsIconClick(wxCommandEvent &aEvent)
void SetBackgroundProgressMax(int aAmount)
Sets the maX progress of the progress bar.
KISTATUSBAR(int aNumberFields, wxWindow *parent, wxWindowID id)
wxStaticText * m_backgroundTxt
void ShowBackgroundProgressBar(bool aCancellable=false)
Shows the background progress bar.
void SetNotificationCount(int aCount)
Sets the notification count on the notifications button A value of 0 will hide the count.
void ShowList(wxWindow *aParent, wxPoint aPos)
Shows 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.