[rkward-cvs] SF.net SVN: rkward: [1928] trunk/rkward/rkward

tfry at users.sourceforge.net tfry at users.sourceforge.net
Thu Jun 7 15:27:11 UTC 2007


Revision: 1928
          http://svn.sourceforge.net/rkward/?rev=1928&view=rev
Author:   tfry
Date:     2007-06-07 08:27:11 -0700 (Thu, 07 Jun 2007)

Log Message:
-----------
Allow to toggle the two parts of the view

Modified Paths:
--------------
    trunk/rkward/rkward/robjectviewer.cpp
    trunk/rkward/rkward/robjectviewer.h

Modified: trunk/rkward/rkward/robjectviewer.cpp
===================================================================
--- trunk/rkward/rkward/robjectviewer.cpp	2007-06-07 15:15:05 UTC (rev 1927)
+++ trunk/rkward/rkward/robjectviewer.cpp	2007-06-07 15:27:11 UTC (rev 1928)
@@ -66,14 +66,24 @@
 	connect (update_button, SIGNAL (clicked ()), this, SLOT (update ()));
 	connect (cancel_button, SIGNAL (clicked ()), this, SLOT (cancel ()));
 
-	new QLabel (i18n("\nResult of 'summary (%1)':\n").arg (object->getFullName ()), box);
+	QHBox *row = new QHBox (box);
+	QLabel *label = new QLabel (i18n("\nResult of 'summary (%1)':\n").arg (object->getFullName ()), row);
+	row->setStretchFactor (label, 10);
+	toggle_summary_button = new QPushButton (i18n ("Hide"), row);
+	connect (toggle_summary_button, SIGNAL (clicked ()), this, SLOT (toggleSummary ()));
+
 	summary_area = new QTextEdit (box);
 	summary_area->setTextFormat (PlainText);
 	summary_area->setReadOnly (true);
 	summary_area->setCurrentFont (font);
 	summary_area->setWordWrap (QTextEdit::NoWrap);
 
-	new QLabel (i18n("\nResult of 'print (%1)':\n").arg (object->getFullName ()), box);
+	row = new QHBox (box);
+	label = new QLabel (i18n("\nResult of 'print (%1)':\n").arg (object->getFullName ()), row);
+	row->setStretchFactor (label, 10);
+	toggle_print_button = new QPushButton (i18n ("Hide"), row);
+	connect (toggle_print_button, SIGNAL (clicked ()), this, SLOT (togglePrint ()));
+
 	print_area = new QTextEdit (box);
 	print_area->setTextFormat (PlainText);
 	print_area->setReadOnly (true);
@@ -91,6 +101,28 @@
 	RK_TRACE (APP);
 }
 
+void RObjectViewer::toggleSummary () {
+	RK_TRACE (APP);
+
+	summary_area->setShown (!summary_area->isShown ());
+	if (summary_area->isShown ()) {
+		toggle_summary_button->setText (i18n ("Hide"));
+	} else {
+		toggle_summary_button->setText (i18n ("Show"));
+	}
+}
+
+void RObjectViewer::togglePrint () {
+	RK_TRACE (APP);
+
+	print_area->setShown (!print_area->isShown ());
+	if (print_area->isShown ()) {
+		toggle_print_button->setText (i18n ("Hide"));
+	} else {
+		toggle_print_button->setText (i18n ("Show"));
+	}
+}
+
 void RObjectViewer::cancel () {
 	RK_TRACE (APP);
 

Modified: trunk/rkward/rkward/robjectviewer.h
===================================================================
--- trunk/rkward/rkward/robjectviewer.h	2007-06-07 15:15:05 UTC (rev 1927)
+++ trunk/rkward/rkward/robjectviewer.h	2007-06-07 15:27:11 UTC (rev 1928)
@@ -43,6 +43,8 @@
 public slots:
 	void cancel ();
 	void update ();
+	void toggleSummary ();
+	void togglePrint ();
 	void objectRemoved (RObject *object);
 protected:
 	friend class RKWorkplace;
@@ -55,6 +57,8 @@
 	QLabel *description_label;
 	QPushButton *update_button;
 	QPushButton *cancel_button;
+	QPushButton *toggle_summary_button;
+	QPushButton *toggle_print_button;
 	QTextEdit *print_area;
 	QTextEdit *summary_area;
 	QString caption;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list