Changeset 673


Ignore:
Timestamp:
01/10/14 10:09:57 (10 years ago)
Author:
jts21
Message:

Add status message area, add basic help text that gives info about what mouse buttons in the current context.
TODO: Add messages for button combos somehow (e.g. middle+right = delete) - this may pose a problem as my current method of displaying help text doesn't have room for text about button combos, so will need to rethink how to display the text.

Location:
trunk/src/org/expeditee/gui
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/gui/FrameMouseActions.java

    r655 r673  
    1313import java.text.NumberFormat;
    1414import java.util.ArrayList;
     15import java.util.Arrays;
    1516import java.util.Collection;
    1617import java.util.Date;
     
    18731874                MouseX = e.getX();
    18741875                MouseY = e.getY();
     1876               
     1877                Help.updateStatus();
     1878               
    18751879                // System.out.println(MouseX + "," + MouseY);
    18761880
     
    33283332                }
    33293333                updateCursor();
     3334               
     3335                Help.updateStatus();
    33303336
    33313337                for (Item i : FreeItems.getInstance()) {
     
    33633369        public static void shift(KeyEvent e) {
    33643370                _shiftDown = e.isShiftDown();
     3371                Help.updateStatus();
    33653372                getInstance().refreshHighlights();
    33663373        }
  • trunk/src/org/expeditee/gui/MessageBay.java

    r649 r673  
    3636
    3737        // messages shown in the message window
    38         private static Text[] _messages = new Text[4];
     38        private static Text[] _messages = new Text[3];
     39        private static Text _status = null;
    3940
    4041        // buffer of the message window
     
    245246                                FrameGraphics.PaintItem(g, t);
    246247                }
     248                if(_status != null)
     249                        FrameGraphics.PaintItem(g, _status);
    247250
    248251                if (// _messageLink.getLink() != null
     
    308311                                        _messages[i].setLink(link);
    309312                                        _messages[i].setActions(actions);
     313                                        _messages[i].setFont(_messageFont);
    310314                                        _creator.addItem(_messages[i].copy(), true);
    311315                                        _messageLink.setLink(_creator.getCurrent());
     
    445449                _supressMessages = val;
    446450        }
     451       
     452        public synchronized static void setStatus(String status) {
     453                if (_status == null) {
     454                        _status = new Text(status);
     455                        _status.setPosition(20, 90);
     456                        _status.setOffset(0, FrameGraphics.getMaxFrameSize().height);
     457                        _status.setLink(null); // maybe link to a help frame?
     458                        _status.setFont(Font.decode(Text.MONOSPACED_FONT));
     459                } else {
     460                        _status.setText(status);
     461                }
     462                Graphics g = FrameGraphics.createGraphics();
     463                if (g != null) {
     464                        refresh(false, g, Item.DEFAULT_BACKGROUND);
     465                }
     466        }
    447467
    448468}
Note: See TracChangeset for help on using the changeset viewer.