Develop and Download Open Source Software

Browse Subversion Repository

Annotation of /branches/ttcomtester/teraterm/teraterm/sizetip.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 8067 - (hide annotations) (download) (as text)
Fri Sep 6 11:31:51 2019 UTC (4 years, 7 months ago) by yutakapon
Original Path: trunk/teraterm/teraterm/sizetip.c
File MIME type: text/x-csrc
File size: 2460 byte(s)
r8066 の修正でSSH認証のパスワードダイアログにおけるツールチップの表示位置を調整した。
1 zmatsuo 7507 /*
2     * Copyright (C) 2008-2019 TeraTerm Project
3 doda 7089 * All rights reserved.
4     *
5     * Redistribution and use in source and binary forms, with or without
6     * modification, are permitted provided that the following conditions
7     * are met:
8     *
9     * 1. Redistributions of source code must retain the above copyright
10     * notice, this list of conditions and the following disclaimer.
11     * 2. Redistributions in binary form must reproduce the above copyright
12     * notice, this list of conditions and the following disclaimer in the
13     * documentation and/or other materials provided with the distribution.
14     * 3. The name of the author may not be used to endorse or promote products
15     * derived from this software without specific prior written permission.
16     *
17     * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
18     * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19     * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20     * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
21     * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22     * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23     * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24     * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25     * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26     * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27     */
28 zmatsuo 7507 /* original idea from PuTTY 0.60 windows/sizetip.c */
29 doda 7089
30     #include "teraterm.h"
31     #include "tttypes.h"
32     #include "ttlib.h"
33     #include "ttwinman.h"
34    
35     #include <windows.h>
36     #include <stdio.h>
37 zmatsuo 7507 #include <tchar.h>
38 doda 7089
39 zmatsuo 7507 #include "TipWin.h"
40    
41     static TipWin *SizeTip;
42 doda 7089 static int tip_enabled = 0;
43    
44     void UpdateSizeTip(HWND src, int cx, int cy)
45     {
46     TCHAR str[32];
47    
48     if (!tip_enabled)
49     return;
50    
51     /* Generate the tip text */
52    
53 zmatsuo 7507 _stprintf_s(str, _countof(str), _T("%dx%d"), cx, cy);
54 doda 7089
55 zmatsuo 7507 if (SizeTip == NULL) {
56 doda 7089 RECT wr;
57 zmatsuo 7507 // ウィンドウの位置を取得
58 doda 7089 GetWindowRect(src, &wr);
59 yutakapon 8066 cx = wr.left;
60     cy = wr.top;
61 yutakapon 8067 SizeTip = TipWinCreate(src, cx, cy, str, TRUE);
62 doda 7089 } else {
63     /* Tip already exists, just set the text */
64 zmatsuo 7507 TipWinSetText(SizeTip, str);
65     //SetWindowText(tip_wnd, str);
66 doda 7089 }
67     }
68    
69     void EnableSizeTip(int bEnable)
70     {
71 zmatsuo 7507 if (SizeTip && !bEnable) {
72     TipWinDestroy(SizeTip);
73     SizeTip = NULL;
74 doda 7089 }
75    
76     tip_enabled = bEnable;
77     }

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26