LImageViewerCell::ShowTitlebar

#include "ltwrappr.h"

L_INT LImageViewerCell::ShowTitlebar(uShow, uFlags)

L_UINT uShow;

/* flag */

L_UINT uFlags;

/* reserved for future use */

Shows or hides the title bar.

Parameter

Description

uShow

Flag that indicates whether to show the title bar. Possible values are:

 

Value

Meaning

 

TRUE

Show the title bar.

 

FALSE

Do not show the title bar.

uFlags

Reserved for future use. Pass 0.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTIVW

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LImageViewer::Create, LImageViewer::Destroy, LImageViewerCell::IsTitlebarIconChecked, LImageViewerCell::GetIconProperties, LImageViewerCell::GetTitlebarProperties, LImageViewerCell::IsTitlebarEnabled, LImageViewerCell::SetIconProperties, LImageViewerCell::SetTitlebarProperties, LImageViewerCell::CheckTitlebarIcon

Topics:

Image Viewer Functions: The Title Bar Feature.

 

The Title Bar Feature

Example

This function maniplulates the title bar feature. In this sample we assume that the user has opened one cell that contains one frame.

#if defined LTV17_CONFIG
L_INT LImageViewer_ShowTitlebar(LImageViewerCell& ImageViewerCell) 
{
   L_INT nI; 
   DISPCONTAINERTITLEBARPROPS DispContainerTitlebarProps; 
   DISPCONTAINERTITLEBARICONPROPS DispContainerIconProps; 
   L_INT nRet; 
   // Check if the title bar is already shown or not. 
   if (!ImageViewerCell.IsTitlebarEnabled(0)) 
      // Show the title bar. 
      ImageViewerCell.ShowTitlebar(TRUE, 0); 
   DispContainerTitlebarProps.uMask = DCTITLEBAR_ALL; 
   DispContainerTitlebarProps.uStructSize = sizeof(DISPCONTAINERTITLEBARPROPS); 
   // Retrieve the title bar properties.
   ImageViewerCell.GetTitlebarProperties (&DispContainerTitlebarProps, 0); 
   if (DispContainerTitlebarProps.bCustomTitlebarColor) 
   {
      // Brighter color for the title bar.
      DispContainerTitlebarProps.crColor = RGB(min(255, GetRValue(DispContainerTitlebarProps.crColor) + 10), 
                                               min(255, GetGValue(DispContainerTitlebarProps.crColor) + 10), 
                                               min(255, GetBValue(DispContainerTitlebarProps.crColor) + 10)); 
      // Change the title bar properties.
      ImageViewerCell.SetTitlebarProperties (&DispContainerTitlebarProps, 0); 
   }
   // Invert the button icon status for all the cells. 
   for (nI = 0; nI < 8; nI++)
   {
      DispContainerIconProps.uMask = DCTITLEBAR_ICONPROPS_ALL; 
      DispContainerIconProps.uStructSize = sizeof(DISPCONTAINERTITLEBARICONPROPS); 
      nRet = ImageViewerCell.GetIconProperties (nI, &DispContainerIconProps, 0); 
      if (!DispContainerIconProps.bReadOnly) 
      {
         ImageViewerCell.CheckTitlebarIcon(0, nI, !ImageViewerCell.IsTitlebarIconChecked(0, nI, 0), 0); 
      }
      nRet = ImageViewerCell.SetIconProperties (nI, &DispContainerIconProps, 0); 
   }
   return SUCCESS; 
}
#else
L_INT LImageViewer_ShowTitlebar(LImageViewer& ImageViewer) 
{
   L_INT nI; 
   DISPCONTAINERTITLEBARPROPS DispContainerTitlebarProps; 
   DISPCONTAINERTITLEBARICONPROPS DispContainerIconProps; 
   L_INT nRet; 
   // Check if the title bar is already shown or not. 
   if (!ImageViewer.IsTitlebarEnabled(0)) 
      // Show the title bar. 
      ImageViewer.ShowTitlebar(TRUE, 0); 
   DispContainerTitlebarProps.uMask = DCTITLEBAR_ALL; 
   DispContainerTitlebarProps.uStructSize = sizeof(DISPCONTAINERTITLEBARPROPS); 
   // Retrieve the title bar properties.
   ImageViewer.GetTitlebarProperties (&DispContainerTitlebarProps, 0); 
   if (DispContainerTitlebarProps.bCustomTitlebarColor) 
   {
      // Brighter color for the title bar.
      DispContainerTitlebarProps.crColor = RGB(min(255, GetRValue(DispContainerTitlebarProps.crColor) + 10), 
                                               min(255, GetGValue(DispContainerTitlebarProps.crColor) + 10), 
                                               min(255, GetBValue(DispContainerTitlebarProps.crColor) + 10)); 
      // Change the title bar properties.
      ImageViewer.SetTitlebarProperties (&DispContainerTitlebarProps, 0); 
   }
   // Invert the button icon status for all the cells. 
   for (nI = 0; nI < 8; nI++)
   {
      DispContainerIconProps.uMask = DCTITLEBAR_ICONPROPS_ALL; 
      DispContainerIconProps.uStructSize = sizeof(DISPCONTAINERTITLEBARICONPROPS); 
      nRet = ImageViewer.GetIconProperties (nI, &DispContainerIconProps, 0); 
      if (!DispContainerIconProps.bReadOnly) 
      {
         ImageViewer.CheckTitlebarIcon(0, 0, nI, !ImageViewer.IsTitlebarIconChecked(0, 0, nI, 0), 0); 
      }
      nRet = ImageViewer.SetIconProperties (nI, &DispContainerIconProps, 0); 
   }
   return SUCCESS; 
}
#endif // LTV17_CONFIG