home *** CD-ROM | disk | FTP | other *** search
/ Prima Shareware 3 / DuCom_Prima-Shareware-3_cd1.bin / PROGRAMO / C / RICHCT / TOLCMBBX.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-05  |  1.6 KB  |  80 lines

  1. /*  Project richctrl
  2.     DHB Software
  3.     Copyright ⌐ 1996. All Rights Reserved.
  4.  
  5.     SUBSYSTEM:    richctrl.apx Application
  6.     FILE:         tolcmbbx.cpp
  7.     AUTHOR:       David H. Borg
  8.  
  9.  
  10.     OVERVIEW
  11.     ========
  12.     Source file for implementation of ToolComboBox (TComboBox).      
  13. */
  14.  
  15. #include <owl\owlpch.h>
  16. #pragma hdrstop
  17.  
  18. #include "tolcmbbx.h"
  19.  
  20.  
  21. //
  22. // Build a response table for all messages/commands handled
  23. // by the application.
  24. //
  25. DEFINE_RESPONSE_TABLE1(ToolComboBox, TComboBox)
  26. //{{ToolComboBoxRSP_TBL_BEGIN}}
  27.     EV_WM_SETFOCUS,
  28. //{{ToolComboBoxRSP_TBL_END}}
  29. END_RESPONSE_TABLE;
  30.  
  31.  
  32. //{{ToolComboBox Implementation}}
  33.  
  34.  
  35. ToolComboBox::ToolComboBox (TWindow* parent, int id, int x, int y, int w, int h, uint32 style, uint textLen, TModule* module):
  36.     TComboBox(parent, id, x, y, w, h, style, textLen, module), returnFocus(0)
  37. {
  38.     // INSERT>> Your constructor code here.
  39.  
  40.     // modify default styles
  41.     Attr.Style &= ~(WS_GROUP | WS_TABSTOP | CBS_SORT);
  42.     Attr.Style |= style;
  43. }
  44.  
  45.  
  46. ToolComboBox::~ToolComboBox ()
  47. {
  48.     Destroy();
  49.  
  50.     // INSERT>> Your destructor code here.
  51.  
  52. }
  53.  
  54.  
  55. void ToolComboBox::EvSetFocus (HWND hWndLostFocus )
  56. {
  57.     TComboBox::EvSetFocus(hWndLostFocus );
  58.  
  59.     // INSERT>> Your code here.
  60.  
  61.     // remember who sent us focus
  62.     returnFocus = hWndLostFocus;
  63. }
  64.  
  65.  
  66. void ToolComboBox::RetWndFocus()
  67. {
  68.     // give focus back to whomever sent it
  69.     ::SetFocus( returnFocus);
  70. }
  71.  
  72.  
  73. void ToolComboBox::InformFocus( uint msg, WPARAM wParam, LPARAM lParam)
  74. {
  75.     // forward the Windows message to the window who lost focus to us
  76.     RetWndFocus();
  77.     ::SendMessage( returnFocus, msg, wParam, lParam);
  78. }
  79.  
  80.