Edwin Yip
-
Content Count
430 -
Joined
-
Last visited
-
Days Won
3
Posts posted by Edwin Yip
-
-
With my very limited knowledge in this area (in the information collecting stage for a possible future project), ActiveX solutions aside, AFAIK, there is only one free option - use the low-level API of PdfiumLib, but I'm not sure if there is any Delphi sample code.
If you can wait, ImageEn developer is planning to add such annotation feature to that lib (with has a PDF viewer already).
-
1 hour ago, VilleK said:Hi,
I implemented Sugiyama here:
Do you mean this algorithm : https://blog.disy.net/sugiyama-method
-
Try this magical Delphi Expert: https://github.com/NickRing/Delphi-Shortcut-Finder
It's as amazing as a magic! I'm using an older version for my old XE4.
-
Alternatively, Maybe raise a request to the CNWizards team for their InputHelper module might get such feature implemented faster ;)
-
1 hour ago, Alexander Sviridenkov said:Yes.
Wonderful! FWIW, please consider QuickJs ;)
-
Hi Alexander,
Another question, do you have a plan to provide JavaScript support in the future for HCL in the future?
I'm not asking for any concrete time-frame but just if a plan is there ;)
-
1 hour ago, Alexander Sviridenkov said:There is CSS contenteditable property which can be set to true or false using snandard CSS rules.
Great!
QuoteDeleting of certain tags cannot be prohibited, but editor supports XML schema which can define rules for adding new tags (what tags are allowed and what tag can be added to another tag).
Pity. Can't the editor provide events like `OnBeforeDeleteElement`, `OnBeforeEditElement`, and so on?
-
Hi Alexander, Good job!
May I take this chance to ask, can you control which elements can/cannot be modified in HCL editor?
For examples:
- Allows some <p> texts to be editable while some cannot be edited.
- Disable deleting of <p> tags while allowing editing the texts.
- And so on...
-
As you said, "I do understand however that you may have non technical users from which you may want to hide this detail.", and that's what I wanted, just like DMustache allows you to use methods (non-class methods) to define custom functions.
Anyways, I understand that's the current status of the template engine, I can live with that.
-
Oh, that make the template code complex, especially if you need third parties to write the template...
And actually I'm asking something else - What I mean is how to access relevant data in Delphi utility functions, like TMyUtilities.DoSomething in the document example...
-
@darnocian, according to the documents, since custom function for the template must be defined as static class methods, how do I access contextual data in those utility methods?
I can see you can use `class var` to pass contextual data to the utility class before calling `Template.Eval`, but in case of multi-threaded template rendering, it seems that locking is unnecessarily needed. But at least it's workable? I'll try but you might have a better answer? Thanks.
It'll be great if ITemplateFunctions.AddFunctions supports non-class methods, so that in the methods the object's fields are accessible.
-
16 minutes ago, darnocian said:Yes, you can do something like the following:
begin var ctx := Template.Context; ctx.StartToken := '{{'; ctx.EndToken := '}}'; Assert.IsEqual('hello', Template.Eval(ctx, '{{ if true }}hello{{else}}bye{{end}}')); end;
Oh, I think you misunderstood - what I mean is that you can customize the html code generated by `RenderMenu` by allowing the passing to it the `<li>` tags to use, for example, use `<li class="levelItem">`
-
After more thoughts I realized that you can customize the starting/closing tags through function parameters, so that to be more practical.
-
As I understand it, I think you are actually demonstrating option 1?
However, it's not suitable for me since I need the logic to be represented in the template code.
But thanks all the same.
The nested for loops does the work - all after all, the menu always have a limited nesting level, on contrary to my original statement...
-
Thanks, no hurry, because I've solved the issue with nested for loops in the template code.
The recursion must be represented in the template code in order to be helpful in my case.
-
@Dany Marmur, Thanks for sharing.
Without sample code actually I'm not sure what does "use a stack in the template" as described by @darnocian actually mean. I use nested `for` loops to access the tree structure passed to the template engine.
-
Thanks for the help. I'm trying to use option 2, by passing multi-level nested objects that represents the menu structure and in the template code use nested `for` loops to generate the `ul/li` items.
-
1 hour ago, Xequte said:Editing of annotations via PDFium is on the to-do list.
This is a great news!!!!
QuoteIf you are looking to generate PDF files only (i.e. not edit existing PDF files) then ImageEn's native PDF support (creating and saving) can be used in threads.
Can you point us to the specific page on your site that describes this feature in detail? Thanks.
-
4 hours ago, Attila Kovacs said:Can we see a "branch" example with 10+ projects having own code, shared code, 10+ major 3rd party libs, tons of binary data, whatever I forgot to mention. Asking for a firend.
I bet you yourself are that friend of your own :D
-
26 minutes ago, timfrost said:But anything based on PDFIUM has the limitation of single threading only. Which may not matter if you have a user interactively tweaking annotations and images, but it does to the applications I deal with.
I don't know that limit. Do you mean you cannot manipulate the pdf with Pdfium in a background thread even using a legitimate locking mechanism?
-
With Sempare Template, how can you achieve recursive code generation?
For example, in case of html page menu, the level is not fixed, how do you recursively generate the nested `<ul><li>` items?
Thanks
-
ImageEn will be unbeatable if it allows editing and saving of pdf annotations like what you can do with it against images.
I had a look at the Pdfium interface, it seems to provide such API.
-
Thanks for your answer.
1. Do you use Pdfium DLL or .obj files? I prefer the later, if even possible.
2. Do you mean with ImageEn you cannot annotate a pdf at all, or do you mean you can annotate it but cannot modify the annotation after saving it to disk?
-
Congrats for the new release. I've got several questions if you don't mind:
- Is the pdf engine based on Pdfium?
- Can you add pdf annotation such as text, rectangle, and so on to a pdf and save to disk, like you can do with image files with ImageEn?
- Does it support navigating a pdf file with the hierarchical bookmarks like this: https://www.winsoft.sk/pdfium.png
Thanks.
When `Scaled` is set, form inheritance will cause duplicated scaling? Any one can confirm?
in VCL
Posted · Edited by Edwin Yip
Hi all,
I've just encountered an issue that's quite strange and it took me hours to figure out but still couldn't confirm where dose it come from.
The situation I found is like this:
Let's say we have a VCL program with DPI-aware enabled (with xml manifest correctly set, all forms have `Scaled` set to true and working), and the form inheritance is like this:
TFormC inherits from TFormB which in turn inherits from TFormA, which have some buttons on some panels.
I found that, when running on a computer with different system DPI, TFormA will be auto scaled for 1 time and it's correct.
But TFormB will be wrongly scaled and shifted twice, while TFormC will be scaled and shifted for 3 times.
All other forms, even with form inheritance, but since there is no controls on the parent forms, the auto-scaling works.
I'm not sure if it's related to my Delphi version and I use XE4, I wonder anyone can confirm if the issue comes from form inheritance?