Skip to content

Commit

Permalink
Fix the (Windows) crash in the suggestions menu (Fixes: #1980).
Browse files Browse the repository at this point in the history
Now I use fixed wxWidgets IDs. Maybe the reserved IDs were
(automatically?) unreserved???
Sometimes it worked first, but a second right mouse click
in the same position caused the assert()?

Not really elegant, but maybe thats the better solution. Maybe all
IDs should be reserved with an enum{}? Many wxWidgets samples
do the same (and do not use NewControlId()).
  • Loading branch information
daute committed Jan 13, 2025
1 parent 0a46908 commit ec9eefc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
1 change: 0 additions & 1 deletion src/EventIDs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,6 @@ const wxWindowIDRef EventIDs::popid_unfold(wxWindow::NewControlId());
const wxWindowIDRef EventIDs::popid_maxsizechooser(wxWindow::NewControlId());
const wxWindowIDRef EventIDs::popid_resolutionchooser(wxWindow::NewControlId());
const wxWindowIDRef EventIDs::popid_reloadimage(wxWindow::NewControlId());
const wxWindowIDRef EventIDs::popid_suggestion1(wxWindow::NewControlId(NumberOfSuggestions()));
const wxWindowIDRef EventIDs::popid_hide_tooltipMarker(wxWindow::NewControlId());
const wxWindowIDRef EventIDs::popid_hide_tooltipMarkerForThisMessage(wxWindow::NewControlId());
const wxWindowIDRef EventIDs::popid_property_real(wxWindow::NewControlId());
Expand Down
23 changes: 13 additions & 10 deletions src/EventIDs.h
Original file line number Diff line number Diff line change
Expand Up @@ -710,16 +710,19 @@ class EventIDs
static const wxWindowIDRef popid_maxsizechooser;
static const wxWindowIDRef popid_resolutionchooser;
static const wxWindowIDRef popid_reloadimage;
static const wxWindowIDRef popid_suggestion1;
static const wxWindowIDRef popid_suggestion2;
static const wxWindowIDRef popid_suggestion3;
static const wxWindowIDRef popid_suggestion4;
static const wxWindowIDRef popid_suggestion5;
static const wxWindowIDRef popid_suggestion6;
static const wxWindowIDRef popid_suggestion7;
static const wxWindowIDRef popid_suggestion8;
static const wxWindowIDRef popid_suggestion9;
static const wxWindowIDRef popid_suggestion10;

enum {
popid_suggestion1 = wxID_HIGHEST+1,
popid_suggestion2,
popid_suggestion3,
popid_suggestion4,
popid_suggestion5,
popid_suggestion6,
popid_suggestion7,
popid_suggestion8,
popid_suggestion9,
popid_suggestion10
};
static const wxWindowIDRef popid_hide_tooltipMarker;
static const wxWindowIDRef popid_hide_tooltipMarkerForThisMessage;
static const wxWindowIDRef popid_property_real;
Expand Down

0 comments on commit ec9eefc

Please sign in to comment.