wxMaxima
Loading...
Searching...
No Matches
Data Structures | Macros | Functions
test_ConfigDialogueStyles.cpp File Reference

The configuration dialog's style editor edits the style that was clicked (GH #2527). More...

#include <wx/app.h>
#include <wx/button.h>
#include <wx/checkbox.h>
#include <wx/config.h>
#include <wx/fileconf.h>
#include <wx/filename.h>
#include <wx/listbox.h>
#include <wx/log.h>
#include "cells/TextStyle.h"
#include "dialogs/ConfigDialogue.h"
#include <catch2/catch.hpp>
Include dependency graph for test_ConfigDialogueStyles.cpp:

Data Structures

class  TestApp
 

Functions

 SCENARIO ("The style editor shows the style that was clicked")
 
 SCENARIO ("Edits in the style editor change the style that was clicked")
 
 SCENARIO ("The style editor remembers the style that was clicked last")
 
 wxDECLARE_APP (TestApp)
 
int main (int argc, char **argv)
 

Detailed Description

The configuration dialog's style editor edits the style that was clicked (GH #2527).

wxQt sends the style list's wxEVT_LISTBOX from QListWidget::currentItemChanged, which Qt emits on a mouse click before it moves the selection: inside the handler the list's GetSelection() still names the style selected before. The dialog used to ask the list, so on wxQt every click showed the previously selected style, and every edit after it was written to the wrong one.

The tests below click the way wxQt does on every port: they send the event for the new item first and only then move the list's selection.