pycrossword  0.3
Pure-Python implementation of a crossword puzzle generator and editor
Public Member Functions | Public Attributes | Private Member Functions | List of all members
pycross.forms.PrintPreviewDialog Class Reference

Print preview window to preview crossword / clues and configure printing. More...

Inheritance diagram for pycross.forms.PrintPreviewDialog:
pycross.forms.BasicDialog

Public Member Functions

def __init__ (self, printer, mainwindow, parent=None, flags=QtCore.Qt.WindowFlags())
 Constructor. More...
 
def showEvent (self, event)
 Update preview on dialog show. More...
 
def addMainLayout (self)
 Creates the main (central) layout for controls. More...
 
def update_controls (self)
 Updates the printer settings from guisettings::CWSettings::settings and updates the controls in toolbar and preview according to current printer settings. More...
 
def update_page_size (self)
 Updates the page size from the one selected in the page size combo. More...
 
def update_margins (self)
 Sets the page margins according to the values in the margin edit fields. More...
 
def write_settings (self)
 Saves the current page config to the global settings. More...
 
def on_combo_page_size (self, index)
 When a new page size is selected in the combo box. More...
 
def on_combo_view (self, index)
 When a view mode is selected in the view combo box. More...
 
def on_combo_layout (self, index)
 When a layout is selected in the layout combo box. More...
 
def on_btn_fit_width (self)
 Scale page to width. More...
 
def on_btn_fit_all (self)
 Scale page to fit in window. More...
 
def on_combo_color (self, index)
 Set print color mode. More...
 
def on_zoom_changed (self, value)
 Set scale factor. More...
 
def on_margins_changed (self, text)
 Set page margins. More...
 
def on_btn_settings (self)
 Shows global settings dialog. More...
 
- Public Member Functions inherited from pycross.forms.BasicDialog
def __init__ (self, geometry=None, title=None, icon=None, parent=None, flags=QtCore.Qt.WindowFlags(), sizepolicy=QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed))
 Constructor. More...
 
def initUI (self, geometry=None, title=None, icon=None)
 Creates the core controls: OK and Cancel buttons and layouts. More...
 
def validate (self)
 Validates user input (reimplemented in child classes). More...
 
def on_btn_OK_clicked (self)
 Fires when the OK button is clicked. More...
 
def on_btn_cancel_clicked (self)
 Fires when the Cancel button is clicked: rejects input and closes window. More...
 

Public Attributes

 printer
 QtPrintSupport.QPrinter selected printer More...
 
 mainwindow
 QtWidgets.QMainWindow pointer to gui::MainWindow instance More...
 
 layout_controls
 
 tb_main
 
 layout_tb_main
 
 combo_page_size
 
 layout_pagesize
 
 combo_view
 
 layout_view
 
 combo_layout
 
 layout_layout
 
 btn_fit_width
 
 btn_fit_all
 
 slider_zoom
 
 layout_fit
 
 combo_color
 
 layout_color
 
 le_margin_l
 
 le_margin_r
 
 le_margin_t
 
 le_margin_b
 
 layout_margins
 
 btn_settings
 
 layout_center
 
 ppreview
 
- Public Attributes inherited from pycross.forms.BasicDialog
 layout_controls
 QtWidgets.QFormLayout central layout for controls More...
 
 btn_OK
 QtWidgets.QPushButton OK button More...
 
 btn_cancel
 QtWidgets.QPushButton Cancel button More...
 
 layout_bottom
 QtWidgets.QHBoxLayout bottom layout for OK and Cancel buttons More...
 
 layout_main
 QtWidgets.QVBoxLayout window layout More...
 

Private Member Functions

def _make_labelled_widgets (self, name, caption, widgets)
 Shortcut method to create a 'tab' (layout) with a caption and widgets. More...
 

Detailed Description

Print preview window to preview crossword / clues and configure printing.

Constructor & Destructor Documentation

◆ __init__()

def pycross.forms.PrintPreviewDialog.__init__ (   self,
  printer,
  mainwindow,
  parent = None,
  flags = QtCore.Qt.WindowFlags() 
)

Constructor.

Parameters
printerQtPrintSupport.QPrinter selected printer
mainwindowQtWidgets.QMainWindow pointer to gui::MainWindow instance
parentQtWidgets.QWidget parent widget (default = None, i.e. no parent)
flagsQtCore.Qt.WindowFlags Qt window flags

Member Function Documentation

◆ _make_labelled_widgets()

def pycross.forms.PrintPreviewDialog._make_labelled_widgets (   self,
  name,
  caption,
  widgets 
)
private

Shortcut method to create a 'tab' (layout) with a caption and widgets.

Parameters
namestr name of caption label
captionstr caption string
widgetsiterable list of widgets to add to layout
Returns
QtWidgets.QVBoxLayout layout with widgets and caption label

