Closed Bug 66781 Opened 24 years ago Closed 24 years ago

[FIX]Mac UI needs to be hooked up for printing selection and page range [print] [mac]

Categories

(Core :: Printing: Output, defect)

PowerPC
Windows NT
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla0.9.2

People

(Reporter: rods, Assigned: dcone)

References

Details

Attachments

(7 files)

No description provided.
Hardware: PC → Macintosh
Status: NEW → ASSIGNED
Summary: Mac UI needs to be hooked up for printing selection and page range → Mac UI needs to be hooked up for printing selection and page range [print] [mac]
Target Milestone: --- → mozilla0.9.1
I changed one file: nsDeviceContextSpecMac.cpp first attachment I added 3 files to the GFX mac project to support resouces needed for printing 1.) nsMacResouces.cpp second attachment 2 [details] [diff] [review].) nsmacResources.h third attachment 3 [details] [diff] [review].) nsMacGFXl.rsrc not attached (it would not attach in bugzilla) the nsMacGFX.rsrc has the DITL's needed for adding items to the print dialog.
dcone: please attach a screenshot of the print dialog stuff for Mac. You can attach the .rsrc file itself if you BinHex it.
Attached file binhex resourced
(Please attach screenshots as PNG images; you can use the PictureViewer application to create these.) Comments: Resources and dialog UI: Can we use Appearance-savvy controls here, and the Appearance Dialog Manager calls? This will make it easier to transition to Carbon, and look better (the single pixel black outline for the Frames grouping looks ugly now, for example). Also, you're using dialog_item_struct and append_item_list_struct to get at Dialog Manager internal data structures. This is a bad. It looks like you just need the number of items in the dialog, which you can get using CountDITL. I'd recommend that you look for a recent Apple technote or sample code on the recommended way to extend the print dialog. +static pascal void MyBBoxDraw(WindowPtr theWindow, short aItemNo) This routine never sets the foreground color, so you might draw the outline in random colors. + switch (myItem) { + case 1: + ::GetDialogItem((DialogPtr)aDialog,firstItem,&itemType,&itemH,&itemBox); + gPrintSelection = (gPrintSelection==PR_TRUE)?PR_FALSE:PR_TRUE; + ::SetControlValue((ControlHandle)itemH,gPrintSelection); + break; + case 2: + case 3: + case 4: Please provide an enum for your dialog items. This makes the code more readable. + // print frames as is + ::GetDialogItem((DialogPtr)aDialog,firstItem+2-1,&itemType,&itemH,& itemBox); + value = ::GetControlValue((ControlHandle)itemH); + if(1==value){ + gCurrOptions->SetPrintFrameType(nsIPrintOptions::kFramesAsIs); + } + + // selected frame + ::GetDialogItem((DialogPtr)aDialog,firstItem+2-1,&itemType,&itemH,& itemBox); + value = ::GetControlValue((ControlHandle)itemH); + if(1==value){ + gCurrOptions->SetPrintFrameType(nsIPrintOptions::kSelectedFrame); + } + + // print all frames + ::GetDialogItem((DialogPtr)aDialog,firstItem+2-1,&itemType,&itemH,& itemBox); + value = ::GetControlValue((ControlHandle)itemH); + if(1==value){ + gCurrOptions->SetPrintFrameType(nsIPrintOptions::kEachFrameSep); + } You're using 'firstItem+2-1 for each of these. Is that wrong? +#include <resources.h> Please fix case (so it works on Mac OS X some day) + PrtJobDialog->pItemProc = NewPItemProc(MyJobItems); This allocates a UPP, which you never free. This may leak a 4-byte pointer. + myDrawListUPP = NewUserItemProc(MyBBoxDraw); Ditto. General comments: nsDeviceContextSpecMac.cpp has inconsistent tabbing/spacing. It also uses some non-standard C++ formatting rules for {} indentation, spaces after , spaces around = and ==, around (), and the indentation of local variables. Also, I don't know if you like the if(1==value){ style, but please don't use it out of any sense of obligation.
Target Milestone: mozilla0.9.1 → mozilla0.9.2
Attached patch patch with fixesSplinter Review
I attached a patch which address Simons suggestions. The only thing I did not address really was using the dialog_item_struct and append_item_List_struct which were taken straight from a technical note from apple on how to extend dialogs. The issues on using the appearance manager I will address later, I wanted to get this in by .91, two days away and could not get that part addressed in time.
r=peterl I assume in OS X there is completely different way of extending the print dialog, but Don for sure get this in for 0.9.1? Anyone know where those resources can be found?
More comments: 1. You still leak the UPPs for pItemProc, myDrawListUPP and theInitProcPtr if PrDlgMain() returns false (user cancelled?). pItemProc is never disposed. 2. Spacing is totally whacked in this file. You need to de-tab it (BBEdit can do this). 3. Would prefer enum over #defines for dialog items, like: enum { ePrintSelectionCheckboxID = 1, ePrintFrameStaticTextID ...etc. The code would be much cleaner if you factored the GetDialogItem()/Get/ SetControlValue into helper methods. Sorry, but I'm still not ready to sr this code.
Much more readable. sr=sfraser
Fixed
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
I see range UI. but no selection UI in 5/30 build on Mac.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Don says it works for him in a debug build but does not show up in a release build.
It works only in debug builds because the CFM init/terminate routines are only set correctly in the non-carbon debug target in the project (so the res fork is never opened when the lib is loaded). The Entry Points under the PPC linker panel in the project settings need to be fixed for all targets (including the carbon targets).
I put the CFM init/terminate routines into all the GFX builds. I had Marc Attinasi and Peter L look at the changes.. and showed them the running application as a test. Waiting for there r and sr.
Summary: Mac UI needs to be hooked up for printing selection and page range [print] [mac] → [FIX]Mac UI needs to be hooked up for printing selection and page range [print] [mac]
visual review @ don's cube, r=peterl
I looked at don's project on his machine, looks good. sr=attinasi
a= asa@mozilla.org for checkin to the trunk. (on behalf of drivers)
Blocks: 83989
fixed
Status: REOPENED → RESOLVED
Closed: 24 years ago24 years ago
Resolution: --- → FIXED
Guys, I see the page range feature in the print dialog, but I don't see any printing selection UI or option... reopening this bug.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
I'm able to access and use the new print options in the latest mac build (2001062108) Netscape 6 option appears in pulldown menu of print dialog. I was able to print a selection on a page, a selection in frame, and a complete frameset.
okay I see it...can we make this selection feature more accessible? Currently its hidden in the "Netscape 6" menu item...nobody is gonna know how to get to this....it fooled me...
Status: REOPENED → RESOLVED
Closed: 24 years ago24 years ago
Resolution: --- → FIXED
verified.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: