Don't implicitly call recalcRect()
This commit is contained in:
@@ -39,7 +39,8 @@ std::string cControl::generateRandomString() {
|
|||||||
|
|
||||||
void cControl::setText(std::string l){
|
void cControl::setText(std::string l){
|
||||||
lbl = l;
|
lbl = l;
|
||||||
recalcRect();
|
// TODO: calling recalcRect() here has major unwanted side effects
|
||||||
|
// recalcRect();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string cControl::getText() const {
|
std::string cControl::getText() const {
|
||||||
|
@@ -373,15 +373,14 @@ public:
|
|||||||
if(anchor_id) *anchor_id = anchor;
|
if(anchor_id) *anchor_id = anchor;
|
||||||
return {horz, vert};
|
return {horz, vert};
|
||||||
}
|
}
|
||||||
|
/// If the control automatically determines its rect based on certain criteria, override this.
|
||||||
|
/// It will automatically be called during parsing.
|
||||||
|
virtual void recalcRect() {}
|
||||||
protected:
|
protected:
|
||||||
/// Create a new control attached to a dialog.
|
/// Create a new control attached to a dialog.
|
||||||
/// @param t The type of the control.
|
/// @param t The type of the control.
|
||||||
/// @param p The parent container.
|
/// @param p The parent container.
|
||||||
cControl(eControlType t, iComponent* p);
|
cControl(eControlType t, iComponent* p);
|
||||||
/// If the control automatically determines its rect based on certain criteria, override this.
|
|
||||||
/// It will automatically be called during parsing.
|
|
||||||
/// When overridden, it should normally be public.
|
|
||||||
virtual void recalcRect() {}
|
|
||||||
/// Returns a list of event handlers that this control supports.
|
/// Returns a list of event handlers that this control supports.
|
||||||
/// @return The list of handlers as a std::set.
|
/// @return The list of handlers as a std::set.
|
||||||
///
|
///
|
||||||
|
@@ -248,6 +248,7 @@ short choose_pattern(short cur_choice, cDialog* parent, bool expandRotatable) {
|
|||||||
std::string id2 = id;
|
std::string id2 = id;
|
||||||
id2.replace(0, 3, "name");
|
id2.replace(0, 3, "name");
|
||||||
pat_dlg[id2].setText(pat.name);
|
pat_dlg[id2].setText(pat.name);
|
||||||
|
pat_dlg[id2].recalcRect();
|
||||||
if(pat.rotatable) {
|
if(pat.rotatable) {
|
||||||
if(!expandRotatable) {
|
if(!expandRotatable) {
|
||||||
choices.push_back(pat_id);
|
choices.push_back(pat_id);
|
||||||
|
Reference in New Issue
Block a user