10 // ÏËÎÁ ÒÉÓÕÀÔÓÑ ×ÎÕÔÒÉ F_Text_Display
12 class F_Window : public F_Widget {
14 F_Group <F_Widget *> widgets;
15 F_Widget *widget_belowmouse_;
18 unsigned int wid_; // ÐÏÓÌÅÄÎÉÊ ÕÎÉËÁÌØÎÙÊ widget_id
20 coord_t last_mx, last_my; // last mouse move coords
24 void draw_border(F_Border_t b = F_NO_BORDER);
26 void moving(bool m) { moving_ = m; }
27 // ÇÌÕÂÉÎÁ ÏËÎÁ ÎÁ ÜËÒÁÎÅ - ÞÅÍ ÂÏÌØÛÅ ÔÅÍ ÇÌÕÂÖÅ - i.e. 0 => top window
28 void depth(unsigned int d) { depth_ = d; }
29 void widget_belowmouse(F_Widget *w) { widget_belowmouse_ = w; }
32 void modal(bool m) { type = (m ? F_MODAL_WINDOW : F_NORMAL_WINDOW); }
33 bool modal() { return (type == F_MODAL_WINDOW ? true : false); }
34 F_Window(coord_t x, coord_t y, dim_t w, dim_t h, const char *label = 0) : F_Widget(x, y, w, h, label) {
35 parent_ = 0; // ÔÉÐÁ ÎÅÔÕ ÅÇÏ ÉÂÏ parent ÅÓÔØ display
37 border(F_DOUBLE_BORDER);
38 visible_ = false; // ÏËÎÏ, × ÏÔÌÉÞÉÅ ÏÔ ×ÉÄÖÅÔÁ, by default ÓËÒÙÔÏ
40 id(f_text_display->new_window(*this));
43 ~F_Window() { f_text_display->delete_window(*this); }
44 F_Widget *widget_belowmouse() { return widget_belowmouse_; }
45 void take_focus(F_Widget *w) {
51 widgets.take_focus(w);
55 F_Widget *focus() { return widgets.focus(); }
56 F_Widget *focus_prev() { return widgets.focus_prev(); }
57 F_Widget *focus_next() { return widgets.focus_next(); }
58 unsigned int depth() { return depth_; }
59 void show() { if (visible()) return; draw(); F_Widget::show(); f_text_display->show_window(*this); }
60 void hide() { if (!visible()) return; F_Widget::hide(); f_text_display->hide_window(*this); }
61 void border(F_Border_t brd) { if (brd == border_) return; lock(); border_ = brd; damage_ |= F_DAMAGE_BORDER; unlock(); }
62 bool moving() { return moving_; }
63 // ÍÏÖÎÏ ÐÏÔÏÍ ÐÅÒÅÄÅÌÁÔØ ÎÁ F_Group
65 bool handle(F_Event_t &ev);
66 // ÐÒÏÈÏÄÉÍ ÐÏ widget'ÁÍ
68 // debug("flushing id %d", id());
69 for (unsigned int i = 0; i < widgets.size(); i++)
71 F_Widget::damage(F_DAMAGE_NONE);
74 F_Damage_t dm = F_Widget::damage();
75 for (unsigned int i = 0; i < widgets.size(); i++)
76 dm |= widgets[i]->damage();
80 friend class F_Text_Display;