Changeset 181 in tmcsimulator-scriptbuilder for trunk/src/event


Ignore:
Timestamp:
01/11/2020 08:29:10 AM (6 years ago)
Author:
jdalbey
Message:

event.editor.Editor.java Change Yes/Cancel? to Cancel/OK to fix #216.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/event/editor/frame/Editor.java

    r180 r181  
    199199                //If we deleted the first event(s), this will add the offsets, 
    200200                //to ensure that events stay at the correct times 
    201                 Object[] options = {"Yes","Cancel"}; 
    202                     int result = JOptionPane.showOptionDialog(null,"Are you sure you want to exit without saving?", 
    203                             "Exit", 
    204                             JOptionPane.YES_NO_OPTION, 
    205                             JOptionPane.QUESTION_MESSAGE, 
    206                             null, 
    207                             options, 
    208                             options[1]); 
    209                     switch (result){ 
    210                         //should just close 
    211                         case 0: 
    212                             closeWindow(); 
    213                             //this.setVisible(true); 
    214                             break; 
    215                         // should do nothing 
    216                         case 1: 
    217                              
    218                             break; 
    219                         default: 
    220                             break; 
    221                     } 
    222                 //add a do you want to close without saving popup window here 
    223                 
     201                Object[] options = {"Cancel","OK"}; 
     202                int result = JOptionPane.showOptionDialog(null, 
     203                        "Are you sure you want to exit without saving?", 
     204                        "Confirm Exit", 
     205                        JOptionPane.OK_CANCEL_OPTION, 
     206                        JOptionPane.QUESTION_MESSAGE, 
     207                        null, 
     208                        options, 
     209                        options[1]); 
     210                // Take action depending on user choice 
     211                switch (result) 
     212                { 
     213                    //OK: should just close 
     214                    case 1: 
     215                        closeWindow(); 
     216                        break; 
     217                    // Cancel: should do nothing 
     218                    case 0:                             
     219                        break; 
     220                    default: 
     221                        break; 
     222                } 
    224223            } 
    225224        }); 
Note: See TracChangeset for help on using the changeset viewer.