|
wxMaxima
|
The class that draws the status bar. More...
#include <StatusBar.h>
Public Types | |
| enum | networkState { idle , error , offline , receive , transmit } |
| The network states that can be passed to NetworkStatus() | |
| enum class | AiStatus { None , Active , Busy , Error } |
| The states the AI status icon (4th status bar field) can be in. More... | |
| enum | MaximaStatus { wait_for_start , process_wont_start , sending , waiting , waitingForPrompt , waitingForAuth , calculating , parsing , transferring , userinput , maximaerror , debugging , lispmode , disconnected } |
Public Member Functions | |
| StatusBar (wxWindow *parent, int id, bool aiChatAvailable=false) | |
| void | UpdateBitmaps () |
| Update the bitmaps to the Right size for the Resolution. | |
| void | NetworkStatus (networkState status) |
| Informs the status bar about networking events. | |
| wxWindow * | GetNetworkStatusElement () |
| wxWindow * | GetStatusTextElement () |
| wxWindow * | GetMaximaStatusElement () |
| wxWindow * | GetAiStatusElement () |
| The AI status icon, or nullptr if aiChatAvailable was false at construction time (the AI Chat feature isn't compiled in / usable here). | |
| void | UpdateAiStatus (AiStatus status, const wxString &detail=wxString()) |
| Update the AI status icon. | |
| void | SetMaximaCPUPercentage (float percentage) |
| Inform the status bar how many percents of the available CPU power maxima uses. | |
| void | UpdateStatusMaximaBusy (MaximaStatus status, std::size_t bytesFromMaxima) |
| wxBitmap | GetTrayIconBitmap (MaximaStatus status) const |
| The exact bitmap m_maximaStatus itself would show for this status – i.e. | |
| void | SetStatusText (wxString statusText) |
| Set the left status text. | |
Protected Member Functions | |
| void | StatusMsgDClick (wxMouseEvent &ev) |
| void | OnSize (wxSizeEvent &event) |
| void | OnTimerEvent (wxTimerEvent &event) |
| void | HandleTimerEvent () |
The class that draws the status bar.
|
strong |
The states the AI status icon (4th status bar field) can be in.
| Enumerator | |
|---|---|
| None | No AI provider is configured – the icon is hidden entirely. |
| Active | A provider is configured and the last request (if any) succeeded. |
| Busy | A request to the provider is currently in flight – mirrors how m_maximaStatus shows a "calculating" icon while Maxima is busy. |
| Error | A provider is configured, but the last request to it failed. |
| StatusBar::StatusBar | ( | wxWindow * | parent, |
| int | id, | ||
| bool | aiChatAvailable = false |
||
| ) |
| aiChatAvailable | Whether the AI Chat feature is compiled in and usable on this system (see AiProvider::SecretStoreAvailable()) – this is a fixed, startup-time property of the running binary, not whether a provider happens to be configured right now (that is what UpdateAiStatus() is for). Only if this is true does the status bar reserve a 4th field for the AI status icon at all; otherwise the status bar looks and behaves exactly as it did before this icon existed. |
|
inline |
The AI status icon, or nullptr if aiChatAvailable was false at construction time (the AI Chat feature isn't compiled in / usable here).
Callers must null-check before binding events to it or querying its screen position.
|
inline |
The exact bitmap m_maximaStatus itself would show for this status – i.e.
the same per-status icon UpdateStatusMaximaBusy()'s switch already assigns via m_maximaStatus->SetBitmap(...), just returned instead of applied to that particular wxStaticBitmap. Lets TrayIcon (GH #2286) reuse these bitmaps instead of re-embedding the same art a second time – the generated headers under art/statusbar (one per icon) define their byte arrays without static/extern, so include-ing one from a second .cpp file is a duplicate-symbol link error, confirmed by trying exactly that first. NOT the m_network_* bitmaps: those belong to the separate m_networkStatus icon (raw socket send/receive activity, driven by HandleTimerEvent()), a different concern from "what is Maxima doing" – using them here first, before this comment, showed as a barely-visible speck in the tray because the "idle" one in that family is a very subtle, mostly-transparent glyph.
|
inline |
Set the left status text.
Skips unchanged text: wxStaticText::SetLabel() re-sizes the label even for identical text, which on wxGTK re-layouts (and repaints) the whole frame - too expensive for a setter that is called from the idle loop.
| void StatusBar::UpdateAiStatus | ( | AiStatus | status, |
| const wxString & | detail = wxString() |
||
| ) |
Update the AI status icon.
| status | None hides the icon entirely (no provider configured). Active/Error show it with the corresponding bitmap/tooltip. |
| detail | Extra text (e.g. the last error message) appended to the tooltip for AiStatus::Error; ignored otherwise. |