Beiträge von jdbiggers

    I found what seems to be a fix.

    I tried the solutions in this message, and none of them actually worked for me unless the RTF was the size of the whole page.

    Here's what I added in the DrawText function...

    where the lines read...

    saveddc := SaveDC(toCanvas.Handle);
    try
    resx := GetDeviceCaps(toCanvas.Handle, LOGPIXELSX);
    resy := GetDeviceCaps(toCanvas.Handle, LOGPIXELSY);
    GetWindowOrgEx(toCanvas.Handle, bl);
    SetMapMode(toCanvas.Handle, MM_ANISOTROPIC);

    ///I did this - note the "resx-3"
    SetWindowExtEx(toCanvas.Handle, resx-3, resy, nil);

    SetViewPortExtEx(toCanvas.Handle,
    MulDiv(resx, Feditor.FResInfo.FZooming, 100),
    MulDiv(resy, Feditor.FResInfo.FZooming, 100), nil);
    SetWindowOrgEx(toCanvas.Handle,
    MulDiv(bl.x - r.Left, 100, Feditor.FResInfo.FZooming),
    MulDiv(bl.y - r.Top, 100, Feditor.FResInfo.FZooming), nil);

    For some reason, adding that "-3" to the code made it display properly at all fonts, sizes, and zooms. I have NO IDEA WHY since I'm not a programmer, but it seems to have solved the problem on my end.

    John-David Biggers

    PS - Julian, my son, Julian, is getting real big, now. Pretty soon I'm going to have to show him the online world and let hime cyber-meet you, the person I named hm after.

    Zitat von mmount

    Thanks JD.

    I am seeing that support (at least via the forums) is dismal at best. Seems like this is a nice foundation of a product though. I gave in and bought the source code so I will delve into that this weekend to extend the product in a more usable direction for me. If you are interested in giving me a hand I'd be happy to share improvements/modifications.

    Again, thanks!

    Mike

    No Problem, Mike.

    I did find some bugs and fixed them. They aren't a problem unless your application also allows users to insert photographs. And I can help you with using real formulas (not the formula field) when you get to that part.

    You see, it would be real easy to simply use regular windows forms (text boxes, labels, etc.) since you can allow users to dynamiclly create these, as well. But, in my case, the typical single-page form has more than 300 fields and aboth the same number of labels. WPForms helps with the scaling of this tremendously when people zoom. Otherwise, I'd just create forms like any other regular application and simply "print" the form to a printer device context. My forms progrm is for real estate appraisers. They select different government forms, photo adenda, etc, and assemble them into a report. The user might have a single page report or a thousand pages. What I do is insert pages everytime the user adds a form from a library of forms, and store the names of the individual forms into a listbox (which is saved with the report). They can navigate through the report by clicking on a page in the listbox, so they can easiy jump from page 1 to page 14 and KNOW what page 14 is (like 14 may be the Comparable Rent Schedule Analysis).

    If your application doesn't have but a few fields per form, you can also do it with standard windows controls. It's not that hard to make a program that can add controls and move controls at runtime for users. he problem comes into play when they are very close to one-another, there are a whole bunch of them, and you need to print the form.

    Anyway, I'll be glad to help. I bought the source for WPForm, too, but not for WPTools. I think I need to buy the source for WPTools so I can get the TWPCustomRichText to work properly. Seems to me it needs a little tweaking. I'm not a programmer, but I'm pretty good at figuring things out.

    JD

    Good luck getting an answer from the developer.

    All the things you want can be done as-is.

    Item 1> there are OnKeyPress, OnKeyDown, and OnKeyUp events for the inplace editors (the editor that appears for each field that allows the entry of data).

    Item 2> Can be tabbed through OR set focus to a particular field

    Item 3> You can easily enable, disable, or even change the properties based on certain criteria DURING form cmpletion. If you aren't even sure what that riteria will be, you can even use scripts to handle things.

    My application is one that allows the user to "build" a set of forms from individual form templates. Each report could be 1 page or several thousand. They might even have duplicates of the same form with different information. What I did was use the "formula" field (which really doesn't work for formulas) and use this to place the name of a script to execute. When focus leaves that field, it executes the script, and that script can do anything from perform functions on fields to make the visible or change their appearance.

    While WPForms is excellent, getting answers is something you pretty much have to figure out on your own.

    There is only one thing keeping me from completing my application and it may make the difference between me using WPForms or starting from scratch because I can't get help on doing it through the developer.

    JD

    Why not create your own dialog with a preview.

    I designed my own. It lists ALL the pages in the form (my program allows the user to build a master report from individual page templates), and allows them to select which pages to print and to which printer.

    In essence, in my case, the user may want to print some pages to a standard B&W printer, and others to a color printer. My program allows them to select TWO default printers and each page of the rpeort can be assigned to a diffferent printer. I created a compound control that handles everything for each page.

    Below is a link to a screenshot of the first version (doesn't have the "copies" option). I have't updated the web-site.


    I can send the control to you if you want. You just add it dynamically for each page in your report. I can give you sample code for that, too.

    JD
    John-David Biggers
    NOT a programmer, just a person irritated by the lack of good software.

    I add the custom rich text object to my forms. It will aloso successfully allow the user to insert photos into it.

    BUT, the image will often disappear unless they click where the image is located on the object AND it won't print. It is still there in the file, and even if the image is visible when they send the print command, the picture does not print and the text simply wraps around a white-space where the picture was.

    Any suggestions on forcing the picture object to be visible when printing?

    JD

    Are there any updates planned for this product?

    I have both your WPTools ad WPForm components, and, to be honest, the WPForm program is really what I need. But, there are a few features not present that I've tried to add myself without success. Just minor things, but important for my needs.

    Be willing to pay to have them added!

    Essentially, the only things I need are...

    1) text flow from one control to the other like the LinkEdit in WPTools, but with some added features like if the user make a "select all" comand it should select the text in all linked boxes. Oh, andthere may be more than ONE linked edit. For example, tere may be 4 single line boxes, and the text can flow through all of them.

    2) Formula to be a TStrings field rather than a String because you can't really put a complex formula in that uses multiple fields: TStrings would allow a copmlex formula that can be executed via a script. Maybe a pointer or variable to decalre the script engine component (for example, if the formua exists and the script control is not nil, it will run the formula using the named script control). Trid to use the WPEval, but since there is abosolutely NO documentation and no source code, I really can't use that.

    3) "down arrow" navigation that would move the focus to a field BELOW the current field instead of the next in the tab order OR a property that would allow the designer to select which controls to set focus on in case of an "up" or "down" key.

    Here are some items I already added, but would be nice to have built-in as properties. I added these features by using the "DesignTimeName" field and parsing a 10-chacacter string, each character representing a property:

    A) Allow transfer Out (if data changes, transfer the data to other same-name controls)
    B) Allow Transfer In (if the above happened, accept the data or not...sometimes we want SOME of he same name fields to be the same, but not always)
    C) Number Rounding Format (each different character represents a different rounding, such as NONE, 5, 10, 100, 500, etc.)
    D) Graphics Format (if object is Picture): stretch, actual size, fit width, etc.)
    E) Supress Zero (i.e. if value is 0 or null, display the "0" or leave field blank)
    F) Multiple Responses (my application allows the user to fill a field based on responses, and this tells me whether the program should set focus to the next control after a selection or stay in that field to allow the user to keep adding to the current field from the response list).
    G) Response Separator (if multiple responses are allowed as above, what should be placed between selections: comma, space and comma, etc.)
    H) Supress Commas (if numeric value, d you want to display commas for values over 999 or not.)
    I) Parse Response (in my application, a response the user can select from to fill the current field may be something like "CT-Ceramic Tile": parse response tells the program whether to place the WHOLE response in the field, take the FIRST part only ("CT") or take the SECOND part only "Ceramic Tile." This is useful for responses that may be entire paragraphs and can have abreviations for the user to select from)

    Now, the last five are obviously things most people wouldn't want, but I think the first few are useful. Because I have to parse the DesignTimeName to get the value for each of the above, it is very slow moving from field to field. Would likely be faster if these (or most of them) were inherent properties of the TWPGraphic.

    I'm trying to add them, but I'm not that smart.
    JD

    Problem 1:

    How do I set focus to a particular graphic (TWPFGGraphicText, TWPFCUSTOMRichText) control for editing.

    When I set fous to the form, a control is highlighted, but typing doesn't enter into that control until I physically click in the field. I tried a few things, but none seem to work.

    Problem 2:
    How do I control the form scrolling. Page-up and Page down either take one to the top of the next page or bottom of the previous page.

    Any help would be appreciated.

    Figured a solution out myself.

    If the focussed control is a TWPCustomRichText and the paragraphc number (CPParNr) is 1, then I Set_ParIndent(X,0,0) where "X" is an integer I store somewhere in the base class (hopefully I can access something like a "formula" field).

    JD

    If I use an TWPCustomRichText in a form, is there a way to set up some protected text.

    In other words, I want the first sentence to be completely uneditable. This way, I can place part of the prompt at the beginning and the user can respond in the remainder.

    My form bsically has areas like...

    "Site Description:


    "

    and the user has the remainder of th eline after "Site Description:" plus two additional lines to decribe the site.

    Since the "ContinuingText" doesn't work the way I'd hoped (for that matter, I don't even know how it works since there's no documentation), this would solve my problem and allow multi-line fields that have only partial first lines.

    Any suggestions?

    John-David Biggers

    OK, not much help in the way of formulas, let's try this one.

    I need to create 5 single-line text fields. If the user types in too much into the first, the focus will be set to the second and text flow will continue there, then to the third, and so on. Essentially, I want to do something similar to that "TextFlow" example in the WPTools demo (linked WPFRickText objects).

    It appears as if the GraphicText oject can be asigned a "continuing control" and I am assuming this is something similar.
    Is there a way to do this?

    For that matter, if you will just point me to where in the source the TWPFGGraphicText object is told not to accept any more text (it beeps when you can't type any more text into the field), I can maybe write some crude code to accomplish this.

    WOULD REALLY APPRECIATE A RESPONSE!


    John-David Biggers

    Hello.

    I have been asing questions about formulas, too, and no one even responds.

    I came up with a work-around.

    In the formula field, create a string in the following format:

    FunctionName|FieldToGetResult|UseField1:UseField2:UseField3

    Then, in the UpdatData section of the form, parse (using the "|" as the separator) the forumla into the function name, the field that gets the result, and the fields (as one string) to use for calculation.

    Then create a VBScript to modify the data, such as

    VBSCRIPT CODE

    function calcs5(params)
    z=split(params,":")
    calc5=(z(1) + z(2))/z(3)
    end function

    DELPHI CODE

    In the Delphi Program, you need to add an MSScript OCX control (the TAWScript is GREATE) I installed the TAWScript unit, so this basically is a wrapper around the MSScript OCX and creates a control call TAWScriptControl. I load the VB Code above intot he Code of the script control. Then I call it like below.

    In the UpdateData section code the following;

    (WPForm1.ObjectByName(FieldToGetResult) as TWPFGGraphic).ansiText
    =TAWScripControl1.CallFunction(calc5,[FieldsToGet]);

    Works perfect.

    Of course, it would be better if I knew one way or the other if formulas could actually be put in the formula field.

    The nice thing is you can store the VB Script into a multiline Text edit in the form, so each form can be independent of the program READING the form.

    John-David Biggers

    Well, I received no reply on the newspost. Finally found this forum. But I see someone else also asked about formulas and received not a single reply in months.

    Can someone tell me if formulas are implemented in WPForm. If they are, please give an example, particularly one that uses calculations for other fields (such as d=(a+b)/c where a, b, d, and d are other fields).

    If they aren't please at least respond that they aren't implemented.

    An answer would be appreciated.

    John-David Biggers (JD)

    I have a program simialr to what you describe.

    In my program, the user builds a form based on individual pages. So, for example, there are a library of pre-built forms (single pages) for them to choose from. They select pages to add to their report. When I save the file, I save to the stream not only the form, but the names of each page. So, in a listbox that displays on the left, it shows all the forms in their report. They click on one to jump to it, and can move pages up, down, or delete to change the order of pages in their report (a use might need a photo page, a comment page, a particular form, etc).

    What I did was if a page was create two WPFormEditors, one visible and one not. I open the form needed in the invisible one, then paste that to a new page in the visible one. When th user saves their report, it first writes the contents of the listbox showing all the forms and their order that they added them, then writes the contents of the form )report) they created.

    So, in your case, you can add a new page and, if a different form is needed, you can open it in a blank editor, insert a new page to your main editor, then paste it over. The thing to be careful of is NOT to overwrite original forms.

    Hopefully I am understanding what you want to do. But it would seem that you could do pretty much the same thing...apply pre-defined forms IF they are needed to a new form set.

    JD