From 125ff943c035d5e5fd7bd2b55f6e1e5d04ea3d19 Mon Sep 17 00:00:00 2001 From: mkr Date: Thu, 14 May 2015 10:03:48 +0300 Subject: [PATCH] refs #514: add 'Cursor for specific operations' section into preferences of HYDRO module. --- src/HYDROGUI/HYDROGUI_Module.cxx | 25 ++++++++ src/HYDROGUI/HYDROGUI_Module.h | 24 +++++++ src/HYDROGUI/resources/HYDROGUI_images.ts | 74 ++++++++++++++++++++++ src/HYDROGUI/resources/HYDROGUI_msg_en.ts | 12 ++++ src/HYDROGUI/resources/LightApp.xml | 3 + src/HYDROGUI/resources/icon_cursor_1.png | Bin 0 -> 171 bytes src/HYDROGUI/resources/icon_cursor_10.png | Bin 0 -> 141 bytes src/HYDROGUI/resources/icon_cursor_11.png | Bin 0 -> 145 bytes src/HYDROGUI/resources/icon_cursor_12.png | Bin 0 -> 161 bytes src/HYDROGUI/resources/icon_cursor_13.png | Bin 0 -> 161 bytes src/HYDROGUI/resources/icon_cursor_14.png | Bin 0 -> 174 bytes src/HYDROGUI/resources/icon_cursor_15.png | Bin 0 -> 161 bytes src/HYDROGUI/resources/icon_cursor_16.png | Bin 0 -> 155 bytes src/HYDROGUI/resources/icon_cursor_17.png | Bin 0 -> 160 bytes src/HYDROGUI/resources/icon_cursor_18.png | Bin 0 -> 147 bytes src/HYDROGUI/resources/icon_cursor_2.png | Bin 0 -> 132 bytes src/HYDROGUI/resources/icon_cursor_3.png | Bin 0 -> 130 bytes src/HYDROGUI/resources/icon_cursor_4.png | Bin 0 -> 124 bytes src/HYDROGUI/resources/icon_cursor_5.png | Bin 0 -> 172 bytes src/HYDROGUI/resources/icon_cursor_6.png | Bin 0 -> 201 bytes src/HYDROGUI/resources/icon_cursor_7.png | Bin 0 -> 199 bytes src/HYDROGUI/resources/icon_cursor_8.png | Bin 0 -> 159 bytes src/HYDROGUI/resources/icon_cursor_9.png | Bin 0 -> 191 bytes 23 files changed, 138 insertions(+) create mode 100644 src/HYDROGUI/resources/icon_cursor_1.png create mode 100644 src/HYDROGUI/resources/icon_cursor_10.png create mode 100644 src/HYDROGUI/resources/icon_cursor_11.png create mode 100644 src/HYDROGUI/resources/icon_cursor_12.png create mode 100644 src/HYDROGUI/resources/icon_cursor_13.png create mode 100644 src/HYDROGUI/resources/icon_cursor_14.png create mode 100644 src/HYDROGUI/resources/icon_cursor_15.png create mode 100644 src/HYDROGUI/resources/icon_cursor_16.png create mode 100644 src/HYDROGUI/resources/icon_cursor_17.png create mode 100644 src/HYDROGUI/resources/icon_cursor_18.png create mode 100644 src/HYDROGUI/resources/icon_cursor_2.png create mode 100644 src/HYDROGUI/resources/icon_cursor_3.png create mode 100644 src/HYDROGUI/resources/icon_cursor_4.png create mode 100644 src/HYDROGUI/resources/icon_cursor_5.png create mode 100644 src/HYDROGUI/resources/icon_cursor_6.png create mode 100644 src/HYDROGUI/resources/icon_cursor_7.png create mode 100644 src/HYDROGUI/resources/icon_cursor_8.png create mode 100644 src/HYDROGUI/resources/icon_cursor_9.png 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 0000000000000000000000000000000000000000..a69ef4eb6158503c7c67c916aea86e65fdc81f72 GIT binary patch literal 171 zcmeAS@N?(olHy`uVBq!ia0vp^k|4~)3?z59=Y9ZEoB=)|uK&RR$m{!Z_zjR^ED7=p zW^j0RBMrz2@N{tusfe>Zw~@EOfQR+sk_Oou&-fjcEVpj<&$!X3+c~E>J1*JV{%`IM zZgwlFFx}G*?uS>UO1?P#t>x;u4TbmfTg6u$kN3O$qTon=&V7RQzr9bPir8&?922WQ%mvv4FO#sHOC(Zx> literal 0 HcmV?d00001 diff --git a/src/HYDROGUI/resources/icon_cursor_12.png b/src/HYDROGUI/resources/icon_cursor_12.png new file mode 100644 index 0000000000000000000000000000000000000000..f37d7b91e8cde73243fa78df45c7808aba1c5fa0 GIT binary patch literal 161 zcmeAS@N?(olHy`uVBq!ia0vp^k|4~)3?z59=Y9ZEoB=)|uK)l42Qqmr4+Dcjj*u+}&-pB%i42~uelF{r5}E+x CJu-a& literal 0 HcmV?d00001 diff --git a/src/HYDROGUI/resources/icon_cursor_13.png b/src/HYDROGUI/resources/icon_cursor_13.png new file mode 100644 index 0000000000000000000000000000000000000000..3b127a05d34b48a2f4f9b9cc77b681c6b43afcdd GIT binary patch literal 161 zcmeAS@N?(olHy`uVBq!ia0vp^k|4~)3?z59=Y9ZEoB=)|uK)l42QqD?iBlbDB7>)^pUXO@geCxo C3NS_h literal 0 HcmV?d00001 diff --git a/src/HYDROGUI/resources/icon_cursor_14.png b/src/HYDROGUI/resources/icon_cursor_14.png new file mode 100644 index 0000000000000000000000000000000000000000..69f13eb347a6c299e06844729a14f657b282fe8f GIT binary patch literal 174 zcmeAS@N?(olHy`uVBq!ia0vp^k|4~)3?z59=Y9ZEoB=)|uK)l42Qq(Z!J(8lD*)YR5__{zaA2hTRnM`U1 literal 0 HcmV?d00001 diff --git a/src/HYDROGUI/resources/icon_cursor_16.png b/src/HYDROGUI/resources/icon_cursor_16.png new file mode 100644 index 0000000000000000000000000000000000000000..a5667e3ffba185fd0138ddfca3d4d88049928812 GIT binary patch literal 155 zcmeAS@N?(olHy`uVBq!ia0vp^k|4~)3?z59=Y9ZEoB=)|uK)l42QqLt)D22WQ%mvv4FO#t=)GwlEX literal 0 HcmV?d00001 diff --git a/src/HYDROGUI/resources/icon_cursor_17.png b/src/HYDROGUI/resources/icon_cursor_17.png new file mode 100644 index 0000000000000000000000000000000000000000..9181c859edaf9aa2c16bc7dbc753609beddd8351 GIT binary patch literal 160 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf6I14-?iy0WWJ3*My{N(AiK*1nS z7sn8d^Q{*i@&Q%1UVQ&I{@1U@lJIG2v-zZ4_*!21iA*SY%@&uqUj2N6zp|zB(=e@$ zx^-U#58Mw=Oi(|itMZAp-iRS3-nPN(&1&mQ4R&G`1|_rB%dJWRn$FgTe~DWM4f DkdQT7 literal 0 HcmV?d00001 diff --git a/src/HYDROGUI/resources/icon_cursor_18.png b/src/HYDROGUI/resources/icon_cursor_18.png new file mode 100644 index 0000000000000000000000000000000000000000..b78dd1dac5a827fa698f1993718f22c282019505 GIT binary patch literal 147 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf6I14-?iy0WWJ3*My{N(AiKtWee z7sn8d^J_1j=3-FbaJl&N|NMQrDg{-+lDl3uEOL6iyxxIhJsV5IbqBU04WsP|EmPEI sG+%tqc!TF=!@MiLH_pW!e7ccq3Qxekuk)up2O7xW>FVdQ&MBb@057mJumAu6 literal 0 HcmV?d00001 diff --git a/src/HYDROGUI/resources/icon_cursor_2.png b/src/HYDROGUI/resources/icon_cursor_2.png new file mode 100644 index 0000000000000000000000000000000000000000..d3e70ef4c2413c6f81c7cfffa32be7228b2b27b9 GIT binary patch literal 132 zcmeAS@N?(olHy`uVBq!ia0vp^k|4~)3?z59=Y9ZEoB=)|uK)l42Qq{%UFuy$6%gUPvacWfgV8N9#n V_FPj?S`E~~;OXk;vd$@?2>`R9Dxv@Y literal 0 HcmV?d00001 diff --git a/src/HYDROGUI/resources/icon_cursor_4.png b/src/HYDROGUI/resources/icon_cursor_4.png new file mode 100644 index 0000000000000000000000000000000000000000..097fc5fa7287da71ffd907b3a11adbda4516aca6 GIT binary patch literal 124 zcmeAS@N?(olHy`uVBq!ia0vp^k|4~)3?z59=Y9ZEoB=)|uK)l42QqWRgqc?pLgqp;N^OZ7kj)9 zt2OYRn)8&w&_Fn;AZ-e>OWiG&j$ap41wJoZG>h5TTvwNMesusN!}2q-U)D!*O8^aL N@O1TaS?83{1OR$JJ0<`C literal 0 HcmV?d00001 diff --git a/src/HYDROGUI/resources/icon_cursor_6.png b/src/HYDROGUI/resources/icon_cursor_6.png new file mode 100644 index 0000000000000000000000000000000000000000..53717e49928a5d0e791baf971e95adc0bbe318d2 GIT binary patch literal 201 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnH3?%tPCZz)@&H$ef*Z=?j1DQaw?tQ;Mki}RM z;uum9xAyEt-c|zv=78lpdFvQ2-{H`#GwYbpmwD+D`;ru|4Sly6 z!u|DfH10id;EhPQ?!aC0$4imznq|kzoDQ|k!q4v~%5Ey$Ds|~#XU>6Rfw7|8GuZ2t ub|G literal 0 HcmV?d00001 diff --git a/src/HYDROGUI/resources/icon_cursor_7.png b/src/HYDROGUI/resources/icon_cursor_7.png new file mode 100644 index 0000000000000000000000000000000000000000..2b08c4e2a3cafc992459a8f484e6c8e6c3e74857 GIT binary patch literal 199 zcmeAS@N?(olHy`uVBq!ia0vp^k|4~)3?z59=Y9ZEoB=)|uK&RR$m{!Z_zjR^ED7=p zW^j0RBMr#O@pN$vsfa5*w~^P`kb@;)w}Ny_&ztDY@kvlRIOU`3qAsV; zTo+`Y{*UQrTXjS>sKxPHd$OYcrG25=M&E9}?0tT1Yy7oqDMB$hU$uYoMqOpDnka4~ qygb6(Z%*F(qx}EZO#W7L6_Nk?#pi+cGI+ZBxvX&}>iqs75rOW+zd6_S+ yS|~6}xHpZ9x7T5rL59RLGuTpf8VsdEq+OT~Tw87C;38om{D5bL fNHFu^21W*zFY