IBitmapControl

The IBitmapControl class creates and manages a window to display a bitmap image. You can add text to the window by using the inherited setText functions.


IBitmapControl - Member Functions and Data by Group

Constructors & Destructor

You can construct and destruct objects of the IBitmapControl class. You cannot copy or assign IBitmapControl objects because both the copy constructor and the assignment operator are private functions.


[view class]
~IBitmapControl
public:
virtual ~IBitmapControl()

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
IBitmapControl


Overload 1
public:
IBitmapControl(unsigned long id, IWindow* parentDialog)

Create an IBitmapControl object for the specified bitmap dialog control.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
public:
IBitmapControl( unsigned long id, IWindow* parent, IWindow* owner, ISystemBitmapHandle::Identifier bitmapId, const IRectangle& initial = IRectangle ( ), const Style& style = defaultStyle ( ) )

Create a bitmap control with the specified window ID, parent and owner windows, specified system bitmap, screen position and size, and window style. If you want to use a system bitmap, use this constructor.

Exception

IInvalidParameter The parent window pointer specified was invalid. You must specify a valid IWindow pointer as the parent.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 3
public:
IBitmapControl( unsigned long id, IWindow* parent, IWindow* owner, unsigned long bitmapId, const IRectangle& initial = IRectangle ( ), const Style& style = defaultStyle ( ) )

Create a bitmap control with the specified ID, parent and owner windows, default resource library with its specified bitmap ID, and window style. If you have not already loaded the bitmap and you want load it from the default resource library, use this constructor.

Exception

IInvalidParameter The parent window pointer specified was invalid. You must specify a valid IWindow pointer as the parent.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 4
public:
IBitmapControl(const IWindowHandle& handle)

Create an IBitmapControl object for the specified bitmap control's window handle.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 5
public:
IBitmapControl( unsigned long id, IWindow* parent, IWindow* owner, const IBitmapHandle& bitmapId = IBitmapHandle ( ), const IRectangle& initial = IRectangle ( ), const Style& style = defaultStyle ( ) )

Create a bitmap control with the specified window ID, parent and owner windows, bitmap, screen position and size, and window style. If you already have a bitmap handle, use this constructor.

Exception

IInvalidParameter The parent window pointer specified was invalid. You must specify a valid IWindow pointer as the parent.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 6
public:
IBitmapControl( unsigned long id, IWindow* parent, IWindow* owner, const IResourceId& bitmapId, const IRectangle& initial = IRectangle ( ), const Style& style = defaultStyle ( ) )

Create a bitmap control using the specified window ID, parent and owner windows, resource library with its specified bitmap ID, screen position and size, and window style. If you have not already loaded it from the resource library of your choice, use this constructor.

Exception

IInvalidParameter The parent window pointer specified was invalid. You must specify a valid IWindow pointer as the parent.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Attributes

Use this member to query and set the accessible attributes of objects of this class.


[view class]
enable
public:
virtual IWindow& enable(bool enableWindow = true)

Enables the window to accept keyboard and mouse input.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Bitmaps

The following member functions can be used to obtain the current bitmap handle, as well as change the current bitmap.


[view class]
bitmap
public:
IBitmapHandle bitmap() const

Returns the handle to the bitmap.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setBitmap

Changes the bitmap used by the IBitmapControl object.


Overload 1
public:
virtual IBitmapControl& setBitmap( const IResourceId& bitmapId )

Set the bitmap by specifying an IResourceId. If you want to load the bitmap from a specific resource library, use this function.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
public:
virtual IBitmapControl& setBitmap( ISystemBitmapHandle::Identifier bitmap )

Set the bitmap using a system bitmap.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 3
public:
virtual IBitmapControl& setBitmap( const IBitmapHandle& handle )

Set the bitmap using an existing bitmap handle.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 4
public:
virtual IBitmapControl& setBitmap(unsigned long bitmapId)

Set the bitmap using the default resource library with the specified bitmap ID.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Graphic Size

Use these members to query and modify the way the graphic image is displayed in a bitmap control object.


[view class]
disableSizeImageToWindow
public:
virtual IBitmapControl& disableSizeImageToWindow()

Clears the sizeImageToWindow style flag.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
disableSizeWindowToImage
public:
virtual IBitmapControl& disableSizeWindowToImage()

