Opened 5 years ago

Closed 5 years ago

#11393 closed enhancement (fixed)

enum wxPrintOrientation instead of #define's

Reported by: troelsk Owned by:
Priority: low Milestone:
Component: GUI-generic Version: stable-latest
Keywords: wxPrintData Cc:
Blocked By: Blocking:
Patch: yes

Description


Attachments (1)

wxPrintOrientation.patch download (6.7 KB) - added by troelsk 5 years ago.
Trunk

Download all attachments as: .zip

Change History (4)

comment:1 Changed 5 years ago by vadz

  • Priority changed from normal to low
  • Status changed from new to infoneeded_new

I'm afraid this is going to break plenty of existing code using int to store the orientation value. I don't know how common is this but I do remember seeing it before and Google code search finds several matches in the first couple of pages and wx does it itself with its wxPrintData::m_printOrientation. Besides, you really didn't have any choice if you wanted to store it before as there was no enum type to use for it.

So I don't think this can be applied as is because of compatibility concerns. We definitely can introduce the enum type and change the accessor to return it. If we could also keep the method taking int and just deprecate it, it would probably be fine too (but I'm not sure if deprecating an overloaded method is going to work correctly). Could you please test if this is going to work and update the patch accordingly (please also update the deprecation section of docs/changes.txt)?

TIA!

Changed 5 years ago by troelsk

Trunk

comment:2 Changed 5 years ago by troelsk

  • Status changed from infoneeded_new to new

changes.txt updated now, and the old overload is back and deprecated; it seems to compile okay.

comment:3 Changed 5 years ago by VZ

  • Resolution set to fixed
  • Status changed from new to closed

(In [62823]) Make wxPORTRAIT and wxLANDSCAPE elements of wxPrintOrientation enum.

Change wxPrintData::SetOrientation() to take wxPrintOrientation instead of
int.

Closes #11393.

Note: See TracTickets for help on using tickets.