[Uml-devel] CVS: kdesdk/umbrello/umbrello umbrelloui.rc,1.1,1.2 uml.cpp,1.5,1.6 umlview.cpp,1.7,1.8

kde at office.kde.org kde at office.kde.org
Fri Jan 31 11:58:02 UTC 2003


Update of /home/kde/kdesdk/umbrello/umbrello
In directory office:/tmp/cvs-serv12175

Modified Files:
	umbrelloui.rc uml.cpp umlview.cpp 
Log Message:
Added zoom buttons to toolbar


Index: umbrelloui.rc
===================================================================
RCS file: /home/kde/kdesdk/umbrello/umbrello/umbrelloui.rc,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- umbrelloui.rc	27 Jan 2003 15:23:22 -0000	1.1
+++ umbrelloui.rc	31 Jan 2003 19:57:10 -0000	1.2
@@ -38,4 +38,8 @@
     <Action name="class_wizard"/>
   </Menu>
 </MenuBar>
+<ToolBar name="mainToolBar">
+  <Action name="umbrello_zoom_in"/>
+  <Action name="umbrello_zoom_out"/>
+</ToolBar>
 </kpartgui>

Index: uml.cpp
===================================================================
RCS file: /home/kde/kdesdk/umbrello/umbrello/uml.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- uml.cpp	31 Jan 2003 00:10:15 -0000	1.5
+++ uml.cpp	31 Jan 2003 19:57:10 -0000	1.6
@@ -144,10 +144,8 @@
 	viewStatusBar = KStdAction::showStatusbar(this, SLOT(slotViewStatusBar()), actionCollection());
 	selectAll = KStdAction::selectAll(this,  SLOT( slotSelectAll() ), actionCollection());
 
-//FIXME - add UI if you want to have zoom in/out by clicking on the diagram
-// note that resultating zoom could not correspond to one of the predefined values if you dont watch the zooming step size
-	//zoomInAction = new KAction(i18n("Zoom In"),"file_new",0,this,SLOT(zoomIn()),actionCollection(),"zoom_in");
-	//zoomOutAction = new KAction(i18n("Zoom Out"),0,this,SLOT(zoomOut()),actionCollection(),"zoom_out");
+	zoomInAction = KStdAction::zoomIn(this,  SLOT( zoomIn() ), actionCollection(), "umbrello_zoom_in");
+	zoomOutAction = KStdAction::zoomOut(this,  SLOT( zoomOut() ), actionCollection(), "umbrello_zoom_out");
 
 	classWizard = new KAction(i18n("New Class Wizard..."),0,this,SLOT(slotClassWizard()),
 	                          actionCollection(),"class_wizard");
@@ -234,7 +232,7 @@
 
 	showDocumentation->setChecked( optionState.uiState.showDocWindow );
 	showDocumentation->setStatusText( i18n( "Enables/disables the documentation window" ) );
-	// use the absolute path to your umlui.rc file for testing purpose in createGUI();
+	// use the absolute path to your umbrelloui.rc file for testing purpose in createGUI();
 	createGUI();
 
 }
@@ -248,7 +246,7 @@
 void UMLApp::setupZoomMenu()
 {
 	int zoom = doc->getCurrentView()->currentZoom();
-	
+
 	//first uncheck all
 	for(int index = 0; index < zoomSelect->count(); index++)
 		zoomSelect->setItemChecked(zoomSelect->idAt(index),false);

Index: umlview.cpp
===================================================================
RCS file: /home/kde/kdesdk/umbrello/umbrello/umlview.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- umlview.cpp	31 Jan 2003 00:10:15 -0000	1.7
+++ umlview.cpp	31 Jan 2003 19:57:10 -0000	1.8
@@ -2710,8 +2710,7 @@
 	emit sigShowGridToggled( m_pData->getShowSnapGrid() );
 }
 
-void UMLView::setZoom(int zoom)
-{
+void UMLView::setZoom(int zoom) {
 	if(zoom<10) zoom = 10;
 	else if (zoom > 500) zoom = 500;
 
@@ -2720,24 +2719,21 @@
 	setWorldMatrix(wm);
 }
 
-int UMLView::currentZoom()
-{
+int UMLView::currentZoom() {
 	return (int)(worldMatrix().m11()*100.0);
 }
 
 
-void UMLView::zoomIn()
-{
+void UMLView::zoomIn() {
 	QWMatrix wm = worldMatrix();
-	wm.scale(2.0,2.0); // adjust zooming step here
+	wm.scale(1.5,1.5); // adjust zooming step here
 	setWorldMatrix(wm);
 }
 
-void UMLView::zoomOut()
-{
+void UMLView::zoomOut() {
 	QWMatrix wm = worldMatrix();
-	wm.scale(0.5,0.5); //adjust zooming step here
+	wm.scale(2.0/3.0, 2.0/3.0); //adjust zooming step here
 	setWorldMatrix(wm);
 }
 
-#include "umlview.moc"
\ No newline at end of file
+#include "umlview.moc"





More information about the umbrello-devel mailing list