Photon microGUI widgets library 0.6.0
PhWidgets::ImageArea Struct Reference

Represents an image area widget for displaying an image. More...

#include <ImageArea.h>

Inheritance diagram for PhWidgets::ImageArea:
PhWidgets::Container PhWidgets::Basic PhWidgets::Widget

Classes

struct  ArgColor
 Contains resource IDs for arguments of type PgColor_t. More...
 
struct  ArgLong
 Contains resource IDs for arguments of type long. More...
 
struct  ArgPImage
 Contains resource IDs for arguments of type PhImage_t. More...
 
struct  ArgRect
 Contains resource IDs for arguments of type PhRect_t. More...
 
struct  ArgShort
 Contains resource IDs for arguments of type short. More...
 
struct  Arguments
 Contains resource IDs for all ImageArea arguments. More...
 
struct  Callback
 Contains resource IDs for callbacks of type PtCallback_t. More...
 
struct  Callbacks
 Contains resource IDs for all ImageArea callbacks. More...
 
struct  Flags
 Contains flags for all ImageArea resources. More...
 
struct  ThisArgs
 Contains resource IDs for ImageArea arguments. More...
 
struct  ThisCallbacks
 Contains resource IDs for ImageArea callbacks. More...
 
struct  ThisFlags
 Contains flags for ImageArea resources. More...
 

Public Member Functions

 ImageArea (int abn)
 (constructor) More...
 
 ImageArea (PtWidget_t *wdg)
 (constructor) More...
 
 ImageArea (const ImageArea &other)
 (copy constructor) More...
 
ImageAreaoperator= (const ImageArea &other)
 Assigns value in ImageArea. More...
 
- Public Member Functions inherited from PhWidgets::Container
 Container (int abn)
 (constructor) More...
 
 Container (PtWidget_t *wdg)
 (constructor) More...
 
 Container (const Container &other)
 (copy constructor) More...
 
Containeroperator= (const Container &other)
 Assigns value in Container widget. More...
 
- Public Member Functions inherited from PhWidgets::Basic
 Basic (int abn)
 (constructor) More...
 
 Basic (PtWidget_t *wdg)
 (constructor) More...
 
 Basic (const Basic &other)
 (copy constructor) More...
 
Basicoperator= (const Basic &other)
 Assigns value in Basic widget. More...
 
void OnActivated (PtCallbackInfo_t *info)
 Raises the Basic::Activate event.
 
void OnArmed (PtCallbackInfo_t *info)
 Raises the Basic::Arm event.
 
void OnDisarmed (PtCallbackInfo_t *info)
 Raises the Basic::Disarm event.
 
void OnGotFocused (PtCallbackInfo_t *info)
 Raises the Basic::GotFocus event.
 
void OnLostFocus (PtCallbackInfo_t *info)
 Raises the Basic::LostFocus event.
 
void OnMenu (PtCallbackInfo_t *info)
 Raises the Basic::Menu event.
 
void OnRepeat (PtCallbackInfo_t *info)
 Raises the Basic::Repeat event.
 
- Public Member Functions inherited from PhWidgets::Widget
 Widget (int abn)
 (constructor) More...
 
 Widget (PtWidget_t *wdg)
 (constructor) More...
 
 Widget (const Widget &other)
 (copy constructor) More...
 
void swap (Widget &other)
 Exchanges the contents of *this and other. More...
 
Widgetoperator= (const Widget &other)
 Assigns value in Widget. More...
 
Widgetoperator= (PtWidget_t *wdg)
 Assigns value in Widget. More...
 
bool operator== (const Widget &other) const
 Compares Widgets. More...
 
bool operator!= (const Widget &other) const
 Compares Widgets. More...
 
bool operator< (const Widget &other) const
 Compares Widgets. More...
 
bool operator<= (const Widget &other) const
 Compares Widgets. More...
 
bool operator> (const Widget &other) const
 Compares Widgets. More...
 
bool operator>= (const Widget &other) const
 Compares Widgets. More...
 
PtWidget_tget () const
 Returns the stored pointer.
 
 operator PtWidget_t * ()
 Converts Widget to Photon widget pointer.
 
 operator const PtWidget_t * () const
 Converts Widget to constant Photon widget pointer.
 
