Author Topic: Practice Qt(C++) Application / AutoLisp editor  (Read 4006 times)

0 Members and 1 Guest are viewing this topic.

JohnK

  • Administrator
  • Seagull
  • Posts: 10648
Practice Qt(C++) Application / AutoLisp editor
« on: September 27, 2011, 07:43:54 PM »
I have recreated an editor like the one pictured in the thread linked to below (in case you wanted to see what it looks like) but a little bit bigger and better. I am only doing this to keep up my Qt skills (I wasn't planning on it being used by or being useful to anyone) but I wanted to ask for a few opinions because I would be more than happy to package this editor up for you to install if you feel that it would be of any value to you (maybe we can both get something out of this).

Right now it's basically like a Windows Notepad with multiple-document interface and syntax highlighting (no indenting--that feature I think will be DIFF-I-CULT *lol*) but I can add in a "auto-completer" feature if you think that would be useful.

Are there any ideas/requests you can give me to practice on (open for requests; I will try my hardest to implement some of the features requested).


https://www.theswamp.org/index.php?topic=36112.msg412509#msg412509
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Ketxu

  • Newt
  • Posts: 109
Re: Practice Qt(C++) Application / AutoLisp editor
« Reply #1 on: September 27, 2011, 10:46:06 PM »
Oh,some of idea :
- Copy code (to copy all of code Line in one windows) or Test function (just make a temp lisp file, call Cad app, load temp file then delete it)
- Highlight pair of ()
- "Auto complete" with own function in the same file or links from others, so, can make a dynamic dictionary, or library functions
- Some Auto correct words
- Auto restore tabs when reload
- Clear empty lines
- Insert template copyright or sth similar
...
Many funny things to do ^^
Btw, will it open source ^^

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: Practice Qt(C++) Application / AutoLisp editor
« Reply #2 on: September 28, 2011, 08:14:50 AM »
What about trying to reuse QScintilla inside your editor.

Here's a sample general purpose code editor based on Scintilla: http://www.scintilla.org/SciTEImage.html
Or for formatting lisp through Scintilla: http://www.daansystems.com/lispide/
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

JohnK

  • Administrator
  • Seagull
  • Posts: 10648
Re: Practice Qt(C++) Application / AutoLisp editor
« Reply #3 on: September 28, 2011, 11:57:06 AM »
What about trying to reuse QScintilla...
Thanks for the tip irneb. I will give it a try. I Downloaded and installed the package. Now all that is left to do is to read the doc's and figure out how to use it. *phew!* There is a lot of information there. *smile*

Ketxu: Thank you for the suggestions. I will try some of these. However I don't think there is/will be a whole lot of interest from the community in a program like this (a small text editor) so I doubt I will even upload an executable let alone make it `Open source'. My only intent was to get some suggestions of features I could attempt (I am not that good of a developer so I need practice) to implement.

Thanks again.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

JohnK

  • Administrator
  • Seagull
  • Posts: 10648
Re: Practice Qt(C++) Application / AutoLisp editor
« Reply #4 on: September 29, 2011, 08:52:04 AM »
I was thinking last night that I wouldn't get many, if any, ideas if you didn't have something to actually look at so I took a few minutes and built an installer.

Here is a program you can play around with.

Some notes:
1. The syntax highlighting is a bit wonky because I'm using Reg-ex to search for the strings (some things may be highlighted when they shouldn't be and I haven't gotten all the functions in there either).
2. There is no (re)formatting; spaces are spaces and tabs are tabs.
3. This program only has a few hours of time on it. Meaning, its really rough around the edges; but I have been looking at a TON of code from others so what is there should be fairly solid--'cept for the highlighting *wink*-.

If you have any suggestions for me to practice my coding skills on I would appreciate it.

EDIT: Re-uped installer. Hopefully I included all the required DLLs this time.
« Last Edit: September 29, 2011, 10:20:36 AM by Se7en »
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: Practice Qt(C++) Application / AutoLisp editor
« Reply #5 on: September 29, 2011, 10:07:52 AM »
You should probably mention that they'd need MinGW to run your app.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

JohnK

  • Administrator
  • Seagull
  • Posts: 10648
Re: Practice Qt(C++) Application / AutoLisp editor
« Reply #6 on: September 29, 2011, 10:16:09 AM »
You should probably mention that they'd need MinGW to run your app.

Did I forget a DLL again (I have made quite a habit of doing that)? Which one?
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

JohnK

  • Administrator
  • Seagull
  • Posts: 10648
Re: Practice Qt(C++) Application / AutoLisp editor
« Reply #7 on: September 29, 2011, 10:22:20 AM »
I just re-attached the installer which should have the "mingwm10.dll" included this time. Sorry 'bout dat.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: Practice Qt(C++) Application / AutoLisp editor
« Reply #8 on: September 29, 2011, 10:47:00 AM »
Here's one suggestion: Remember (at least in session) which folder the user browsed to last, else it always opens in c:\Program Files\LispEditor

BTW, there's issues with double quotes inside strings. Attached comparison between yours and SciTE using my suggested Scintilla libraries.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

JohnK

  • Administrator
  • Seagull
  • Posts: 10648
Re: Practice Qt(C++) Application / AutoLisp editor
« Reply #9 on: September 29, 2011, 11:04:28 AM »
Yeah there will be quite a few of those little highlighting quirks because of how my highlighter is searching -i.e. Reg-ex.

Oh, trust me, I haven't forgotten about the (Q)Scintilla stuff you linked to earlier (that was some good stuff). However that will have to come a bit later. There is quite a bit of documentation there for me to digest and I need to get my base classes all cleaned up so I can use it.

Here's one suggestion: Remember (at least in session) which folder the user browsed to last...

Thanks. I think I have two ideas, one of them should work. thanx.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

JohnK

  • Administrator
  • Seagull
  • Posts: 10648
Re: Practice Qt(C++) Application / AutoLisp editor
« Reply #10 on: September 29, 2011, 08:50:27 PM »
My thoughts:
I am building QScintilla for Linux as we speak.
I also think I may have an over-complicated model so I think I am going to implement a simpler (at least I hope it will be) SDI (single doc interface) model for my editor instead.

I'm starting over (well not totally, but it sounds more dramatic if I say it that way *lol*).
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

JohnK

  • Administrator
  • Seagull
  • Posts: 10648
Re: Practice Qt(C++) Application / AutoLisp editor
« Reply #11 on: September 30, 2011, 02:06:26 PM »
And now we are back to a single doc interface. The application is smaller (and quicker) now.

TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

JohnK

  • Administrator
  • Seagull
  • Posts: 10648
Re: Practice Qt(C++) Application / AutoLisp editor
« Reply #12 on: September 30, 2011, 05:37:55 PM »
Scratch that smaller comment above. *eye-roll*

As far as the `browsed to last' bug goes, I tried a few ideas I had with no success (every idea I tried--short of writing a to a text file--tosses a wobbly on me)...AND, I can't reproduce the problem to begin with so, I may have to put a pin in this feature/problem until I get better.

QScintilla update: I got real confused reading some of the docs. From what I can infer I will have to setup/use their "CustomLexer" class before I can begin to use some of the features like highlighting, completion, and indenting. I am kind of on the fence so far about this lib (in this application).

Auto complete update: I don't know if I can build an auto-complete from `this file' or a `set of files' but I did find an example that uses a text file containing a bunch of words (like a dictionary) I think I could add to the program.  I have added some initial (concept) code to start on this idea as well.

Any other ideas/feature requests/etc. from anyone?
I was going to start writing some code to know where the cursor was/is so I can build in some indenting. As far as I can tell--looking at other code and thinking about the problem myself--I will have to build a mini parser. The one I was looking at a little while ago only indented the code based upon the previous line. That code was WAY over my head but I grasped the concept and it seems like it would be the fastest method so I thought I would work on that concept.

Well at any rate, thank you for your time, ideas, and comments guys.
If anyone has any other ideas for any other features I would appreciate them.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org