mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-12 05:36:59 -04:00
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:
+7
-18
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user