void BringToFront ()
 Brings the widget to the front of the z-order. More...
 
bool Contains (const Widget &widget)
 Retrieves a value indicating whether the specified widget is a child of the widget. More...
 
bool Focus ()
 Sets input focus to the widget. More...
 
Widget GetNextWidget (const Widget &widget, bool forward=true) const
 Retrieves the next widget forward or back in the tab order of child widgets. More...
 
void Hide ()
 Conceals the widget from the user. More...
 
void Invalidate (PhRect_t rc, bool invalidateChildren=false)
 Invalidates a specific region of the widget and causes a paint message to be sent to the widget. More...
 
void Invalidate (bool invalidateChildren=false)
 Invalidates a specific region of the widget and causes a paint message to be sent to the widget. More...
 
bool Realize ()
 Make the widget and its children visible and possibly interactive. More...
 
void Refresh ()
 Forces the widget to invalidate its client area and immediately redraw itself and any child widgets. More...
 
void SendToBack ()
 Sends the widget to the back of the z-order. More...
 
void SetBounds (short x, short y, unsigned short width, unsigned short height)
 Sets the bounds of the widget to the specified location and size. More...
 
void SetBounds (short x, short y)
 Sets the bounds of the widget to the specified location. More...
 
void Select ()
 Activates the widget. More...
 
void Show ()
 Displays the widget to the user. More...
 
bool Unrealize ()
 Unrealizes the widget and all its children. More...
 
void OnDestroyed (PtCallbackInfo_t *info)
 Raises the Widget::Destroyed event.
 
void OnBlocked (PtCallbackInfo_t *info)
 Raises the Widget::Blocked event.
 
void OnDragDrop (PtCallbackInfo_t *info)
 Raises the Widget::DragDrop event.
 
void OnOutbound (PtCallbackInfo_t *info)
 Raises the Widget::Outbound event.
 
void OnRealized (PtCallbackInfo_t *info)
 Raises the Widget::Realized event.
 
void OnUnrealized (PtCallbackInfo_t *info)
 Raises the Widget::Unrealized event.
 

Public Attributes

WidgetResourcesSingleton resource
 Resources of the ImageArea. More...
 
Properties

Properties are used to simplify use of widget resources.

property< bool >::bind< ImageArea, &ImageArea::getAutoScale, &ImageArea::setAutoScale > AutoScale
 Determines whether or not to use automatically scale the image to fit the size of the widget. More...
 
phproperty< Drawing::Color >::bind< ImageArea, ArgColor::eArgColor, Arguments::grid_colorGridColor
 Gets or sets the color of the grid, if displayed. More...
 
phproperty< long >::bind< ImageArea, ArgLong::eArgLong, Arguments::grid_thresholdGridThreshold
 Gets or sets the grid threshold. More...
 
property< Drawing::Image >::bind< ImageArea, &ImageArea::getImage, &ImageArea::setImage > Image
 Gets or sets the image that is displayed by ImageArea. More...
 
phproperty< long >::bind< ImageArea, ArgLong::eArgLong, Arguments::zoomZoomingFactor
 Gets or sets the zooming factor. More...
 
Events
phwidgets_event< ImageArea, ImageArea::Callbacks::dragDrag
 
phwidgets_event< ImageArea, ImageArea::Callbacks::movementMovement
 
phwidgets_event< ImageArea, ImageArea::Callbacks::scrolledScrolled
 
phwidgets_event< ImageArea, ImageArea::Callbacks::selectionSelection
 
- Public Attributes inherited from PhWidgets::Container
WidgetResourcesSingleton resource
 Resources of the Container. More...
 
property< Widget >::bind< Container, &Container::getActiveWidget, &Container::setActiveWidget > ActiveWidget
 Gets or sets the active widget on the Container widget. More...
 
phwidgets_event< Container, Container::Callbacks::child_added_removed > ChildAddedRemoved
 
phwidgets_event< Container, Container::Callbacks::child_getting_focus > ChildGettingFocus
 
