PBEdit - a Canvas-based Texteditor
Re: PBEdit - a Canvas-based Texteditor
Super
Unfortunately 'WindowVectorOutout()' does not work with macOS (Catalina) anymore.
Solution for Style_LoadFont is to create a dummy image.
Line 3428
Unfortunately 'WindowVectorOutout()' does not work with macOS (Catalina) anymore.
Solution for Style_LoadFont is to create a dummy image.
Line 3428
Code: Select all
Procedure Style_LoadFont(*te.TE_STRUCT, *font.TE_FONT, fontName.s, fontSize, fontStyle = 0)
ProcedureReturnIf((*te = #Null) Or (*font = #Null))
Protected c, minTextWidth, image
If IsFont(*font\nr)
FreeFont(*font\nr)
EndIf
fontStyle | #PB_Font_HighQuality
CompilerSelect #PB_Compiler_OS
CompilerCase #PB_OS_Windows
*font\nr = LoadFont(#PB_Any, fontName, fontSize / DesktopResolutionY() * 1.0, fontStyle)
CompilerCase #PB_OS_MacOS
*font\nr = LoadFont(#PB_Any, fontName, fontSize / DesktopResolutionY() * 1.2, fontStyle)
CompilerCase #PB_OS_Linux
*font\nr = LoadFont(#PB_Any, fontName, fontSize / DesktopResolutionY() * 1.0, fontStyle)
CompilerEndSelect
If IsFont(*font\nr)
*font\style = fontStyle
*font\id = FontID(*font\nr)
*font\name = fontName
*font\size = fontSize
image = CreateImage(#PB_Any, 32, 32)
If StartVectorDrawing(ImageVectorOutput(image))
VectorFont(*font\id)
minTextWidth = VectorTextWidth(" ")
*font\height = VectorTextHeight(" ")
*te\lineHeight = *font\height
For c = 0 To 255
*font\width(c) = Max(minTextWidth, VectorTextWidth(Chr(c)))
Next
*font\width(#TAB) = minTextWidth
StopVectorDrawing()
EndIf
FreeImage(image)
ProcedureReturn #True
EndIf
ProcedureReturn #False
EndProcedure
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
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: PBEdit - a Canvas-based Texteditor
Thanks for the kind replies!
I already uploaded a new version with multilanguage support.
When i started I didn't even knew about multicursor editing
The adjustments for the Menutitles can be made in the new "language.cfg" file
I already uploaded a new version with multilanguage support.
I think thats strage - 12% at Idle state is quite high, isn't it?J. Baker wrote:At idle, it uses 12% CPU and 64 MB of memory. I have an Intel 1.4 Ghz dual core CPU. Not bad.
I have worked quite a long time. Many weeks. Mainly because I didn't plan thoroughly in the beginning. So I had to rewrite large parts of the code over and over again.STARGÅTE wrote:How long did you worked on this version?
When i started I didn't even knew about multicursor editing
Did you try pressing down the "Alt"-key while selecting code with the mouse. Is that what you mean by "column selection"?oreopa wrote:Column selection mode like UltraEdit would be a nice addition.
That might be true. Unfortunately I have no clue what to do about itUser_Russian wrote:The editor only supports English characters and numbers.
In the new version they are swapped. I thought horizontal splitting means split the "x-axis" but it could also mean that a horizontal split is made on the y-axis...infratec wrote:I think horizontal and vertical split are swapped
sorry, I didn't think about the XP users.Mesa wrote:With windows XP 32, there is something wrong with the pop-up menu.
The adjustments for the Menutitles can be made in the new "language.cfg" file
Thanks for the reply. Yes, a dummy image is a nice solution. Also the "multi-OS" part for the fontsize.mk-soft wrote:Unfortunately 'WindowVectorOutout()' does not work with macOS (Catalina) anymore.
Re: PBEdit - a Canvas-based Texteditor
It's most likely the blinking cursor having to redraw itself. Otherwise it would be much lower, if not zero percent.Mr.L wrote:I think thats strage - 12% at Idle state is quite high, isn't it?
www.posemotion.com
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT
Even the vine knows it surroundings but the man with eyes does not.
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT
Even the vine knows it surroundings but the man with eyes does not.
Re: PBEdit - a Canvas-based Texteditor
It kind of is, and it kind of isn't. I know thats not very helpful. It works nicely in tables that are regularly formatted, but in data with shorter lines, or lines with no data at all, it doesn't - its kind of a visual thing, but also a slightly different functionality thing as well. I think the simplest way to describe it is that top left and bottom right of the selection define a box which is the selection, and the cursor(s) are placed there (right side) and data typed or deleted happens there... even in lines with nothing but a <cr>... the selection is uniformly rectangular... i dunno if thats an accurate description... it's kinda hard to explain the subtle difference... phew...Mr.L wrote:Did you try pressing down the "Alt"-key while selecting code with the mouse. Is that what you mean by "column selection"?oreopa wrote:Column selection mode like UltraEdit would be a nice addition.
It's not a big deal really. It's a very nice editor indeed.
EDIT: Redraw takes a paltry 0.45% on my ancient 1st gen i5... and (mega-huge) pasting is surprisingly fast...
Proud supporter of PB! * Musician * C64/6502 Freak
Re: PBEdit - a Canvas-based Texteditor
@oreopa:
ah, now i see what you mean. But it would be tough to implement that feature into my editor, i guess.
Right now, in my editor the selection is directly connected to the textlines and you cannot select anything that "is not there".
So, i will keep that feature in mind and maybe one day i come up with a solution
ah, now i see what you mean. But it would be tough to implement that feature into my editor, i guess.
Right now, in my editor the selection is directly connected to the textlines and you cannot select anything that "is not there".
So, i will keep that feature in mind and maybe one day i come up with a solution
Re: PBEdit - a Canvas-based Texteditor
@Mr.L ,
I have two questions:
1. Is there a pure text mode that ignores 'keywords'?
2. Can the background and text colours be changed?
I have two questions:
1. Is there a pure text mode that ignores 'keywords'?
2. Can the background and text colours be changed?
DE AA EB
Re: PBEdit - a Canvas-based Texteditor
yes, if you comment the line (near the end of the code)davido wrote: 1. Is there a pure text mode that ignores 'keywords'?
2. Can the background and text colours be changed?
Code: Select all
PBEdit_LoadStyle(0, "PB_Style.xml")
inside the procedure "_PBEdit_::Editor_New"
you can find the line:
Code: Select all
*te\colors\currentBackground = RGBA( 30, 30, 25, 255)
the default textcolor is defined in the procedure "_PBEdit_::Style_SetDefaultStyle"
Code: Select all
Protected defaultColor = RGBA(155,220,255,255)
Re: PBEdit - a Canvas-based Texteditor
Yes. I guessed that. I guess one would need to pad the "offending" lines out with tabs/spaces on the fly somehow.Mr.L wrote:@oreopa:
ah, now i see what you mean. But it would be tough to implement that feature into my editor, i guess.
Right now, in my editor the selection is directly connected to the textlines and you cannot select anything that "is not there".
So, i will keep that feature in mind and maybe one day i come up with a solution
Thx again, really is a work of art.
Proud supporter of PB! * Musician * C64/6502 Freak
Re: PBEdit - a Canvas-based Texteditor
A new version is online (1.0.2)
Download
added: Settings file "PBEdit.xml"
all editor settings and colors can be changed inside this file.
Download
added: Settings file "PBEdit.xml"
all editor settings and colors can be changed inside this file.
Re: PBEdit - a Canvas-based Texteditor
Whoooo! I love it. Congratulations for this code
➽ Windows 11 64-bit - PB 6.0 x64 - AMD Ryzen 7 - NVIDIA GeForce GTX 1650 Ti
Sorry for my bad english and the Dunning–Kruger effect.
Re: PBEdit - a Canvas-based Texteditor
thank you, Mesa!
I've uploaded a new version (1.0.5 - see first post) that includes your translation!
I've uploaded a new version (1.0.5 - see first post) that includes your translation!
Re: PBEdit - a Canvas-based Texteditor
Hi,
the flickering of the text below, when the mouse is moved, or other, can be removed completely with a trick.
Best Regards Saki
the flickering of the text below, when the mouse is moved, or other, can be removed completely with a trick.
Code: Select all
Case #PB_Event_Gadget
lineNr$="lineNr: " + Str(PBEdit_GetCurrentLineNr(0)) +
" Column: " + Str(PBEdit_GetCurrentColumnNr(0)) +
" (Char: " + Str(PBEdit_GetCurrentCharNr(0)) + ")"
If lineNr$<>old_lineNr$
StatusBarText(0, 0, lineNr$)
old_lineNr$=lineNr$
EndIf
selection$="Selection [" +
Str(PBEdit_GetFirstSelectedLineNr(0)) + ", " +
Str(PBEdit_GetFirstSelectedCharNr(0)) + "] [" +
Str(PBEdit_GetLastSelectedLineNr(0)) + ", " +
Str(PBEdit_GetLastSelectedCharNr(0)) + "]"
If selection$<>old_selection$
StatusBarText(0, 1, selection$)
old_selection$=selection$
EndIf
If ListSize(*te\cursor())<>old_cursors_changed
StatusBarText(0, 2, "Cursors: " + Str(ListSize(*te\cursor())))
old_cursors_changed=ListSize(*te\cursor())
EndIf
地球上の平和