Basic Editor for 300 LOC or so? - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: Chatting and Socializing (https://qb64phoenix.com/forum/forumdisplay.php?fid=11) +--- Forum: General Discussion (https://qb64phoenix.com/forum/forumdisplay.php?fid=2) +--- Thread: Basic Editor for 300 LOC or so? (/showthread.php?tid=2189) |
Basic Editor for 300 LOC or so? - bplus - 11-19-2023 Where did I get the idea I could build one for 300 LOC? I am at 617 LOC and haven't finished Cut/Copy/Paste yet but 3 Color Themes I have already: Forest Patriot Orange (No Blue!) Ha! gotta get those colors first thing! But also font that is a size easy on eyes. Thanks to Terry for Lucon 18 pixel hieght Mono, my eyes are loving it both in IDE and this Editor (for programs not Word Wrap), Forest is my choice, Orange / No Blue gave me a headache! So Dav's is OK at 891 LOC plenty of instructions, you can figure it out if you're willing to put up with all that tight packing into a "Pete" Screen You can toggle with Enter key between a Hex thing and a more normal thing. And we've already commented on Eric's growing monster ;-)) I think I saw one (Editor at 300 LOC) back in mid 90's, Dr Dobbs Journal?, I think. https://en.wikipedia.org/wiki/Dr._Dobb%27s_Journal One of those jobs you type from a paper or magazine. I think I saw one in there for QB, haven't been able to dig it up or anything close to it. I might have mentioned this before, sure would like to see that code again! Anyone got anything close to bare bones editor only a few c's of lines ? RE: Basic Editor for 300 LOC or so? - SpriggsySpriggs - 11-20-2023 Does it allow for using the mouse or is everything controlled by the keyboard? RE: Basic Editor for 300 LOC or so? - bplus - 11-20-2023 (11-20-2023, 03:29 PM)SpriggsySpriggs Wrote: Does it allow for using the mouse or is everything controlled by the keyboard? 99% most likely no mouse, I remember I had to get a book with Mouse subs (Interrupts) to get mouse functions in my Basic. Did QB4.5 have them? Maybe with some Interrupt / Registers routines. Mouse will definitely add to LOC, so I'd say no. Plus you probably had to type in Input line your filename to save or load. The journal was only a couple of pages, I don't think they did installments? I am thinking no Cut/Copy/Paste because highlighting and getting that working really adds to code lines. Pete had something working pretty well with that but tons of lines! BTW Aurel informed me that Windows API has 2 Editor Controls! @SpriggsySpriggs have you checked out GUI possibilties through Windows API? RE: Basic Editor for 300 LOC or so? - SpriggsySpriggs - 11-20-2023 Yep. You can definitely do text boxes in Win32. I know how to do it. It's just a pain in the ass. My test Win32 program works in Linux so I might be able to do something. RE: Basic Editor for 300 LOC or so? - Ed Davis - 11-24-2023 (11-19-2023, 09:04 PM)bplus Wrote: Anyone got anything close to bare bones editor only a few c's of lines ?How about this? Based on an old FreeBasic editor I found a while back. It used linked lists, had a few issues. I converted it to QB64, used an array of strings instead of the linked list, fixed a few bugs, probably added a few more. Available commands are in the main sub below. Very bare bones! But less than 200 lines, and pretty easy to follow Does not currently handle horizontal scrolling. Code: (Select All)
RE: Basic Editor for 300 LOC or so? - bplus - 11-24-2023 That's just the Bare Bones kind of thing I think I saw way back... thankyou Ed. That is under 200 LOC if you remove the unnecessary Declares. I remember starting with similar and adding on... and on... I am just over 600 with mouser functions. Just cleared a hurdle of selecting text with mousebutton(1) dragging. I had arrows or scrolling selecting with Shift but had hell of time doing MouseDown like QB64 IDE does (which is my model I wish to duplicate). hmm Locate with 3 arguments? gotta look into that. > It's for cursor on/off RE: Basic Editor for 300 LOC or so? - mnrvovrfc - 11-24-2023 Might have to redo this in Python if we expect to do a decent text editor in under 600 lines of code. LOL. Otherwise don't expect anything fancier than "Wizedit", one of the first text editors I've ever witnessed. Raw stuff, hard to believe Nano on Linux is more featured. Also the editor I discovered in one of the old Central Point or McAfee suites for 16-bit computers long ago. For this one, press [ESC] to get a chance to save the document and leave the program. No mouse support in any of those two MS-DOS programs. These days how kids expect spell-checking in a "simple" code editor... you have to take a look at how Vim has grown. Earlier this year I played with a text editor called Liritext. It did not allow configuration, just provided a dorky graphics window using a font which was not monospaced. The inability to change the font is a no-go for anything that doesn't act like a full-featured word processor. I wanted to keep this Liritext but it was just too simple for my purposes. :/ Oh yeah and the "sliding" animations that seem to be everywhere, try replicating that on Pete's screen. I'm glad it cannot be! At least in one place I could be succorred from something that has been driving me up the wall about Linux desktop environments! RE: Basic Editor for 300 LOC or so? - SMcNeill - 11-24-2023 I can do this in just 1 line of code. You guys are overthinking the issue: Code: (Select All) SHELL "notepad.exe" RE: Basic Editor for 300 LOC or so? - bplus - 11-25-2023 actually Shell QB64pe.exe might get us closer. RE: Basic Editor for 300 LOC or so? - bplus - 11-26-2023 With left mouse click a popup menu just like in QB64: Just shy of 700 LOC and plenty of bugs making me squirm |