OWLNext 6.32
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
owl::TGridPicker Class Reference
Inheritance diagram for owl::TGridPicker:
owl::TControl owl::TBitFlags< uint > owl::TWindow owl::TEventHandler owl::TStreamableBase owl::TPopupPicker owl::TColorPicker

List of all members.

Public Types

enum  TPickerStyles { psTrackMouse = 0x0001, psShrinkToCells = 0x0002, psFlatSyle = 0x0004, psMessageTips = 0x0008, psLocalTips = 0x0010 }

Public Member Functions

 TGridPicker (TWindow *parent, int id, int x, int y, int w=0, int h=0, TModule *module=0)
 TGridPicker (TWindow *parent, int resourceId, TModule *module=0)
void SetSelection (int sel=0)
int GetSelection ()
TPickerCellGetSelectedCell ()
int GetFocus ()
TPickerCellGetFocusedCell ()
TPickerCellGetDefaultCell ()
TPickerCellGetCustomCell ()
void SetColumns (int colmn=4)
int GetColumns ()
void SetFont (const TFont &font)
TFontGetFont ()
void SetTarget (const TWindow *wnd)
TWindowGetTarget ()
void AddCell (TPickerCell *cells, bool select=false)
TPickerCellRemoveCell (int loc)
void ModifyPopStyle (uint off, uint on)
uint GetPopStyle ()
virtual bool IsFlatStyle ()
void EnableDefault (LPCTSTR text=0, int resId=0, TPickerCell *cl=0)
void EnableDefault (const tstring &text, int resId=0, TPickerCell *cl=0)
void EnableButton (LPCTSTR text=0, int resId=0, TPickerCell *cl=0)
void EnableButton (const tstring &text, int resId=0, TPickerCell *cl=0)
TTooltipGetTooltip () const
void EnableTooltip (bool enable=true)
void SetTooltip (TTooltip *tooltip)
void SetMargins (TMargins &margins)
virtual void Layout ()

Protected Types

enum  TCellState {
  ppTrackMouse = 0x0001, ppShrCells = 0x0002, ppFlatStyle = 0x0004, ppMessageTips = 0x0008, ppShowTipsCell = 0x0010, ppFocus = 0x0040, ppPushed = 0x0080, ppShowDefItem = 0x0100, ppShowCustItem = 0x0200, ppButtonSel = 0x0400,
  ppCustomOpen = 0x0800, ppSelected = 0x1000
}

Protected Member Functions

virtual
owl::TWindow::TGetClassNameReturnType 
GetClassName ()
virtual void GetWindowClass (WNDCLASS &wndClass)
virtual void Paint (TDC &dc, bool erase, TRect &rect)
virtual void SetupWindow ()
virtual bool PreProcessMsg (MSG &msg)
uint EvGetDlgCode (MSG *msg)
void EvActivateApp (bool active, HTASK hTask)
void EvSetFocus (THandle hWndLostFocus)
void EvKillFocus (THandle hWndGetFocus)
void EvLButtonDown (uint modKeys, TPoint &point)
void EvLButtonDblClk (uint modKeys, TPoint &point)
void EvLButtonUp (uint modKeys, TPoint &point)
void EvMouseMove (uint modKeys, TPoint &point)
void EvKeyDown (uint key, uint repeatCount, uint flags)
void EvKeyUp (uint key, uint repeatCount, uint flags)
void EvCancelMode ()
virtual void SetBounds (TPickerCell &cell, const TRect &rect)
virtual tstring LoadTipText (int resId)
virtual void SetStatusBarMessage (int id)
virtual void PaintDivider (TDC &dc, const TRect &rect)
virtual bool CallCustomBox ()
virtual void NotifyParent (uint code)
virtual void ExitPicker (bool status=false)
void InitPicker ()
void ClearCapture ()
int Contains (const TPoint &point)
void GetCellRect (TRect &rect)
void ClearCell ()
void RefocusCell (int loc)
void ApplyChanges ()
int Add (TPickerCell *cell)
TPickerCellRemove (int loc)
TPickerCellGetCell (int loc)
uint Size ()
 DECLARE_RESPONSE_TABLE (TGridPicker)

Protected Attributes

TPickerCellArrayCells
int Selected
int Focused
int NRows
int NColumns
int TextHeight
TMargins Margins
TFontFont
TWindowTarget
TTooltipTooltip

Member Function Documentation

bool owl::TGridPicker::CallCustomBox ( ) [protected, virtual]

call user defined custom box if pressed custom button

Reimplemented in owl::TColorPicker.

void owl::TGridPicker::EvActivateApp ( bool  active,
HTASK  hTask 
) [inline, protected]

The default message handler for WM_ACTIVATEAPP.

Reimplemented from owl::TWindow.

Reimplemented in owl::TPopupPicker.

References owl::TWindow::EvActivateApp().

void owl::TGridPicker::EvCancelMode ( ) [protected]

The default message handler for WM_CANCELMODE.

Reimplemented from owl::TWindow.

uint owl::TGridPicker::EvGetDlgCode ( MSG *  msg) [inline, protected]

