示例#1
0
/*
  Usually, the application will catch the kill command key sequence by itself,
  but if the event queue gets really full e.g. when appending large amounts
  of data to the output window, the key event may get buried underneath
  everything else that's happening. This function "manually" checks for
  the key sequence and returns true if the user is trying to cancel.
*/
bool CommandUtils::IsMacroCancelled(bool &command_timeout)
{
  if (command_timeout) { return true; }
  if (kill_key_down()) {
    FXushort mods=FXSELTYPE(killkey);
    if ( (mods&CONTROLMASK) && (!ctrl_key_down())  ) { return false; }
    if ( (mods&SHIFTMASK)   && (!shift_key_down()) ) { return false; }
    if ( (mods&ALTMASK)     && (!alt_key_down())   ) { return false; }
    command_timeout=true;
  }
  return command_timeout;
}
示例#2
0
long MyTreeList::onEnterLeave(FXObject*o, FXSelector sel, void*p) {
  switch (FXSELTYPE(sel)) {
    case SEL_ENTER: {
      getApp()->setWheelLines(DefaultWheelLines*8);
      getApp()->setScrollSpeed(DefaultScrollSpeed/16);
      break;
    }
    case SEL_LEAVE: {
      getApp()->setWheelLines(DefaultWheelLines);
      getApp()->setScrollSpeed(DefaultScrollSpeed);
      break;
    }
  }
  return FXTreeList::handle(0,sel,p);
}
示例#3
0
long MyText::onEnterLeave(FXObject*o, FXSelector sel, void*p)
{
  switch (FXSELTYPE(sel)) {
    case SEL_ENTER: 
      getApp()->setWheelLines(4);
      getApp()->setScrollSpeed(DefaultScrollSpeed*16);
      getApp()->setScrollDelay(0);
      break;
    case SEL_LEAVE:
      getApp()->setScrollSpeed(DefaultScrollSpeed);
      getApp()->setScrollDelay(DefaultScrollDelay);
      break;
  }
  return FXText::handle(0,sel,p);
}
示例#4
0
long
GNEInternalLane::onDefault(FXObject* obj, FXSelector sel, void* data) {
    if (myEditor != 0) {
        FXuint before = myState;
        myStateTarget.handle(obj, sel, data);
        if (myState != before) {
            myEditor->handleChange(this);
        }
        // let GUISUMOAbstractView know about clicks so that the popup is properly destroyed
        if (FXSELTYPE(sel) == SEL_COMMAND) {
            if (myPopup != 0) {
                myPopup->getParentView()->destroyPopup();
                myPopup = 0;
            }
        }
    }
    return 1;
}
示例#5
0
long ACE_FoxReactor::onFileEvents(FXObject* /* ob */, FXSelector se, void* handle){
  FXSelector sel=FXSELTYPE(se);
  ACE_Select_Reactor_Handle_Set dispatch_set;
  bool f=false;
  if(sel==SEL_IO_READ){
    dispatch_set.rd_mask_.set_bit(ACE_HANDLE(reinterpret_cast<FXival>(handle)));
    f=true;
  }
  else
  if(sel==SEL_IO_WRITE){
    dispatch_set.wr_mask_.set_bit(ACE_HANDLE(reinterpret_cast<FXival>(handle)));
    f=true;
  }
  else
  if(sel==SEL_IO_EXCEPT){
    dispatch_set.ex_mask_.set_bit(ACE_HANDLE(reinterpret_cast<FXival>(handle)));
    f=true;
  };
  if(f) dispatch (1, dispatch_set);

  return 1;
}
示例#6
0
long MyIconList::onFocusInOut(FXObject*o, FXSelector sel, void*p)
{
  long rv=FXIconList::handle(o,sel,p);
  switch (FXSELTYPE(sel)) {
    case SEL_FOCUSIN: {
      if (getNumItems()>0) {
        if (!isItemSelected(getCurrentItem())) {
          setCurrentItem(0);
          selectItem(0, true);
          target->handle(this,FXSEL(SEL_COMMAND,message),0);
        }
        setListStyle(ICONLIST_BROWSESELECT);
      }
      break; 
    }
    case SEL_FOCUSOUT: {
      setListStyle(ICONLIST_SINGLESELECT);
      break; 
    }
  }
  return rv;
}
示例#7
0
long GMRemote::onCmdVolumeButton(FXObject*,FXSelector sel,void*ptr){
  volumeslider->handle(this,FXSEL(FXSELTYPE(sel),0),ptr);
  return 1;
  }
示例#8
0
// When BuildClassTree() is called, ctags parses all source files in the directory list.
// This routine is called by the CmdIO object, once for each line of output from ctags.
long TagParserBase::onParseAllSources(FXObject*o, FXSelector sel, void*p)
{
  const FXString* s=(const FXString*)p;
  if (FXSELTYPE(sel)==SEL_IO_EXCEPT) { return 1; }
  LocationIndex dirindex=(LocationIndex)((FXuval)((CmdIO*)o)->getUserData());
  FXString ancestor=FXString::null;
  FXString scopename=FXString::null;
  FXint linenum=ExtractLineNumber(s);
  FXchar kind=s->section('\t', 3)[0];
  FXString tagname=s->section('\t',0);
  FXString filename=s->section('\t',1);
  if (current_filename!=filename) {
    current_filename=filename;
    dirs[dirindex]->append(filename);
  }
  const FXchar ext=Ascii::toLower(FXPath::extension(filename)[0]);

  if ( (kind=='n') ) {
    if (ext=='c') { return 1; } // namespaces are only interesting if they are in a public header
  }
  for (FXint i=4; i<=s->contains('\t'); i++) {
    const FXString sect=s->section('\t', i);
    if (sect.find(':')>0) {
      const FXString key=sect.section(':',0);
      if ((kind=='s')&&(key=="access")) {  // ignore structs defined inside a class
        return 1;
      } else if ((kind=='f')&&((key=="class")||(key=="namespace"))) {
        scopename=sect.section(':',1,1024);
        StripNamespace(scopename);
      } else if (key=="inherits") {
        ancestor=sect.section(':',1);
        if (ancestor.find(',')>0) {
          ancestor=ancestor.section(',',0);  // can't do multiple inheritence
        }
        StripNamespace(ancestor);
      }
    }
  }
  switch (kind) {
    case 'c':
    case 'n':    
    case 's': {
      tag_info_list->append(kind, tagname, ancestor, dirindex, dirs[dirindex]->no()-1, linenum);
      break;
    }
    default: {
      FXString* entry = new FXString();
      entry->format(
        "%c\t%s%s%s\t%d",
        kind,
        scopename.text(),
        scopename.empty()?"":"::",
        tagname.text(),
        linenum
      );
      dirs[dirindex]->tail()->append(entry);
      break;
    }
  }
  return 1;
}