PBEdit - a Canvas-based Texteditor

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
Mr.L
Enthusiast
Enthusiast
Posts: 104
Joined: Sun Oct 09, 2011 7:39 am

Re: PBEdit - a Canvas-based Texteditor

Post by Mr.L »

Hi Saki, thanks for the reply. Your workaround is working great, but i came along with another solution.
I now send custom events to signal changes of the cursor position or the selection.

This is implemented in the new version (1.0.6) - see first post.
User avatar
Saki
Addict
Addict
Posts: 830
Joined: Sun Apr 05, 2020 11:28 am
Location: Pandora

Re: PBEdit - a Canvas-based Texteditor

Post by Saki »

Hi, yes.
If things are still too hectic, I often put a small timer in, then it is optimally smooth.
But it always depends on what it is.

Best Regards Saki
地球上の平和
Mesa
Enthusiast
Enthusiast
Posts: 345
Joined: Fri Feb 24, 2012 10:19 am

Re: PBEdit - a Canvas-based Texteditor

Post by Mesa »

@Mr L
thank you, Mesa!
I've uploaded a new version (1.0.5 - see first post) that includes your translation!
cool. :D

A little bug is here, line 905:
Change

Code: Select all

languageFile = "language_XX.cfg"
by

Code: Select all

languageFile = "PBEdit_XX.cfg"
M.
Mr.L
Enthusiast
Enthusiast
Posts: 104
Joined: Sun Oct 09, 2011 7:39 am

Re: PBEdit - a Canvas-based Texteditor

Post by Mr.L »

thanks again, Mesa! I totally overlook that.

My only way of testing the code under Linux is to run it under Virtualbox.
Unfortunately, scrolling or writing text rapidly is lagging really bad.
Can somebody with "real" Linux confirm that? Or does it run smoothly?
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5342
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: PBEdit - a Canvas-based Texteditor

Post by Kwai chang caine »

Wonderfull professionnal look :shock:
Thanks for sharing 8)
ImageThe happiness is a road...
Not a destination
mestnyi
Addict
Addict
Posts: 995
Joined: Mon Nov 25, 2013 6:41 am

Re: PBEdit - a Canvas-based Texteditor

Post by mestnyi »

Works surprisingly well thanks for sharing. I hope you haven't abandoned it. Does your editor have word wrap?
Mr.L
Enthusiast
Enthusiast
Posts: 104
Joined: Sun Oct 09, 2011 7:39 am

Re: PBEdit - a Canvas-based Texteditor

Post by Mr.L »

mestnyi wrote:I hope you haven't abandoned it. Does your editor have word wrap?
Hi, mestnyi!
No, its not abendoned but unfortunately wordwrap is not implemented yet.
I started doing so but quickly realized that it is really hard to make it work properly. (I should have thought about that feature much earlier :oops: )
User avatar
Saki
Addict
Addict
Posts: 830
Joined: Sun Apr 05, 2020 11:28 am
Location: Pandora

Re: PBEdit - a Canvas-based Texteditor

Post by Saki »

Look for it, MK-Soft has solved it nicely,
maybe this will help you.
地球上の平和
Mr.L
Enthusiast
Enthusiast
Posts: 104
Joined: Sun Oct 09, 2011 7:39 am

Re: PBEdit - a Canvas-based Texteditor

Post by Mr.L »

The word wrap "as such" is not the big problem. But calculating the line numer or get the correct character at mouse position X/Y, is (at leaast for me).
Then there are cases where you have a line continuation or folded code parts...
When i started this project I had a code editor in mind, so that feature never was on my agenda.
User avatar
Saki
Addict
Addict
Posts: 830
Joined: Sun Apr 05, 2020 11:28 am
Location: Pandora

Re: PBEdit - a Canvas-based Texteditor

Post by Saki »

Yes, I also think it is unnecessary.
The effort is in no relation to the effect.
地球上の平和
User avatar
fsw
Addict
Addict
Posts: 1572
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Re: PBEdit - a Canvas-based Texteditor

Post by fsw »

Very nice job Mr.L.

There seems to be a bug with AutoComplete.
(running macOS Big Sur)

If I type:
  • Procedure
The AutoComplete window appears with a list containing:
  • Procedure
    ProcedureC
    ProcedureDLL
    EndProcedure
    ProcedureCDLL
    ProcedureReturn
and all is fine, as all six keywords are visible.

Now, when I add a "C" to make:
  • ProcedureC
The list is reduced to 2 keywords, but the lower item in the list is covered by the horizontal scrollbar of that list.

Even worse, if I add a "D" to make:
  • ProcedureCD
The list is reduced to 1 keyword, but the keyword in the list is covered by the horizontal scrollbar of that list.

Like I said, I'm on macOS Big Sur and it could very well be a Big Sur issue.
(as scrollbars are visually different than on former macOS versions.

Keep up the good work.
:)

EDIT: Typos...
Last edited by fsw on Fri Dec 04, 2020 11:11 pm, edited 3 times in total.

I am to provide the public with beneficial shocks.
Alfred Hitshock
Mr.L
Enthusiast
Enthusiast
Posts: 104
Joined: Sun Oct 09, 2011 7:39 am

Re: PBEdit - a Canvas-based Texteditor

Post by Mr.L »

fsw wrote:There seems to be a bug with AutoComplete.
(running macOS Big Sur)
Thx for the reply, fsw!
I'm looking into it. Maybe I have to create my own Listview for the AutoComplete list (already had that in mind some time ago). That would open up some nice extra features and eliminate some workarounds I had to come up with in the current version.
Last edited by Mr.L on Mon Dec 07, 2020 9:15 pm, edited 1 time in total.
Mr.L
Enthusiast
Enthusiast
Posts: 104
Joined: Sun Oct 09, 2011 7:39 am

Re: PBEdit - a Canvas-based Texteditor

Post by Mr.L »

Version 1.08 is online!

changed: the new AutoComplete list is drawn directly on the canvas (no separate Window and ListViewGadget anymore)
fixed: bug in Procedure Selection_Move that led to adding of blank lines and messed with the undo function

update
fixed: bug in display of the AutoComplete list
fixed: multicursor with overwrite-mode didn't work properly with multiple cursors set in same textline

Download
User avatar
fsw
Addict
Addict
Posts: 1572
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Re: PBEdit - a Canvas-based Texteditor

Post by fsw »

Hello Mr.L,
The Autocomplete ListView seems to work fine, thank you.

Keep up the good work :)

I am to provide the public with beneficial shocks.
Alfred Hitshock
True29
User
User
Posts: 64
Joined: Sun Feb 03, 2013 1:50 am

Re: PBEdit - a Canvas-based Texteditor

Post by True29 »

good work and great editor.
- i miss the information wich pb version the commands are from, for autocomplete.
- great would be the possibilitie to import a projekt and search for usings of prozedures ;)
- the important shortcuts from vb would be great.
Post Reply