libcdos-fw
CFMenu.h
1 #ifndef __CF_MENU_H__
2 #define __CF_MENU_H__
3 
4 #include <Gui/CFMenuShell.h>
5 #include <gdkmm.h>
6 #include <giomm.h>
7 
8 CF_NAMESPACE_BEGIN
9 
10 class CFMenu : public CFMenuShell {
11 public:
12  typedef sigc::slot<void, int&, int&, bool&> SlotPositionCalc;
13  CFMenu();
14  CFMenu(const Glib::RefPtr<Gio::MenuModel>& model);
15 
16  void popup(CFMenuShell& parent_menu_shell,
17  CFMenuItem& parent_menu_item,
18  const SlotPositionCalc& slot,
19  CFUInt button,
20  CFUInt32 activate_time,
21  const Glib::RefPtr<Gdk::Device>& device
22  = Glib::RefPtr<Gdk::Device>());
23 
24  void popup(const SlotPositionCalc& position_calc_slot,
25  CFUInt button,
26  CFUInt32 activate_time,
27  const Glib::RefPtr<Gdk::Device>& device
28  = Glib::RefPtr<Gdk::Device>());
29 
30  void popup(CFUInt button,
31  CFUInt32 activate_time,
32  const Glib::RefPtr<Gdk::Device>& device
33  = Glib::RefPtr<Gdk::Device>());
34 
35  void popupAtWidget(CFWidget* widget,
36  Gdk::Gravity widget_anchor,
37  Gdk::Gravity menu_anchor,
38  const GdkEvent* trigger_event);
39 
40  void popupAtPointer(const GdkEvent* trigger_event);
41 
42  void reposition();
43 
44  void popdown();
45 
46  CFMenuItem* getActive();
47 
48  void setActive(CFUInt index);
49 
50  void setAccelPath(const Glib::ustring& accel_path);
51 
52  Glib::ustring getAccelPath();
53 
54  void detach();
55 
56  CFWidget* getAttachWidget();
57 
58  void setTearoffState(bool torn_off = true);
59 
60  bool getTearoffState();
61 
62  void setTitle(const Glib::ustring& title);
63 
64  void unsetTitle();
65 
66  Glib::ustring getTitle();
67 
68  void setScreen(const Glib::RefPtr<Gdk::Screen>& screen);
69 
70  void attach(CFWidget& child,
71  CFUInt left_attach,
72  CFUInt right_attach,
73  CFUInt top_attach,
74  CFUInt bottom_attach);
75 
76  void setMonitor(int monitor_num);
77 
78  int getMonitor();
79 
80  void reorderChild(CFMenuItem& child, int position);
81 
82  void setReserveToggleSize(bool reserve_toggle_size = true);
83 
84  bool getReserveToggleSize();
85 
86  void attachToWidget(CFWidget& attach_widget);
87 };
88 
89 CF_NAMESPACE_END
90 
91 #endif // __CF_MENU_H__
Definition: CFMenuShell.h:12
所有可视控件的基类,抽象类。
Definition: CFWidget.h:25
Definition: CFMenuItem.h:9
Definition: CFMenu.h:10