Index: /CKEditor/branches/prototype/_source/plugins/dialog/plugin.js
===================================================================
--- /CKEditor/branches/prototype/_source/plugins/dialog/plugin.js	(revision 2498)
+++ /CKEditor/branches/prototype/_source/plugins/dialog/plugin.js	(revision 2499)
@@ -215,4 +215,12 @@
 		this.selectPage( this._.definition.contents[0].id );
 
+		// Reset all inputs back to their default value.
+		for ( var i in this._.contents )
+		{
+			var c = this._.contents[i];
+			if ( c.reset )
+				c.reset();
+		}
+
 		// Execute onLoad for the first show.
 		this.fireOnce( 'load', {} );
@@ -335,5 +343,14 @@
 			onClick : function( evt )
 			{
-				var ret = evt.data.dialog.fire( 'cancel', { hide : true } ).hide;
+				var dialog = evt.data.dialog,
+					ret = dialog.fire( 'cancel', { hide : true } ).hide;
+				for ( var i in dialog._.contents )
+				{
+					if ( dialog._.contents[i].isChanged() )
+					{
+						ret = ret && confirm( 'Some of the options have been changed. Are you sure to close the dialog?' );
+						break;
+					}
+				}
 				if ( ret !== false )
 					evt.data.dialog.hide();
@@ -660,5 +677,5 @@
 	isChanged : function()
 	{
-		// Override in subclasses.
+		// Override in input classes.
 		return false;
 	},
@@ -672,34 +689,4 @@
 CKEDITOR.ui.dialog.hbox.prototype = CKEDITOR.tools.extend( new CKEDITOR.ui.dialog.uiElement,
 	{
-		setValue : function( value )
-		{
-			var len = Math.min( value.length, this._.children.length );
-			for ( var i = 0 ; i < len ; i++ )
-				this._.children[i].setValue( value[i] );
-		},
-
-		getValue : function()
-		{
-			var retval = [];
-			for ( var i = 0 ; i < this._.children.length ; i++ )
-				retval.push( this._.children[i].getValue() );
-			return retval;
-		},
-
-		isChanged : function()
-		{
-			for ( var i = 0 ; i < this._.children.length ; i++ )
-			{
-				if ( this._.children[i].isChanged() )
-					return true;
-			}
-			return false;
-		},
-
-		focus : function()
-		{
-			this.getElement().focus();
-		},
-
 		getChild : function( indices )
 		{
Index: /CKEditor/branches/prototype/_source/plugins/dialogui/plugin.js
===================================================================
--- /CKEditor/branches/prototype/_source/plugins/dialogui/plugin.js	(revision 2498)
+++ /CKEditor/branches/prototype/_source/plugins/dialogui/plugin.js	(revision 2499)
@@ -21,302 +21,15 @@
 CKEDITOR.plugins.add( 'dialogui' );
 
-CKEDITOR.tools.extend( CKEDITOR.ui.dialog,
-	{
-		labeledElement : function( dialog, elementDefinition, htmlList, contentHtml )
-		{
-			if ( arguments.length < 4 )
-				return;
-
-			if ( !this._ )
-				this._ = {};
-			var children = this._.children = [];
-			var innerHTML = function()
-			{
-				var html = [ '<div class="cke_dialog_ui_labeled_label">',
-						CKEDITOR.tools.htmlEncode( elementDefinition.label ),
-						'</div>',
-						'<div class="cke_dialog_ui_labeled_content">',
-						contentHtml( dialog, elementDefinition ),
-						'</div>'
-					];
-				return html.join( '' );
-			};
-			CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition, htmlList, 'div', null, null, innerHTML );
-		},
-
-		textInput : function( dialog, elementDefinition, htmlList, stylesArg, attributesArg, contentsArg )
-		{
-			if ( arguments.length < 3 )
-				return;
-
-			if ( !this._ )
-				this._ = {};
-			var attributes = ( attributesArg && attributesArg.call ? attributesArg( elementDefinition ) : attributesArg ) || {},
-				id = this._.inputId = attributes.id || elementDefinition.id, 
-				styles = ( stylesArg && stylesArg.call ? stylesArg( elementDefinition ) : stylesArg ) || {},
-				inputContents = ( contentsArg && contentsArg.call ? contentsArg( dialog, elementDefinition) : contentsArg ) || '',
-				i;
-
-			// Set the id for the inner input element.
-			if ( id )
-			{
-				id = this._.inputId = id + '_textInput';
-				attributes.id = attributes.name = id;
-			}
-
-			// Set the type.
-			attributes.type = elementDefinition.type;
-
-			// Set the type and definition CSS class names.
-			var classes = {};
-			classes[ 'cke_dialog_ui_input_' + elementDefinition.type ] = 1;
-			if ( elementDefinition.className )
-				classes[ elementDefinition.className ] = 1;
-			var attributeClasses = ( attributes['class'] && attributes['class'].split ) ? attributes['class'].split( ' ' ) : [];
-			for ( i = 0 ; i < attributeClasses.length ; i++ )
-			{
-				if ( attributeClasses[i] )
-					classes[ attributeClasses[i] ] = 1;
-			}
-			var finalClasses = [];
-			for ( i in classes )
-				finalClasses.push( i );
-			attributes['class'] = finalClasses.join( ' ' );
-
-			// Set the default value.
-			if ( elementDefinition['default'] )
-				attributes.value = elementDefinition['default'];
-
-			// Write the inline CSS styles.
-			var styleStr = [];
-			for ( i in styles )
-				styleStr.push( i + ':' + styles[i] );
-			if ( styleStr.length > 0 )
-				attributes.style = styleStr.join( '; ' );
-
-			var innerHTML = function()
-			{
-				var html = [ '<input ' ];
-				for ( var i in attributes )
-					html.push( i + '="' + attributes[i] + '" ' );
-				html.push( '>', inputContents, '</input>' );
-				return html.join( '' );
-			};
-			CKEDITOR.ui.dialog.labeledElement.call( this, dialog, elementDefinition, htmlList, innerHTML );
-		},
-
-		checkbox : function( dialog, elementDefinition, htmlList )
-		{
-			if ( arguments.length < 3)
-				return;
-
-			if ( !this._ )
-				var _ = this._ = {};
-
-			var innerHTML = function()
-			{
-				var myDefinition = CKEDITOR.tools.extend( {}, elementDefinition,
-						{
-							id : elementDefinition.id ? elementDefinition.id + '_checkbox' : CKEDITOR.tools.getNextNumber() + '_checkbox',
-							title : null,
-							type : null
-						}, true ),
-					html = [],
-					attributes = { 'class' : 'cke_dialog_ui_checkbox_input', type : 'checkbox' };
-				if ( elementDefinition.checked )
-					attributes.checked = 'checked';
-				_.checkbox = new CKEDITOR.ui.dialog.uiElement( dialog, myDefinition, html, 'input', null, attributes );
-				html.push( ' ', CKEDITOR.tools.htmlEncode( elementDefinition.label ) );
-				return html.join( '' );
-			};
-
-			CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition, htmlList, 'label', null, null, innerHTML );
-		},
-
-		radio : function( dialog, elementDefinition, htmlList )
-		{
-			if ( arguments.length < 3)
-				return;
-
-			if ( !this._ )
-				this._ = {};
-			var children = [];
-
-			var innerHTML = function()
-			{
-				var inputHtmlList = [], html = [],
-					commonAttributes = { 'class' : 'cke_dialog_ui_radio_item' },
-					commonName = elementDefinition.id ? elementDefinition.id + '_radio' : CKEDITOR.tools.getNextNumber() + '_radio';
-				for ( var i = 0 ; i < elementDefinition.items.length ; i++ )
-				{
-					var item = elementDefinition.items[i],
-						inputDefinition = CKEDITOR.tools.extend( {}, elementDefinition,
-								{
-									id : CKEDITOR.tools.getNextNumber() + '_radio_input',
-									title : null,
-									type : null
-								}, true ),
-						labelDefinition = CKEDITOR.tools.extend( {}, inputDefinition,
-								{
-									id : null,
-									title : item[2]
-								}, true ),
-						inputHtml = [],
-						inputAttributes = 
-						{
-							type : 'radio',
-							'class' : 'cke_dialog_ui_radio_input',
-							name : commonName,
-							value : item[1]
-						};
-					if ( elementDefinition['default'] == item[1] )
-						inputAttributes.checked = 'checked';
-					children.push( new CKEDITOR.ui.dialog.uiElement( dialog, inputDefinition, inputHtml, 'input', null, inputAttributes ) );
-					new CKEDITOR.ui.dialog.uiElement( dialog, labelDefinition, inputHtmlList, 'label', null, null,
-						   inputHtml.join( '' ) + ' ' + item[0] );
-				}
-				new CKEDITOR.ui.dialog.hbox( dialog, [], inputHtmlList, html );
-				return html.join( '' );
-			};
-
-			CKEDITOR.ui.dialog.labeledElement.call( this, dialog, elementDefinition, htmlList, innerHTML );
-		},
-
-		button : function( dialog, elementDefinition, htmlList )
-		{
-			if ( arguments.length < 3)
-				return;
-
-			if ( !this._ )
-				this._ = {};
-
-			var innerHTML = function()
-			{
-				return [ '<tbody><tr><td class="cke_dialog_ui_button_txt">',
-					   CKEDITOR.tools.htmlEncode( elementDefinition.label ),
-					   '</td></tr></tbody>' ].join( '' );
-			};
-
-			// Add OnClick event to this input.
-			CKEDITOR.event.implementOn( this );
-			if ( elementDefinition.onClick )
-				this.on( 'click', elementDefinition.onClick );
-
-			// Register an event handler for processing button clicks.
-			var me = this;
-			dialog.on( 'load', function( eventInfo )
-					{
-						var element = this.getElement();
-						element.on( 'mousedown', function( evt )
-							{
-								// Change styles to indicate the button is being clicked.
-								var target = evt.data.getTarget();
-								target.addClass( 'cke_dialog_ui_button_active' );
-
-								// Store the currently active button.
-								CKEDITOR.ui.dialog.button._.activeButton = [ me, target ];
-							});
-
-						// IE BUG: Padding attributes are ignored for <td> cells.
-						if ( CKEDITOR.env.ie )
-							element.getChild( [0, 0, 0] ).$.innerHTML += '';
-
-						if ( !eventInfo.data.buttonHandlerRegistered )
-						{
-							CKEDITOR.document.on( 'mouseup', function( evt )
-								{
-									var target = evt.data.getTarget();
-
-									// If there's no active button, bail out.
-									if ( !CKEDITOR.ui.dialog.button._.activeButton )
-										return;
-
-									// Change styles to remove active status.
-									CKEDITOR.ui.dialog.button._.activeButton[1].removeClass( 'cke_dialog_ui_button_active' );
-
-									// Fire the click event - but only if the
-									// active button is the same as target.
-									if ( CKEDITOR.ui.dialog.button._.activeButton[1].$ == target.$ )
-										CKEDITOR.ui.dialog.button._.activeButton[0].fire( 'click', { dialog : dialog } );
-
-									// Clear active button flag.
-									CKEDITOR.ui.dialog.button._.activeButton = null;
-								});
-
-							eventInfo.data.buttonHandlerRegistered = true;
-						}
-
-						this.getElement().unselectable();
-					}, this );
-
-			CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition, htmlList, 'table', null, null, innerHTML );
-		},
-
-		html : function( dialog, elementDefinition, htmlList )
-		{
-			if ( arguments.length < 3 )
-				return;
-
-			CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition, htmlList, 'span', null, null, elementDefinition.html );
-		}
-	}, true);
-
-CKEDITOR.ui.dialog.textInput.prototype = CKEDITOR.tools.extend( new CKEDITOR.ui.dialog.labeledElement,
-		{
-			getElement : function()
-			{
-				return CKEDITOR.document.getById( this._.inputId );
-			}
-		}, true );
-
-CKEDITOR.ui.dialog.checkbox.prototype = CKEDITOR.tools.extend( new CKEDITOR.ui.dialog.uiElement,
-		{
-			getElement : function()
-			{
-				return this._.checkbox.getElement();
-			},
-
-			setValue : function( checked )
-			{
-				this.getElement().$.checked = checked;
-			},
-
-			getValue : function()
-			{
-				return this.getElement().$.checked;
-			}
-		}, true );
-
-CKEDITOR.ui.dialog.radio.prototype = CKEDITOR.tools.extend( new CKEDITOR.ui.dialog.uiElement,
-		{
-			setValue : function( value )
-			{
-				var children = this._.children,
-					item;
-				for ( var i = 0 ; ( i < children.length ) && ( item = children[i] ) ; i++ )
-					item.$.checked = ( item.getValue() == value );
-			},
-
-			getValue : function()
-			{
-				var children = this._.children;
-				for ( var i = 0 ; i < children.length ; i++ )
-				{
-					if ( children[i].$.checked )
-						return children[i].getValue();
-				}
-				return null;
-			}
-		}, true );
-
-CKEDITOR.ui.dialog.labeledElement.prototype
-	= CKEDITOR.ui.dialog.button.prototype
-	= CKEDITOR.ui.dialog.html.prototype = new CKEDITOR.ui.dialog.uiElement;
-
-CKEDITOR.ui.dialog.button._ = { activeButton : null };
-
 (function()
 {
-	var textBuilder = 
+	var initPrivateObject = function( elementDefinition )
+	{
+		if ( !this._ )
+			this._ = {};
+		if ( 'default' in elementDefinition )
+			this._['default'] = elementDefinition['default'];
+		return this._;
+	},
+	textBuilder = 
 	{
 		build : function( dialog, elementDefinition, output )
@@ -331,5 +44,318 @@
 			return new CKEDITOR.ui.dialog[elementDefinition.type]( dialog, elementDefinition, output );
 		}
+	},
+	commonPrototype =
+	{
+		isChanged : function()
+		{
+			return this.getValue() != this._['default'];
+		},
+
+		reset: function()
+		{
+			this.setValue( this._['default'] );
+		}
 	};
+
+	CKEDITOR.tools.extend( CKEDITOR.ui.dialog,
+		{
+			labeledElement : function( dialog, elementDefinition, htmlList, contentHtml )
+			{
+				if ( arguments.length < 4 )
+					return;
+
+				initPrivateObject.call( this, elementDefinition );
+				var children = this._.children = [];
+				var innerHTML = function()
+				{
+					var html = [ '<div class="cke_dialog_ui_labeled_label">',
+							CKEDITOR.tools.htmlEncode( elementDefinition.label ),
+							'</div>',
+							'<div class="cke_dialog_ui_labeled_content">',
+							contentHtml( dialog, elementDefinition ),
+							'</div>'
+						];
+					return html.join( '' );
+				};
+				CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition, htmlList, 'div', null, null, innerHTML );
+			},
+
+			textInput : function( dialog, elementDefinition, htmlList, stylesArg, attributesArg, contentsArg )
+			{
+				if ( arguments.length < 3 )
+					return;
+
+				initPrivateObject.call( this, elementDefinition );
+				var attributes = ( attributesArg && attributesArg.call ? attributesArg( elementDefinition ) : attributesArg ) || {},
+					id = this._.inputId = attributes.id || elementDefinition.id, 
+					styles = ( stylesArg && stylesArg.call ? stylesArg( elementDefinition ) : stylesArg ) || {},
+					inputContents = ( contentsArg && contentsArg.call ? contentsArg( dialog, elementDefinition) : contentsArg ) || '',
+					i;
+
+				// Set the default value.
+				if ( !( 'default' in this._ ) )
+					this._['default'] = '';
+
+				// Set the id for the inner input element.
+				if ( id )
+				{
+					id = this._.inputId = id + '_textInput';
+					attributes.id = attributes.name = id;
+				}
+
+				// Set the type.
+				attributes.type = elementDefinition.type;
+
+				// Set the type and definition CSS class names.
+				var classes = {};
+				classes[ 'cke_dialog_ui_input_' + elementDefinition.type ] = 1;
+				if ( elementDefinition.className )
+					classes[ elementDefinition.className ] = 1;
+				var attributeClasses = ( attributes['class'] && attributes['class'].split ) ? attributes['class'].split( ' ' ) : [];
+				for ( i = 0 ; i < attributeClasses.length ; i++ )
+				{
+					if ( attributeClasses[i] )
+						classes[ attributeClasses[i] ] = 1;
+				}
+				var finalClasses = [];
+				for ( i in classes )
+					finalClasses.push( i );
+				attributes['class'] = finalClasses.join( ' ' );
+
+				// Set the default value.
+				if ( elementDefinition['default'] )
+					attributes.value = elementDefinition['default'];
+
+				// Write the inline CSS styles.
+				var styleStr = [];
+				for ( i in styles )
+					styleStr.push( i + ':' + styles[i] );
+				if ( styleStr.length > 0 )
+					attributes.style = styleStr.join( '; ' );
+
+				var innerHTML = function()
+				{
+					var html = [ '<input ' ];
+					for ( var i in attributes )
+						html.push( i + '="' + attributes[i] + '" ' );
+					html.push( '>', inputContents, '</input>' );
+					return html.join( '' );
+				};
+				CKEDITOR.ui.dialog.labeledElement.call( this, dialog, elementDefinition, htmlList, innerHTML );
+			},
+
+			checkbox : function( dialog, elementDefinition, htmlList )
+			{
+				if ( arguments.length < 3)
+					return;
+
+				var _ = initPrivateObject.call( this, elementDefinition );
+				this._['default'] = elementDefinition.checked || false;
+
+				var innerHTML = function()
+				{
+					var myDefinition = CKEDITOR.tools.extend( {}, elementDefinition,
+							{
+								id : elementDefinition.id ? elementDefinition.id + '_checkbox' : CKEDITOR.tools.getNextNumber() + '_checkbox',
+								title : null,
+								type : null
+							}, true ),
+						html = [],
+						attributes = { 'class' : 'cke_dialog_ui_checkbox_input', type : 'checkbox' };
+					if ( elementDefinition.checked )
+						attributes.checked = 'checked';
+					_.checkbox = new CKEDITOR.ui.dialog.uiElement( dialog, myDefinition, html, 'input', null, attributes );
+					html.push( ' ', CKEDITOR.tools.htmlEncode( elementDefinition.label ) );
+					return html.join( '' );
+				};
+
+				CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition, htmlList, 'label', null, null, innerHTML );
+			},
+
+			radio : function( dialog, elementDefinition, htmlList )
+			{
+				if ( arguments.length < 3)
+					return;
+
+				initPrivateObject.call( this, elementDefinition );
+				if ( !( 'default' in this._ ) )
+					this._['default'] = elementDefinition.items[0][1] ;
+				var children = [];
+
+				var innerHTML = function()
+				{
+					var inputHtmlList = [], html = [],
+						commonAttributes = { 'class' : 'cke_dialog_ui_radio_item' },
+						commonName = elementDefinition.id ? elementDefinition.id + '_radio' : CKEDITOR.tools.getNextNumber() + '_radio';
+					for ( var i = 0 ; i < elementDefinition.items.length ; i++ )
+					{
+						var item = elementDefinition.items[i],
+							inputDefinition = CKEDITOR.tools.extend( {}, elementDefinition,
+									{
+										id : CKEDITOR.tools.getNextNumber() + '_radio_input',
+										title : null,
+										type : null
+									}, true ),
+							labelDefinition = CKEDITOR.tools.extend( {}, inputDefinition,
+									{
+										id : null,
+										title : item[2]
+									}, true ),
+							inputHtml = [],
+							inputAttributes = 
+							{
+								type : 'radio',
+								'class' : 'cke_dialog_ui_radio_input',
+								name : commonName,
+								value : item[1]
+							};
+						if ( elementDefinition['default'] == item[1] )
+							inputAttributes.checked = 'checked';
+						children.push( new CKEDITOR.ui.dialog.uiElement( dialog, inputDefinition, inputHtml, 'input', null, inputAttributes ) );
+						new CKEDITOR.ui.dialog.uiElement( dialog, labelDefinition, inputHtmlList, 'label', null, null,
+							   inputHtml.join( '' ) + ' ' + item[0] );
+					}
+					new CKEDITOR.ui.dialog.hbox( dialog, [], inputHtmlList, html );
+					return html.join( '' );
+				};
+
+				CKEDITOR.ui.dialog.labeledElement.call( this, dialog, elementDefinition, htmlList, innerHTML );
+				this._.children = children;
+			},
+
+			button : function( dialog, elementDefinition, htmlList )
+			{
+				if ( arguments.length < 3)
+					return;
+
+				initPrivateObject.call( this, elementDefinition );
+
+				var innerHTML = function()
+				{
+					return [ '<tbody><tr><td class="cke_dialog_ui_button_txt">',
+						   CKEDITOR.tools.htmlEncode( elementDefinition.label ),
+						   '</td></tr></tbody>' ].join( '' );
+				};
+
+				// Add OnClick event to this input.
+				CKEDITOR.event.implementOn( this );
+				if ( elementDefinition.onClick )
+					this.on( 'click', elementDefinition.onClick );
+
+				// Register an event handler for processing button clicks.
+				var me = this;
+				dialog.on( 'load', function( eventInfo )
+						{
+							var element = this.getElement();
+							element.on( 'mousedown', function( evt )
+								{
+									// Change styles to indicate the button is being clicked.
+									var target = evt.data.getTarget();
+									target.addClass( 'cke_dialog_ui_button_active' );
+
+									// Store the currently active button.
+									CKEDITOR.ui.dialog.button._.activeButton = [ me, target ];
+								});
+
+							// IE BUG: Padding attributes are ignored for <td> cells.
+							if ( CKEDITOR.env.ie )
+								element.getChild( [0, 0, 0] ).$.innerHTML += '';
+
+							if ( !eventInfo.data.buttonHandlerRegistered )
+							{
+								CKEDITOR.document.on( 'mouseup', function( evt )
+									{
+										var target = evt.data.getTarget();
+
+										// If there's no active button, bail out.
+										if ( !CKEDITOR.ui.dialog.button._.activeButton )
+											return;
+
+										// Change styles to remove active status.
+										CKEDITOR.ui.dialog.button._.activeButton[1].removeClass( 'cke_dialog_ui_button_active' );
+
+										// Fire the click event - but only if the
+										// active button is the same as target.
+										if ( CKEDITOR.ui.dialog.button._.activeButton[1].$ == target.$ )
+											CKEDITOR.ui.dialog.button._.activeButton[0].fire( 'click', { dialog : dialog } );
+
+										// Clear active button flag.
+										CKEDITOR.ui.dialog.button._.activeButton = null;
+									});
+
+								eventInfo.data.buttonHandlerRegistered = true;
+							}
+
+							this.getElement().unselectable();
+						}, this );
+
+				CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition, htmlList, 'table', null, null, innerHTML );
+			},
+
+			html : function( dialog, elementDefinition, htmlList )
+			{
+				if ( arguments.length < 3 )
+					return;
+
+				CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition, htmlList, 'span', null, null, elementDefinition.html );
+			}
+		}, true);
+
+	CKEDITOR.ui.dialog.labeledElement.prototype
+		= CKEDITOR.ui.dialog.button.prototype
+		= CKEDITOR.ui.dialog.html.prototype = new CKEDITOR.ui.dialog.uiElement;
+
+	CKEDITOR.ui.dialog.textInput.prototype = CKEDITOR.tools.extend( new CKEDITOR.ui.dialog.labeledElement,
+			{
+				getElement : function()
+				{
+					return CKEDITOR.document.getById( this._.inputId );
+				}
+			}, commonPrototype, true );
+
+	CKEDITOR.ui.dialog.checkbox.prototype = CKEDITOR.tools.extend( new CKEDITOR.ui.dialog.uiElement,
+			{
+				getElement : function()
+				{
+					return this._.checkbox.getElement();
+				},
+
+				setValue : function( checked )
+				{
+					this.getElement().$.checked = checked;
+				},
+
+				getValue : function()
+				{
+					return this.getElement().$.checked;
+				}
+			}, commonPrototype, true );
+
+	CKEDITOR.ui.dialog.radio.prototype = CKEDITOR.tools.extend( new CKEDITOR.ui.dialog.uiElement,
+			{
+				setValue : function( value )
+				{
+					console.log( 'Radio button... children length=' + this._.children.length );
+					var children = this._.children,
+						item;
+					for ( var i = 0 ; ( i < children.length ) && ( item = children[i] ) ; i++ )
+					{
+						item.getElement().$.checked = ( item.getValue() == value );
+					}
+				},
+
+				getValue : function()
+				{
+					var children = this._.children;
+					for ( var i = 0 ; i < children.length ; i++ )
+					{
+						if ( children[i].getElement().$.checked )
+							return children[i].getValue();
+					}
+					return null;
+				}
+			}, commonPrototype, true );
+
+	CKEDITOR.ui.dialog.button._ = { activeButton : null };
 
 	CKEDITOR.dialog.addUIElement( 'text', textBuilder );