phwidgets_event< Container, Container::Callbacks::child_losing_focus > ChildLosingFocus
 
phwidgets_event< Container, Container::Callbacks::layout > LayoutChanged
 
phwidgets_event< Container, Container::Callbacks::resize > Resize
 
- Public Attributes inherited from PhWidgets::Basic
WidgetResourcesSingleton resource
 Resources of the Basic. More...
 
phproperty< Drawing::Color >::bind< Basic, Arguments< PgColor_t >::ColorResource, Arguments<>::BevelColor > BevelColor
 Gets or sets the main color of the bevel. More...
 
phproperty< Drawing::Color >::bind< Basic, Arguments< PgColor_t >::ColorResource, Arguments<>::DrawingColor > Color
 Gets or sets the foreground or drawing color for the widget. More...
 
phproperty< Drawing::Color >::bind< Basic, Arguments< PgColor_t >::ColorResource, Arguments<>::DarkBevelColor > DarkBevelColor
 Gets or sets the dark outermost color used when applying a bevel to a widget. More...
 
phproperty< Drawing::Color >::bind< Basic, Arguments< PgColor_t >::ColorResource, Arguments<>::DarkFillColor > DarkFillColor
 Gets or sets the dark color with which a gradient (if applied) goes. More...
 
phproperty< Drawing::Color >::bind< Basic, Arguments< PgColor_t >::ColorResource, Arguments<>::FillColor > FillColor
 Gets or sets the fill color for the widget. More...
 
phproperty< Drawing::Color >::bind< Basic, Arguments< PgColor_t >::ColorResource, Arguments<>::InlineColor > InlineColor
 Gets or sets the color of the inline of the border. More...
 
phproperty< Drawing::Color >::bind< Basic, Arguments< PgColor_t >::ColorResource, Arguments<>::LightBevelColor > LightBevelColor
 Gets or sets the light outermost color used when applying a bevel to a widget. More...
 
phproperty< Drawing::Color >::bind< Basic, Arguments< PgColor_t >::ColorResource, Arguments<>::LightFillColor > LightFillColor
 Gets or sets the light color with which a gradient (if applied) goes. More...
 
phproperty< unsigned short >::bind< Basic, Arguments< unsigned short >::Scalar, Arguments<>::MarginHeight > MarginHeight
 Gets or sets the amount of vertical space between the widget's canvas and the widget's border. More...
 
phproperty< unsigned short >::bind< Basic, Arguments< unsigned short >::Scalar, Arguments<>::MarginWidth > MarginWidth
 Gets or sets the amount of horizontal space between the widget's canvas and the widget's border. More...
 
phproperty< Drawing::Color >::bind< Basic, Arguments< PgColor_t >::ColorResource, Arguments<>::OutlineColor > OutlineColor
 Gets or sets the color of the outline of the border. More...
 
phbitmask< unsigned long, Flags::Basic::type >::bind< Basic, Arguments< unsigned long >::Scalar, Arguments<>::BasicFlags > BasicFlags
 Gets or sets basic flags inherited by all widgets. See Flags::Basic::type.
 
phwidgets_event< Basic, Basic::Callbacks<>::Activate > Activate
 Occurs when you release the left pointer button while pointing at an armed widget.
 
phwidgets_event< Basic, Basic::Callbacks<>::Arm > Arm
 Occurs when you press the left pointer button while pointing at the widget.
 
phwidgets_event< Basic, Basic::Callbacks<>::Disarm > Disarm
 Occurs when you release the left pointer button when not pointing at an armed widget.
 
phwidgets_event< Basic, Basic::Callbacks<>::GotFocus > GotFocus
 Occurs when a widget gets focus or its focus status changes.
 
phwidgets_event< Basic, Basic::Callbacks<>::LostFocus > LostFocus
 Occurs when a widget loses focus.
 
phwidgets_event< Basic, Basic::Callbacks<>::Menu > Menu
 Occurs when you press the right button while the pointer is on top of the widget.
 
phwidgets_event< Basic, Basic::Callbacks<>::Repeat > Repeat
 Documentation in progress...
 
