Article View: comp.windows.interviews
Article #230StringBrowser question
From: Ashok Bakthavathsalam
Date: Tue, 11 Aug 1992 02:05
Date: Tue, 11 Aug 1992 02:05
24 lines
1304 bytes
1304 bytes
I am using IV_3.0.1 in the IV_2.6 compatible mode.
The StringBrowser has the methods:
Remove(index);
Insert(const char* line, int index);
I implemented a Replace(const char* line, int index) in a
derived class of StringBrowser, which simply calls these functions
successively for the desired effect. It works; but it isn't
very elegant when there are, say, 200 lines in the browser.
If I need to replace the 5th line, all the 195 lines below are
displaced up (as a result of a Remove() ) and displaced down ( as a
result of the subsequent Insert() ).
Questions:
1. Why isn't Replace() available in the first place ?
2. Is there a more elegant implementation of Replace() than that
presented above?
( I noticed TextDisplay has a ReplaceText() method, but the
TextDisplay object within the StringBrowser is private... )
Many thanks for your responses
% ashok
Technical Details
Message-ID:
<9208110205.AA03500@opus.cellnet>Path:
arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!cellnet.com!ashokShow Full Headers
Complete Article Headers
Newsgroups: comp.windows.interviews Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!cellnet.com!ashok From: ashok@cellnet.com (Ashok Bakthavathsalam) Subject: StringBrowser question Message-ID: <9208110205.AA03500@opus.cellnet> Sender: news@shelby.stanford.edu (USENET News System) Organization: Internet-USENET Gateway at Stanford University Date: Tue, 11 Aug 1992 02:05:09 GMT Lines: 28