mirror of
https://github.com/MeowLynxSea/ceditor.git
synced 2025-07-09 10:54:37 +00:00
新增了Menu类
This commit is contained in:
parent
e87f6ce103
commit
4f55beda64
@ -123,8 +123,6 @@ public:
|
|||||||
void setFocus(bool focusStatus) {
|
void setFocus(bool focusStatus) {
|
||||||
BaseComponent::setFocus(focusStatus);
|
BaseComponent::setFocus(focusStatus);
|
||||||
cursor_.setVisibility(focusStatus);
|
cursor_.setVisibility(focusStatus);
|
||||||
|
|
||||||
draw();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void onKeyPress(int key) override {
|
void onKeyPress(int key) override {
|
||||||
@ -242,8 +240,6 @@ public:
|
|||||||
moveRight();
|
moveRight();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
draw();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -16,16 +16,6 @@ private:
|
|||||||
int maxLineWidth_ = 0;
|
int maxLineWidth_ = 0;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Text(int left, int top, int width, int height) : BaseComponent(top, left, width, height) {
|
|
||||||
text_ = RichText();
|
|
||||||
}
|
|
||||||
Text(int left, int top, int width, int height, const RichText& text) : BaseComponent(top, left, width, height) {
|
|
||||||
text_ = text;
|
|
||||||
}
|
|
||||||
~Text() override {
|
|
||||||
lines_.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
void setText(const RichText& text) {
|
void setText(const RichText& text) {
|
||||||
this->text_ = text;
|
this->text_ = text;
|
||||||
|
|
||||||
@ -70,6 +60,20 @@ public:
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Text() : BaseComponent(0, 0, 0, 0) {
|
||||||
|
setText(RichText());
|
||||||
|
}
|
||||||
|
|
||||||
|
Text(int left, int top, int width, int height) : BaseComponent(left, top, width, height) {
|
||||||
|
setText(RichText());
|
||||||
|
}
|
||||||
|
Text(int left, int top, int width, int height, const RichText& text) : BaseComponent(left, top, width, height) {
|
||||||
|
setText(text);
|
||||||
|
}
|
||||||
|
~Text() override {
|
||||||
|
lines_.clear();
|
||||||
|
}
|
||||||
|
|
||||||
RichText getText() {
|
RichText getText() {
|
||||||
return text_;
|
return text_;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user