Develop and Download Open Source Software

Browse CVS Repository

Diff of /ttssh2/teraterm/source/teraterm/vtdisp.c

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

revision 1.16 by yutakapon, Wed Jan 23 15:10:55 2008 UTC revision 1.17 by yutakapon, Thu Jan 24 11:38:42 2008 UTC
# Line 1700  void CaretKillFocus(BOOL show) Line 1700  void CaretKillFocus(BOOL show)
1700    HPEN oldpen;    HPEN oldpen;
1701    HDC hdc;    HDC hdc;
1702    
1703      if (ts.KillFocusCursor == 0)
1704              return;
1705    
1706    // Eterm lookfeelの場合は何もしない    // Eterm lookfeelの場合は何もしない
1707    if (BGEnable)    if (BGEnable)
1708            return;            return;
# Line 1740  void CaretOn() Line 1743  void CaretOn()
1743  {  {
1744    int CaretX, CaretY, H;    int CaretX, CaretY, H;
1745    
1746    if (! Active) {    if (ts.KillFocusCursor == 0 && !Active)
           CaretKillFocus(TRUE);  
1747            return;            return;
   } else {  
           CaretKillFocus(FALSE);  
   }  
1748    
1749    CaretX = (CursorX-WinOrgX)*FontWidth;    CaretX = (CursorX-WinOrgX)*FontWidth;
1750    CaretY = (CursorY-WinOrgY)*FontHeight;    CaretY = (CursorY-WinOrgY)*FontHeight;
1751    
1752    if ((ts.Language==IdJapanese) &&    if ((ts.Language==IdJapanese) &&
1753        CanUseIME() && (ts.IMEInline>0))            CanUseIME() && (ts.IMEInline>0))
1754      /* set IME conversion window pos. & font */          /* set IME conversion window pos. & font */
1755      SetConversionWindow(HVTWin,CaretX,CaretY);          SetConversionWindow(HVTWin,CaretX,CaretY);
1756    
1757    if (! CaretEnabled) return;    if (! CaretEnabled) return;
1758    
1759    if (ts.CursorShape!=IdVCur)    if (Active) {
1760    {            if (ts.CursorShape!=IdVCur)
1761      if (ts.CursorShape==IdHCur)            {
1762      {                  if (ts.CursorShape==IdHCur)
1763       CaretY = CaretY+FontHeight-CurWidth;                  {
1764       H = CurWidth;                   CaretY = CaretY+FontHeight-CurWidth;
1765      }                   H = CurWidth;
1766      else H = FontHeight;                  }
1767                    else H = FontHeight;
1768    
1769                    DestroyCaret();
1770                    if (CursorOnDBCS)
1771                      CreateCaret(HVTWin, 0, FontWidth*2, H); /* double width caret */
1772                    else
1773                      CreateCaret(HVTWin, 0, FontWidth, H); /* single width caret */
1774                    CaretStatus = 1;
1775              }
1776    
1777      DestroyCaret();            SetCaretPos(CaretX,CaretY);
     if (CursorOnDBCS)  
       CreateCaret(HVTWin, 0, FontWidth*2, H); /* double width caret */  
     else  
       CreateCaret(HVTWin, 0, FontWidth, H); /* single width caret */  
     CaretStatus = 1;  
1778    }    }
1779    
   SetCaretPos(CaretX,CaretY);  
   
1780    while (CaretStatus > 0)    while (CaretStatus > 0)
1781    {    {
1782      ShowCaret(HVTWin);            if (! Active) {
1783                      CaretKillFocus(TRUE);
1784              } else {
1785                  ShowCaret(HVTWin);
1786              }
1787      CaretStatus--;      CaretStatus--;
1788    }    }
1789    
# Line 1786  void CaretOn() Line 1791  void CaretOn()
1791    
1792  void CaretOff()  void CaretOff()
1793  {  {
1794          if (! Active) {    if (ts.KillFocusCursor == 0 && !Active)
1795                  CaretKillFocus(FALSE);            return;
                 return;  
         }  
1796    
1797    if (CaretStatus == 0)    if (CaretStatus == 0)
1798    {    {
1799      HideCaret(HVTWin);            if (! Active) {
1800                    CaretKillFocus(FALSE);
1801              } else {
1802                HideCaret(HVTWin);
1803              }
1804      CaretStatus++;      CaretStatus++;
1805    }    }
1806  }  }
# Line 1810  BOOL IsCaretOn() Line 1817  BOOL IsCaretOn()
1817  {  {
1818          // 非アクティブ(フォーカス無効)の場合においても、カーソル描画を行いたいため、          // 非アクティブ(フォーカス無効)の場合においても、カーソル描画を行いたいため、
1819          // 2つめの条件を追加する。(2008.1.24 yutaka)          // 2つめの条件を追加する。(2008.1.24 yutaka)
1820    return ((Active && (CaretStatus==0)) || !Active);    if (ts.KillFocusCursor == 0)
1821            return (( Active && (CaretStatus==0)) );
1822      else
1823            return ((Active && (CaretStatus==0)) || (!Active && (CaretStatus==0)));
1824  }  }
1825    
1826  void DispEnableCaret(BOOL On)  void DispEnableCaret(BOOL On)
# Line 2939  void DispSetActive(BOOL ActiveFlag) Line 2949  void DispSetActive(BOOL ActiveFlag)
2949    Active = ActiveFlag;    Active = ActiveFlag;
2950    if (Active)    if (Active)
2951    {    {
2952            if (IsCaretOn())
2953                    CaretKillFocus(FALSE);
2954    
2955      SetFocus(HVTWin);      SetFocus(HVTWin);
2956      ActiveWin = IdVT;      ActiveWin = IdVT;
2957    }    }

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

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