menubar LEFT, RIGHT, DOWN
767946
def handle_keys
      @selected = false
      @repaint_required = true # added 2011-12-12 otherwise keeps repainting and you see a flicker
      @toggle_key ||= 27 # default switch off with ESC, if nothing else defined
      set_menu 0
      begin
      catch(:menubarclose) do
      while((ch = @window.getchar()) != @toggle_key )
       #$log.debug "menuubar inside handle_keys :  #{ch}"  if ch != -1
        case ch
        when -1
          next
        when KEY_DOWN
    
          if !@selected
            current_menu.fire
          else
            current_menu.handle_key ch
          end
            
          @selected = true
        when KEY_ENTER, 10, 13, 32
          @selected = true
          ret = current_menu.handle_key ch
          #break; ## 2008-12-29 18:00  This will close after firing anything
          break if ret == :CLOSE
        when KEY_UP
          current_menu.handle_key ch
        when KEY_LEFT
          ret = current_menu.handle_key ch
          prev_menu if ret == :UNHANDLED
        when KEY_RIGHT
          ret = current_menu.handle_key ch
          next_menu if ret == :UNHANDLED
        when ?\C-g.getbyte(0) # abort
          throw :menubarclose
        else
          ret = current_menu.handle_key ch
          if ret == :UNHANDLED
            Ncurses.beep 
          else
            break  # we handled a menu action, close menubar (THIS WORKS FOR MNEMONICS ONLY and always)
          end
        end
        Ncurses::Panel.update_panels();
        Ncurses.doupdate();

        @window.wrefresh
      end
      end # catch
      ensure
        #ensure is required becos one can throw a :close
        $log.debug " DESTROY IN ENSURE"
        current_menu.clear_menus
        @repaint_required = false
        destroy  # Note that we destroy the menu bar upon exit
      end
    end
327593
function moveRender (type) {
    var method = type ? 'down' : 'up'
    
    ui
      .left(lastLen + 2)
      .up(count - cur)
      .write('  ')
    
    // Each time move to right-bottom.
    ui[method]()
      .left(2)
      .write(chalk.blue(pointer))
      .left(2)
      .down(count - (type ? ++cur : --cur))
      .right(lastLen + 2)
  }
967784
def move_right(self):
        """"""
        self.at(ardrone.at.pcmd, True, self.speed, 0, 0, 0)
831179
function() {
			var barEl = this.get(BAR_EL);

			switch (this.get(DIRECTION)) {
				case DIRECTION_LTR:
				case DIRECTION_RTL:
					this._barSpace = parseInt(this.get(WIDTH),10) - 
						(parseInt(Dom.getStyle(barEl,'marginLeft'),10) || 0) -
						(parseInt(Dom.getStyle(barEl,'marginRight'),10) || 0);
					break;
				case DIRECTION_TTB:
				case DIRECTION_BTT:
					this._barSpace = parseInt(this.get(HEIGHT),10) -
						(parseInt(Dom.getStyle(barEl,'marginTop'),10) || 0)-
						(parseInt(Dom.getStyle(barEl,'marginBottom'),10) || 0); 
					break;
			}
			this._barFactor = this._barSpace / (this.get(MAX_VALUE) - (this.get(MIN_VALUE) || 0))  || 1;
		}
977427
def right_click(self, data, event_button, event_time):
        
        self.menu(event_button, event_time, data)
210652
void setMenuBar (MenuBar menuBar) {
		if (this.menuBar != null && menuBar != null) throw new IllegalStateException("Menu was already added to MenuBar");
		this.menuBar = menuBar;
	}
1003616
function (x, y) {
        if (x - this.pos.x < this.width / 2) {
            if (this.cursors.left === false) {
                me.input.triggerKeyEvent(me.input.KEY.LEFT, true);
                this.cursors.left = true;
                this.joypad_offset.x = -((this.width / 2 - (x - this.pos.x)) % this.pad.width / 4);
            }
            // release the right key if it was pressed
            if (this.cursors.right === true) {
                me.input.triggerKeyEvent(me.input.KEY.RIGHT, false);
                this.cursors.right = false;
            }
        }
        if (x - this.pos.x > this.width / 2) {
            if (this.cursors.right === false) {
                me.input.triggerKeyEvent(me.input.KEY.RIGHT, true);
                this.cursors.right = true;
                this.joypad_offset.x = +(((x - this.pos.x) - this.width / 2) % this.pad.width / 4);
            }
            // release the left key is it was pressed
            if (this.cursors.left === true) {
                me.input.triggerKeyEvent(me.input.KEY.LEFT, false);
                this.cursors.left = false;
            }
        }
    }
