Skip to content
Snippets Groups Projects
Select Git revision
  • 4c01e3f25d7dedd71dbce5a1ad324051df3a5ee1
  • master default protected
  • patches-4.14
  • steplayer
  • bl
  • pluginMeshQuality
  • fixBugsAmaury
  • hierarchical-basis
  • alphashapes
  • relaying
  • new_export_boris
  • oras_vs_osm
  • reassign_partitions
  • distributed_fwi
  • rename-classes
  • fix/fortran-api-example-t4
  • robust_partitions
  • reducing_files
  • fix_overlaps
  • 3115-issue-fix
  • 3023-Fillet2D-Update
  • gmsh_4_14_0
  • gmsh_4_13_1
  • gmsh_4_13_0
  • gmsh_4_12_2
  • gmsh_4_12_1
  • gmsh_4_12_0
  • gmsh_4_11_1
  • gmsh_4_11_0
  • gmsh_4_10_5
  • gmsh_4_10_4
  • gmsh_4_10_3
  • gmsh_4_10_2
  • gmsh_4_10_1
  • gmsh_4_10_0
  • gmsh_4_9_5
  • gmsh_4_9_4
  • gmsh_4_9_3
  • gmsh_4_9_2
  • gmsh_4_9_1
  • gmsh_4_9_0
41 results

paletteWindow.h

Blame
  • 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