Beiträge von Sleep

    Hi,

    I am using following code to insert images with hyperlink into the editor:

    Code
    // SelectInternalHyperlinkAsObject is method which creates // new TWPOImage descendant class object. So different formats  // has different classes - TdoWPSoundImage, TdoWPFlashImage etc...// lImageHyperlink is new object created by the method.lImageHyperlink:=SelectInternalHyperlinkAsObject(WorkWithRichText.Memo.RTFData);if Assigned(lImageHyperlink) thenbegin  with lImageHyperlink do  begin     //... some settings here  end;  WorkWithRichText.SelectedObject := WorkWithRichText.TextObjects.Insert(lImageHyperlink);  lHyperlinkObject := WorkWithRichText.HyperlinkAtCP;   // we need to setup also hyperlink for this new object  lPomS := CONST_HYPERLINK_GUID + TdoWPImage(lImageHyperlink).GUID;  if lHyperlinkObject <> nil then    lHyperlinkObject.Source := lPomS  else    WorkWithRichText.InputHyperlink(lPomS);end;

    I need the inserted hyperlink available when showing the text inside the application.
    I have also created new HTML writer class, to be able to render our own object for the web browsers as needed.

    In the writer I override the method WriteObject and I am calling the appropriate code to render correct HTML for the TdoWPSoundImage and other objects. But here is the problem. Because the Hyperlink text object is always generated as A tag, I always get something like

    Code
    <a href ....><embed id........></a>

    the embed part is our own code. The a href part is from hyperlink object. This makes some problems for us.

    I have method which is called before the rich text is generated to html. In this method I need to delete some of the hyperlinks, based on the hyperlink's inner image object class. My idea is:

    1) Iterate throught all TextObjects inside the richtext. (I know how to do it :-)
    2) If the objref for current object is our own class (TdoWPSoundImage) then delete its text hyperlink object (I have no idea how to do this - I can select hyperlink at CP but How can I found the CP for the selected object). Or is there any other way how to solve it?

    Can you help me, please?

    Petr.

    Hi,

    I want to order upgrade from WPTools 5 STD to WPTools 6 Pro/Premium. I was not able to find that option in the upgrade order page. Can you help me with this? Should I order WPTools 5 STD to WPTools 6 STD upgrade (€99) and then WPTools STD to WPTools PRO? And if I want to move to premium version? You don't have anyt option to move from STD to PREMIUM or from PRO to PREMIUM. Also if I own also licence for Wpdf, should I upgrade also this product?

    Petr.

    Hmmm to be honest, you didn't answer my questions at all. I understand that many improvements made for WPTools 6 are propagated back to WPTools 5 and new functions will be available only in WPTools 6. What I don't understand is why only NEW CUSTOMERS have access to betaversion??? Why your current customers can not buy upgrade or get access to some time limited betaversion to be able to try the new functions? We own components from DevExpress, HiComponents, TMS software, Digital-metaphors, and from some other companies. You are the only one who provide access to new betaversions to NEW customers only and completely ignore your current customers. In normal way, current customers get access to betaversion at first place and new customers gets only the final version.

    Am I the only one person who has this feelings?

    Quick update: I just discovered that upgrade to WPTools 6 is available. I have some questions about upgrade in different topic. Thanks for that.

    Petr.

    I read in one of your message, that WPTools version 6 beta is available to new customers. If that is true and the beta is not available to legitimate users of WPTools 5 - than I am really dissapointed by that decision.

    Let me explain why. I use WPTools since version 3. I payed you for new versions - upgrade to version 4, than version 5. Now you have new version - I am waiting for it (unicode support and changes in dialogs GUI) - and now you get this new betaversion to your new customers only??? We your loyal customers have more experience with WPTools compared with new customers, we have projects where are your components used and we are omitted from betatesting? Why are you choosing this strategy? Why didn't we received any notification about availability of this release or at least some explanation? Are your loyal customers not important for you and you need to catch new customers only?

    If we can not betatest and you have only few betatesters than, please, explain the situation to your other customers. We need more information.

    Maybe I missed some information, but I read all messages about WPTools 6 and didn't find any detailed explanation. If you have more information available, can you please forward me to correct place?

    Is it only me who has this feeling about lack of the provided informations?

    Petr.

    Hi,

    another question belongs to alpha transparency of bitmap object. I am still trying to make it works, but I am not able to find the right way, how to load or show transparent images PNG inside WPTools.

    I am using ImageEN components to create TBitmap object with alpha transparency but WPTools alsways shows the image with gray color in background. If I set TWPOImage Transparency to True, the image will be transparent only like one color transarency. Can you change the internal drawing of TWPOImage.Paint method to use alpha channel? Or can you please, provide me example, how to use transparent images inside WPTools?

    Thanks.

    Petr Slipek.

    Hi,

    I need to place video player inside WPTools editor with the play and stop functionality. Something like image object but with (for example avi) video file assigned. I will also need to have some buttons to control the start, stop and play functionality.

    What is the best way to have it done? I have idea to create Image descendant and make some work on saving and loading video file and to show first screen of the video together with buttons. But I have no idea how to show video inside the bitmap object - while playing. I can only play the video in separate window. Is it possible to embed TMediaPlayer as a object?

    Thanks for your answer.

    Petr Slipek

    Hi, I have troubles with HTML Writer in combination with hyperlinks. The writer wrongly closes font tag in generated HTML page. Here is the example

    -------GENERATED HTML CODE-------------
    <div>
    <font> Some text
    <ahref>
    </font>
    <i>
    <font>Hyprlink text</font>
    </i>
    <font></a>
    not hyperlinked text.
    </font>
    </div>
    ------------------------------------------------
    You can see, that a href tag is placed inside the font tag. The same is for closing a tag. The correct output should be

    ------------CORRECT CODE-----------------
    <div>
    <font>Some text</font>
    <ahref>
    <i>
    <font>Hyprlink text</font>
    </i></a>
    <font>
    not hyperlinked text.
    </font>
    </div>
    -----------------------------------------------

    The code above is just short part of the whole html file. The main problem is the order of the open and close tags. Please send us the bugfix or tips how to correct this.

    With regards
    Petr Slipek.

    Hi,

    I found some small bug with mailmerge functionality. I am using TppDBWPTRichText wrapper. If I use the mailmerge functionality the ReportBuilder prints the rich text without merged fields - the Merge fields are empty. I slightly modified the TppCustomWPTRichText.MergeDBFields methods and now it works. Can you look at the changes and include them into official release? Thanks.

    My changes:

    Petr Slipek

    Great thanks.

    Yes, yes, yes, it works as expected. I knew that I was doing something wrong, but I totally missed that methods (load and save) - so my mistake.

    Thanks for help.

    Now it seems that I can begin with implementing new features into our application. Conversion from v4 to v5 is done. It takes only few days and with your support it goes smoothly. Thanks again.

    With regards

    Petr Slipek

    Hi,

    I implemented your modificcations into WPTools and it works as it schould. Nice work. Thanks.

    Final modified code is:

    1. Procedure TableMakeCellWidthPC:

    Code
    procedure TWPCustomRtfEdit.TableMakeCellWidthPC;var par: TParagraph;  b: Boolean;  w : Integer; begin  par := HeaderFooter.FirstPar;  b := FALSE;  while par <> nil do  begin    if par.ParagraphType = wpIsTable then    begin      par.FixAllRightCellWidths(true, 0, true);      if {AlsoSetTableWidthPC and} par.AGet(WPAT_BoxWidth, w) then      begin         par.ADel(WPAT_BoxWidth);        if par.ParentCell<>nil then          w := Round(w/(par.ParentCell._IsWidthTw)*10000)        else          if WordWrap then            w := Round(w/(((Memo.WindowWidth/CurrentZooming*100)*1440-XOffset)/WPScreenPixelsPerInch)*10000)          else            w := Round(w/(Header.PageWidth-Header.LeftMargin-Header.RightMargin)*10000);        if w>10000 then w := 10000;        par.ASet(WPAT_BoxWidth_PC, w);      end;      b := TRUE;    end;    par := par.next;  end;  if b then DelayedReformat;end;


    I comment out the AlsoSetTableWidthPC and - I didn't find info for AlsoSetTableWidthPC variable or constant or switch.

    2. DoBroadcastMsg - changed:

    Code
    WPBROADCAST_AFTER_LOAD:begin  {if wpAlwaysColWidthPC in EditOptionsEx then  begin    ReformatAll(false, false);    TableMakeCellWidthPC;   end;}   if assigned(FAfterLoadText) then FAfterLoadText(Self);   StartUpdate(WPUPD_AFTER_LOAD); end;

    3. Added one line to the Resize method after inherited Resize:

    Code
    inherited Resize;
    if WordWrap and (wpAlwaysColWidthPC in EditOptionsEx) then TableMakeCellWidthPC;

    After this, the editor behaives as I need. Can you, please, include this modifications into official release. Thanks.

    If you help me to resolve the last problems with Custom OLE objects, I will be totally satisfied and happy customer. :-)

    With regards.
    Petr Slipek

    Hi,

    I understand your tip. This way I can save internal metafile to the data stream. No problem with it. But I will have big problem with loading texts created in WPTools v4.25. Where are this data handled differently.

    In version 4.25 I slightly modified your code - look at the thread http://wpcubed.com/forum/viewtopic.php?t=1692. I sended you our unit by e-mail.

    This way in v4.25 I can generate inserted OLE object to Metafile and display it as metafile, but store its original data as data bag for the image. It saves and loads correctly - I can edit the data after save, load process. After converting to v5 this mechanism fails. You stated in the above thread that this is functional in v5. I really need some tips how to solve this. In the e-mail I sended you example of saved RTF from version 4.25. With corresponding unit to handle OLE objects you could be able to load the RTF into v4.25. How can I load it into v5 correctly.

    Thanks for your time.

    Petr Slipek.

    Hi,

    about the total table width. Maybe I don't understand you at all - sorry about that - maybe my language skillness.

    The created table is always set to have some fixed width? Or you are just saying that the code you changed - modified the WPTools to have only columns width in % are for columns handling?

    Because if I insert new table - the table's width is the whole page - I can resize the editor to any size and the table is resized too. If I chage any of the columns - the table get's to fixed width - stops resizing.

    I didn't tested the code yet - for table resizing, but will it works for Tables inside other tables?

    Code
    if WordWrap then 
      w := Round(w/(((Memo.WindowWidth/CurrentZooming*100)*1440-XOffset)/WPScreenPixelsPerInch)*10000) 
    else 
      w := Round(w/(Header.PageWidth-Header.LeftMargin-Header.RightMargin)*10000); 
    if w>10000 then w := 10000;

    It uses ClientWidth for basic calculation. Is this Editor Width or ParentCell Width, as it schould be.

    Anyway thanks for your help.

    Petr Slipek

    Hi,

    i have still problems with our custom objects - for use within WPTools. I build demo application which shows our problem. http://www.dosli.cz/soubory/wpcubed/WPToolsCustomObj.zip

    The main problem is, that our object is saved with extension CST, but loaded with default TWPOImage class. Not ours. Our class returns correctly custom extension, but the load mechanism failed.

    We need to create image object which shows Metafile or PNG Image and can carry another data - for this reason I use streamed data storage technology (for the demo not necessary, but it only shows the problem). I build this objects based on your code from this forum. The same code works with v4.25 but not with 5.20.2.

    In the demo is some notes on the form - how to use it.

    With regards
    Petr Slipek

    Hi,
    thanks for the new version with wpAlwaysColWidthPC EditBoxOptions. There are some minor yet unresolved backside effects.

    If you create new table with 3 columns. Then try to resize the editor to any width - the table will resize correctly - columns remains with relative width.

    Than try to change column width to other width. Then if you change the editor width to smaller, the table will resize correctly, but if you change the width of the editor to bigger size that was before changing column width, the table will stop resize at that position and didn't get bigger. So the total table width gets fixed. Can you, please, correct this too? Thanks.

    And I have another problem if I resize the editor I sometimes get error Invalid floating point operation. This error appears in procedure TWPCustomRtfEdit.TableMakeCellWidthPC;

    Call stack:

    It looks like some initialization problem because this is happen only if assigning new text (editor.AsString) with contained table to editor. Will investigate further.

    After the error if I click on the editor the text is showed correctly.

    Petr Slipek

    Hi,

    I am able to duplicate this error with simple application - just follow the steps:

    1. Place two WPRichText editors on the form.
    3. Place one button on the form.
    4. Create ButtonOnClick event with this code:

    Code
    WPRichText2.Clear;
    WPRichText2.AsString := WPRichText1.AsString;

    If you run this application, the second line of event handler generates AV. If you delete any of these lines the application will run correctly. If you remove second line you will see that the paper of the WPRichText2 editor dissapears. If you click on the grayed editor the paper is drawed correctly. This code works with WPTools 5.20 but don't work with v5.20.1

    Petr Slipek