Create the UI artefacts for the "Print contacts" sub form.
771665
private void createPrintContactsSubForm() {
		add(new WHeading(HeadingLevel.H3, "Print to CSV"));

		WButton printBtn = new WButton("Print");
		printBtn.setAction(new Action() {
			@Override
			public void execute(final ActionEvent event) {
				printDetails();
			}
		});
		printBtn.setImage("/image/document-print.png");
		printBtn.setImagePosition(WButton.ImagePosition.EAST);

		WFieldLayout layout = new WFieldLayout();
		add(layout);
		layout.setMargin(new Margin(Size.LARGE, null, null, null));
		layout.addField("Print output", printOutput);
		layout.addField((WLabel) null, printBtn);
		add(new WAjaxControl(printBtn, printOutput));
	}
297191
def Print(self):
        """"""
        for hypo, prob in sorted(self.Items()):
            print(hypo, prob)
246237
private FormLayout initForm() {

        FormLayout form = new FormLayout();
        form.setWidth("100%");
        m_dateField = new CmsDateField();
        m_dateField.setCaption(
            CmsVaadinUtils.getMessageText(org.opencms.workplace.commons.Messages.GUI_LABEL_DATE_PUBLISH_SCHEDULED_0));
        form.addComponent(m_dateField);
        m_includeSubResources = new CheckBox(
            CmsVaadinUtils.getMessageText(org.opencms.workplace.commons.Messages.GUI_PUBLISH_MULTI_SUBRESOURCES_0));
        if (hasFolders()) {
            form.addComponent(m_includeSubResources);
        }

        return form;
    }
1131095
def printInspectors():
    
    # Imported here so this module can be imported without Qt being installed.
    from argos.application import ArgosApplication

    argosApp = ArgosApplication()
    argosApp.loadOrInitRegistries()
    for regItem in argosApp.inspectorRegistry.items:
        print(regItem.fullName)
414185
def setup_ui(self, ):
        
        self.main_vbox = QtGui.QVBoxLayout(self)
        self.import_all_references_cb = QtGui.QCheckBox("Import references")
        self.main_vbox.addWidget(self.import_all_references_cb)
1328741
public function Form()
    {
        $crumbs = $this->Breadcrumbs();
        
        if ($crumbs && $crumbs->count()>=2) {
            $one_level_up = $crumbs->offsetGet($crumbs->count()-2);
        }
        
        $record_ids = "";
        $query_string = "";
        $recordList = $this->getRecordIDList();
        
        foreach ($this->getRecordIDList() as $id) {
            $record_ids .= $id . ',';
            $query_string .= "records[]={$id}&";
        }
        
        // Cut off the last 2 parts of the string
        $record_ids = substr($record_ids, 0, -1);
        $query_string = substr($query_string, 0, -1);
        
        $form = new Form(
            $this,
            'Form',
            $fields = FieldList::create(
                HiddenField::create("RecordIDs", "", $record_ids),
                DropdownField::create(
                    "ContactListID",
                    _t("Contacts.ChooseList", "Choose a list"),
                    ContactList::get()->map()
                )->setEmptyString(_t("Contacts.SelectList", "Select a List"))
            ),
            $actions = FieldList::create(
                FormAction::create('doAddToList', _t("Contacts.Add", 'Add'))
                    ->setAttribute('id', 'bulkEditingSaveBtn')
                    ->addExtraClass('btn btn-success')
                    ->setAttribute('data-icon', 'accept')
                    ->setUseButtonTag(true),
                    
                FormAction::create('Cancel', _t('GRIDFIELD_BULKMANAGER_EDIT_HANDLER.CANCEL_BTN_LABEL', 'Cancel'))
                    ->setAttribute('id', 'bulkEditingUpdateCancelBtn')
                    ->addExtraClass('btn btn-danger cms-panel-link')
                    ->setAttribute('data-icon', 'decline')
                    ->setAttribute('href', $one_level_up->Link)
                    ->setUseButtonTag(true)
                    ->setAttribute('src', '')
            )
        );
        
        if ($crumbs && $crumbs->count() >= 2) {
            $form->Backlink = $one_level_up->Link;
        }
        
        // override form action URL back to bulkEditForm
        // and add record ids GET var
        $form->setFormAction(
            $this->Link('Form?records[]='.implode('&', $recordList))
        );

        return $form;
    }