The default message handler for WM_GETDLGCODE.

WM_GETDLGCODE handler - Informs dialog manager that arrow keys are to be used.

Reimplemented from owl::TWindow.

References owl::TWindow::EvGetDlgCode().

void owl::TGridPicker::EvKeyDown ( uint  key,
uint  repeatCount,
uint  flags 
) [protected]

The default message handler for WM_KEYDOWN.

Reimplemented from owl::TWindow.

References ExitPicker(), owl::TBitFlags< uint >::IsSet(), and owl::TBitFlags< uint >::Set().

void owl::TGridPicker::EvKeyUp ( uint  key,
uint  repeatCount,
uint  flags 
) [protected]
void owl::TGridPicker::EvKillFocus ( THandle  getFocus) [protected]

Handle WM_KILLFOCUS so that we can have a parent window hold onto our Handle and possibly restore focus later.

Reimplemented from owl::TWindow.

Reimplemented in owl::TPopupPicker.

References owl::TBitFlags< uint >::Clear(), and owl::TBitFlags< uint >::IsSet().

void owl::TGridPicker::EvLButtonDblClk ( uint  modKeys,
TPoint point 
) [protected]

The default message handler for WM_LBUTTONDBLCLK.

Reimplemented from owl::TWindow.

References EvLButtonDown().

void owl::TGridPicker::EvLButtonDown ( uint  modKeys,
TPoint point 
) [protected]

Response method for an incoming WM_LBUTTONDOWN message

If the TWindow's Scroller has been constructed and if auto-scrolling has been requested, captures mouse input, loops until a WM_LBUTTONUP message comes in calling the Scroller's AutoScroll method, and then releases capture on mouse input. Will also break if a WM_MOUSEMOVE comes in without the left button down indicating a lost WM_LBUTTONUP

Reimplemented from owl::TWindow.

Reimplemented in owl::TPopupPicker.

References owl::TBitFlags< uint >::IsSet(), owl::TBitFlags< uint >::Set(), owl::TWindow::SetCapture(), and owl::TWindow::SetFocus().

void owl::TGridPicker::EvLButtonUp ( uint  modKeys,
TPoint point 
) [protected]
void owl::TGridPicker::EvMouseMove ( uint  modKeys,
TPoint point 
) [protected]

The default message handler for WM_MOUSEMOVE.

Reimplemented from owl::TWindow.

References owl::TRect::Contains(), owl::TWindow::GetCapture(), owl::TWindow::GetClientRect(), and owl::TBitFlags< uint >::IsSet().

void owl::TGridPicker::EvSetFocus ( THandle  hWndLostFocus) [protected]

The default message handler for WM_SETFOCUS.

Reimplemented from owl::TWindow.

References owl::TWindow::Invalidate(), and owl::TBitFlags< uint >::Set().

void owl::TGridPicker::ExitPicker ( bool  status = false) [protected, virtual]

do noting here

Reimplemented in owl::TPopupPicker.

int owl::TGridPicker::GetFocus ( ) [inline]

Gets a handle to the window that has the focus. Use the function SetFocus to set the keyboard focus to this window.

Note:
Wrapper for Windows API.

Reimplemented from owl::TWindow.

void owl::TGridPicker::GetWindowClass ( WNDCLASS &  wndClass) [protected, virtual]

