home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / winfe / fmselone.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.8 KB  |  86 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. #ifndef __FORM_SELECT_ONE_H
  20. #define __FORM_SELECT_ONE_H
  21.  
  22. //    This file is dedicated to form type select one elements
  23. //        otherwise known as combo boxes on windows and
  24. //        their implementation as requried by the XP layout
  25. //        library.
  26.  
  27. #include "fmabstra.h"
  28.  
  29. class CFormSelectOne : public CFormElement    {
  30. //    Construction/destruction.
  31. //    Do not construct directly, use GetFormElement instead.
  32. protected:
  33.     CFormSelectOne();
  34.     virtual ~CFormSelectOne();
  35.     friend CFormElement;
  36.  
  37. //    The form element we represent.
  38. //    This can be called at various times, so always update
  39. //        our information when this function is called
  40. //        (refresh cached or calculated XP data).
  41. protected:
  42.     virtual void SetElement(LO_FormElementStruct *pFormElement);
  43.  
  44. //    This is called to inform us of the owning context.
  45. //    Once set, we should query it to decide how we will represent our
  46. //        selves (printing through a DC, existing as a window, etc).
  47. protected:
  48.     virtual void SetContext(CAbstractCX *pCX);
  49.  
  50. //    Actions that we've been told to take.
  51. public:
  52.     virtual void DisplayFormElement(LTRB& Rect);
  53. protected:
  54.     //    Destroy the widget (window) implemenation of the form.
  55.     virtual void DestroyWidget();
  56.  
  57.     //    Create the widget (window) implementation of the form
  58.     //        but DO NOT DISPLAY.
  59.     virtual void CreateWidget();
  60.  
  61.     //    Copy the current data out of the layout struct into the form
  62.     //        widget, or mark that you should represent using the current data.
  63.     virtual void UseCurrentData();
  64.  
  65.     //    Copy the default data out of the layout struct into the form
  66.     //        widget, or mark that you should represent using the default data.
  67.     virtual void UseDefaultData();
  68.  
  69.     //    Fill in the layout size information in the layout struct regarding
  70.     //        the dimensions of the widget.
  71.     virtual void FillSizeInfo();
  72.  
  73.     //    Copy the current data out of the form element back into the
  74.     //        layout struct.
  75.     virtual void UpdateCurrentData();
  76.  
  77. public:
  78.     virtual HWND GetRaw();
  79.  
  80. //    Our widget representation.
  81. private:
  82.     CMochaComboBox *m_pWidget;
  83. };
  84.  
  85. #endif // __FORM_SELECT_ONE_H
  86.