◆ addMainLayout()

def pycross.forms.PrintPreviewDialog.addMainLayout (   self)

Creates the main (central) layout for controls.

Must be overridden by child classes to change the layout type (default = QtWidgets.QFormLayout) and add controls.

Reimplemented from pycross.forms.BasicDialog.

◆ on_btn_fit_all()

def pycross.forms.PrintPreviewDialog.on_btn_fit_all (   self)

Scale page to fit in window.

◆ on_btn_fit_width()

def pycross.forms.PrintPreviewDialog.on_btn_fit_width (   self)

Scale page to width.

◆ on_btn_settings()

def pycross.forms.PrintPreviewDialog.on_btn_settings (   self)

Shows global settings dialog.

◆ on_combo_color()

def pycross.forms.PrintPreviewDialog.on_combo_color (   self,
  index 
)

Set print color mode.

◆ on_combo_layout()

def pycross.forms.PrintPreviewDialog.on_combo_layout (   self,
  index 
)

When a layout is selected in the layout combo box.

◆ on_combo_page_size()

def pycross.forms.PrintPreviewDialog.on_combo_page_size (   self,
  index 
)

When a new page size is selected in the combo box.

◆ on_combo_view()

def pycross.forms.PrintPreviewDialog.on_combo_view (   self,
  index 
)

When a view mode is selected in the view combo box.

◆ on_margins_changed()

def pycross.forms.PrintPreviewDialog.on_margins_changed (   self,
  text 
)

Set page margins.

See also
PrintPreviewDialog::update_margins()

◆ on_zoom_changed()

def pycross.forms.PrintPreviewDialog.on_zoom_changed (   self,
  value 
)

Set scale factor.

◆ showEvent()

def pycross.forms.PrintPreviewDialog.showEvent (   self,
  event 
)

Update preview on dialog show.

◆ update_controls()

def pycross.forms.PrintPreviewDialog.update_controls (   self)

Updates the printer settings from guisettings::CWSettings::settings and updates the controls in toolbar and preview according to current printer settings.

◆ update_margins()

def pycross.forms.PrintPreviewDialog.update_margins (   self)

Sets the page margins according to the values in the margin edit fields.

◆ update_page_size()

def pycross.forms.PrintPreviewDialog.update_page_size (   self)

Updates the page size from the one selected in the page size combo.

◆ write_settings()

def pycross.forms.PrintPreviewDialog.write_settings (   self)

Saves the current page config to the global settings.

Member Data Documentation

◆ btn_fit_all

pycross.forms.PrintPreviewDialog.btn_fit_all

◆ btn_fit_width

pycross.forms.PrintPreviewDialog.btn_fit_width

◆ btn_settings

pycross.forms.PrintPreviewDialog.btn_settings

◆ combo_color

pycross.forms.PrintPreviewDialog.combo_color

◆ combo_layout

pycross.forms.PrintPreviewDialog.combo_layout

◆ combo_page_size

pycross.forms.PrintPreviewDialog.combo_page_size

◆ combo_view

pycross.forms.PrintPreviewDialog.combo_view

◆ layout_center

pycross.forms.PrintPreviewDialog.layout_center

◆ layout_color

pycross.forms.PrintPreviewDialog.layout_color

◆ layout_controls

pycross.forms.PrintPreviewDialog.layout_controls

◆ layout_fit

pycross.forms.PrintPreviewDialog.layout_fit

◆ layout_layout

pycross.forms.PrintPreviewDialog.layout_layout

◆ layout_margins

pycross.forms.PrintPreviewDialog.layout_margins

◆ layout_pagesize

pycross.forms.PrintPreviewDialog.layout_pagesize

◆ layout_tb_main

pycross.forms.PrintPreviewDialog.layout_tb_main

◆ layout_view

pycross.forms.PrintPreviewDialog.layout_view

◆ le_margin_b

pycross.forms.PrintPreviewDialog.le_margin_b

◆ le_margin_l

pycross.forms.PrintPreviewDialog.le_margin_l

◆ le_margin_r

pycross.forms.PrintPreviewDialog.le_margin_r

◆ le_margin_t

pycross.forms.PrintPreviewDialog.le_margin_t

◆ mainwindow

pycross.forms.PrintPreviewDialog.mainwindow

QtWidgets.QMainWindow pointer to gui::MainWindow instance

◆ ppreview

pycross.forms.PrintPreviewDialog.ppreview

◆ printer

pycross.forms.PrintPreviewDialog.printer

QtPrintSupport.QPrinter selected printer

◆ slider_zoom

pycross.forms.PrintPreviewDialog.slider_zoom

◆ tb_main

pycross.forms.PrintPreviewDialog.tb_main

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