1129032
function barPositionCSS(n, speed, ease) {
    var barCSS;

    if (Settings.positionUsing === 'translate3d') {
      barCSS = { transform: 'translate3d('+toBarPerc(n)+'%,0,0)' };
    } else if (Settings.positionUsing === 'translate') {
      barCSS = { transform: 'translate('+toBarPerc(n)+'%,0)' };
    } else {
      barCSS = { 'margin-left': toBarPerc(n)+'%' };
    }

    barCSS.transition = 'all '+speed+'ms '+ease;

    return barCSS;
  }
404286
def _right(self):
        """"""
        left, _, width, _ = self._extents
        return left + width
57044
def __initialize_menu_bar(self):
        

        self.__file_menu = QMenu("&File", parent=self.__menu_bar)
        self.__file_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&File|&New",
            shortcut=QKeySequence.New,
            slot=self.__new_file_action__triggered))
        self.__file_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&File|&Load ...",
            shortcut=QKeySequence.Open,
            slot=self.__load_file_action__triggered))
        self.__file_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&File|Source ...",
            slot=self.__source_file_action__triggered))
        self.__file_menu.addSeparator()
        self.__file_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&File|Add Project ...",
            slot=self.__add_project_action__triggered))
        self.__file_menu.addSeparator()
        self.__file_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&File|&Save",
            shortcut=QKeySequence.Save,
            slot=self.__save_file_action__triggered))
        self.__file_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&File|Save As ...",
            shortcut=QKeySequence.SaveAs,
            slot=self.__save_file_as_action__triggered))
        self.__file_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&File|Save All",
            slot=self.__save_all_files_action__triggered))
        self.__file_menu.addSeparator()
        self.__file_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&File|Revert",
            slot=self.__revert_file_action__triggered))
        self.__file_menu.addSeparator()
        self.__file_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&File|Close ...",
            shortcut=QKeySequence.Close,
            slot=self.__close_file_action__triggered))
        self.__file_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&File|Close All ...",
            shortcut=Qt.SHIFT + Qt.ControlModifier + Qt.Key_W,
            slot=self.__close_all_files_action__triggered))
        self.__file_menu.addSeparator()
        for action in self.__recent_files_actions:
            self.__file_menu.addAction(action)
        self.__set_recent_files_actions()
        self.__menu_bar.addMenu(self.__file_menu)

        self.__edit_menu = QMenu("&Edit", parent=self.__menu_bar)
        self.__edit_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&Edit|&Undo",
            shortcut=QKeySequence.Undo,
            slot=self.__undo_action__triggered))
        self.__edit_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&Edit|&Redo",
            shortcut=QKeySequence.Redo,
            slot=self.__redo_action__triggered))
        self.__edit_menu.addSeparator()
        self.__edit_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&Edit|Cu&t",
            shortcut=QKeySequence.Cut,
            slot=self.__cut_action__triggered))
        self.__edit_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&Edit|&Copy",
            shortcut=QKeySequence.Copy,
            slot=self.__copy_action__triggered))
        self.__edit_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&Edit|&Paste",
            shortcut=QKeySequence.Paste,
            slot=self.__paste_action__triggered))
        self.__edit_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&Edit|Delete",
            slot=self.__delete_action__triggered))
        self.__edit_menu.addSeparator()
        self.__edit_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&Edit|Select All",
            shortcut=QKeySequence.SelectAll,
            slot=self.__select_all_action__triggered))
        self.__menu_bar.addMenu(self.__edit_menu)

        self.__source_menu = QMenu("&Source", parent=self.__menu_bar)
        self.__source_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&Source|Delete Line(s)",
            shortcut=Qt.ControlModifier + Qt.Key_D,
            slot=self.__delete_lines_action__triggered))
        self.__source_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&Source|Duplicate Line(s)",
            shortcut=Qt.SHIFT + Qt.ControlModifier + Qt.Key_D,
            slot=self.__duplicate_lines_action__triggered))
        self.__source_menu.addSeparator()
        self.__source_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&Source|Move Up",
            shortcut=Qt.SHIFT + Qt.ControlModifier + Qt.ALT + Qt.Key_Up,
            slot=self.__move_up_action__triggered))
        self.__source_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&Source|Move Down",
            shortcut=Qt.SHIFT + Qt.ControlModifier + Qt.ALT + Qt.Key_Down,
            slot=self.__move_down_action__triggered))
        self.__source_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&Source|Indent Selection",
            shortcut=Qt.Key_Tab,
            slot=self.__indent_selection_action__triggered))
        self.__source_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&Source|Unindent Selection",
            shortcut=Qt.Key_Backtab,
            slot=self.__unindent_selection_action__triggered))
        self.__source_menu.addSeparator()
        self.__source_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&Source|Convert Indentation To Tabs",
            slot=self.__convert_indentation_to_tabs_action__triggered))
        self.__source_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&Source|Convert Indentation To Spaces",
            slot=self.__convert_indentation_to_spaces_action__triggered))
        self.__source_menu.addSeparator()
        self.__source_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&Source|Remove Trailing WhiteSpaces",
            slot=self.__remove_trailing_white_spaces_action__triggered))
        self.__source_menu.addSeparator()
        self.__source_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&Source|Toggle Comments",
            shortcut=Qt.ControlModifier + Qt.Key_Slash,
            slot=self.__toggle_comments_action__triggered))
        self.__menu_bar.addMenu(self.__source_menu)

        self.__navigate_menu = QMenu("&Navigate", parent=self.__menu_bar)
        self.__navigate_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&Navigate|Goto Line ...",
            shortcut=Qt.ControlModifier + Qt.Key_L,
            slot=self.__go_to_line_action__triggered))
        self.__navigate_menu.addSeparator()
        self.__menu_bar.addMenu(self.__navigate_menu)

        self.__search_menu = QMenu("&Search", parent=self.__menu_bar)
        self.__search_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&Search|Search And Replace ...",
            shortcut=Qt.ControlModifier + Qt.Key_F,
            slot=self.__search_and_replace_action__triggered))
        self.__search_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&Search|Search In Files ...",
            shortcut=Qt.ALT + Qt.ControlModifier + Qt.Key_F,
            slot=self.__search_in_files_action__triggered))
        self.__search_menu.addSeparator()
        self.__search_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&Search|Search Next",
            shortcut=Qt.ControlModifier + Qt.Key_K,
            slot=self.__search_next_action__triggered))
        self.__search_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&Search|Search Previous",
            shortcut=Qt.SHIFT + Qt.ControlModifier + Qt.Key_K,
            slot=self.__search_previous_action__triggered))
        self.__menu_bar.addMenu(self.__search_menu)

        self.__command_menu = QMenu("&Command", parent=self.__menu_bar)
        self.__command_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&Command|&Evaluate Selection",
            shortcut=Qt.ControlModifier + Qt.Key_Return,
            slot=self.__evaluate_selection_action__triggered))
        self.__command_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&Command|Evaluate &Script",
            shortcut=Qt.SHIFT + Qt.CTRL + Qt.Key_Return,
            slot=self.__evaluate_script_action__triggered))
        self.__menu_bar.addMenu(self.__command_menu)

        self.__view_menu = QMenu("&View", parent=self.__menu_bar)
        self.__view_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&View|Increase Font Size",
            shortcut=Qt.ControlModifier + Qt.Key_Plus,
            slot=self.__increase_font_size_action__triggered))
        self.__view_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&View|Decrease Font Size",
            shortcut=Qt.ControlModifier + Qt.Key_Minus,
            slot=self.__decrease_font_size_action__triggered))
        self.__view_menu.addSeparator()
        self.__view_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&View|Toggle Word Wrap",
            slot=self.__toggle_word_wrap_action__triggered))
        self.__view_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&View|Toggle White Spaces",
            slot=self.__toggle_white_spaces_action__triggered))
        self.__view_menu.addSeparator()
        self.__view_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&View|Loop Through Editors",
            shortcut=Qt.AltModifier + Qt.SHIFT + Qt.Key_Tab,
            slot=self.__loop_through_editors_action__triggered))
        self.__menu_bar.addMenu(self.__view_menu)
