Onscreen IDE & dynamic instant update [_v0.5.4_]

:laughing: :laughing:
Is it glass sphere or what ? I think I saw something living, breathing in it.
Let me see it closely…
Oh, it’s you !
No wonder why the glass is so foggy.
:laughing: :laughing: Keep laughing, man. :slight_smile:
Does it matter if I mention that I was born at 11:10am ? So close to 11:11, isn’t it ?
Just like on the clock lately, always the last seconds before switching up to the hot one. Just like my post before your last one, 4:43 pm.

This is sooooo OOT, I better stop. CUT !

:smiley:
11:10 -> 1110 = 14 (dual) = AH reverd HA :smiley: the smile is sticking on your face;)

Eventhough this is my own IDE, I have a dislike list about it :

[>_<] When loading a file for the 1st time, I need to create all lines at once, and flatten each line, which takes a lot of time for thousands lines files (could be a minute). There is a dilemma about this process. If I flatten it at file loading, it takes too much time. If I flatten it later at their first appearance on the screen, there is chug upon page scrolling, if most of them aren’t flattened yet. If I don’t flatten them at all, it’s a slideshow, not interactive anymore.
[>_<] To avoid text regeneration for files were previously opened, I created .bam cache. Those .bam’s are also exist at the same time in RAM as BamStream, so it consumes so much RAM, and several hundreds MB of disk space (10 MB for 200 KB file).
[>_<] Since text flattening takes so much time for thousands lines, it’s impossible to highlight multiple-lines string. Say I typed three quotes, then it means I have to highlight (means regenerate) the rest of the lines (could be thousands). Shoooooot, who has the patience for that ?
[>_<] If I select many lines and copy, then paste them, I have to wait again. eeewwwww…

So, it’s a very very pathetic situation, and limiting my IDE to do things I need, it only makes me mad.

Then I realized that I’m just circling around the REAL problem, which is slow flatten process, which does so much things.

But, wait…,
there is still hope, and I hope it’s not too late for a new year present.
[b]Here I present v0.1, and NOT without any good reason, since…

[size=150]ALL
THINGS
IN
THAT
LIST
ABOVE[/size]
[/b]

[size=200][color=blue]HAVE
GONE !![/size]

Why didn’t I do it this way since the first place ?
I can’t believe I’d been a morron for almost a year.

Here’s how it’s done now :
[^_^] Letters quads in a line are generated by directly creating 1 geom and a vertex data and fill it with their vertices. Even in Python, it’s faster than flattening (in C++) colorScaled letters quads.
For 5000+ text lines) :
(hilighter_ON) : 15% faster
(hilighter_OFF) : 17% faster
And once I generate the text in C++, it can go 4.5x (avg.) faster than that. YYhhhhaaaahahahaha…
[b][^
^][/b] only onscreen text lines are generated
[b][^
^][/b] if a text line is already displayed, it won’t be regenerated again upon editing other line or page scrolling, unless it must be differently highlighted

[X] Now, loading any file takes only a couple seconds.
[X] It’s now RAM and disk friendly, since the text regeneration is not so expensive, so I don’t need .bam cache.
You can freely remove your hundreds-MBytes “docsTextCache” directory.

OTHER UPDATES :
[X] fixed indentation notch closeup viewport’s sort order
[X] fixed unindent : if the selected lines are already flushed left, it won’t be recorded in edit history, so if undone, it’ll be restored correctly
[X] fixed a bug in exception handler
[X] the user alerter code is called only if the erroneous file is successfully loaded
[X] smarter break line undo
[X] Replace remembers what the current file was, since other file might be set as current one when it causes a runtime error.
[X] added wildcards in Find
[X] added context menu in the workspace
[X] improved submenu placement
[X] since I don’t need to save each text line anymore, I can switch the hilighter on and off anytime I want.
[X] changed some highlighter colors

REFACTORED syntax highlighter :
[1] now ignores single quotes inside triple quotes, and escaped quotes inside quotes (both single and triple)
[2] numeric characters are highlighted, integer and float use different color
[3] docstring (triple quoted) uses different color than ordinary string (single quoted)

Note that, as of the current cvs version, this is the way that Panda also generates text internally–it no longer generates a long list of Geoms and flattens them together. So you might want to compare the performance of your new algorithm to raw Panda text generates on the trunk. Your other optimization approaches (generate only onscreen text, avoid unnecessary regenerates) are still great ideas, though.

David

