|
wxMaxima
|
Regression test: changing a toolbar button's state must repaint the toolbar. More...
#include <wx/app.h>#include <wx/artprov.h>#include <wx/frame.h>#include <wx/log.h>#include "ToolBar.h"#include "wxMaximaArtProvider.h"#include <catch2/catch.hpp>Data Structures | |
| class | TestApp |
Functions | |
| SCENARIO ("Enabling the follow button repaints the toolbar") | |
| SCENARIO ("Switching the follow button's icon repaints the toolbar") | |
| wxDECLARE_APP (TestApp) | |
| int | main (int argc, char **argv) |
Regression test: changing a toolbar button's state must repaint the toolbar.
wxAuiToolBar::EnableTool() and SetToolBitmap() only change the tool's data; neither repaints. So the "return to the cell being evaluated" button, which the worksheet enables when the user scrolls away from the evaluation, kept looking disabled until the mouse pointer entered the toolbar and its hover highlight happened to repaint it.
Whether a paint event actually arrives depends on the display and the toolkit's frame clock, which makes counting paint events flaky. Refresh() is the virtual that queues the repaint, though, so a subclass counting calls to it tells deterministically whether one was requested.