Layout() always called when editor/viewer control changes size

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@145 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2006-12-22 15:33:14 +00:00
parent 274cb1117f
commit a16c098eac
10 changed files with 41 additions and 35 deletions
+2
View File
@@ -58,6 +58,7 @@ ValueViewer* DataViewer::focusedViewer() const { return nullptr; }
Context& DataViewer::getContext() const { return set->getContext(); }
Rotation DataViewer::getRotation() const {
if (!stylesheet) stylesheet = set->stylesheet;
StyleSheetSettings& ss = settings.stylesheetSettingsFor(*stylesheet);
return Rotation(ss.card_angle(), stylesheet->getCardRect(), ss.card_zoom(), true);
}
@@ -71,6 +72,7 @@ void DataViewer::setCard(const CardP& card) {
stylesheet = set->stylesheetFor(card);
setStyles(stylesheet, stylesheet->card_style);
setData(card->data);
onChangeSize();
}
// ----------------------------------------------------------------------------- : Viewers
+3 -2
View File
@@ -73,14 +73,15 @@ class DataViewer : public SetView {
/// Notification that the total image has changed
virtual void onChange() {}
/// Notification that the viewers are initialized
virtual void onInit() {}
/// Notification that the size of the viewer may have changed
virtual void onChangeSize() {}
vector<ValueViewerP> viewers; ///< The viewers for the different values in the data
CardP card; ///< The card that is currently displayed, if any
public:
StyleSheetP stylesheet; ///< Stylesheet being used
mutable StyleSheetP stylesheet; ///< Stylesheet being used
};
// ----------------------------------------------------------------------------- : EOF