scrollbar store reference to pane
This commit is contained in:
@@ -27,7 +27,7 @@ enum eScrollStyle {
|
||||
/// using the methods to get the scrollbar's position.
|
||||
/// Alternatively, it can be used as a slider control.
|
||||
class cScrollbar : public cControl, public iEventListener, public iDrawable {
|
||||
std::string name;
|
||||
cControl* pane;
|
||||
int pos, max, pgsz;
|
||||
std::string link;
|
||||
// Make sure this is equal to the number of constants in eScrollStyle
|
||||
@@ -66,6 +66,7 @@ class cScrollbar : public cControl, public iEventListener, public iDrawable {
|
||||
public:
|
||||
/// @copydoc cDialog::init()
|
||||
static void init();
|
||||
inline void setPane(cControl* pane) { this->pane = pane; }
|
||||
bool parseAttribute(ticpp::Attribute& attr, std::string tagName, std::string fname) override;
|
||||
void validatePostParse(ticpp::Element& who, std::string fname, const std::set<std::string>& attrs, const std::multiset<std::string>& nodes) override;
|
||||
location getPreferredSize() const override;
|
||||
|
@@ -17,6 +17,7 @@
|
||||
#include <climits>
|
||||
|
||||
cScrollPane::cScrollPane(cDialog& parent) : cContainer(CTRL_PANE, parent), scroll(parent) {
|
||||
scroll.setPane(this);
|
||||
recalcRect();
|
||||
}
|
||||
|
||||
|
@@ -25,6 +25,7 @@ class cScrollPane : public cContainer {
|
||||
public:
|
||||
/// Create a new scroll pane
|
||||
explicit cScrollPane(cDialog& parent);
|
||||
inline cScrollbar& getScroll() { return scroll; }
|
||||
bool parseAttribute(ticpp::Attribute& attr, std::string tagName, std::string fname) override;
|
||||
bool parseContent(ticpp::Node& content, int n, std::string tagName, std::string fname, std::string& text) override;
|
||||
void validatePostParse(ticpp::Element& who, std::string fname, const std::set<std::string>& attrs, const std::multiset<std::string>& nodes) override;
|
||||
|
Reference in New Issue
Block a user