To: vim-dev@vim.org Subject: Patch 5.6.026 (extra) Fcc: outbox From: Bram Moolenaar ------------ Patch 5.6.026 (extra) Problem: Win32 GUI: Toolbar bitmaps are searched for in $VIMRUNTIME/bitmaps, while GTK looks in $VIM/bitmaps. (Keith Radebaugh) Solution: Use $VIM/bitmaps for both, because these are not part of the distribution but defined by the user. Files: src/gui_w32.c, runtime/doc/gui.txt *** ../vim-5.6.25/src/gui_w32.c Sat Mar 25 18:13:50 2000 --- src/gui_w32.c Thu Jan 27 10:34:50 2000 *************** *** 5614,5620 **** /* * Find a bitmap by name. * If the name is one of the built-in bitmaps, return the index to that bitmap. ! * Otherwise, look for $vim/bitmaps/.bmp, load it, add it to the toolbar * bitmap list and return the resulting index on failure return -1, which will * result in a blank (but still functional) button */ --- 5612,5618 ---- /* * Find a bitmap by name. * If the name is one of the built-in bitmaps, return the index to that bitmap. ! * Otherwise, look for $VIM/bitmaps/.bmp, load it, add it to the toolbar * bitmap list and return the resulting index on failure return -1, which will * result in a blank (but still functional) button */ *************** *** 5675,5681 **** HANDLE hbitmap; fname = alloc(_MAX_PATH); ! STRCPY(fname, "$VIMRUNTIME\\bitmaps\\"); strcat(fname, name); strcat(fname, ".bmp"); ffname = expand_env_save(fname); --- 5673,5679 ---- HANDLE hbitmap; fname = alloc(_MAX_PATH); ! STRCPY(fname, "$VIM\\bitmaps\\"); strcat(fname, name); strcat(fname, ".bmp"); ffname = expand_env_save(fname); *** ../vim-5.6.25/runtime/doc/gui.txt Sun Jan 16 14:12:54 2000 --- runtime/doc/gui.txt Tue Jan 25 20:55:53 2000 *************** *** 396,402 **** bufmenu_fullpath and bufmenu_maxlen. The former specifies full path of files to be used in the menu if set to 1. The latter specifies the maximum length of the path in the menu label. If the path is longer, path elements other than the ! first and list are removed. Then trailing and leading characters are removed from these if necessary. Last all path elements are removed. These variables must be set in .vimrc or similar, since .gvimrc is executed after menu.vim. Default values are bufmenu_fullpath=0 and bufmenu_maxlen=50. --- 396,402 ---- bufmenu_fullpath and bufmenu_maxlen. The former specifies full path of files to be used in the menu if set to 1. The latter specifies the maximum length of the path in the menu label. If the path is longer, path elements other than the ! first and last are removed. Then trailing and leading characters are removed from these if necessary. Last all path elements are removed. These variables must be set in .vimrc or similar, since .gvimrc is executed after menu.vim. Default values are bufmenu_fullpath=0 and bufmenu_maxlen=50. *************** *** 550,565 **** the built-in bitmaps available in Vim. Currently there are 28, numbered from 0 to 27, which cover most common editing operations |builtin-tools|. 2) An item with another name is first searched for in the directory ! $VIMRUNTIME/bitmaps. If found, the bitmaps file is used as the toolbar ! button image. Note that the exact filename is OS-specific: For example, ! under Win32 the command > :amenu ToolBar.Hello :echo "hello" would search for the file 'hello.bmp'. Under GTK+/X11 it is 'Hello.xpm'. Loading a custom bitmap is only supported on W95, NT4, and GTK+. The bitmap is scaled to fit the button in Win32, but not GTK+. For GTK+, the size of the default pixmaps used is 20 by 20 pixels. ! 3) If the bitmap is not found in $VIMRUNTIME/bitmaps, Vim checks for a match ! against its list of built-in names. Each built-in button image has a name. So the command > :amenu ToolBar.Open :e will show the built in "open a file" button image if no open.bmp exists. --- 550,565 ---- the built-in bitmaps available in Vim. Currently there are 28, numbered from 0 to 27, which cover most common editing operations |builtin-tools|. 2) An item with another name is first searched for in the directory ! $VIM/bitmaps. If found, the bitmap file is used as the toolbar button ! image. Note that the exact filename is OS-specific: For example, under ! Win32 the command > :amenu ToolBar.Hello :echo "hello" would search for the file 'hello.bmp'. Under GTK+/X11 it is 'Hello.xpm'. Loading a custom bitmap is only supported on W95, NT4, and GTK+. The bitmap is scaled to fit the button in Win32, but not GTK+. For GTK+, the size of the default pixmaps used is 20 by 20 pixels. ! 3) If the bitmap is not found in $VIM/bitmaps, Vim checks for a match against ! its list of built-in names. Each built-in button image has a name. So the command > :amenu ToolBar.Open :e will show the built in "open a file" button image if no open.bmp exists. *** ../vim-5.6.25/src/version.c Sat Mar 25 18:42:55 2000 --- src/version.c Sat Mar 25 18:47:49 2000 *************** *** 420,421 **** --- 420,423 ---- { /* Add new patch number below this line */ + /**/ + 26, /**/ -- GALAHAD: No. Look, I can tackle this lot single-handed! GIRLS: Yes, yes, let him Tackle us single-handed! "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /-/-- Bram Moolenaar --- Bram@moolenaar.net --- http://www.moolenaar.net --\-\ \-\-- Vim: http://www.vim.org ---- ICCF Holland: http://www.vim.org/iccf --/-/