Description
Tests if all the texts and pictures in the current page are 'ready': fitting, not dummy, in a specified workstate etc. When called with the first parameter=0, it doesn't display the dialog box with the list of errors, but it returns EOK (0) is there are no errors, or ECANCELLED (1013) if there are errors.
Syntax
Page.PageTest (int1, lng2, lng3, lng4, bool5) |
int1
prompting: 0=no prompt, 1=display the list of 'offending' elements, 2=display the list and allow the user to proceed
lng2
bit-field that specifies which conditions are required
lng3
required workstate id for texts
lng4
required workstate id for pictures
bool5
True to test only the current layer, false to test all the layers
Remarks
Returns EOK if everything is ok or if the user confirmed, ECANCELLED otherwise
Tests are numbered as:
1=fitting text, 2=text in the specified workstate, 4=text not in use, 8=no dummy pictures, 16=no pictures to update, 32=pictures in the specified workstate, 64=no empty frames, 128=fitting local text, 256=All the layers must be visible, 512=objects in basket with no view privilege for user, 1024=overlapping elements of different layers , 2048=texts with justification errors, 4096=check for overfull lines in text, 8192=check for paragraph with more or less lines than specified in the format, 16384=check if elements on page (not the carbon copy ones) are of the right spot color, if defined for that page/half-page, 32768=check if pictures on page contains spot colors that are not defined as colors for the current title. This check is useful only if the preference 'Ignore spot colors in EPS pictures' is set; 65536=check overlaps on the same layer; 131072=check for picture placeholders
To enable more tests at once, sum the numbers, e.g 2049 means 1+2048, e.g. it tests for fitting texts and for text with justification errors.
To enable all tests, specify -1.
Examples
Public Sub PageTest() Dim ptd As InputDlg = New InputDlg ptd.Title = "Perform specific page test"
Dim def = True
ptd.AddSwitch("Texts must fit", "Test", def) ptd.AddSwitch("Texts must be in the specified workstate", "Test", def) ptd.AddSwitch("Texts must not be in use", "Test", def) ptd.AddSwitch("Pictures must not be dummy", "Test", def) ptd.AddSwitch("Pictures must not be to update", "Test", def) ptd.AddSwitch("Picture must be in the specified workstate", "Test", def) ptd.AddSwitch("No empty frames", "Test", def) ptd.AddSwitch("Local texts must fit", "Test", def) ptd.AddSwitch("All the layers must be visible", "Test", def) ptd.AddSwitch("Texts must be justified", "Test", def) ptd.AddSwitch("Frames and bitmaps do not overlap on different layers", "Test", def) ptd.AddSwitch("Justification errors on the page", "Test", def) ptd.AddSwitch("Text must not have overfull lines", "Test", def) ptd.AddSwitch("Text must not have non-fitting paragraphs", "Test", def) ptd.AddSwitch("Check elements color on spot color pages", "Test", def) ptd.AddSwitch("Check if there are ignored spot colors on the page", "Test", def) ptd.AddSwitch("Frames and bitmaps do not overlap on the same layer", "Test", def) ptd.AddSwitch("Pictures must not be a placeholder", "Test", def)
' ptd.combostart() ' ptd.comboaddquery(Sql, "select name,id from workstatetable where (mask & 2)<>0")
' wt = ptd.AddCombo("Workstate required for texts", 0) ' wp = ptd.AddCombo("Workstate required for pictures", 0) Dim wt = ptd.AddInt("Workstate ID required for texts", 0) Dim wp = ptd.AddInt("Workstate ID required for pictures", 0)
ptd.Width = 400 ptd.SetLabelWidth(320) If ptd.ShowDialog() = True Then Dim test = 0 Dim pot = 1 For i = 0 To wt - 1 If (ptd.GetItemValue(i) = True) Then test = test + pot pot = pot * 2 Next
Page.PageTest(1, test, ptd.GetItemValue(wt), ptd.GetItemValue(wp), False) End If End Sub |
The first call is silent and it returns 0 or 1013, depending if there are errors or not. The second test displays the dialog box, and returns 0 if the user clicked Proceed, or 1013 if the user clicked Cancel. dim e=page.pagetest(0,-1,0,0, false) if e=0 then 'no errors else e=page.pagetest(2,-1,0,0,false) end if |
Context
Page designer