4 #include "mwindowgui.h"
5 #include "panedividers.h"
9 PaneDivider::PaneDivider(MWindow *mwindow, int x, int y, int length, int is_x)
12 is_x ? mwindow->theme->pane_w : length,
13 is_x ? length : mwindow->theme->pane_h,
14 mwindow->theme->pane_color)
16 this->mwindow = mwindow;
20 images[0] = images[1]= images[2] = 0;
24 PaneDivider::~PaneDivider()
31 void PaneDivider::create_objects()
36 set_cursor(HSEPARATE_CURSOR, 0, 0);
37 image_src = mwindow->theme->get_image_set("xpane");
41 set_cursor(VSEPARATE_CURSOR, 0, 0);
42 image_src = mwindow->theme->get_image_set("ypane");
45 for(int i = 0; i < 3; i++)
47 images[i] = new BC_Pixmap(this, image_src[i], PIXMAP_ALPHA);
53 void PaneDivider::draw(int flush)
72 void PaneDivider::reposition_window(int x, int y, int length)
74 BC_SubWindow::reposition_window(x,
76 is_x ? mwindow->theme->pane_w : length,
78 is_x ? length : mwindow->theme->pane_h);
81 int PaneDivider::button_press_event()
85 origin_x = get_cursor_x();
86 origin_y = get_cursor_y();
88 status = BUTTON_DOWNHI;
95 int PaneDivider::button_release_event()
104 // might be deleted in here
105 mwindow->gui->stop_pane_drag();
106 status = BUTTON_UPHI;
115 int PaneDivider::cursor_motion_event()
121 if(is_x && abs(get_cursor_x() - origin_x) > 5)
124 mwindow->gui->start_x_pane_drag();
127 if(!is_x && abs(get_cursor_y() - origin_y) > 5)
130 mwindow->gui->start_y_pane_drag();
135 mwindow->gui->handle_pane_drag();
143 int PaneDivider::cursor_enter_event()
147 if(get_button_down())
149 status = BUTTON_DOWNHI;
152 if(status == BUTTON_UP)
154 status = BUTTON_UPHI;
162 int PaneDivider::cursor_leave_event()
164 if(status == BUTTON_UPHI)