Thank you for sharing.

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
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?
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.
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.
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?
It kind of is, and it kind of isn't.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.
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")
Code: Select all
*te\colors\currentBackground = RGBA( 30, 30, 25, 255)
Code: Select all
Protected defaultColor = RGBA(155,220,255,255)
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
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