From 5d566cae13d1bd35eb05accca73ba1136102f6b8 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Tue, 8 May 2001 11:34:19 +0000 Subject: [PATCH] windows icon --- Common/Bitmaps.h | 39 +++++++++++++++++++++++++++++++++++++++ Fltk/GUI.cpp | 16 ++++++++-------- Fltk/GUI.h | 1 - 3 files changed, 47 insertions(+), 9 deletions(-) diff --git a/Common/Bitmaps.h b/Common/Bitmaps.h index a088563c18..0e570694c8 100644 --- a/Common/Bitmaps.h +++ b/Common/Bitmaps.h @@ -1,6 +1,8 @@ #ifndef _BITMAPS_H_ #define _BITMAPS_H_ +// 'Gmsh' (Unix) icon + #define g1_width 66 #define g1_height 29 static char g1_bits[] = { @@ -23,6 +25,8 @@ static char g1_bits[] = { 0xa5,0x28,0xfd,0x30,0x00,0x00,0x00,0x00,0x24,0x99,0xc8,0xfd,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0xfc}; +// 'Gmsh Menu' (Unix) icon + #define g2_width 66 #define g2_height 29 static char g2_bits[] = { @@ -45,6 +49,8 @@ static char g2_bits[] = { 0x00,0x00,0xfc,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0xfc}; +// 'Gmsh command' (Unix) icon + #define g3_width 66 #define g3_height 29 static char g3_bits[] = { @@ -67,6 +73,9 @@ static char g3_bits[] = { 0x52,0x94,0xfd,0x30,0x00,0xe0,0x71,0x92,0x92,0x6c,0x64,0xfd,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0xfc}; + +// 'About Gmsh' bitmap + #define about_width 49 #define about_height 111 static char about_bits[] = { @@ -123,22 +132,52 @@ static char about_bits[] = { 0x00,0x00,0xfc,0x01,0x00,0xfe,0x00,0x00,0x00,0xf8,0x00,0x00,0xfe,0x00,0x00, 0x00,0x00,0x00,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0xfe}; +// 'Abort' bitmap + #define abort_width 13 #define abort_height 13 static char abort_bits[] = { 0x00,0xe0,0x40,0xe0,0x40,0xe0,0x50,0xe1,0x48,0xe2,0x44,0xe4,0x44,0xe4,0x44, 0xe4,0x04,0xe4,0x04,0xe4,0x08,0xe2,0xf0,0xe1,0x00,0xe0}; +// 'Play button' bitmap + #define start_width 9 #define start_height 13 static char start_bits[] = { 0x00,0xfe,0x06,0xfe,0x0a,0xfe,0x12,0xfe,0x22,0xfe,0x42,0xfe,0x82,0xfe,0x42, 0xfe,0x22,0xfe,0x12,0xfe,0x0a,0xfe,0x06,0xfe,0x00,0xfe}; +// 'Pause button' bitmap + #define stop_width 9 #define stop_height 13 static char stop_bits[] = { 0x00,0xfe,0xee,0xfe,0xaa,0xfe,0xaa,0xfe,0xaa,0xfe,0xaa,0xfe,0xaa,0xfe,0xaa, 0xfe,0xaa,0xfe,0xaa,0xfe,0xaa,0xfe,0xee,0xfe,0x00,0xfe}; +// 'Gmsh' (Windows) icon + +static char gmsh_and_bits[] = { + 0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x03,0x00,0x01,0xf0,0x03,0xc1, + 0x63,0x8c,0x83,0xe3,0xf3,0x86,0xc3,0xf3,0xf9,0x87,0xe3,0xcb,0xe5,0x47,0xb3, + 0xc7,0xe3,0x3f,0x9a,0xe3,0xe1,0x1f,0xce,0xe1,0xe0,0x07,0xc7,0x60,0xc0,0x80, + 0x03,0x00,0x00,0xc0,0x01,0x60,0x00,0xe0,0x00,0x60,0x00,0xf0,0x00,0x70,0x00, + 0x78,0x00,0x38,0x00,0x7c,0x00,0x38,0x00,0x3c,0x00,0x1c,0x00,0x1e,0x00,0x0e, + 0x00,0x0c,0x02,0x06,0x00,0x00,0x03,0x03,0x00,0x80,0x07,0xc1,0x00,0xc0,0x87, + 0xe0,0x01,0x60,0x8f,0xf0,0x01,0x10,0x4e,0xe8,0x01,0x08,0x4e,0xc4,0x21,0x24, + 0xe4,0xc2,0x11,0x32,0xe6,0xc1,0x09,0x70,0xe3,0xc0,0x05,0xe0,0x40,0xc0,0x03, + 0x00,0x00,0x80,0x01,0x00,0x00,0x00,0x00}; + +static char gmsh_and_bits[] = { + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; + #endif diff --git a/Fltk/GUI.cpp b/Fltk/GUI.cpp index 0e348f4d26..3146ea7f87 100644 --- a/Fltk/GUI.cpp +++ b/Fltk/GUI.cpp @@ -1,4 +1,4 @@ -// $Id: GUI.cpp,v 1.72 2001-05-07 06:25:26 geuzaine Exp $ +// $Id: GUI.cpp,v 1.73 2001-05-08 11:34:19 geuzaine Exp $ // To make the interface as visually consistent as possible, please: // - use the BH, BW, WB, IW values for button heights/widths, window borders, etc. @@ -464,12 +464,6 @@ GUI::GUI(int argc, char **argv) { Fl::add_handler(SetGlobalShortcut); - // Icons - - icon1_bmp = new Fl_Bitmap(g1_bits,g1_width,g1_height); - icon2_bmp = new Fl_Bitmap(g2_bits,g2_width,g2_height); - icon3_bmp = new Fl_Bitmap(g3_bits,g3_width,g3_height); - // All static windows are contructed (even if some are not // displayed) since the shortcuts should be valid even for hidden // windows, and we don't want to test for widget existence every time @@ -477,7 +471,13 @@ GUI::GUI(int argc, char **argv) { create_menu_window(argc, argv); create_graphic_window(argc, argv); -#ifndef WIN32 +#ifdef WIN32 + HICON icon = CreateIcon(NULL, 32, 32, 1, 1, + (CONST BYTE *)gmsh_and_bits, + (CONST BYTE *)gmsh_xor_bits); + m_window->icon((char *)icon); + g_window->icon((char *)icon); +#else fl_open_display(); Pixmap p1 = XCreateBitmapFromData(fl_display, DefaultRootWindow(fl_display), g1_bits, g1_width, g1_height); diff --git a/Fltk/GUI.h b/Fltk/GUI.h index 14a5a23aba..86677e1f3e 100644 --- a/Fltk/GUI.h +++ b/Fltk/GUI.h @@ -82,7 +82,6 @@ class GUI{ int MH ; // Bitmaps - Fl_Bitmap *icon1_bmp, *icon2_bmp, *icon3_bmp; Fl_Bitmap *abort_bmp, *start_bmp, *stop_bmp, *about_bmp ; void add_post_plugins ( Fl_Menu_Button *button , int iView); -- GitLab