- Public Attributes inherited from PhWidgets::Widget
WidgetResourcesSingleton resource
 Resources of the Widget. More...
 
property< bool >::bind< Widget, &Widget::getAllowDrop, &Widget::setAllowDrop > AllowDrop
 Gets or sets a value indicating whether the widget can accept data that the user drags onto it. More...
 
phbitmask< unsigned, Flags::Anchor::type, Flags::Anchor::All >::bind< Widget, Arguments< unsigned >::Flag, Arguments< unsigned >::AnchorFlags > Anchor
 Gets or sets flags specifying how the widget is anchored to its parent. More...
 
phproperty< unsigned short >::bind< Widget, Arguments< unsigned short >::Scalar, Arguments< unsigned short >::BevelWidth > BevelWidth
 Gets or sets the bevel width of the widget. More...
 
property< short, property<>::ro >::bind< Widget, &Widget::getBottom > Bottom
 Gets the distance, in pixels, between the bottom edge of the widget and the top edge of its container's client area. More...
 
property< PhArea_t >::bind< Widget, &Widget::getBounds, &Widget::setBounds > Bounds
 Gets or sets the size and location of the widget including its nonclient elements, in pixels, relative to the parent widget. More...
 
property< bool, property<>::ro >::bind< Widget, &Widget::getCanFocus > CanFocus
 Gets a value indicating whether the widget can receive focus. More...
 
property< bool, property<>::ro >::bind< Widget, &Widget::getCanSelect > CanSelect
 Gets a value indicating whether the widget can be selected. More...
 
property< bool, property<>::ro >::bind< Widget, &Widget::getContainsFocus > ContainsFocus
 Gets a value indicating whether the widget, or one of its child widgets, currently has the input focus. More...
 
property< PhWidgets::Cursor >::bind< Widget, &Widget::getCursor, &Widget::setCursor > Cursor
 Gets or sets the cursor that is displayed when the mouse pointer is over the widget. More...
 
phproperty< Drawing::Color >::bind< Widget, Arguments< PgColor_t >::Color, Arguments< PgColor_t >::CursorColor > CursorColor
 Gets or sets the color of the cursor pointer when it's inside the widget. More...
 
property< bool >::bind< Widget, &Widget::getEnabled, &Widget::setEnabled > Enabled
 Gets or sets a value indicating whether the widget can respond to user interaction. More...
 
property< bool, property<>::ro >::bind< Widget, &Widget::getFocused > Focused
 Gets a value indicating whether the widget has input focus. More...
 
property< bool, property<>::ro >::bind< Widget, &Widget::hasChildren > HasChildren
 Gets a value indicating whether the widget contains one or more child widgets. More...
 
property< bool, property<>::ro >::bind< Widget, &Widget::hasParent > HasParent
 Gets a value indicating whether the widget has parent. More...
 
phproperty< unsigned short >::bind< Widget, Arguments< unsigned short >::Scalar, Arguments< unsigned short >::Height > Height
 Gets or sets the height of the widget. More...
 
property< std::string >::bind< Widget, &Widget::getHelpTopic, &Widget::setHelpTopic > HelpTopic
 Gets or sets the help topic of the widget. More...
 
property< bool, property<>::ro >::bind< Widget, &Widget::getIsRealized > IsRealized
 Gets or sets a value indicating whether the widget is realized. More...
 
property< short >::bind< Widget, &Widget::getLeft, &Widget::setLeft > Left
 Gets or sets the distance, in pixels, between the left edge of the widget and the left edge of its container's client area. More...
 
property< PhPoint_t >::bind< Widget, &Widget::getLocation, &Widget::setLocation > Location
 Gets or sets the coordinates of the upper-left corner of the widget relative to the upper-left corner of its container. More...
 
property< PtWidget_t * >::bind< Widget, &Widget::getParent, &Widget::setParent > Parent
 Gets or sets the parent container of the widget. More...
 
phproperty< PhPoint_t >::bind< Widget, Arguments< PhPoint_t >::Struct, Arguments< PhPoint_t >::Position > Position
 Gets or sets the absolute coordinates of the upper-left corner of the widget. More...
 