Clears the sizeWindowToImage style flag.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
enableSizeImageToWindow
public:
virtual IBitmapControl& enableSizeImageToWindow( bool enable = true )

Sets or clears the sizeImageToWindow style flag.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
enableSizeWindowToImage
public:
virtual IBitmapControl& enableSizeWindowToImage( bool enable = true )

Sets or clears the sizeWindowToImage style flag.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
isSizeImageToWindowEnabled
public:
virtual bool isSizeImageToWindowEnabled() const

Returns true if the sizeImageToWindow style flag is currently set.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
isSizeWindowToImageEnabled
public:
virtual bool isSizeWindowToImageEnabled() const

Returns true if the sizeWindowToImage style flag is currently set.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Layout Support

Layout is information used by the canvas classes to provide dialog-like behavior.


[view class]
setLayoutDistorted
public:
virtual IBitmapControl& setLayoutDistorted( unsigned long layoutAttributesOn, unsigned long layoutAttributesOff )

Indicates that changes have occurred in the window causing the layout of the window in a canvas to be updated.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
calcMinimumSize
protected:
virtual ISize calcMinimumSize() const

Returns the minimum size this bitmap control can be, based on the actual size of the currently set bitmap.

Exception

IAccessError The call to determine the size of the bitmap failed. The bitmap may be corrupted.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Styles

Use these style members to provide valid styles for IBitmapControl::setDefaultStyle and for the constructor of the IBitmapControl class.


[view class]
convertToGUIStyle
public:
virtual unsigned long convertToGUIStyle( const IBitFlag& style, bool extendedOnly = false ) const

Converts a style object into a value appropriate for the presentation system. The default action is to return the base GUI styles for the platform. Extended styles, those defined by the application and the Open Class Library, are returned if you set extendedOnly to true.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
defaultStyle
public:
static Style defaultStyle()

Returns the default style. This style is classDefaultStyle unless you have changed it using setDefaultStyle.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setDefaultStyle
public:
static void setDefaultStyle(const Style& style)

Sets the default style for all subsequent bitmap controls.

This member function is not thread safe. In a multithreaded application, it should only be called when a conflict is not possible. A conflict can arise if you set the default style on one thread at the same time that it is being queried on another. In this situation, the query would take place while the style is in an unknown state.

When you create a window class and do not specifically specify window styles in the constructor, the Open Class Library queries the default style. Therefore, the only safe place to call this member function is when no other application threads that create windows are active.

Another way to avoid a conflict in a multithreaded application is to specifically specify window styles on window construction, rather than calling this member function.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
classDefaultStyle
public:
static const Style classDefaultStyle

Returns the original default style for this class, which is IWindow::visible | IBitmapControl::sizeImageToWindow.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
sizeImageToWindow
public:
static const Style sizeImageToWindow

Use this style to control the automatic stretching or shrinking of the graphical image to fit the window. If you set this style, the image is resized to cover the face of the window. If you do not set this style, the image is rendered in the center of the window without resizing. If the image is larger that the window, it is clipped at the boundaries of the window label area.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
sizeWindowToImage
public:
static const Style sizeWindowToImage

Use this style to cause the window to be automatically resized to fit the image when you set a new image. The automatic resizing only occurs when a new image is set, such as during construction of the window or with the setBitmap function. Note that if there is text set in the window, the window is sized to accommodate the larger of the text and the image.

This style does not affect the behavior of the window if you use the sizeTo function after setting the image. You can use the sizeImageToWindow style to control automatic stretching or shrinking of the image. You can also set an IAlignmentAttribute for the window to control automatic resizing of the window by canvas classes such as IMultiCellCanvas.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Window Positioning

Use these members to set the size and position of windows.


[view class]
moveSizeTo
public:
virtual IBitmapControl& moveSizeTo( const IRectangle& rectangle )

Changes the position and size of the window.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes

AIX Considerations

This IWindow function is overridden to handle bitmap sizing and positioning in Motif.


IBitmapControl - Inherited Member Functions and Data

Inherited Public Functions

IControl
INotifier
IStaticText
ITextControl
IWindow

Inherited Public Data

IWindow
INotifier
IStaticText
ITextControl

Inherited Protected Functions

IStaticText
IWindow
INotifier
IControl
ITextControl

Inherited Protected Data