find/replace kind of working

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@299 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-04-23 22:25:14 +00:00
parent 5b89617148
commit 89ce208198
16 changed files with 199 additions and 69 deletions
+7 -18
View File
@@ -15,24 +15,6 @@
#include <render/value/text.hpp>
class TextValueEditorScrollBar;
class wxFindReplaceData;
DECLARE_POINTER_TYPE(Card);
// ----------------------------------------------------------------------------- : Search/replace
/// Information for search/replace
class FindInfo {
public:
FindInfo(wxFindReplaceData& what) : what(what) {}
virtual ~FindInfo() {}
/// Handle that a match was found.
/** Should return whether more searching is needed.
*/
virtual bool handle(const CardP& card, const TextValueP& value, size_t start, size_t end) = 0;
wxFindReplaceData& what; ///< What to search for, the direction to search in
};
// ----------------------------------------------------------------------------- : TextValueEditor
@@ -94,6 +76,13 @@ class TextValueEditor : public TextValueViewer, public ValueEditor {
virtual void insert(const String& text, const String& action_name);
// --------------------------------------------------- : Search/replace
virtual bool search(FindInfo& find, bool from_start);
private:
bool matchSubstr(const String& s, size_t pos, FindInfo& find);
public:
// --------------------------------------------------- : Other
virtual wxCursor cursor() const;