1124809
function _keyRight() {
            if (lxSelect.choicesViewMode !== 'panes' || lxSelect.activeChoiceIndex === -1) {
                return;
            }

            var paneOpened = _openPane((lxSelect.panes.length - 1), lxSelect.activeChoiceIndex, true);

            if (paneOpened) {
                lxSelect.activeChoiceIndex = 0;
            } else {
                _keySelect();
            }
        }
584799
def setOrientation( self, orientation ):
        
        super(XToolBar, self).setOrientation(orientation)
        self.refreshButton()
736733
function Menu (opts) {
    Menu.superclass.constructor.call(this, opts)

    var items = opts.items

    if (Director.sharedDirector.isTouchScreen) {
        this.isTouchEnabled = true
    } else {
        this.isMouseEnabled = true
    }

    var s = Director.sharedDirector.winSize

    this.isRelativeAnchorPoint = false
    this.anchorPoint = ccp(0.5, 0.5)
    this.contentSize = s

    this.position = ccp(s.width / 2, s.height / 2)


    if (items) {
        var z = 0
        items.forEach(function (item) {
            this.addChild({child: item, z: z++})
        }.bind(this))
    }
}
1047828
function Menu(funct, enabled)
{
	mxEventSource.call(this);
	this.funct = funct;
	this.enabled = (enabled != null) ? enabled : true;
}
992420
private void setUpUtilBar() {
		utilBar.setLayout(new ListLayout(ListLayout.Type.FLAT, ListLayout.Alignment.RIGHT, ListLayout.Separator.NONE, false));
		WTextField selectOther = new WTextField();
		selectOther.setToolTip("Enter text.");
		utilBar.add(selectOther);
		utilBar.add(new WButton("Go"));
		utilBar.add(new WButton("A"));
		utilBar.add(new WButton("B"));
		utilBar.add(new WButton("C"));
		utilBar.setVisible(false);
	}
