Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

128 lines
3.4 KiB

  1. /****************************************************************************
  2. PMODE.CPP : PMode class implementation which manage conversion mode button
  3. on the Cicero Toolbar
  4. History:
  5. 10-JAN-2000 CSLim Created
  6. ****************************************************************************/
  7. #include "precomp.h"
  8. #include "pmode.h"
  9. #include "gdata.h"
  10. #include "ui.h"
  11. #include "winex.h"
  12. #include "resource.h"
  13. // {9B34BF53-340A-45bd-9885-61B278EA454E}
  14. const GUID GUID_LBI_KORIME_PMODE =
  15. {
  16. 0x9b34bf53,
  17. 0x340a,
  18. 0x45bd,
  19. { 0x98, 0x85, 0x61, 0xb2, 0x78, 0xea, 0x45, 0x4e }
  20. };
  21. /*---------------------------------------------------------------------------
  22. PMode::PMode
  23. ---------------------------------------------------------------------------*/
  24. PMode::PMode(CToolBar *ptb)
  25. {
  26. WCHAR szText[256];
  27. szText[0] = L'\0';
  28. m_pTb = ptb;
  29. // Set Add/Remove text and tootip text
  30. OurLoadStringW(vpInstData->hInst, IDS_STATUS_TT_IME_PAD, szText, sizeof(szText)/sizeof(WCHAR));
  31. InitInfo(CLSID_SYSTEMLANGBARITEM_KEYBOARD,
  32. GUID_LBI_KORIME_PMODE,
  33. TF_LBI_STYLE_BTN_BUTTON,
  34. 230,
  35. szText);
  36. SetToolTip(szText);
  37. // Set button text. Use tooltip text.
  38. // OurLoadStringW(vpInstData->hInst, IDS_STATUS_BUTTON_IME_PAD, szText, sizeof(szText)/sizeof(WCHAR));
  39. SetText(szText);
  40. }
  41. /*---------------------------------------------------------------------------
  42. PMode::Release
  43. ---------------------------------------------------------------------------*/
  44. STDAPI_(ULONG) PMode::Release()
  45. {
  46. long cr;
  47. cr = --m_cRef;
  48. DbgAssert(cr >= 0);
  49. if (cr == 0)
  50. {
  51. delete this;
  52. }
  53. return cr;
  54. }
  55. /*---------------------------------------------------------------------------
  56. PMode::GetIcon
  57. Get Button face Icon
  58. ---------------------------------------------------------------------------*/
  59. STDAPI PMode::GetIcon(HICON *phIcon)
  60. {
  61. DWORD dwCM = GetCMode();
  62. UINT uiIcon = IDI_CMODE_IMEPAD;
  63. *phIcon = LoadIcon(vpInstData->hInst, MAKEINTRESOURCE(uiIcon));
  64. return S_OK;
  65. }
  66. /*---------------------------------------------------------------------------
  67. PMode::InitMenu
  68. No need, this is just toggle button
  69. ---------------------------------------------------------------------------*/
  70. STDAPI PMode::InitMenu(ITfMenu *pMenu)
  71. {
  72. return E_NOTIMPL;
  73. }
  74. /*---------------------------------------------------------------------------
  75. PMode::OnMenuSelect
  76. No need, this is just toggle button
  77. ---------------------------------------------------------------------------*/
  78. STDAPI PMode::OnMenuSelect(UINT wID)
  79. {
  80. return E_NOTIMPL;
  81. }
  82. //+---------------------------------------------------------------------------
  83. //
  84. // OnLButtonUp
  85. //
  86. //----------------------------------------------------------------------------
  87. HRESULT PMode::OnLButtonUp(const POINT pt, const RECT* prcArea)
  88. {
  89. OurPostMessage(GetActiveUIWnd(), WM_MSIME_IMEPAD, 0, 0);
  90. return S_OK;
  91. }
  92. //+---------------------------------------------------------------------------
  93. //
  94. // OnRButtonUp
  95. //
  96. //----------------------------------------------------------------------------
  97. HRESULT PMode::OnRButtonUp(const POINT pt, const RECT* prcArea)
  98. {
  99. return S_OK;
  100. }