/[emacs]/emacs/src/w32fns.c
ViewVC logotype

Diff of /emacs/src/w32fns.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.138 by jasonr, Thu Nov 22 20:40:03 2001 UTC revision 1.139 by jasonr, Sat Nov 24 17:39:31 2001 UTC
# Line 4686  w32_wnd_proc (hwnd, msg, wParam, lParam) Line 4686  w32_wnd_proc (hwnd, msg, wParam, lParam)
4686        goto dflt;        goto dflt;
4687    
4688      case WM_MENUSELECT:      case WM_MENUSELECT:
4689  #if OLD_MENU_HELP  #if DIRECT_MENU_HELP
       wmsg.dwModifiers = w32_get_modifiers ();  
       my_post_msg (&wmsg, hwnd, msg, wParam, lParam);  
 #else  
4690        {        {
4691          /* Try to process these directly: the relevant parts of redisplay          /* Tooltips seemed to behave better when help_echo was directly
4692             are supposed to be re-entrant now.  This should allow tooltips             displayed, but this causes crashes when GC kicks in when the
4693             to be shown for menus.  */             tip_frame is active.  */
4694          HMENU menu = (HMENU) lParam;          HMENU menu = (HMENU) lParam;
4695          UINT menu_item = (UINT) LOWORD (wParam);          UINT menu_item = (UINT) LOWORD (wParam);
4696          UINT flags = (UINT) HIWORD (wParam);          UINT flags = (UINT) HIWORD (wParam);
# Line 4702  w32_wnd_proc (hwnd, msg, wParam, lParam) Line 4699  w32_wnd_proc (hwnd, msg, wParam, lParam)
4699          w32_menu_display_help (menu, menu_item, flags);          w32_menu_display_help (menu, menu_item, flags);
4700          UNBLOCK_INPUT;          UNBLOCK_INPUT;
4701        }        }
4702    #else
4703          wmsg.dwModifiers = w32_get_modifiers ();
4704          my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
4705  #endif  #endif
4706        return 0;        return 0;
4707    
# Line 4835  w32_wnd_proc (hwnd, msg, wParam, lParam) Line 4835  w32_wnd_proc (hwnd, msg, wParam, lParam)
4835        return 0;        return 0;
4836    
4837      case WM_WINDOWPOSCHANGING:      case WM_WINDOWPOSCHANGING:
4838          /* Don't restrict the sizing of tip frames.  */
4839          if (hwnd == tip_window)
4840            return 0;
4841        {        {
4842          WINDOWPLACEMENT wp;          WINDOWPLACEMENT wp;
4843          LPWINDOWPOS lppos = (WINDOWPOS *) lParam;          LPWINDOWPOS lppos = (WINDOWPOS *) lParam;
# Line 5062  void Line 5065  void
5065  my_create_tip_window (f)  my_create_tip_window (f)
5066       struct frame *f;       struct frame *f;
5067  {  {
5068    HWND hwnd;    RECT rect;
5069    
5070    FRAME_W32_WINDOW (f) = hwnd    rect.left = rect.top = 0;
5071      rect.right = PIXEL_WIDTH (f);
5072      rect.bottom = PIXEL_HEIGHT (f);
5073    
5074      AdjustWindowRect (&rect, f->output_data.w32->dwStyle,
5075                        FRAME_EXTERNAL_MENU_BAR (f));
5076    
5077      tip_window = FRAME_W32_WINDOW (f)
5078      = CreateWindow (EMACS_CLASS,      = CreateWindow (EMACS_CLASS,
5079                      f->namebuf,                      f->namebuf,
5080                      f->output_data.w32->dwStyle,                      f->output_data.w32->dwStyle,
5081                      f->output_data.w32->left_pos,                      f->output_data.w32->left_pos,
5082                      f->output_data.w32->top_pos,                      f->output_data.w32->top_pos,
5083                      PIXEL_WIDTH (f),                      rect.right - rect.left,
5084                      PIXEL_HEIGHT (f),                      rect.bottom - rect.top,
5085                      FRAME_W32_WINDOW (SELECTED_FRAME ()), /* owner */                      FRAME_W32_WINDOW (SELECTED_FRAME ()), /* owner */
5086                      NULL,                      NULL,
5087                      hinst,                      hinst,
5088                      NULL);                      NULL);
5089    
5090    if (hwnd)    if (tip_window)
5091      {      {
5092        SetWindowLong (hwnd, WND_FONTWIDTH_INDEX, FONT_WIDTH (f->output_data.w32->font));        SetWindowLong (tip_window, WND_FONTWIDTH_INDEX, FONT_WIDTH (f->output_data.w32->font));
5093        SetWindowLong (hwnd, WND_LINEHEIGHT_INDEX, f->output_data.w32->line_height);        SetWindowLong (tip_window, WND_LINEHEIGHT_INDEX, f->output_data.w32->line_height);
5094        SetWindowLong (hwnd, WND_BORDER_INDEX, f->output_data.w32->internal_border_width);        SetWindowLong (tip_window, WND_BORDER_INDEX, f->output_data.w32->internal_border_width);
5095        SetWindowLong (hwnd, WND_BACKGROUND_INDEX, FRAME_BACKGROUND_PIXEL (f));        SetWindowLong (tip_window, WND_BACKGROUND_INDEX, FRAME_BACKGROUND_PIXEL (f));
5096    
5097          /* Tip frames have no scrollbars.  */
5098          SetWindowLong (tip_window, WND_SCROLLBAR_INDEX, 0);
5099    
5100        /* Do this to discard the default setting specified by our parent. */        /* Do this to discard the default setting specified by our parent. */
5101        ShowWindow (hwnd, SW_HIDE);        ShowWindow (tip_window, SW_HIDE);
5102      }      }
5103  }  }
5104    
# Line 13202  x_create_tip_frame (dpyinfo, parms, text Line 13215  x_create_tip_frame (dpyinfo, parms, text
13215          parms = Fcons (Fcons (Qinternal_border_width, value),          parms = Fcons (Fcons (Qinternal_border_width, value),
13216                         parms);                         parms);
13217      }      }
13218    /* Default internalBorderWidth for tooltips to 2 on Windows to match    x_default_parameter (f, parms, Qinternal_border_width, make_number (1),
      other programs.  */  
   x_default_parameter (f, parms, Qinternal_border_width, make_number (2),  
13219                         "internalBorderWidth", "internalBorderWidth",                         "internalBorderWidth", "internalBorderWidth",
13220                         RES_TYPE_NUMBER);                         RES_TYPE_NUMBER);
13221    
# Line 13330  compute_tip_xy (f, parms, dx, dy, width, Line 13341  compute_tip_xy (f, parms, dx, dy, width,
13341       int *root_x, *root_y;       int *root_x, *root_y;
13342  {  {
13343    Lisp_Object left, top;    Lisp_Object left, top;
   unsigned pmask;  
13344        
13345    /* User-specified position?  */    /* User-specified position?  */
13346    left = Fcdr (Fassq (Qleft, parms));    left = Fcdr (Fassq (Qleft, parms));
# Line 13361  compute_tip_xy (f, parms, dx, dy, width, Line 13371  compute_tip_xy (f, parms, dx, dy, width,
13371    
13372    if (INTEGERP (left))    if (INTEGERP (left))
13373      *root_x = XINT (left);      *root_x = XINT (left);
13374    else if (*root_x + XINT (dx) + width > FRAME_WIDTH (f))    else if (*root_x + XINT (dx) + width > FRAME_W32_DISPLAY_INFO (f)->width)
13375      *root_x -= width + XINT (dx);      *root_x -= width + XINT (dx);
13376    else    else
13377      *root_x += XINT (dx);      *root_x += XINT (dx);
# Line 13542  Text larger than the specified size is c Line 13552  Text larger than the specified size is c
13552          row_width = row->pixel_width;          row_width = row->pixel_width;
13553                
13554        /* TODO: find why tips do not draw along baseline as instructed.  */        /* TODO: find why tips do not draw along baseline as instructed.  */
13555        height += row->height * 2;        height += row->height;
13556        width = max (width, row_width);        width = max (width, row_width);
13557      }      }
13558    
# Line 13556  Text larger than the specified size is c Line 13566  Text larger than the specified size is c
13566    compute_tip_xy (f, parms, dx, dy, width, height, &root_x, &root_y);    compute_tip_xy (f, parms, dx, dy, width, height, &root_x, &root_y);
13567    
13568    BLOCK_INPUT;    BLOCK_INPUT;
13569    SetWindowPos (FRAME_W32_WINDOW (f), HWND_TOPMOST,    {
13570                       root_x, root_y - height, width, height,      /* Adjust Window size to take border into account.  */
13571                       SWP_NOACTIVATE);      RECT rect;
13572    my_show_window (f, FRAME_W32_WINDOW (f), SW_SHOWNORMAL);      rect.left = rect.top = 0;
13573        rect.right = width;
13574        rect.bottom = height;
13575        AdjustWindowRect (&rect, f->output_data.w32->dwStyle,
13576                          FRAME_EXTERNAL_MENU_BAR (f));
13577    
13578        SetWindowPos (FRAME_W32_WINDOW (f), HWND_TOPMOST,
13579                      root_x, root_y, rect.right - rect.left,
13580                      rect.bottom - rect.top, SWP_NOACTIVATE);
13581    
13582        /* Let redisplay know that we have made the frame visible already.  */
13583        f->async_visible = 1;
13584    
13585        ShowWindow (FRAME_W32_WINDOW (f), SW_SHOWNOACTIVATE);
13586      }
13587    UNBLOCK_INPUT;    UNBLOCK_INPUT;
13588    
13589    /* Draw into the window.  */    /* Draw into the window.  */

Legend:
Removed from v.1.138  
changed lines
  Added in v.1.139

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26