Redefined by derived classes, GetWindowClass fills the supplied MS-Windows registration class structure with registration attributes, thus, allowing instances of TWindow to be registered. This function, along with GetClassName, allows Windows classes to be used for the specified ObjectWindows class and its derivatives. It sets the fields of the passed WNDCLASS parameter to the default attributes appropriate for a TWindow. The fields and their default attributes for the class are the following:

  • cbClsExtra 0 (the number of extra bytes to reserve after the Window class structure). This value is not used by ObjectWindows.
  • cbWndExtra 0 (the number of extra bytes to reserve after the Window instance). This value is not used by ObjectWindows.
  • hInstance The instance of the class in which the window procedure exists
  • hIcon 0 (Provides a handle to the class resource.) By default, the application must create an icon if the application's window is minimized.
  • hCursor IDC_ARROW (provides a handle to a cursor resource)
  • hbrBackground COLOR_WINDOW + 1 (the system background color)
  • lpszMenuName 0 (Points to a string that contains the name of the class's menu.) By default, the windows in this class have no assigned menus.
  • lpszClassName Points to a string that contains the name of the window class.
  • lpfnWndProc The address of the window procedure. This value is not used by ObjectWindows.
  • style Style field.

The style field can contain one or more of the following values:

  • CS_BYTEALIGNCLIENT Aligns the window's client on a byte boundary in the x direction. This alignment, designed to improve performance, determines the width and horizontal position of the window.
  • CS_BYTEALIGNWINDOW Aligns a window on a byte boundary in the x direction. This alignment, designed to improve performance, determines the width and horizontal position of the window.
  • CS_CLASSDC Allocates a single device context (DC) that's going to be shared by all of the window in the class. This style controls how multi-threaded applications that have windows belonging to the same class share the same DC.
  • CS_DBLCLKS Sends a double-click mouse message to the window procedure when the mouse is double-clicked on a window belonging to this class.
  • CS_GLOBALCLASS Allows an application to create a window class regardless of the instance parameter. You can also create a global class by writing a DLL that contains the window class.
  • CS_HREDRAW If the size of the window changes as a result of some movement or resizing, redraws the entire window.
  • CS_NOCLOSE Disables the Close option on this window's system menu.
  • CS_OWNDC Enables each window in the class to have a different DC.
  • CS_PARENTDC Passes the parent window's DC to the child windows.
  • CS_SAVEBITS Saves the section of the screen as a bitmap if the screen is covered by another window. This bitmap is later used to recreate the window when it is no longer obscured by another window.
  • CS_VREDRAW If the height of the client area is changed, redraws the entire window.

After the Windows class structure has been filled with default values by the base class, you can override this function to change the values of the Windows class structure. For example, you might want to change the window's colors or the cursor displayed.

Register unique classes for windows that want system background colors so that full-drag erasing uses the right color (NT fails to let window erase itself)

Reimplemented from owl::TWindow.

Reimplemented in owl::TPopupPicker.

tstring owl::TGridPicker::LoadTipText ( int  resId) [protected, virtual]
void owl::TGridPicker::NotifyParent ( uint  code) [protected, virtual]

notify parent on event -> BN_CLICKED and BN_HILITE

Reimplemented in owl::TColorPicker.

References owl::TWindow::GetDlgCtrlID(), owl::TWindow::GetParent(), and owl::TWindow::SendNotification().

void owl::TGridPicker::Paint ( TDC dc,
bool  erase,
TRect rect 
) [protected, virtual]

Repaints the client area (the area you can use for drawing) of a window. Called by base classes when responding to a WM_PAINT message, Paint serves as a placeholder for derived types that define Paint member functions. Paint is called by EvPaint and requested automatically by Windows to redisplay the window's contents. dc is the paint display context supplied to text and graphics output functions. The supplied reference to the rect structure is the bounding rectangle of the area that requires painting. erase indicates whether the background needs erasing.

Reimplemented from owl::TWindow.

Reimplemented in owl::TPopupPicker, and owl::TColorPicker.

References owl::TDC::GetViewportOrg(), owl::TBitFlags< uint >::IsSet(), PaintDivider(), and owl::TDC::SetViewportOrg().

void owl::TGridPicker::PaintDivider ( TDC dc,
const TRect rect 
) [protected, virtual]
bool owl::TGridPicker::PreProcessMsg ( MSG &  msg) [protected, virtual]

Called from TApplication::ProcessAppMsg() to give the window an opportunity to perform preprocessing of the Windows message

If you return true, further processing of the message is halted

Allows preprocessing of queued messages prior to dispatching. If you override this method in a derived class, be sure to call the base class's PreProcessMsg because it handles the translation of accelerator keys.

Reimplemented from owl::TWindow.

References owl::TWindow::IsChild(), owl::TWindow::IsWindow(), and owl::TTooltip::RelayEvent().

void owl::TGridPicker::SetBounds ( TPickerCell cell,
const TRect rect 
) [inline, protected, virtual]

set bounds for cell

void owl::TGridPicker::SetStatusBarMessage ( int  id) [protected, virtual]

send WM_MENUSELECT and WM_ENTERIDLE to frame window

References owl::TWindow::GetParentO().

void owl::TGridPicker::SetupWindow ( ) [protected, virtual]

Performs setup following creation of an associated MS-Windows window.

The first virtual function called when the HWindow becomes valid. TWindow's implementation performs window setup by iterating through the child list, attempting to create an associated interface element for each child window object for which autocreation is enabled. (By default, autocreation is enabled for windows and controls, and disabled for dialog boxes.) If a child window cannot be created, SetupWindow calls TXWindow with an IDS_CHILDCREATEFAIL message.

If the receiver has a TScroller object, calls the scroller's SetBarRange() method.

SetupWindow can be redefined in derived classes to perform additional special initialization. Note that the HWindow is valid when the overridden SetupWindow is called, and that the children's HWindows are valid after calling the base classes' SetupWindow function.

The following example from the sample program, APPWIN.CPP, illustrates the use of an overridden SetupWindow to setup a window, initialize .INI entries, and tell Windows that we want to accept drag and drop transactions:

 void TAppWindow::SetupWindow()
 { 
   TFloatingFrame::SetupWindow();
   InitEntries();   // Initialize .INI entries.
   RestoreFromINIFile(); // from APPLAUNC.INI in the startup directory
   UpdateAppButtons();
   DragAcceptFiles(true);
 }

Reimplemented from owl::TWindow.

Reimplemented in owl::TColorPicker.

References owl::TTooltip::AddTool(), owl::TWindow::Create(), owl::TWindow::GetHandle(), owl::TWindow::GetId(), LoadTipText(), and owl::TWindow::ModifyStyle().


The documentation for this class was generated from the following files: