src/gui.cpp

changeset 219
70eb948a2b02
parent 218
2a65ad4972a8
child 220
1f368f0a323b
equal deleted inserted replaced
218:2a65ad4972a8 219:70eb948a2b02
191 addMenuAction ("newCondLine"); // New Conditional Line 191 addMenuAction ("newCondLine"); // New Conditional Line
192 addMenuAction ("newComment"); // New Comment 192 addMenuAction ("newComment"); // New Comment
193 addMenuAction ("newBFC"); // New BFC Statment 193 addMenuAction ("newBFC"); // New BFC Statment
194 addMenuAction ("newVertex"); // New Vertex 194 addMenuAction ("newVertex"); // New Vertex
195 addMenuAction ("newRadial"); // New Radial 195 addMenuAction ("newRadial"); // New Radial
196 menu->addSeparator (); // -----
197 addMenuAction ("modeSelect"); // Select Mode
198 addMenuAction ("modeDraw"); // Draw Mode
199 196
200 // Edit menu 197 // Edit menu
201 initMenu ("&Edit"); 198 initMenu ("&Edit");
202 addMenuAction ("undo"); // Undo 199 addMenuAction ("undo"); // Undo
203 addMenuAction ("redo"); // Redo 200 addMenuAction ("redo"); // Redo
208 addMenuAction ("del"); // Delete 205 addMenuAction ("del"); // Delete
209 menu->addSeparator (); // ----- 206 menu->addSeparator (); // -----
210 addMenuAction ("selectAll"); // Select All 207 addMenuAction ("selectAll"); // Select All
211 addMenuAction ("selectByColor"); // Select by Color 208 addMenuAction ("selectByColor"); // Select by Color
212 addMenuAction ("selectByType"); // Select by Type 209 addMenuAction ("selectByType"); // Select by Type
210 menu->addSeparator (); // -----
211 addMenuAction ("modeSelect"); // Select Mode
212 addMenuAction ("modeDraw"); // Draw Mode
213 menu->addSeparator (); // -----
214 addMenuAction ("setDrawDepth"); // Set Draw Depth
213 215
214 initMenu ("&Tools"); 216 initMenu ("&Tools");
215 addMenuAction ("setColor"); // Set Color 217 addMenuAction ("setColor"); // Set Color
216 addMenuAction ("invert"); // Invert 218 addMenuAction ("invert"); // Invert
217 addMenuAction ("inlineContents"); // Inline 219 addMenuAction ("inlineContents"); // Inline
832 return true; 834 return true;
833 835
834 return false; 836 return false;
835 } 837 }
836 838
837 short ForgeWindow::getSelectedColor() { 839 short ForgeWindow::getSelectedColor () {
838 short result = -1; 840 short result = -1;
839 841
840 for (LDObject* obj : m_sel) { 842 for (LDObject* obj : m_sel) {
841 if (obj->color == -1) 843 if (obj->color == -1)
842 continue; // doesn't use color 844 continue; // doesn't use color
853 855
854 // ============================================================================= 856 // =============================================================================
855 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 857 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
856 // ============================================================================= 858 // =============================================================================
857 LDObject::Type ForgeWindow::uniformSelectedType () { 859 LDObject::Type ForgeWindow::uniformSelectedType () {
858 LDObject::Type eResult = LDObject::Unidentified; 860 LDObject::Type result = LDObject::Unidentified;
859 861
860 for (LDObject* obj : m_sel) { 862 for (LDObject* obj : m_sel) {
861 if (eResult != LDObject::Unidentified && obj->color != eResult) 863 if (result != LDObject::Unidentified && obj->color != result)
862 return LDObject::Unidentified; 864 return LDObject::Unidentified;
863 865
864 if (eResult == LDObject::Unidentified) 866 if (result == LDObject::Unidentified)
865 eResult = obj->getType (); 867 result = obj->getType ();
866 } 868 }
867 869
868 return eResult; 870 return result;
869 } 871 }
870 872
871 // ============================================================================= 873 // =============================================================================
872 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 874 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
873 // ============================================================================= 875 // =============================================================================
905 contextMenu->addAction (findAction ("copy")); 907 contextMenu->addAction (findAction ("copy"));
906 contextMenu->addAction (findAction ("paste")); 908 contextMenu->addAction (findAction ("paste"));
907 contextMenu->addAction (findAction ("del")); 909 contextMenu->addAction (findAction ("del"));
908 contextMenu->addSeparator (); 910 contextMenu->addSeparator ();
909 contextMenu->addAction (findAction ("setColor")); 911 contextMenu->addAction (findAction ("setColor"));
912
910 if (single) 913 if (single)
911 contextMenu->addAction (findAction ("setContents")); 914 contextMenu->addAction (findAction ("setContents"));
915
912 contextMenu->addAction (findAction ("makeBorders")); 916 contextMenu->addAction (findAction ("makeBorders"));
913 contextMenu->addAction (findAction ("setOverlay")); 917 contextMenu->addAction (findAction ("setOverlay"));
914 contextMenu->addAction (findAction ("clearOverlay")); 918 contextMenu->addAction (findAction ("clearOverlay"));
919
920 for (const char* mode : g_modeActionNames)
921 contextMenu->addAction (findAction (mode));
922
923 if (R ()->camera () != GL::Free) {
924 contextMenu->addSeparator ();
925 contextMenu->addAction (findAction ("setDrawDepth"));
926 }
915 927
916 contextMenu->exec (pos); 928 contextMenu->exec (pos);
917 } 929 }
918 930
919 // ======================================================================================================================================== 931 // ========================================================================================================================================

mercurial