117957
protected void doPrint() {

        PrintablePage pageInView = previewPane.getPrintablePage();
        PrintablePage pageToPrint = new PrintablePage();

        try {
            pageInView.bindPage(pageToPrint);

            Printer printer = Printer.getDefaultPrinter();

            if (printer == null || settingsView.getPaperView()
                    .getAvailablePapers().isEmpty()) {
                // Show an Error
                Alert alert = new Alert(AlertType.INFORMATION);
                alert.initOwner(dialog);
                alert.setTitle(Messages
                        .getString("DateControl.TITLE_CALENDAR_PROBLEM"));
                alert.setHeaderText(
                        Messages.getString("PrintView.NO_PRINTERS"));
                alert.setContentText(
                        Messages.getString("PrintView.ERROR_NO_PRINTER"));
                alert.show();
                return;
            }

            hide();
            LoggingDomain.PRINTING.fine("printer = " + printer);

            PageLayout layout = null;

            final Paper paper = pageInView.getPaper();
            final PageOrientation pageOrientation = pageInView.getViewType()
                    .getPageOrientation();
            final PaperView.MarginType marginType = pageInView.getMarginType();

            LoggingDomain.PRINTING.fine("paper = " + paper);
            LoggingDomain.PRINTING.fine("pageOrientation = " + pageOrientation);
            LoggingDomain.PRINTING.fine("marginType = " + marginType);
            LoggingDomain.PRINTING
                    .fine("custom margins = left: " + pageInView.getLeftMargin()
                            + ", right: " + pageInView.getRightMargin()
                            + ", top: " + pageInView.getTopMargin()
                            + ", bottom: " + pageInView.getBottomMargin());

            switch (marginType) {
            case DEFAULT:
                layout = printer.createPageLayout(paper, pageOrientation,
                        Printer.MarginType.DEFAULT);
                break;
            case MINIMUM:
                layout = printer.createPageLayout(paper, pageOrientation,
                        Printer.MarginType.HARDWARE_MINIMUM);
                break;
            case CUSTOM:
                layout = printer.createPageLayout(paper, pageOrientation,
                        pageInView.getLeftMargin(), pageInView.getRightMargin(),
                        pageInView.getTopMargin(),
                        pageInView.getBottomMargin());
                break;
            }

            // sizes of print page and physical page
            double pageWidth = pageToPrint.prefWidth(-1);
            double pageHeight = pageToPrint.prefHeight(-1);

            double printableWidth = layout.getPrintableWidth();
            double printableHeight = layout.getPrintableHeight();

            // scaling
            double scaleX = printableWidth / pageWidth;
            double scaleY = printableHeight / pageHeight;
            double scale = Math.min(scaleX, scaleY);

            LoggingDomain.PRINTING.fine("pageWidth / pageHeight = " + pageWidth
                    + " / " + pageHeight);
            LoggingDomain.PRINTING.fine("printableWidth / printableHeight = "
                    + printableWidth + " / " + printableHeight);
            LoggingDomain.PRINTING
                    .fine("scaleX / scaleY = " + scaleX + " / " + scaleY);
            LoggingDomain.PRINTING.fine("scale = " + scale);

            pageToPrint.applyCss();
            pageToPrint.layout();
            pageToPrint.getTransforms().add(new Scale(scale, scale));

            // transformation = center
            final double translateX = (printableWidth - (pageWidth * scale))
                    / 2;
            final double translateY = (printableHeight - (pageHeight * scale))
                    / 2;

            LoggingDomain.PRINTING.fine("translateX / translateY = "
                    + translateX + " / " + translateY);

            pageToPrint.setTranslateX(translateX);
            pageToPrint.setTranslateY(translateY);

            PrinterJob job = PrinterJob.createPrinterJob(printer);
            JobSettings settings = job.getJobSettings();
            settings.setJobName(Messages.getString("PrintView.TITLE_LABEL"));
            settings.setPageLayout(layout);

            if (job.showPrintDialog(getScene().getWindow())) {
                do {
                    boolean success = job.printPage(pageToPrint);
                    if (!success) {
                        break;
                    }
                } while (pageToPrint.next());

                job.endJob();
            }
        } finally {
            pageInView.unbindPage(pageToPrint);
        }
    }
