[Module] EditorEx (Custom Editor Gadget)

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: [Module] EditorEx (Custom Editor Gadget)

Post by srod »

A few bugs I'm afraid.

Hit 'enter' in the middle of a line and then hit backspace a couple of times. Doesn't work the way it should.

Cursor to the end of a line and insert a couple of characters. Sometimes it works fine, other times the first character is prepended to the next line and the second character is added elsewhere!

Undo doesn't seem to work unless I am missing something?

PB 5.70 LTSx64 beta 3.
I may look like a mule, but I'm not a complete ass.
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] EditorEx (Custom Editor Gadget)

Post by Thorsten1867 »

Apparently the invisible control characters for the line break caused the problems.
I hope it works better now.

An Undo is created after pressing the Space key for the previous word.
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: [Module] EditorEx (Custom Editor Gadget)

Post by srod »

Yes, better! :)

However, cursor to the middle of a line, hit return and then backspace. An additional space is inserted. Hit return twice, 2 spaces inserted!

Still can't get undo/redo to work in any 'sensible' way. Seems to undo one action and no more.
I may look like a mule, but I'm not a complete ass.
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] EditorEx (Custom Editor Gadget) [Beta]

Post by Thorsten1867 »

Code: Select all

[09/12/18] Scroll and drawing routines completely revised & flashing cursor & mouse wheel & Shortcuts added & Bugfixes
Please test!

Here is a list of the currently available shortcuts:

Code: Select all

; Home         - Move cursor to start of row
; End          - Move cursor to end of row
; Shft-Del     - Cut & copy selected text to clipboard
; Shft-Insert  - Paste clipboard at cursor position
; Crtl-A       - Select all
; Crtl-C       - Copy selected text to clipboard
; Crtl-D       - Delete selected text
; Crtl-V       - Paste clipboard at cursor position
; Crtl-X       - Cut & copy selected text to clipboard
; Ctrl-Z       - Perform Undo
; Ctrl-End     - Move the cursor to the end of the last row
; Ctrl-Down    - Move the cursor to the beginning of the next paragraph
; Ctrl-Home    - Move the cursor to the beginning of the first row
; Crtl-Insert  - Copy selected text to clipboard 
; Crtl-Left    - Move the cursor to the beginning of the previous word
; Crtl-Minus   - Insert at cursor position a 'Soft-Hyphen'
; Crtl-Right   - Move the cursor to the beginning of the next word.
; Crtl-Up      - Move the cursor to the beginning of the previous paragraph.
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
mestnyi
Addict
Addict
Posts: 995
Joined: Mon Nov 25, 2013 6:41 am

Re: [Module] EditorEx (Custom Editor Gadget) [Beta]

Post by mestnyi »

invalid memory access
3125 line

Code: Select all

Edit()\Text\Space  = Font()\Char(" ")
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] EditorEx (Custom Editor Gadget) [Beta]

Post by Thorsten1867 »

Code: Select all

[11/12/18] Fixed fundamental problem in selection & Bugfixes
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] EditorEx (Custom Editor Gadget) [Beta]

Post by Thorsten1867 »

Code: Select all

[12/12/18] Automatic spell checking & Bugfixes
I have tried to implement this as resource-efficiently as possible.

On the one hand, a check is only carried out if there is an empty or punctuation character and on the other hand, each word (even if there are several gadgets) is only checked once against the dictionary until the program is finished.
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
Cyllceaux
Enthusiast
Enthusiast
Posts: 458
Joined: Mon Jun 23, 2014 1:18 pm
Contact:

Re: [Module] EditorEx (Custom Editor Gadget) [Beta]

Post by Cyllceaux »

How about a DPI-Version? :wink:
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] EditorEx (Custom Editor Gadget)

Post by Thorsten1867 »

Update:
  • Modules completely revised (selection/cursor handling)
  • DPI - compliant
Possibly there are still hidden problems with DPI that I haven't discovered yet.
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
Cyllceaux
Enthusiast
Enthusiast
Posts: 458
Joined: Mon Jun 23, 2014 1:18 pm
Contact:

Re: [Module] EditorEx (Custom Editor Gadget)

Post by Cyllceaux »

works for me :D

OH... Line 5259... Why CompilerElseIf?

thx
davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

Re: [Module] EditorEx (Custom Editor Gadget)

Post by davido »

@Thorsten1867,
I downloaded the latest version. On Windows 10 it looks fine.
However, I noticed a minor problem on my Macbook:
On a new line I entered 4
The cursor appeared to be 1 pixel after the character: 4|
Upon entering another 4 the cursor was now on the last pixel of the last 4
After a few entries the line looked: 444444|4
DE AA EB
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] EditorEx (Custom Editor Gadget)

Post by Thorsten1867 »

After the cursor caused some trouble again and again, I now follow a new approach and have completely reworked the module.
Instead of splitting the text into lines using wordwrap, I now work with "virtual" lines, i.e. these are only one position with a certain length in the text string.
In addition, the text is no longer drawn line by line, but word by word, which allows a seamless integration of WordWarp, hyphenation and syntax highlighting.
After I stumbled across the "Damerau-Levenshtein-Distance" some time ago, there are now suggestions for correcting misspelled words.

Update:
  • New: Completely revised with a new approach to text handling
  • Added: Correction suggestions for spell-checking (right click on wrong (red) words)
  • Added: Right douple click: spell-checking of the word and, if necessary, correction suggestions
  • Added: CountItems()
  • Bugfix: SetText()
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
mestnyi
Addict
Addict
Posts: 995
Joined: Mon Nov 25, 2013 6:41 am

Re: [Module] EditorEx (Custom Editor Gadget)

Post by mestnyi »

this does not work in mac os
User avatar
mk-soft
Always Here
Always Here
Posts: 5334
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: [Module] EditorEx (Custom Editor Gadget)

Post by mk-soft »

There is a small bug in the InputHandler

Change Line 2888

Code: Select all

    If FindMapElement(EditEx(), Str(GNum))
      
      If EditEx()\Flags & #ReadOnly = #False

P.S.
I change BackColor...
Line 4459

Code: Select all

          ;EditEx()\Color\Back          = BlendColor_(OSX_NSColorToRGB(CocoaMessage(0, 0, "NSColor textBackgroundColor")), $FFFFFF, 90)
          EditEx()\Color\Back          = BlendColor_(OSX_NSColorToRGB(CocoaMessage(0, 0, "NSColor textBackgroundColor")), $FFFFFF, 97)
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] EditorEx (Custom Editor Gadget)

Post by Thorsten1867 »

Bug fixed
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
Post Reply