From: mkr Date: Thu, 14 May 2015 07:03:48 +0000 (+0300) Subject: refs #514: add 'Cursor for specific operations' section into preferences of HYDRO... X-Git-Tag: v1.4.1~21^2~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=125ff943c035d5e5fd7bd2b55f6e1e5d04ea3d19;p=modules%2Fhydro.git refs #514: add 'Cursor for specific operations' section into preferences of HYDRO module. --- diff --git a/src/HYDROGUI/HYDROGUI_Module.cxx b/src/HYDROGUI/HYDROGUI_Module.cxx index e0f4f8c8..a9690cdb 100644 --- a/src/HYDROGUI/HYDROGUI_Module.cxx +++ b/src/HYDROGUI/HYDROGUI_Module.cxx @@ -83,6 +83,7 @@ #include #include #include +#include #include #include @@ -706,6 +707,30 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient, theMenu->addAction( action( EditLocalCSId ) ); } +void HYDROGUI_Module::createPreferences() +{ + int genTab = addPreference( tr( "PREF_TAB_GENERAL" ) ); + int CursorGroup = addPreference( tr( "PREF_GROUP_CURSOR" ), genTab ); + + int typeOfCursor = addPreference( tr( "PREF_TYPE_OF_CURSOR" ), CursorGroup, + LightApp_Preferences::Selector, "preferences", "type_of_cursor" ); + + // Set property cursor type + QList aCursorTypeIndicesList; + QList aCursorTypeIconsList; + + SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); + for ( int i = CT_ArrowCursor; i < CT_User; i++ ) { + QString icoFile = QString( "ICON_CURSOR_%1" ).arg( i+1 ); + QPixmap pixmap = resMgr->loadPixmap( "HYDRO", tr( qPrintable( icoFile ) ) ); + aCursorTypeIndicesList << i; + aCursorTypeIconsList << pixmap; + } + + setPreferenceProperty( typeOfCursor, "indexes", aCursorTypeIndicesList ); + setPreferenceProperty( typeOfCursor, "icons", aCursorTypeIconsList ); +} + void HYDROGUI_Module::update( const int flags ) { if( !isUpdateEnabled() ) diff --git a/src/HYDROGUI/HYDROGUI_Module.h b/src/HYDROGUI/HYDROGUI_Module.h index b0dbd20c..6aa6f6da 100644 --- a/src/HYDROGUI/HYDROGUI_Module.h +++ b/src/HYDROGUI/HYDROGUI_Module.h @@ -57,6 +57,29 @@ class HYDROGUI_Module : public LightApp_Module enum CustomEvent { NewViewEvent = QEvent::User + 100 }; + enum CursorType + { + CT_ArrowCursor = 0, + CT_UpArrowCursor, + CT_CrossCursor, + CT_IBeamCursor, + CT_WaitCursor, + CT_BusyCursor, + CT_ForbiddenCursor, + CT_PointingHandCursor, + CT_WhatsThisCursor, + CT_SizeVerCursor, + CT_SizeHorCursor, + CT_SizeBDiagCursor, + CT_SizeFDiagCursor, + CT_SizeAllCursor, + CT_SplitVCursor, + CT_SplitHCursor, + CT_OpenHandCursor, + CT_ClosedHandCursor, + CT_User + }; + public: enum ViewManagerRole @@ -101,6 +124,7 @@ public: virtual void viewManagers( QStringList& ) const; virtual void contextMenuPopup( const QString&, QMenu*, QString& ); + virtual void createPreferences(); virtual void update( const int ); virtual void updateCommandsStatus(); diff --git a/src/HYDROGUI/resources/HYDROGUI_images.ts b/src/HYDROGUI/resources/HYDROGUI_images.ts index dbbf4380..ef3bea3e 100644 --- a/src/HYDROGUI/resources/HYDROGUI_images.ts +++ b/src/HYDROGUI/resources/HYDROGUI_images.ts @@ -397,5 +397,79 @@ icon_profile_interpolate_image.png + + + ICON_CURSOR_1 + icon_cursor_1.png + + + ICON_CURSOR_2 + icon_cursor_2.png + + + ICON_CURSOR_3 + icon_cursor_3.png + + + ICON_CURSOR_4 + icon_cursor_4.png + + + ICON_CURSOR_5 + icon_cursor_5.png + + + ICON_CURSOR_6 + icon_cursor_6.png + + + ICON_CURSOR_7 + icon_cursor_7.png + + + ICON_CURSOR_8 + icon_cursor_8.png + + + ICON_CURSOR_9 + icon_cursor_9.png + + + ICON_CURSOR_10 + icon_cursor_10.png + + + ICON_CURSOR_11 + icon_cursor_11.png + + + ICON_CURSOR_12 + icon_cursor_12.png + + + ICON_CURSOR_13 + icon_cursor_13.png + + + ICON_CURSOR_14 + icon_cursor_14.png + + + ICON_CURSOR_15 + icon_cursor_15.png + + + ICON_CURSOR_16 + icon_cursor_16.png + + + ICON_CURSOR_17 + icon_cursor_17.png + + + ICON_CURSOR_18 + icon_cursor_18.png + + diff --git a/src/HYDROGUI/resources/HYDROGUI_msg_en.ts b/src/HYDROGUI/resources/HYDROGUI_msg_en.ts index 58c93cde..86277845 100644 --- a/src/HYDROGUI/resources/HYDROGUI_msg_en.ts +++ b/src/HYDROGUI/resources/HYDROGUI_msg_en.ts @@ -225,6 +225,18 @@ All supported formats (*.brep *.iges *.igs *.step *.stp) STREAM_PROFILES Profiles + + PREF_TAB_GENERAL + General + + + PREF_GROUP_CURSOR + Cursor for edition operations + + + PREF_TYPE_OF_CURSOR + Type + diff --git a/src/HYDROGUI/resources/LightApp.xml b/src/HYDROGUI/resources/LightApp.xml index 7f1052e3..2b595df6 100644 --- a/src/HYDROGUI/resources/LightApp.xml +++ b/src/HYDROGUI/resources/LightApp.xml @@ -41,4 +41,7 @@ +
+ +
diff --git a/src/HYDROGUI/resources/icon_cursor_1.png b/src/HYDROGUI/resources/icon_cursor_1.png new file mode 100644 index 00000000..a69ef4eb Binary files /dev/null and b/src/HYDROGUI/resources/icon_cursor_1.png differ diff --git a/src/HYDROGUI/resources/icon_cursor_10.png b/src/HYDROGUI/resources/icon_cursor_10.png new file mode 100644 index 00000000..1edbab27 Binary files /dev/null and b/src/HYDROGUI/resources/icon_cursor_10.png differ diff --git a/src/HYDROGUI/resources/icon_cursor_11.png b/src/HYDROGUI/resources/icon_cursor_11.png new file mode 100644 index 00000000..a9f40cbc Binary files /dev/null and b/src/HYDROGUI/resources/icon_cursor_11.png differ diff --git a/src/HYDROGUI/resources/icon_cursor_12.png b/src/HYDROGUI/resources/icon_cursor_12.png new file mode 100644 index 00000000..f37d7b91 Binary files /dev/null and b/src/HYDROGUI/resources/icon_cursor_12.png differ diff --git a/src/HYDROGUI/resources/icon_cursor_13.png b/src/HYDROGUI/resources/icon_cursor_13.png new file mode 100644 index 00000000..3b127a05 Binary files /dev/null and b/src/HYDROGUI/resources/icon_cursor_13.png differ diff --git a/src/HYDROGUI/resources/icon_cursor_14.png b/src/HYDROGUI/resources/icon_cursor_14.png new file mode 100644 index 00000000..69f13eb3 Binary files /dev/null and b/src/HYDROGUI/resources/icon_cursor_14.png differ diff --git a/src/HYDROGUI/resources/icon_cursor_15.png b/src/HYDROGUI/resources/icon_cursor_15.png new file mode 100644 index 00000000..1beda257 Binary files /dev/null and b/src/HYDROGUI/resources/icon_cursor_15.png differ diff --git a/src/HYDROGUI/resources/icon_cursor_16.png b/src/HYDROGUI/resources/icon_cursor_16.png new file mode 100644 index 00000000..a5667e3f Binary files /dev/null and b/src/HYDROGUI/resources/icon_cursor_16.png differ diff --git a/src/HYDROGUI/resources/icon_cursor_17.png b/src/HYDROGUI/resources/icon_cursor_17.png new file mode 100644 index 00000000..9181c859 Binary files /dev/null and b/src/HYDROGUI/resources/icon_cursor_17.png differ diff --git a/src/HYDROGUI/resources/icon_cursor_18.png b/src/HYDROGUI/resources/icon_cursor_18.png new file mode 100644 index 00000000..b78dd1da Binary files /dev/null and b/src/HYDROGUI/resources/icon_cursor_18.png differ diff --git a/src/HYDROGUI/resources/icon_cursor_2.png b/src/HYDROGUI/resources/icon_cursor_2.png new file mode 100644 index 00000000..d3e70ef4 Binary files /dev/null and b/src/HYDROGUI/resources/icon_cursor_2.png differ diff --git a/src/HYDROGUI/resources/icon_cursor_3.png b/src/HYDROGUI/resources/icon_cursor_3.png new file mode 100644 index 00000000..fe38e744 Binary files /dev/null and b/src/HYDROGUI/resources/icon_cursor_3.png differ diff --git a/src/HYDROGUI/resources/icon_cursor_4.png b/src/HYDROGUI/resources/icon_cursor_4.png new file mode 100644 index 00000000..097fc5fa Binary files /dev/null and b/src/HYDROGUI/resources/icon_cursor_4.png differ diff --git a/src/HYDROGUI/resources/icon_cursor_5.png b/src/HYDROGUI/resources/icon_cursor_5.png new file mode 100644 index 00000000..69056c47 Binary files /dev/null and b/src/HYDROGUI/resources/icon_cursor_5.png differ diff --git a/src/HYDROGUI/resources/icon_cursor_6.png b/src/HYDROGUI/resources/icon_cursor_6.png new file mode 100644 index 00000000..53717e49 Binary files /dev/null and b/src/HYDROGUI/resources/icon_cursor_6.png differ diff --git a/src/HYDROGUI/resources/icon_cursor_7.png b/src/HYDROGUI/resources/icon_cursor_7.png new file mode 100644 index 00000000..2b08c4e2 Binary files /dev/null and b/src/HYDROGUI/resources/icon_cursor_7.png differ diff --git a/src/HYDROGUI/resources/icon_cursor_8.png b/src/HYDROGUI/resources/icon_cursor_8.png new file mode 100644 index 00000000..d2004aef Binary files /dev/null and b/src/HYDROGUI/resources/icon_cursor_8.png differ diff --git a/src/HYDROGUI/resources/icon_cursor_9.png b/src/HYDROGUI/resources/icon_cursor_9.png new file mode 100644 index 00000000..b47601c3 Binary files /dev/null and b/src/HYDROGUI/resources/icon_cursor_9.png differ