Skip to content
Snippets Groups Projects
Select Git revision
  • f6c523d68175d9e763fc6a219c9cb27ecffcbf56
  • master default
  • cgnsUnstructured
  • partitioning
  • poppler
  • HighOrderBLCurving
  • gmsh_3_0_4
  • gmsh_3_0_3
  • gmsh_3_0_2
  • gmsh_3_0_1
  • gmsh_3_0_0
  • gmsh_2_16_0
  • gmsh_2_15_0
  • gmsh_2_14_1
  • gmsh_2_14_0
  • gmsh_2_13_2
  • gmsh_2_13_1
  • gmsh_2_12_0
  • gmsh_2_11_0
  • gmsh_2_10_1
  • gmsh_2_10_0
  • gmsh_2_9_3
  • gmsh_2_9_2
  • gmsh_2_9_1
  • gmsh_2_9_0
  • gmsh_2_8_6
26 results

onelab.h

Blame
  • Forked from gmsh / gmsh
    Source project has a limited visibility.
    paletteWindow.h 1.22 KiB
    // Gmsh - Copyright (C) 1997-2012 C. Geuzaine, J.-F. Remacle
    //
    // See the LICENSE.txt file for license information. Please report all
    // bugs and problems to <gmsh@geuz.org>.
    
    #ifndef _PALETTE_WINDOW_H
    #define _PALETTE_WINDOW_H
    
    #include <FL/Fl.H>
    #include <FL/Fl_Double_Window.H>
    
    // Derive special windows from Fl_Double_Window to correctly process
    // the OS-specific shorcuts (Esc & Cmd-w on Mac, Alt+F4 on Windows)
    class paletteWindow : public Fl_Double_Window {
     private:
      int handle(int event)
      {
        switch (event) {
        case FL_SHORTCUT:
        case FL_KEYBOARD:
    #if defined(__APPLE__)
          if(Fl::test_shortcut(FL_META+'w') || Fl::test_shortcut(FL_Escape)){
    #elif defined(WIN32)
          if(Fl::test_shortcut(FL_ALT+FL_F+4) || Fl::test_shortcut(FL_Escape)){
    #else
          if(Fl::test_shortcut(FL_CTRL+'w') || Fl::test_shortcut(FL_Escape)){
    #endif
            do_callback();
            return 1;
          }
          break;
        }
        return Fl_Double_Window::handle(event);
      }
     public:
      paletteWindow(int w, int h, bool nonModal, const char *l=0)
        : Fl_Double_Window(w, h, l) 
      {
        if(nonModal) set_non_modal();
      }
      void show()
      {
        if(non_modal() && !shown()) Fl_Double_Window::show(); // fix ordering
        Fl_Double_Window::show();
      }
    };
    
    #endif