Well, I don’t use Panda’s TextNode since the 1st place for these reasons :

  1. I want fixed-width spacing, even if using non-monospace font.
  2. I don’t want to spend the time to insert the color property change into the string.
  3. and I guess I’ll need more flexibility in the future.

I wanted to try this IDE but when I execute IDE_Starter.pyw I get an error that says “No module named wx”. I am using windows xp and have installed “wxPython2.8-win32-unicode-2.8.7.1-py25.exe” All other wxpython programs that I have tried to run seem to work. Does anyone have any idea what is going wrong?

Under your site-packages, it’s instaled in wx-2.8-msw-unicode folder.
All you need to do is create a file in site-packages :

wx-2.8-msw-unicode

and save it as wx.pth

That file with that text is already in the site-packeges directory. I get the same message.

Do you have multiple Python installations ?
Did you use the same python executable when running your other wxpython programs ?
Maybe pythonw.exe executes the other python.exe

UPDATES :
[X] join lines is disabled for read only files
[X] replace all in current file and undo replace are now a blink away, since I forgot to disable display update. >_<
2300 lines, 1200 occurences : 0.3 sec (used to be 5+ secs)
9400 lines, 5100 occurences : 1.6 secs
[X] refactored move lines to get faster undo & redo, especially if movement delta is large
[X] changed confirmation message for exit without save

Yes I do have multiple python installations. I have python 2.2,2.4 and 2.4 installed in seperate directories

Here is my python path
PYTHONPATH=C:\PYTHON25;C:\PYTHON25\DLLS;C:\PYTHON25\LIB;C:\PYTHON25\LIB\LIB-TK;C
:\PYTHON24;C:\PYTHON24\DLLS;C:\PYTHON24\LIB;C:\PYTHON24\LIB\LIB-TK;C:\PYTHON22;C
:\PYTHON22\DLLS;C:\PYTHON22\LIB;C:\PYTHON22\LIB\LIB-TK

Ahgr. Sounds like trouble.
You don’t have Panda’s copy of python on your pythonpath? Just make sure you installed the copy of Wx into the version of Python which you are running.

Wx is installed under the c:\python25\Lib\site-packages directory. That is also where wxpath is install

Uhm… You installed the 2.5 wxPython binaries into the Python 2.3 directory? Woah, no wonder it doesn’t work.

Install the Wx package either in Panda’s copy of python (c:\Panda3D-ver\python\site-packages), or, in your Python 2.5 copy. Or, into both, if you aren’t sure which one you’re actually using.

But I really recommend uninstalling all copies of python. Panda ships with its own copy of 2.5.

No sorry pro-rsoft that was a typo when I was typing in the directory path. It should have been C:\Python25\Lib\site-packages.

Then make sure you’re running that copy of Python…
To be sure:

C:\Python25\python blahblah.py

But why not install wx in Panda’s python?

Because I would rather not have two version of the same package on my HD. I mean its no big deal just reduntant.

…I made mistakes again…

[v0.1.2]
[X] Upon undo/redo, if you jump back to the page before that undo/redo, the text won’t be displayed. In fact, they’re already removed, but the page manager believes that they still exist, so they’re not drawn.
[X] In TextDrawer.cxx, in the destructor, there are two _letters_uv.clear(); lines. One of them should be _letters_vtx.clear();
[X] import checking is disabled for string (quoted) lines
[X] fixed exception handler to load the .py file if the error is in the .pyc
[X] added revert to saved

[v0.1.3]
[X] macro manager : exposed smartPaste argument of paste command options, so I can record a macro to insert text before and after the selected text, say forum tags.
E.g. a macro actions to insert quote tags would be :
[1] cut
[2] type [
[3] type /quote
[4] goto prev word
[5] go left 2 chars
[6] paste with keeping cursor position
[7] type [
[8] type quote=
[9] type "
And the cursor will end up exactly between the quotes. But before really using it, you need to edit the macro, to disable “smart paste” option, or else the 2nd-nth selected text lines will be indented following the cursor column.
[X] fixed a bug in undo paste when smartPaste is off
[X] fixed highlighter bug and improved it to colorize invalid numeric sequence differently instead
[X] added 3 color chooser modes to context menu
[X] added matching brackets highlight

[v0.1.4]
[X] clamped slider thumb Z size, so it will never be a-hair-thin for thousands lines files, and easier to grab
[X] fixed brackets highlighter to include comments if not using Python highlighter
[X] now you can clear log file, from context menu
[X] added context menu to code description pane to copy it
[X] added select inside brackets