768455
function menu(t) {
			var i, j, a, html, l, src = self.fm.options.contextmenu[t]||[];
			for (i=0; i < src.length; i++) {
				if (src[i] == 'delim') {
					self.menu.children().length && !self.menu.children(':last').hasClass('delim') && self.menu.append('<div class="delim" />');
				} else if (self.fm.ui.includeInCm(src[i], t)) {
					a = self.cmd[src[i]].argc();
					html = '';

					if (a.length) {
						html = '<span/><div class="el-finder-contextmenu-sub" style="z-index:'+(parseInt(self.menu.css('z-index'))+1)+'">';
						for (var j=0; j < a.length; j++) {
							html += '<div name="'+src[i]+'" argc="'+a[j].argc+'" class="'+a[j]['class']+'">'+a[j].text+'</div>';
						};
						html += '</div>';
					}
					self.menu.append('<div class="'+src[i]+'" name="'+src[i]+'">'+html+self.cmdName(src[i])+'</div>');
				}
			};
		}
830087
def _progress_bar(self, width, percent, left="", right="", fill="|"):
        
        text = left + (width - len(left) - len(right)) * " " + right
        cutoff = int(round(percent * width))
        text = text[:cutoff].replace(" ", fill) + text[cutoff:]
        low_cutoff = int(round(0.7 * width))
        med_cutoff = int(round(0.9 * width))
        if percent < 0.7:
            yield 2, text[:cutoff]
            yield 0, text[cutoff:]
        elif percent < 0.9:
            yield 2, text[:low_cutoff]
            yield 3, text[low_cutoff:cutoff]
            yield 0, text[cutoff:]
        else:
            yield 2, text[:low_cutoff]
            yield 3, text[low_cutoff:med_cutoff]
            yield 4, text[med_cutoff:cutoff]
            yield 0, text[cutoff:]