clip picons as clip_icon.png, vwindow hang, fix for drop target test
[goodguy/history.git] / cinelerra-5.1 / guicast / bcmenubar.C
index ac4dbdc64e0d437d98b2412de21831b7a9706afb..908567ec592184381a3f141758a7833bc75ac0a1 100644 (file)
@@ -2,21 +2,21 @@
 /*
  * CINELERRA
  * Copyright (C) 2008-2015 Adam Williams <broadcast at earthling dot net>
- * 
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- * 
+ *
  */
 
 #include "bcmenu.h"
@@ -27,7 +27,7 @@
 #include "bcpopupmenu.h"
 #include "bcresources.h"
 #include "bcsignals.h"
-#include "colors.h"
+#include "bccolors.h"
 #include "fonts.h"
 #include "keys.h"
 #include <string.h>
@@ -79,7 +79,7 @@ int BC_MenuBar::initialize()
 // Create the subwindow
        BC_SubWindow::initialize();
 
-       if(resources->menu_bg) 
+       if(resources->menu_bg)
                set_background(resources->menu_bg);
        draw_face(0, 0);
        show_window(0);
@@ -109,23 +109,19 @@ int BC_MenuBar::add_menu(BC_Menu* menu)
        if(menu_titles.total == 0)
                x = 2;
        else
-               x = menu_titles.values[menu_titles.total - 1]->x + 
+               x = menu_titles.values[menu_titles.total - 1]->x +
                        menu_titles.values[menu_titles.total - 1]->w;
 
        w = get_text_width(MEDIUMFONT, menu->text) + 20;
 // get pointer
        menu_titles.append(menu);
 // initialize and draw
-       menu->initialize(top_level, this, x, 2, w, get_h() - 4); 
+       menu->initialize(top_level, this, x, 2, w, get_h() - 4);
        return 0;
 }
 
 int BC_MenuBar::focus_out_event()
 {
-       for(int i = 0; i < menu_titles.total; i++) {
-               if( menu_titles.values[i]->active )
-                       return 0;
-       }
        deactivate();
        return 0;
 }
@@ -205,10 +201,14 @@ int BC_MenuBar::cursor_motion_event()
 
 int BC_MenuBar::cursor_leave_event()
 {
-       for(int i = 0; i < menu_titles.total; i++)
-       {
+       for(int i = 0; i < menu_titles.total; i++) {
                menu_titles.values[i]->dispatch_cursor_leave();
        }
+       for(int i = 0; i < menu_titles.total; i++) {
+               if( menu_titles.values[i]->active )
+                       return 0;
+       }
+       deactivate();
        return 0;
 }
 
@@ -262,9 +262,9 @@ int BC_MenuBar::draw_face(int flash, int flush)
 {
        if(menu_bar_bg)
        {
-               draw_3segmenth(0, 
-                       0, 
-                       get_w(), 
+               draw_3segmenth(0,
+                       0,
+                       get_w(),
                        menu_bar_bg);
 // 9 segment doesn't draw properly
 //             draw_9segment(0, 0, get_w(), get_h(), menu_bar_bg);
@@ -275,7 +275,7 @@ int BC_MenuBar::draw_face(int flash, int flush)
                int h, w;
                h = get_h();
                w = get_w();
-               h--; 
+               h--;
                w--;
 
                lx = 1;  ly = 1;