Cudatext: API: A couple 'Editor.gap()' requests

Created on 6 Jun 2021  路  8Comments  路  Source: Alexey-T/CudaText

  1. If it is not too much trouble - ability to embed a dialog in the gaps.
  2. GAP_DELETE_BY_TAG - at the moment I can only delete all or by line indexes.

I'm making a preview for long lines. So far works ok, but it would be nice for the dialog to scroll with the text, and even better if I don't have to move it manually :)

llpv

(No urgency :) )

enhancement API

All 8 comments

I like these ideas. Added GAP_DELETE_BY_TAG. Todo: seecond wish.

It's even trivial to animate with app_idle(), that's cool

https://user-images.githubusercontent.com/74829192/120929373-7a86ba80-c6f1-11eb-84f2-043224c9c0ce.mp4

it was jarring without animation

yes, looks nice. About such forms-in-gap. 2-3 years ago I thought that we can have 'embedded editors' like Adobe's editor (based on JS) can do for editing CSS parts inside HTML file. I ditched this work. but API resurrects this idea

adobe

This adobe editor? (google result)

Basically editing linked documents inside original doc? That's really cool, I would use it a ton to glance at the code from other files.

yes, correct.

last beta upddated. Added API!
tested it a little in a helper program.

  • add: Editor.gap: GAP_ADD can also add the form using form's handle

  • GAP_ADD: Adds gap to editor. Returns bool: params correct, gap added. Params:
    * "num1": int: Line index; can be -1 for gap before the first line.
    *
    "num2": int: Can be:
    * 0: gap will be empty
    handle of bitmap (created via GAP_MAKE_BITMAP): place bitmap in the gap;
    *
    * handle of dialog (created via dlg_proc()): place form in the gap.

Works great, thank you.

Is it ok to change gap size by just adding new one to the same line? Seems to work fine, number of gaps in GAP_GET_ALL doesn't change, but I don't know how adding same dialog 20 times during the animation is handled...

as I see, it must work ok, w/o any mem leaks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xcme picture xcme  路  5Comments

JairoMartinezA picture JairoMartinezA  路  5Comments

Alexey-T picture Alexey-T  路  5Comments

Alexey-T picture Alexey-T  路  7Comments

junguler picture junguler  路  5Comments