Fixed TextCtrl to work for keyword properties;

Added wrapping of <> around parameters to TextElement;
Added colors for keyword parameters;
Added menu & toolbar for keyword panel;
Fixed bug in package, save/save-as was the wrong way around;
Added third quality setting to RotatedDC: using SetUserScale, this gets you more precise positioning.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@250 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-04-12 17:35:00 +00:00
parent 1fc7e57b91
commit 42ab8c84c0
36 changed files with 468 additions and 116 deletions
+11
View File
@@ -94,6 +94,17 @@ class ValueEditor {
virtual size_t selectionStart() const { return 0; }
virtual size_t selectionEnd() const { return 0; }
// --------------------------------------------------- : Search / replace
/// Do a search or replace action for the given FindInfo
/** If from_start == false: searches only from the current selection onward (or backward),
* excluding the sellection itself.
* If from_start == true: searches everything
*
* Returns true when more searching is needed.
*/
bool search(FindInfo& find, bool from_start);
// --------------------------------------------------- : Other
/// The cursor type to use when the mouse is over this control
+2 -2
View File
@@ -529,7 +529,7 @@ void TextValueEditor::moveSelection(IndexType t, size_t new_end, bool also_move_
{
// Move selection
shared_ptr<DC> dc = editor().overdrawDC();
RotatedDC rdc(*dc, viewer.getRotation(), false);
RotatedDC rdc(*dc, viewer.getRotation(), QUALITY_LOW);
if (nativeLook()) {
// clip the dc to the region of this control
rdc.SetClippingRegion(style().getRect());
@@ -659,7 +659,7 @@ void TextValueEditor::determineSize(bool force_fit) {
Bitmap bmp(1,1);
dc.SelectObject(bmp);
dc.SetFont(style().font.font);
style().height = dc.GetCharHeight() + 2;
style().height = dc.GetCharHeight() + 2 + style().padding_top + style().padding_bottom;
}
}
+18
View File
@@ -15,6 +15,24 @@
#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