Project

General

Profile

Actions

Bug #1364

closed

Unable to retrieve the 'Ok' StandardButton from a WMessageBox

Added by S van der Hoest over 11 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
Start date:
07/24/2012
Due date:
% Done:

0%

Estimated time:

Description

When I create a WMessageBox with an 'Ok' StandardButton, I get a null pointer when calling 'button(Ok)'.

Example code:

WMessageBox * msgBox = new Wt::WMessageBox(

"Just a messagebox",

"Hi there",

Warning,

Yes | Ok

);

WPushButton* pYesButton = msgBox->button(Yes); // this works

WPushButton* pOkButton = msgBox->button(Ok); // this doesn't work


Problem seems located in WMessageBox.c

The array 'order_' has 'Ok' at index 0:

From WMessabeBox.c:

StandardButton WMessageBox::order_[] = { Ok, Yes, YesAll, Retry, No,

NoAll, Abort, Ignore, Cancel };

The 'button' function starts using this array from index 1.

Found this with Wt 3.2.1.

Actions #1

Updated by S van der Hoest over 11 years ago

Found that it also goes wrong after adding a button using the 'addButton' function.

The 'button' function checks 'buttons_' which is not updated by the 'addButton' function.

Actions #2

Updated by Wim Dumon over 11 years ago

  • Status changed from New to Resolved

Confirmed and fixed - that 1 should be a 0.

Note that without fixing the bug, the button() method may also return the wrong button.

BR,

Wim.

Actions #3

Updated by Koen Deforche over 11 years ago

  • Status changed from Resolved to Closed
  • Target version set to 3.2.3

Fixed in Wt 3.2.3 RC1.

Actions

Also available in: Atom PDF