May 06, 2024, 02:05:37 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Update 02-04-2012

Started by LarryMc, February 04, 2012, 02:16:05 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

LarryMc

Completed the Print Preview functionality.

The current IDE has a button on the main toolbar as well as a File/Print.. menu option that opens the OS printer dialog.
There is also a File/Print Preview menu option and a File/Print Setup... menu option.

The new IDE also has a button on the main toolbar and a File/Print.. menu option; neither of which opens the OS printer dialog.  Instead they open a custom print preview window. This window contains the basic functionality of the OS printer dialog, the preview dialog and the printer setup dialog.  As a result the File/Print Preview and File/Print Setup... menu options are no longer needed.

Refering to the screenshots below:
The preview dialog contains three sections:
1. Along the top are the main controls.
2. Along the left side are all the configuration controls
3. The remaing area is the preview window.

1. The main controls along the top starts with the area where the file name is shown along with the number of pages required (with the user's current configuration) to print one copy of the entire file.

To the right is the current page indicator with arrow buttons on either side. When the preview window is opened it always defaults to the first page. The arrow buttons are each disabled when they reach their upper/lower limits on page numbers.
Each time a button is clicked and the page number is changed the actual preview page below will update.

Next are the zoom-in and zoom-out buttons.  There are 3 levels of zoom. The 1st level shows a preview of the entire page. This is the default each time the preview window is opened and shown in the first screenshot.
The 2nd level of zoom (2nd img) shows the page zoomed-in to the point that it fills approx. 90% of the available width.
The 3rd level of zoom (3 img) shows the page at actual size.
When the preview image exceeds the available viewing area the scrolbars are available so that all portions of the preview may be seen.

Next is the help button while will open the help file to the section that covers this portion of the IDE.

Then the Print button which initiates the actual printing of the pages.
And lastly a Close button to exit the preview window.

NOTE: While the preview window is open the IDE window is disabled like a normal Modal dialog.

2.The left section contains all the configuration controls.
At the top is an edit control that indicates the currently selected printer. To the right is a button which opens a dialog that contains a combobox containing the available printers. The user can select the desired printer and close the dialog.  The selected printer will appear in the edit control. The entry here is saved each time the preview window is closed and reloaded when the preview is reopened.

Next the user can select the paper orientation.  Any change will immediately be reflected in the preview with all necessary ajustments made for wordwrapping and page count.  This is a saved parameter; as above.
The first 3 screenshots show the portrait view and the 4th is the landscape view.

Next are the 4 available print ranges(what pages to print)
The bottom option - Selection - is enabled when the user opens the print preview with some text selected. The top three options will be disabled at that time. If the selected text required more than one page to print then the required # of pages will appear next to the file name at the top of the window.  The assumption is that if you selected text then you wanted all the text to print.

If no text is selected when the preview window is opened the Selection option is disabled and the other 3 are enabled. The default on opening is always All; the setting is not saved.

Clicking the Print button with All selected will result in the number of indicated next to the file name to be printed.

Doing the same with Current selected results in the page that is currently in the preview being printed.

Selecting the Range option results in the page numbers in the associated edit window being printed.

For example: 1-2,9,5-7 ,11-  when there ar 12 pages would result in 1,2,3,5,6,7,9,11,12 being printed.
Notice that I did not enter the #s is proper order( the 9 is out of sequence).  No problem. They will be printed in proper order.
Also, if you enter a group of numbers that results in a page number being entered more than once the extra entry or entries will be removed.  For example: 1-5,4-7,3-9,6  would result in 1,2,3,4,5,6,7,8,9.  If a page is entered that does not exit it is simply ignored.

Next copies the number of copies. The edit field has an associated up/down button.  This always defaults to 1 and is not saved.
This number represents how many times each page will be printed.

Next is the Page Order section
The user selects either Front to Back or Back to Front.  This totally depends on the users printer.  On my printer I want to use Front to Back so that the last page is printed first and the first page is the last to print.  That way when the printing is finished I can punch holes in the stack and put it in a notebook without having to resort any pages.

Others may need the pages printed just the opposite  so the option is there.  This setting is saved from session to session.

There is a checkbox for controlling collation. The easy way to explain it is with an example:
We want 3 copies of a file that has 3 pages. With the F2B/B2F set at Back to Front for my printer this is what I would get with the Collate box UNchecked - 3,3,3,2,2,2,1,1,1
If I check the box I will get - 3,2,1,3,2,1,3,2,1
The state of the checkbox is saved.

Next is the Margins section
There are four edit fields with associated up/down controls.  Their layout location indicates which margin they control.  The inc/dec in 1/10th of an inch intervals.  These values are saved.  As the user inc/dec a given margin the change is automatically indicated in the preview.  The 1st three screenshots show a larger left margin (for hole punch).  The 4th image shows the margins set with values that will probably never be used.
Reducing all margins to 0.0 does not necessarily allow printing at the absolute edge of the paper.  Most printers have a small dead area around the edge of the paper.  The preview window takes that value into account in its calculations.

The final section is for the remaining options. The header contains the name of the file.  It can be turned off resulting in the space it would have used being given back for printing the file.
The header is followed by a line which will always be there.
The footer works in exactly the same manner. The left side cotaind the date and time the page was printed and the right side contains the page number.
The wordwrap option when checked results in lines that are longer than the allowable print width are properly wrapped so that no characters are lost.  Wrapped lines are easy to spot since it will appear as a line with no line number. If the option is not selected then long lines will be truncated and text will be lost.

The final option is color. If checked then the printed pages will apear exactly the way they do in the IDE editor windows.  The colors are set in the IDE's Code Editor Preferences dialog. The 3rd screenshot shows the preview with color turned off and will appear the same when printed.

All four options in this section are saved. When any one of them is changed the preview is immediately recalculated and redisplayed. Changing any one or more of the first three options may result in a change in the number of pages will be display next to the file name at the top of the window.

I considered this valid beta that I'm sure I'll revisit before the final product.

Now, back to some "regular" stuff.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Brian

I don't often use superlatives, but . . . Wow! That's very impressive, Larry

And produced, no doubt, with your always attention to detail

Well done,

Brian