Author: sh-sh-sh
Date: Mon Jun 18 17:26:25 2007
New Revision: 38510
URL: http://svn.opensuse.org/viewcvs/yast?rev=38510&view=rev
Log:
migrated PushButton
Modified:
branches/tmp/sh/mod-ui/core/libyui/src/YPushButton.cc
branches/tmp/sh/mod-ui/core/libyui/src/YPushButton.h
branches/tmp/sh/mod-ui/core/libyui/src/YUI.h
branches/tmp/sh/mod-ui/core/libyui/src/YUI_widgets.cc
branches/tmp/sh/mod-ui/core/libyui/src/YWidgetFactory.cc
branches/tmp/sh/mod-ui/core/libyui/src/YWidgetFactory.h
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YPushButton.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YPushButton.cc?rev=38510&r1=38509&r2=38510&view=diff
==============================================================================
Files branches/tmp/sh/mod-ui/core/libyui/src/YPushButton.cc (original) and branches/tmp/sh/mod-ui/core/libyui/src/YPushButton.cc Mon Jun 18 17:26:25 2007 differ
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YPushButton.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YPushButton.h?rev=38510&r1=38509&r2=38510&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YPushButton.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YPushButton.h Mon Jun 18 17:26:25 2007
@@ -23,6 +23,8 @@
class YPushButtonPrivate;
+using std::string;
+
class YPushButton : public YWidget
{
@@ -30,7 +32,7 @@
/**
* Constructor.
**/
- YPushButton( const YWidgetOpt & opt, const std::string & label );
+ YPushButton( YWidget * parent, const string & label );
/**
* Destructor.
@@ -46,7 +48,7 @@
/**
* Get the label (the text on the RadioButton).
**/
- std::string label() const;
+ string label() const;
/**
* Set the label (the text on the button).
@@ -54,7 +56,7 @@
* Derived classes are free to reimplement this, but they should call this
* base class method at the end of the overloaded function.
**/
- virtual void setLabel( const std::string & label );
+ virtual void setLabel( const string & label );
/**
* Returns 'true' if this is the dialog's default button, i.e. the one
@@ -64,13 +66,21 @@
bool isDefaultButton() const;
/**
+ * Make this button the default button.
+ *
+ * Derived classes should reimplement this, but call this base class
+ * function in the overwritten function.
+ **/
+ virtual void setDefaultButton( bool def = true );
+
+ /**
* Set this button's icon from an icon file in the UI's default icon
* directory. Clear the icon if the name is empty.
*
* This default implementation does nothing.
* UIs that can handle icons can choose to overwrite this method.
**/
- virtual void setIcon( const std::string & iconName ) {}
+ virtual void setIcon( const string & iconName ) {}
/**
* Set a property.
@@ -78,7 +88,7 @@
*
* This method may throw YUIPropertyExceptions.
**/
- virtual void setProperty( const std::string & propertyName,
+ virtual void setProperty( const string & propertyName,
const YPropertyValue & val );
/**
@@ -87,7 +97,7 @@
*
* This method may throw YUIPropertyExceptions.
**/
- virtual YPropertyValue getProperty( const std::string & propertyName );
+ virtual YPropertyValue getProperty( const string & propertyName );
/**
* Return this class's property set.
@@ -102,14 +112,14 @@
*
* Reimplemented from YWidget.
**/
- virtual std::string shortcutString() { return label(); }
+ virtual string shortcutString() { return label(); }
/**
* Set the string of this widget that holds the keyboard shortcut.
*
* Reimplemented from YWidget.
**/
- virtual void setShortcutString( const std::string & str )
+ virtual void setShortcutString( const string & str )
{ setLabel( str ); }
@@ -119,4 +129,7 @@
};
+typedef YPushButton YIconButton;
+
+
#endif // YPushButton_h
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YUI.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YUI.h?rev=38510&r1=38509&r2=38510&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YUI.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YUI.h Mon Jun 18 17:26:25 2007
@@ -562,12 +562,6 @@
const YCPString & label, int visibleLines, int maxLines ) = 0;
/**
- * Creates a push button.
- * @param label Label of the button
- */
- virtual YWidget *createPushButton( YWidget *parent, YWidgetOpt & opt, const std::string & label ) = 0;
-
- /**
* Creates a menu button.
* @param label Label of the button
*/
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YUI_widgets.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YUI_widgets.cc?rev=38510&r1=38509&r2=38510&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YUI_widgets.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YUI_widgets.cc Mon Jun 18 17:26:25 2007
@@ -1258,10 +1258,12 @@
opt.key_Fxx.setValue( defaultFunctionKey( YCPString( label ) ) );
- YPushButton * button = dynamic_cast