1058805
def new_embed_ui(self):
        """"""

        self.logger.debug("Creating new embed ui object")

        # Initial queue display
        queue_display = []
        for i in range(self.queue_display):
            queue_display.append("{}. ---\n".format(str(i + 1)))

        # Initial datapacks
        datapacks = [
            ("Now playing", "---", False),
            ("Author", "---", True),
            ("Source", "---", True),
            ("Time", "```http\n" + _timebar.make_timebar() + "\n```", False),
            ("Queue", "```md\n{}\n```".format(''.join(queue_display)), False),
            ("Songs left in queue", "---", True),
            ("Volume", "{}%".format(self.volume), True),
            ("Status", "```---```", False)
        ]

        # Create embed UI object
        self.embed = ui_embed_tools.UI(
            self.mchannel,
            "",
            "",
            modulename=_data.modulename,
            colour=_data.modulecolor,
            datapacks=datapacks
        )

        # Add handlers to update gui
        noformatter = logging.Formatter("{message}", style="{")
        timeformatter = logging.Formatter("```http\n{message}\n```", style="{")
        mdformatter = logging.Formatter("```md\n{message}\n```", style="{")
        statusformatter = logging.Formatter("```__{levelname}__\n{message}\n```", style="{")
        volumeformatter = logging.Formatter("{message}%", style="{")

        nowplayinghandler = EmbedLogHandler(self, self.embed, 0)
        nowplayinghandler.setFormatter(noformatter)
        nowplayingauthorhandler = EmbedLogHandler(self, self.embed, 1)
        nowplayingauthorhandler.setFormatter(noformatter)
        nowplayingsourcehandler = EmbedLogHandler(self, self.embed, 2)
        nowplayingsourcehandler.setFormatter(noformatter)
        timehandler = EmbedLogHandler(self, self.embed, 3)
        timehandler.setFormatter(timeformatter)
        queuehandler = EmbedLogHandler(self, self.embed, 4)
        queuehandler.setFormatter(mdformatter)
        queuelenhandler = EmbedLogHandler(self, self.embed, 5)
        queuelenhandler.setFormatter(noformatter)
        volumehandler = EmbedLogHandler(self, self.embed, 6)
        volumehandler.setFormatter(volumeformatter)
        statushandler = EmbedLogHandler(self, self.embed, 7)
        statushandler.setFormatter(statusformatter)

        self.nowplayinglog.addHandler(nowplayinghandler)
        self.nowplayingauthorlog.addHandler(nowplayingauthorhandler)
        self.nowplayingsourcelog.addHandler(nowplayingsourcehandler)
        self.timelog.addHandler(timehandler)
        self.queuelog.addHandler(queuehandler)
        self.queuelenlog.addHandler(queuelenhandler)
        self.volumelog.addHandler(volumehandler)
        self.statuslog.addHandler(statushandler)
1156625
def create_ui_structure(cls, username, napp_name, ui_templates_path,
                            context):
        """"""
        for section in ['k-info-panel', 'k-toolbar', 'k-action-menu']:
            os.makedirs(os.path.join(username, napp_name, 'ui', section))

        templates = os.listdir(ui_templates_path)

        for tmp in templates:
            fname = os.path.join(username, napp_name, 'ui',
                                 tmp.rsplit('.template')[0])

            with open(fname, 'w') as file:
                content = cls.render_template(ui_templates_path, tmp,
                                              context)
                file.write(content)
405106
def _createscratch(self, shape=1):
        """"""
        self._scratch = record.FieldArray(shape, dtype=[(p, float)
            for p in self.inputs])
167674
def new
      @contact_form = Cmtool::ContactForm.new

      respond_to do |format|
        format.html # new.html.erb
        format.xml  { render xml: @contact_form }
      end
    end
407726
def setup_ui(self, ):
        
        log.debug("Setting up the ui")
        self.setup_prjs_page()
        self.setup_prj_page()
        self.setup_seq_page()
        self.setup_shot_page()
        self.setup_atype_page()
        self.setup_asset_page()
        self.setup_dep_page()
        self.setup_task_page()
        self.setup_users_page()
        self.setup_user_page()
1086385
def mangle_form(form):
    ""
    for field, widget in form.fields.iteritems():
        if type(widget) is forms.widgets.TextInput:
            form.fields[field].widget = PaperTextInput()
            form.fields[field].label = ''
        if type(widget) is forms.widgets.PasswordInput:
            field.widget = PaperPasswordInput()
            field.label = ''
    return form
1165801
function print( theme ) {
    if ( theme === 'grid' || ( !theme && isGrid() ) ) {
        let swapped = false;
        dialog.prompt( 'Enter valid paper format', 'A4' )
            .then( format => {
                if ( !format ) {
                    throw new Error( 'Print cancelled by user.' );
                }
                swapped = styleToAll();
                return fixGrid( {
                    format
                } );
            } )
            .then( window.print )
            .catch( console.error )
            .then( () => {
                if ( swapped ) {
                    setTimeout( styleReset, 500 );
                }
            } );
    } else {
        window.print();
    }
}
1195273
def pprint(self, ind):
        """"""
        pp = pprint.PrettyPrinter(indent=ind)
        pp.pprint(self.tree)
140352
def dprint(s):
    ''''''

    import inspect

    frameinfo = inspect.stack()[1]
    callerframe = frameinfo.frame
    d = callerframe.f_locals

    if (isinstance(s,str)):
        val = eval(s, d)
    else:
        val = s
        cc = frameinfo.code_context[0]
        import re
        regex = re.compile("dprint\((.*)\)")
        res = regex.search(cc)
        s = res.group(1)

    text = ''
    text += bcolors.OKBLUE + "At <{}>\n".format(str(frameinfo)) + bcolors.ENDC
    text += bcolors.WARNING + "{}:  ".format(s) + bcolors.ENDC
    text += str(val)
    text += str()

    print(text)
41349
function showPrinterSettings() {

        fillAndSetBinsList();

        var $dlg = $('#dlg-printersettings');
        var printer = MeadCo.ScriptX.Printing;
        $dlg.find('#fld-collate').prop('checked', printer.collate);
        $dlg.find('#fld-copies').val(printer.copies);

    }