property< short, property<>::ro >::bind< Widget, &Widget::getRight > Right
 Gets the distance, in pixels, between the right edge of the widget and the left edge of its container's client area. More...
 
phproperty< PhDim_t >::bind< Widget, Arguments< PhDim_t >::Struct, Arguments< PhDim_t >::Dimension > Size
 Gets or sets the size of the widget. More...
 
tag_property< Widget, &Widget::getTag, &Widget::setTag > Tag
 Gets or sets the resource that contains data about the widget. More...
 
property< short >::bind< Widget, &Widget::getTop, &Widget::setTop > Top
 Gets or sets the distance, in pixels, between the top edge of the widget and the top edge of its container's client area. More...
 
property< bool >::bind< Widget, &Widget::getVisible, &Widget::setVisible > Visible
 Gets or sets a value indicating whether the widget and all its child widgets are displayed. More...
 
property< std::set< PhWidgets::Widget >, property<>::ro >::bind< Widget, &Widget::getWidgets > Widgets
 Gets the list of widgets contained within the widget. More...
 
phproperty< unsigned short >::bind< Widget, Arguments< unsigned short >::Scalar, Arguments< unsigned short >::Width > Width
 Gets or sets the width of the widget. More...
 
phbitmask< unsigned long, Flags::Extended::type >::bind< Widget, Arguments< unsigned long >::Flag, Arguments< unsigned long >::ExtendedFlags > ExtendedFlags
 Gets or sets extended flags inherited by all widgets. See Flags::Extended::type.
 
phbitmask< long, Flags::type >::bind< Widget, Arguments< long >::Flag, Arguments< long >::Flags > WidgetFlags
 Gets or sets flags inherited by all widgets. More...
 
phbitmask< long, Flags::Resize::type >::bind< Widget, Arguments< long >::Flag, Arguments< long >::Resiztype > Resiztype
 Gets or sets flags to control a widget's resize policy. See Flags::Resize::type.

 
phwidgets_event< Widget, Widget::Callbacks<>::Destroyed > Destroyed
 Occurs when the widget is destroyed.
 
phwidgets_event< Widget, Widget::Callbacks<>::Blocked > Blocked
 Occurs when the widget is blocked.
 
phwidgets_event< Widget, Widget::Callbacks<>::DragAndDrop > DragDrop
 Occurs when a drag-and-drop operation is completed.
 
phwidgets_event< Widget, Widget::Callbacks<>::IsDestroyed > IsDestroyed
 Occurs when the widget's resources are being released.
 
phwidgets_event< Widget, Widget::Callbacks<>::Outbound > Outbound
 Occurs when you press the pointer button on the widget and then move out of the "hot spot" with the button still depressed.
 
phwidgets_event< Widget, Widget::Callbacks<>::Realized > Realized
 Occurs when the widget is realized.
 
phwidgets_event< Widget, Widget::Callbacks<>::Unrealized > Unrealized
 Occurs when the widget is unrealized.
 

Additional Inherited Members

- Public Types inherited from PhWidgets::Widget
typedef phevent::ph_callback_t callback_t
 An event handler that is raised when an event occur.
 
- Static Public Member Functions inherited from PhWidgets::Widget
static void Update ()
 Causes the Photon microGUI to redraw the all invalidated regions. More...
 

Detailed Description

Represents an image area widget for displaying an image.

ImageArea is an area in which you can display an image. You can select an area, zoom in and out, and scroll if the image is too large to fit in the area. You can optionally display a grid when you've zoomed in past a specified amount.

Note
ImageArea can not handle alpha images.
See also

Constructor & Destructor Documentation

◆ ImageArea() [1/3]

PhWidgets::ImageArea::ImageArea ( int  abn)
explicit

(constructor)

Constructs a ImageArea by ID.

Parameters
[in]abnID given by PhAB to widget (like 'ABN_WIDGET_NAME').

◆ ImageArea() [2/3]

PhWidgets::ImageArea::ImageArea ( PtWidget_t wdg)
explicit

(constructor)

Constructs a ImageArea by pointer to widget.

Parameters
[in]wdgpointer to Photon widget.

◆ ImageArea() [3/3]

