Correct backtrace() array size argument
[forms.git] / F / F_Menu_Button.H
blob7fea0c09b5c61e045b59e78ef468c0221751672f
2  /*
3   *   Copyright (C) 2007, Harbour, All rights reserved.
4   */
6 #ifndef _F_MENU_BUTTON_H_
7 #define _F_MENU_BUTTON_H_
9 #include <F_Text_Display.H>
10 #include <F_Window.H>
11 #include <F_Menu.H>
12 #include <F_Button.H>
14 namespace F {
16 class F_Menu_Button : public F_Menu {
18   F_Button *b_;
20   bool handle(F_Event_t &ev);
22   static void f_menu_button_cb(F_Button *b, void *d) {
23     F_Menu_Button *mb = (F_Menu_Button *) d;
24     switch (b->state()) {
25       case F_BUTTON_PRESSED:
26         mb->b_->hide();
27         mb->state_ = F_BUTTON_ON_FOCUS;
28         mb->draw();
29         mb->show();
30         break;
31       default:
32         break;
33     }
34   }
36  public:
37   F_Menu_Button(F_Box_Type_t btype, coord_t x, coord_t y, dim_t w, dim_t h,
38     const char *label = 0) : F_Menu(x, y, w, h, label) {
39       b_ = new F_Button(F_UP_BOX, x, y, w, h, label);
40       b_->callback((F_Callback *)f_menu_button_cb, this);
41       b_->when(F_WHEN_NOT_CHANGED);
42       add_child(b_);
43  }
44   ~F_Menu_Button() { delete b_; }
45  };
48 #endif