diplomat.wx_gui.scroll_image_list.ScrollImageList

class diplomat.wx_gui.scroll_image_list.ScrollImageList(*args: Any, **kwargs: Any)[source]

Bases: ScrolledCanvas

A custom wx widget which is capable of dynamically displaying a list of images with scroll bars. The images can be updated without breaking the widget, which will properly resize its scrollbars to accommodate the images…

__init__(parent, img_list: List[wx.Bitmap] | None, orientation=wx.VERTICAL, padding=20, wid=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0, name='ScrollImageList')[source]

Construct a new scrollable image list.

Parameters:
  • parent – The parent widget.

  • img_list – A list of wx.Bitmap, the bitmaps to be displayed in the widget

  • orientation – The direction to layout images in, wx.VERTICAL or wx.HORIZONTAL. Defaults to wx.VERTICAL.

  • padding – The padding between images. Defaults to 20 pixels.

  • wid – wx ID of the window, and integer. Defaults to wx.ID_ANY.

  • pos – WX Position of the control. Defaults to wx.DefaultPosition.

  • size – WX Size of the control. Defaults to wx.DefaultSize.

  • style – WX ScrolledCanvas Style. See wx.Control docs for possible options. (Defaults to wx.HSCROLL | wx.VSCROLL).

  • name – WX internal name of widget.

Methods

OnDraw(dc)

Executed whenever the ScrolledImageList is requested to be redrawn.

OnMouseWheel(event)

SetScrollPageSize(orient, pageSize)

__init__(parent, img_list[, orientation, ...])

Construct a new scrollable image list.

get_bitmaps()

Get the list of bitmaps being shown.

get_orientation()

Get the orientation of the images.

get_padding()

Get the padding between images for this scroll image list.

set_bitmaps(bitmaps)

Set the list of bitmaps being shown.

set_orientation(value)

Set the orientation of the images.

set_padding(value)

Set the padding between images for this scroll image list.

Attributes

SCROLL_RATE

OnDraw(dc: wx.DC)[source]

Executed whenever the ScrolledImageList is requested to be redrawn. Redraws all of the images.

param dc: The wx.DC to draw to.

_compute_dimensions(event=None)[source]

Compute the total size that will be taken up by the images. Returns, a tuple of two integers being the width and height of the canvas (internal size, so inside the scroll area).

get_bitmaps() List[wx.Bitmap][source]

Get the list of bitmaps being shown.

Returns:

A list of wx.Bitmap.

get_orientation() int[source]

Get the orientation of the images.

Returns:

wx.VERTICAL or wx.HORIZONTAL.

get_padding() int[source]

Get the padding between images for this scroll image list.

Returns:

An integer, being the padding value used between images.

set_bitmaps(bitmaps: List[wx.Bitmap])[source]

Set the list of bitmaps being shown.

Parameters:

bitmaps – A list of wx.Bitmap.

set_orientation(value: int)[source]

Set the orientation of the images.

Parameters:

value – wx.VERTICAL or wx.HORIZONTAL.

set_padding(value: int)[source]

Set the padding between images for this scroll image list.

Parameters:

value – An integer, being the padding value to use between images.