PhWidgets::ImageArea::ImageArea ( const ImageArea other)

(copy constructor)

Constructs a ImageArea by copy.

Parameters
[in]otheranother ImageArea to be used as source to initialize the elements of the container with.

Member Function Documentation

◆ operator=()

ImageArea & PhWidgets::ImageArea::operator= ( const ImageArea other)

Assigns value in ImageArea.

Replaces the contents of the ImageArea.

Parameters
[in]otheranother ImageArea to use as data source.

Member Data Documentation

◆ AutoScale

property<bool>::bind<ImageArea, &ImageArea::getAutoScale, &ImageArea::setAutoScale> PhWidgets::ImageArea::AutoScale

Determines whether or not to use automatically scale the image to fit the size of the widget.

Property Value

bool

true if the image within the ImageArea is stretched or shrunk to fit the size of the ImageArea; otherwise, false. The default is false.

See also

◆ GridColor

phproperty<Drawing::Color>::bind<ImageArea, ArgColor::eArgColor, Arguments::grid_color> PhWidgets::ImageArea::GridColor

Gets or sets the color of the grid, if displayed.

Property Value

Drawing::Color

A Drawing::Color that represents the color of the grid, if displayed.

See also

◆ GridThreshold

phproperty<long>::bind<ImageArea, ArgLong::eArgLong, Arguments::grid_threshold> PhWidgets::ImageArea::GridThreshold

Gets or sets the grid threshold.

Property Value

long

A long that represents the grid threshold, expressed as a fixed-point 16.16 number.

Remarks
If the zooming factor (ImageArea::ZoomingFactor) is greater than this threshold, the grid is displayed.
See also

◆ Image

property<Drawing::Image>::bind<ImageArea, &ImageArea::getImage, &ImageArea::setImage> PhWidgets::ImageArea::Image

Gets or sets the image that is displayed by ImageArea.

Property Value

Drawing::Image

The Drawing::Image to display.

Examples

void CreateBitmapAtRuntime( PtWidget_t *ptwidget, void *, PtCallbackInfo_t * )
{
using namespace PhWidgets;
Widget this_widget(ptwidget);
// constructing new ImageArea
ImageArea imageArea1;
imageArea1.Size = PhDim_t({210, 110});
imageArea1.Parent = this_widget;
Drawing::Image flag = Drawing::Image::FromFile("./flag_rus.jpg");
imageArea1.Image = flag;
}
An abstract base class that provides functionality for the Drawing::Bitmap class.
Definition: Image.h:185
static Image FromFile(std::string filename)
Creates an Image from the specified file.
Represents an image area widget for displaying an image.
Definition: ImageArea.h:31
property< Drawing::Image >::bind< ImageArea, &ImageArea::getImage, &ImageArea::setImage > Image
Gets or sets the image that is displayed by ImageArea.
Definition: ImageArea.h:395
Superclass for all widgets.
Definition: Widget.h:110
property< PtWidget_t * >::bind< Widget, &Widget::getParent, &Widget::setParent > Parent
Gets or sets the parent container of the widget.
Definition: Widget.h:1867
phproperty< PhDim_t >::bind< Widget, Arguments< PhDim_t >::Struct, Arguments< PhDim_t >::Dimension > Size
Gets or sets the size of the widget.
Definition: Widget.h:1931
The main namespace for all widgets.
Definition: Basic.h:11
Remarks
The Image property is set to the Drawing::Image to display. You can do this either at design time or at run time.
Note
If you want to use the same image in multiple ImageArea widgets, create a clone of the image for each ImageArea. Accessing the same image from multiple widgets causes an exception to occur.
See also
  • ImageLocation

◆ resource

WidgetResourcesSingleton PhWidgets::ImageArea::resource

Resources of the ImageArea.

See also

◆ ZoomingFactor

phproperty<long>::bind<ImageArea, ArgLong::eArgLong, Arguments::zoom> PhWidgets::ImageArea::ZoomingFactor

Gets or sets the zooming factor.

Property Value

long

A long that represents the zooming factor, expressed as a fixed-point 16.16 number.

See also

The documentation for this struct was generated from the following file: