Create dialog body. Return widget that should have initial
        focus.

        Inherited from tkinter.simpledialog.Dialog
971299
def body(self, master):
        
        self.frame = ttk.Frame(master, padding=(5, 5, 10, 10))

        self.lbl_message = ttk.Label(
            self.frame,
            text='Select User Type: ',
        )
        self.rb_student = ttk.Radiobutton(
            self.frame,
            text='Student',
            variable=self.rb_choice,
            value='student',
        )
        self.rb_tutor = ttk.Radiobutton(
            self.frame,
            text='Tutor',
            variable=self.rb_choice,
            value='tutor',
        )
        self.btn_ok = ttk.Button(
            self.frame,
            text='OK',
            command=self.ok,
        )
        self.btn_cancel = ttk.Button(
            self.frame,
            text='Cancel',
            command=self.cancel,
        )
        # assemble grid
        self.frame.grid(column=0, row=0, sticky=(N, S, E, W))
        self.lbl_message.grid(column=0, row=0, columnspan=2, sticky=(W, E))
        self.rb_student.grid(column=0, row=1, columnspan=2, sticky=W)
        self.rb_tutor.grid(column=0, row=2, columnspan=2, sticky=W)
        self.btn_ok.grid(column=0, row=3)
        self.btn_cancel.grid(column=1, row=3)

        # key bindings
        self.bind('<Return>', self.ok)
        self.bind('<KP_Enter>', self.ok)
        self.bind('<Escape>', self.cancel)

        self.rb_tutor.invoke()

        return self.btn_ok
171124
def init_widget(self):
        
        super(UiKitSlider, self).init_widget()

        d = self.declaration
        if d.min:
            self.set_min(d.min)
        if d.max:
            self.set_max(d.max)
        if d.progress:
            self.set_progress(d.progress)

        #: A really ugly way to add the target
        #: would be nice if we could just pass the block pointer here :)
        self.get_app().bridge.addTarget(
            self.widget,
            forControlEvents=UISlider.UIControlEventValueChanged,
            andCallback=self.widget.getId(),
            usingMethod="onValueChanged",
            withValues=["value"]#,"selected"]
        )

        self.widget.onValueChanged.connect(self.on_checked_changed)
1024066
def init_widget(self):
        
        if not self.toast:
            return
        super(AndroidToast, self).init_widget()

        d = self.declaration
        if not self.made_toast:
            #: Set it to LONG
            self.toast.setDuration(1)
        if d.gravity:
            self.set_gravity(d.gravity)
        if d.show:
            self.set_show(d.show)
84280
def create_dialog(self):
        
        box0 = QGroupBox('Info')

        self.name = FormStr()

        self.name.setText('spin')
        self.idx_group.activated.connect(self.update_channels)
        self.idx_chan.itemSelectionChanged.connect(self.count_channels)

        form = QFormLayout(box0)
        form.addRow('Event name',
                       self.name)
        form.addRow('Channel group',
                       self.idx_group)
        form.addRow('Channel(s)',
                       self.idx_chan)
        form.addRow('Cycle(s)',
                       self.idx_cycle)
        form.addRow('Stage(s)',
                       self.idx_stage)

        box1 = QGroupBox('Parameters')

        self.idx_method = FormMenu(SPINDLE_METHODS)
        self.index['f1'] = FormFloat()
        self.index['f2'] = FormFloat()
        self.index['rolloff'] = FormFloat()
        self.index['tolerance'] = FormFloat()
        self.index['min_dur'] = FormFloat()
        self.index['max_dur'] = FormFloat()
        self.index['interval'] = FormFloat()
        
        self.index['0'] = FormFloat() # sigma
        self.index['1'] = FormFloat() # win_sz
        self.index['2'] = FormFloat() # smooth
        self.index['3'] = FormFloat() # det_thresh
        self.index['4'] = FormFloat() # det_thresh_hi
        self.index['5'] = FormFloat() # sel_thresh
        
        self.label = []
        for i in range(6):
            self.label.append(QLabel(''))

        self.method = self.idx_method.currentText()
        self.idx_method.currentIndexChanged.connect(self.update_values)

        form = QFormLayout(box1)
        form.addRow('Method',
                       self.idx_method)
        form.addRow('Lowcut (Hz)',
                       self.index['f1'])
        form.addRow('Highcut (Hz)',
                       self.index['f2'])
        form.addRow('Roll-off (Hz)',
                       self.index['rolloff'])
        
        form.addRow(self.label[0], self.index['0'])
        form.addRow(self.label[1], self.index['1'])
        form.addRow(self.label[2], self.index['2'])
        form.addRow(self.label[3], self.index['3'])
        form.addRow(self.label[4], self.index['4'])
        form.addRow(self.label[5], self.index['5'])

        form.addRow('Tolerance (sec)',
                       self.index['tolerance'])
        form.addRow('Min. duration (sec)',
                       self.index['min_dur'])
        form.addRow('Max. duration (sec)',
                       self.index['max_dur'])
        form.addRow('Min. interval (sec)',
                       self.index['interval'])
        
        box3 = QGroupBox('Options')

        self.index['excl_epoch'] = FormBool('Exclude Poor signal epochs')
        self.index['excl_event'] = FormMenu(['none', 'channel-specific', 
                                      'from any channel'])
        self.index['min_seg_dur'] = FormFloat(5)
        self.index['merge'] = FormBool('Merge events across channels')

        self.index['excl_epoch'].set_value(True)
        self.index['merge'].setCheckState(Qt.Unchecked)
        self.index['merge'].setEnabled(False)

        form = QFormLayout(box3)
        form.addRow(self.index['excl_epoch'])
        form.addRow('Exclude Artefact events', 
                    self.index['excl_event'])
        form.addRow('Minimum subsegment duration',
                       self.index['min_seg_dur'])
        form.addRow(self.index['merge'])

        box4 = QGroupBox('Pre-processing')
        
        self.index['resample'] = FormBool('Resample (polyphase)')
        self.index['rs_freq'] = FormInt()
        self.index['prep_filt'] = FormBool('Bandpass filter')
        self.index['prep_lc'] = FormFloat()
        self.index['prep_hc'] = FormFloat()
        self.index['detrend'] = FormBool('Detrend (linear)')
        
        rsbox = QHBoxLayout()
        rsbox.addWidget(self.index['rs_freq'])
        rsbox.addWidget(QLabel('Hz'))
        
        filtbox = QHBoxLayout()
        filtbox.addWidget(self.index['prep_lc'])
        filtbox.addWidget(QLabel('-'))
        filtbox.addWidget(self.index['prep_hc'])
        filtbox.addWidget(QLabel('Hz'))
        
        grid = QGridLayout(box4)
        #grid.addWidget(self.index['resample'], 0, 0)
        #grid.addLayout(rsbox, 0, 1)
        grid.addWidget(self.index['prep_filt'], 1, 0)
        grid.addLayout(filtbox, 1, 1)
        grid.addWidget(self.index['detrend'], 2, 0, 1, 2)        
        
        self.bbox.clicked.connect(self.button_clicked)

        btnlayout = QHBoxLayout()
        btnlayout.addStretch(1)
        btnlayout.addWidget(self.bbox)

        vlayout = QVBoxLayout()
        vlayout.addWidget(box1)
        vlayout.addWidget(box3)
        vlayout.addWidget(box4)
        vlayout.addStretch(1)
        vlayout.addLayout(btnlayout)

        hlayout = QHBoxLayout()
        hlayout.addWidget(box0)
        hlayout.addLayout(vlayout)

        self.update_values()
        self.setLayout(hlayout)
