summaryrefslogtreecommitdiff
path: root/sc/source/ui/inc/checklistmenu.hxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@suse.com>2011-11-02 23:44:00 -0400
committerKohei Yoshida <kohei.yoshida@suse.com>2011-11-04 22:40:25 -0400
commitc524e1935668f40415927a365e39a0a1c75d91c5 (patch)
tree671d47af211cd7dcf8c4c39d7093742f40708b7e /sc/source/ui/inc/checklistmenu.hxx
parent9508d11845aac62ac8a62c8a01f37726cf2b21a1 (diff)
Calculate window size and geometries of controls based on menu items.
This makes the popup window more flexible and adjust to a varying number of menu items. This is necessary now that we use this popup in two different places (autofilter and pivot table field popup) with different menu item configurations.
Diffstat (limited to 'sc/source/ui/inc/checklistmenu.hxx')
-rw-r--r--sc/source/ui/inc/checklistmenu.hxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/sc/source/ui/inc/checklistmenu.hxx b/sc/source/ui/inc/checklistmenu.hxx
index 4c96c2fbd36e..6816b063cc24 100644
--- a/sc/source/ui/inc/checklistmenu.hxx
+++ b/sc/source/ui/inc/checklistmenu.hxx
@@ -91,6 +91,7 @@ public:
protected:
+ Size getMenuSize() const;
void drawMenuItem(size_t nPos);
void drawAllMenuItems();
const Font& getLabelFont() const;
@@ -229,6 +230,7 @@ public:
const Size& getWindowSize() const;
void getResult(::boost::unordered_map< ::rtl::OUString, bool, ::rtl::OUStringHash>& rResult);
+ void launch(const Rectangle& rRect);
void close(bool bOK);
/**
@@ -278,6 +280,11 @@ private:
};
void getSectionPosSize(Point& rPos, Size& rSize, SectionType eType) const;
+ /**
+ * Calculate the appropriate window size, the position and size of each
+ * control based on the menu items.
+ */
+ void packWindow();
void setAllMemberState(bool bSet);
void selectCurrentMemberOnly(bool bSet);
void cycleFocus(bool bReverse = false);
@@ -303,7 +310,8 @@ private:
::std::auto_ptr<ExtendedData> mpExtendedData;
::std::auto_ptr<Action> mpOKAction;
- const Size maWndSize; /// hard-coded window size.
+ Size maWndSize; /// whole window size.
+ Size maMenuSize; /// size of all menu items combined.
TriState mePrevToggleAllState;
};