#define MSWINDOWS_BLANK_SIZE 5
#define MSWINDOWS_MINIMUM_TOOLBAR_SIZE 8
+static void
+mswindows_move_toolbar (struct frame *f, enum toolbar_pos pos);
+
#define SET_TOOLBAR_WAS_VISIBLE_FLAG(frame, pos, flag) \
do { \
switch (pos) \
/* hmm what do we generate an id based on */
int id = TOOLBAR_ITEM_ID_BITS (internal_hash (button->callback, 0));
while (!NILP (Fgethash (make_int (id),
- FRAME_MSWINDOWS_TOOLBAR_HASHTABLE (f), Qnil)))
+ FRAME_MSWINDOWS_TOOLBAR_HASH_TABLE (f), Qnil)))
{
id = TOOLBAR_ITEM_ID_BITS (id + 1);
}
{
TBBUTTON info;
- /* delete the buttons and remove the command from the hashtable*/
+ /* Delete the buttons and remove the command from the hash table*/
i = SendMessage (toolbarwnd, TB_BUTTONCOUNT, 0, 0);
for (i--; i >= 0; i--)
{
SendMessage (toolbarwnd, TB_GETBUTTON, (WPARAM)i,
(LPARAM)&info);
Fremhash(make_int(info.idCommand),
- FRAME_MSWINDOWS_TOOLBAR_HASHTABLE(f));
+ FRAME_MSWINDOWS_TOOLBAR_HASH_TABLE(f));
SendMessage (toolbarwnd, TB_DELETEBUTTON, (WPARAM)i, 0);
}
{
struct toolbar_button *tb = XTOOLBAR_BUTTON (button);
- checksum = HASH4 (checksum,
+ checksum = HASH5 (checksum,
internal_hash (get_toolbar_button_glyph(w, tb), 0),
internal_hash (tb->callback, 0),
- width);
+ width,
+ LISP_HASH (w->toolbar_buttons_captioned_p));
button = tb->next;
nbuttons++;
}
if (IMAGE_INSTANCE_PIXMAP_TYPE_P (p))
{
- /* we are going to honour the toolbar settings
+ /* we are going to honor the toolbar settings
and resize the bitmaps accordingly if they are
too big. If they are too small we leave them
and pad the difference - unless a different size
{
xfree (button_tbl);
if (ilist) ImageList_Destroy (ilist);
- signal_simple_error ("couldn't resize pixmap",
+ signal_simple_error ("Couldn't resize pixmap",
instance);
}
/* we don't care if the mask fails */
nbuttons, nbuttons * 2 )))
{
xfree (button_tbl);
- signal_simple_error ("couldn't create image list",
+ signal_simple_error ("Couldn't create image list",
instance);
}
}
Fputhash (make_int (tbbutton->idCommand),
- button, FRAME_MSWINDOWS_TOOLBAR_HASHTABLE (f));
+ button, FRAME_MSWINDOWS_TOOLBAR_HASH_TABLE (f));
}
/* now fix up the button size */
/* now display the window */
ShowWindow (toolbarwnd, SW_SHOW);
+ /* no idea why this is necessary but initial display will not
+ happen otherwise. */
+ mswindows_move_toolbar (f, pos);
if (button_tbl) xfree (button_tbl);
}
static void
+mswindows_redraw_frame_toolbars (struct frame *f)
+{
+ mswindows_redraw_exposed_toolbars (f, 0, 0, FRAME_PIXWIDTH (f),
+ FRAME_PIXHEIGHT (f));
+}
+
+static void
mswindows_initialize_frame_toolbars (struct frame *f)
{
mswindows_get_toolbar_button_text ( struct frame* f, int command_id )
{
Lisp_Object button = Fgethash (make_int (command_id),
- FRAME_MSWINDOWS_TOOLBAR_HASHTABLE (f), Qnil);
+ FRAME_MSWINDOWS_TOOLBAR_HASH_TABLE (f), Qnil);
if (!NILP (button))
{
Lisp_Object button, data, fn, arg, frame;
button = Fgethash (make_int (id),
- FRAME_MSWINDOWS_TOOLBAR_HASHTABLE (f), Qnil);
+ FRAME_MSWINDOWS_TOOLBAR_HASH_TABLE (f), Qnil);
if (NILP (button))
return Qnil;
CONSOLE_HAS_METHOD (mswindows, initialize_frame_toolbars);
CONSOLE_HAS_METHOD (mswindows, free_frame_toolbars);
CONSOLE_HAS_METHOD (mswindows, redraw_exposed_toolbars);
+ CONSOLE_HAS_METHOD (mswindows, redraw_frame_toolbars);
}