370092
def create_widgets(self):
        """"""
        self.bbox = QDialogButtonBox(
                QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
        self.idx_ok = self.bbox.button(QDialogButtonBox.Ok)
        self.idx_cancel = self.bbox.button(QDialogButtonBox.Cancel)

        self.idx_group = FormMenu([gr['name'] for gr in self.groups])

        chan_box = QListWidget()
        self.idx_chan = chan_box

        stage_box = QListWidget()
        stage_box.addItems(STAGE_NAME)
        stage_box.setSelectionMode(QAbstractItemView.ExtendedSelection)
        self.idx_stage = stage_box

        cycle_box = QListWidget()
        cycle_box.setSelectionMode(QAbstractItemView.ExtendedSelection)
        self.idx_cycle = cycle_box
581256
function() {
			// Insert the dialog's element to the root document.
			var element = this._.element;
			var definition = this.definition;
			if ( !( element.getParent() && element.getParent().equals( CKEDITOR.document.getBody() ) ) )
				element.appendTo( CKEDITOR.document.getBody() );
			else
				element.setStyle( 'display', 'block' );

			// First, set the dialog to an appropriate size.
			this.resize( this._.contentSize && this._.contentSize.width || definition.width || definition.minWidth, this._.contentSize && this._.contentSize.height || definition.height || definition.minHeight );

			// Reset all inputs back to their default value.
			this.reset();

			// Select the first tab by default.
			this.selectPage( this.definition.contents[ 0 ].id );

			// Set z-index.
			if ( CKEDITOR.dialog._.currentZIndex === null )
				CKEDITOR.dialog._.currentZIndex = this._.editor.config.baseFloatZIndex;
			this._.element.getFirst().setStyle( 'z-index', CKEDITOR.dialog._.currentZIndex += 10 );

			// Maintain the dialog ordering and dialog cover.
			if ( CKEDITOR.dialog._.currentTop === null ) {
				CKEDITOR.dialog._.currentTop = this;
				this._.parentDialog = null;
				showCover( this._.editor );

			} else {
				this._.parentDialog = CKEDITOR.dialog._.currentTop;
				var parentElement = this._.parentDialog.getElement().getFirst();
				parentElement.$.style.zIndex -= Math.floor( this._.editor.config.baseFloatZIndex / 2 );
				CKEDITOR.dialog._.currentTop = this;
			}

			element.on( 'keydown', accessKeyDownHandler );
			element.on( 'keyup', accessKeyUpHandler );

			// Reset the hasFocus state.
			this._.hasFocus = false;

			for ( var i in definition.contents ) {
				if ( !definition.contents[ i ] )
					continue;

				var content = definition.contents[ i ],
					tab = this._.tabs[ content.id ],
					requiredContent = content.requiredContent,
					enableElements = 0;

				if ( !tab )
					continue;

				for ( var j in this._.contents[ content.id ] ) {
					var elem = this._.contents[ content.id ][ j ];

					if ( elem.type == 'hbox' || elem.type == 'vbox' || !elem.getInputElement() )
						continue;

					if ( elem.requiredContent && !this._.editor.activeFilter.check( elem.requiredContent ) )
						elem.disable();
					else {
						elem.enable();
						enableElements++;
					}
				}

				if ( !enableElements || ( requiredContent && !this._.editor.activeFilter.check( requiredContent ) ) )
					tab[ 0 ].addClass( 'cke_dialog_tab_disabled' );
				else
					tab[ 0 ].removeClass( 'cke_dialog_tab_disabled' );
			}

			CKEDITOR.tools.setTimeout( function() {
				this.layout();
				resizeWithWindow( this );

				this.parts.dialog.setStyle( 'visibility', '' );

				// Execute onLoad for the first show.
				this.fireOnce( 'load', {} );
				CKEDITOR.ui.fire( 'ready', this );

				this.fire( 'show', {} );
				this._.editor.fire( 'dialogShow', this );

				if ( !this._.parentDialog )
					this._.editor.focusManager.lock();

				// Save the initial values of the dialog.
				this.foreach( function( contentObj ) {
					contentObj.setInitValue && contentObj.setInitValue();
				} );

			}, 100, this );
		}
366214
def create_widget(self):
        
        d = self.declaration
        button_type = UIButton.UIButtonTypeSystem if d.flat else UIButton.UIButtonTypeRoundedRect
        self.widget = UIButton(buttonWithType=button_type)
370793
def create_widget(self):
        
        d = self.declaration
        style = d.style if d.style else (
            '@attr/borderlessButtonStyle' if d.flat else '@attr/buttonStyle')
        self.widget = Button(self.get_context(), None, style)
983649
def formfield(self, **kwargs):
        
        from yacms.generic.forms import KeywordsWidget
        kwargs["widget"] = KeywordsWidget
        return super(KeywordsField, self).formfield(**kwargs)
769561
def create_widget(self):
        
        d = self.declaration
        self.widget = FloatingActionButton(self.get_context(), None, d.style)
1131481
def focusPrev(self, event):
        """"""
        try:
            event.widget.tk_focusPrev().focus_set()
        except TypeError:
            # see tkinter equivalent code for tk_focusPrev to see
            # commented original version
            name = event.widget.tk.call('tk_focusPrev', event.widget._w)
            event.widget._nametowidget(str(name)).focus_set()
622041
private void constructDialog() {
		if (getParentWindow() instanceof Frame) {
			dialog = new JDialog((Frame) getParentWindow(), getTitle(), modal);
		}
		else {
			dialog = new JDialog((Dialog) getParentWindow(), getTitle(), modal);
		}

		dialog.getContentPane().setLayout(new BorderLayout());
		dialog.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
		dialog.setResizable(resizable);

		initStandardCommands();
		addCancelByEscapeKey();
	}
804859
def prompt(text='', title='' , default='', root=None, timeout=None):
    """"""
    assert TKINTER_IMPORT_SUCCEEDED, 'Tkinter is required for pymsgbox'
    return __fillablebox(text, title, default=default, mask=None,root=root, timeout=timeout)
864216
def create_widget(self):
        
        d = self.declaration
        self.widget = TabLayout(self.get_context(), None, d.style)
1173339
def get_focus_widget(self):
        

        current_widget = QApplication.focusWidget()
        if current_widget is None:
            return False

        if current_widget.objectName() == "Script_Editor_Output_plainTextEdit" or \
                isinstance(current_widget, Editor):
            return current_widget
327174
def create_widget(self):
        
        d = self.declaration

        if self.indeterminate:
            #: Note: Style will only exist on activity indicators!
            style = ProgressBar.STYLES[d.size]
        else:
            style = ProgressBar.STYLE_HORIZONTAL
        self.widget = ProgressBar(self.get_context(), None, style)
1113383
def create_widget(self):
        
        d = self.declaration
        if d.text:
            Toast.makeText(self.get_context(),
                           d.text, 1).then(self.on_make_toast)
            self.made_toast = True
        else:
            self.toast = Toast(self.get_context())