# eric7.EricWidgets.EricZoomWidget

Module implementing a zoom widget for the status bar.

### Global Attributes

None

### Classes

EricZoomWidget | Class implementing a zoom widget for the status bar.

### Functions

None

## EricZoomWidget

Class implementing a zoom widget for the status bar.

### Signals

valueChanged(value)
  emitted to indicate the new zoom value (int)

### Derived from

QWidget, Ui_EricZoomWidget

### Class Attributes

None

### Class Methods

None

### Methods

EricZoomWidget | Constructor
__indexForValue | Private method to get the nearest index for a given value.
__setValueLabelWidth | Private slot to determine the width of the zoom value label.
__zoomIn | Private slot to zoom in one step.
__zoomOut | Private slot to zoom out one step.
__zoomReset | Private slot to reset the value.
_sliderValueChanged | Protected slot to handle changes of the slider value.
default | Public method to get the default zoom value.
isMapped | Public method to check for a mapped zoom widget.
isPercent | Public method to get the percent mode.
mapping | Public method to get the current mapping.
maximum | Public method to get the maximum value.
minimum | Public method to get the minimum value.
on_slider_sliderMoved | Private slot to handle changes of the zoom value.
pageStep | Public method to get the page step value.
setDefault | Public method to set the default zoom value.
setMapping | Public method to set a zoom level mapping.
setMaximum | Public method to set the maximum value.
setMinimum | Public method to set the minimum value.
setPageStep | Public method to set the page step value.
setPercent | Public method to set the percent mode of the widget.
setSingleStep | Public method to set the single step value.
setValue | Public slot to set the value.
singleStep | Public method to get the single step value.
value | Public method to get the current value.

### Static Methods

None

#### EricZoomWidget (Constructor)

EricZoomWidget(outPix, inPix, resetPix, parent=None)

Constructor

outPix
  pixmap for the zoom out button (QPixmap)
inPix
  pixmap for the zoom in button (QPixmap)
resetPix
  pixmap for the zoom reset button (QPixmap)
parent
  reference to the parent widget (QWidget)

#### EricZoomWidget.__indexForValue

__indexForValue(value)

Private method to get the nearest index for a given value.

value
  value to get the index for (integer)

Return:
  index into the mapping list or the unchanged value, if mapping is not set (integer)

#### EricZoomWidget.__setValueLabelWidth

__setValueLabelWidth()

Private slot to determine the width of the zoom value label.

#### EricZoomWidget.__zoomIn

__zoomIn()

Private slot to zoom in one step.

#### EricZoomWidget.__zoomOut

__zoomOut()

Private slot to zoom out one step.

#### EricZoomWidget.__zoomReset

__zoomReset()

Private slot to reset the value.

#### EricZoomWidget._sliderValueChanged

_sliderValueChanged(value)

Protected slot to handle changes of the slider value.

value
  slider value (integer)

#### EricZoomWidget.default

default()

Public method to get the default zoom value.

Return:
  default zoom value (integer)

#### EricZoomWidget.isMapped

isMapped()

Public method to check for a mapped zoom widget.

Return:
  flag indicating a mapped zoom widget (boolean)

#### EricZoomWidget.isPercent

isPercent()

Public method to get the percent mode.

Return:
  flag indicating percent mode (boolean)

#### EricZoomWidget.mapping

mapping()

Public method to get the current mapping.

Return:
  tuple of the mapping and the default index (list of integer, integer)

#### EricZoomWidget.maximum

maximum()

Public method to get the maximum value.

Return:
  maximum value (integer)

#### EricZoomWidget.minimum

minimum()

Public method to get the minimum value.

Return:
  minimum value (integer)

#### EricZoomWidget.on_slider_sliderMoved

on_slider_sliderMoved(value)

Private slot to handle changes of the zoom value.

value
  value of the slider (integer)

#### EricZoomWidget.pageStep

pageStep()

Public method to get the page step value.

Return:
  page step value (integer)

#### EricZoomWidget.setDefault

setDefault(value)

Public method to set the default zoom value.

value
  default zoom value (integer)

#### EricZoomWidget.setMapping

setMapping(mapping, default, percent=True)

Public method to set a zoom level mapping.

When zoom level mapping is activated, the slider covers values from 0 to the max. index of the mapping list. The default value is the value of the default zoom level. If percent is given, the zoom level is shown as a percent value.

mapping
  list of mapping values (list of integer)
default
  index of the default value (integer)
percent
  flag indicating to show zoom value in percent (boolean)

#### EricZoomWidget.setMaximum

setMaximum(maximum)

Public method to set the maximum value.

maximum
  new maximum value (integer)

#### EricZoomWidget.setMinimum

setMinimum(minimum)

Public method to set the minimum value.

minimum
  new minimum value (integer)

#### EricZoomWidget.setPageStep

setPageStep(value)

Public method to set the page step value.

value
  page step value (integer)

#### EricZoomWidget.setPercent

setPercent(on)

Public method to set the percent mode of the widget.

on
  flag indicating percent mode (boolean)

#### EricZoomWidget.setSingleStep

setSingleStep(value)

Public method to set the single step value.

value
  value for the single step (integer)

#### EricZoomWidget.setValue

setValue(value)

Public slot to set the value.

value
  new zoom value (integer)

#### EricZoomWidget.singleStep

singleStep()

Public method to get the single step value.

Return:
  single step value (integer)

#### EricZoomWidget.value

value()

Public method to get the current value.

Return:
  current zoom value (integer)

Up