Hard Light Productions Forums
Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: Kazan on October 28, 2003, 12:35:25 pm
-
Well i have the syntax highlighting table editor working
(http://www.cs.iastate.edu/~kazan/fsdevstudio0001.jpg)
the only problem is it's slow as molassis in january on large files - i cannot find a fast was of performing it - no way of getting only the visible range, not to mention to good way to catch all screen changes
I cannot optimize my function any further - it's the underyling wxWindows calls that are slowing **** down.
Maybe i should ***** to them and in future releases get it speed up
-
:( a red X
-
helps to upload the image..
-
Can you lvlshot that pic please Kazan? Oh and ask Tolwyn if he minds you giving his ICQ number away? :lol:
Looks good so far though. Hope you find a way to speed it up cause I'm definately waiting for this with baited breath.
-
ehy that's a truely nice idea:)
-
out of curiosity, could you write a custom version of he wx widget that reported viewable range?
-
actually that's my ICQ number
mikhael - not familiar with wx widget - i am new to wxWindows but i like what i see thus far
-
well, by wxWidget, I mean the wxWindows widget you're using for the edit display. at some point, it must keep track of how big the display area is, and the offset into the edit buffer where the display starts (I'm guessing here, I've not started working with wxWin yet myself. Its on the to do list). If the current version won't tell you those things, you can probably write wx$Control-Kazan that does, and that might help.
On the other hand, when we're talking about dog slow, how dog slow are we talking here?
-
Originally posted by Kazan
actually that's my ICQ number
Doh! I use Trillian all the time too! :)
-
none of the classes that wxTextCtrl are derived from have an intelligent way of determining the first visible line in the text control (if i want to do this i have to violating portability and use direct win32 calls) and there is no way to intelligently tell the last visible line - and there is no effective way of catching every visibility range change currently
i guess i could brute force it with a wxTimer and compairing the last visible first line before with the currently last visible first line - and then add something like 75 to it for last line (my screen can exceed 50 lines visible - but not 75 and im wrunning 1600x1200)
-
That bites. You'd think that there would be an accessor for the general range of visible lines in a text control.
I say rewrite wxTextCtrl and submit a patch. ;)
-
you know how much of a ***** that would be... oui
-
Yeah. Doom.
I wonder how stuff like ConTEXT (though that's written in Delphi) or the other various editors do context highlighting so fast.
-
Lookin' good, Kazan.
-
erm, wouldn't it be possible to do this at load, and at an edit, only for the edited line?
/me stupid n00b, /me only knows QB
-
That's actually a good point. Does wxTextCtrl let you screw about arbitrarily with the current line? Does it at least expose the address of the current line so that you can work with it?
-
Yeah; if that's the case, you could just go an arbitrary number of lines up and down from the current line.
-
looks good:yes: :yes: :)
-
ok - instead of dealing with all kinds of **** in autohighlight - i added "Highlight" to the right-click menu .. it'll process the entire document at once and show a progress bar
-
Well, I'm going to copy ad paste my comments from the original idea post to here, just in case it was missed :)
One thing that would be nice is a bit more flexibility to the table editor, so you could, for example, create a ship table entry using a form, and then the program would insert it into ships.tbl at a specified point (By species/role), the same would also be good for other tables as well, though it would take a more 'aware' parser, which is more work for Kazan, who already seems rushed off his feet. I suppose the best part of this would be if the 'insert' info was saveable, so you could save a single table entry, and just run it through the program to insert it into someone elses tables. This would be great for Modders working on projects who are trying to keep their tables in order
Another nice idea would be 'Replace this item with original'. This way you could choose a ship or weapons etc that you have altered and the program could replace it with the original from the .tbl. I am sure we have all tweaked a ship but not wanted to replace the whole table again when we have finished, just a glorified cut&paste, but useful
Flipside :D
-
the more advanced one is coming later
holy mother of trash
NEVER run the highlight on the ships.tbl (fortunate I put in the abort) just the "$*:" tag pass was estimated by wxWindows to take 10 minutes! then there's the " " pass (two big passes) which i've never gotten to
remove the wxTextCtrl::SetStyle calls and the entire document takes a few seconds - so it's not my code at fault!
-
oh man.. the problem is all the way down at the operating system level
-
Dontcha just love Microsoft :)
I coded in the days of 6502 & Z80 so I can't offer any constructive help, sorry :(
Flipside :D
-
Would you be willing to post the code in the SCP internal?
-
from what i gather, the problem is setting the font right? couldn't you set the font tags in an internal array, coded by you, and have ms only thouch the code currently onscreen?
-
that would require the ability to determine what lines were currently onscreen - which you cannot do
-
(http://www.cs.iastate.edu/~kazan/POFEditor.jpg)
general layout
-
Can only get better from here. :D
-
Lookin' good!